Datasets:
Add files using upload-large-folder tool
Browse files- md/train/1YLJDvSx6J4/1YLJDvSx6J4.md +403 -0
- md/train/6nbpPqUCIi7/6nbpPqUCIi7.md +0 -0
- md/train/86NHK__yFDl/86NHK__yFDl.md +322 -0
- md/train/B1eY_pVYvB/B1eY_pVYvB.md +284 -0
- md/train/B1gjs6EtDr/B1gjs6EtDr.md +329 -0
- md/train/B1l3M64KwB/B1l3M64KwB.md +232 -0
- md/train/BJuWrGW0Z/BJuWrGW0Z.md +248 -0
- md/train/BJx8YnEFPH/BJx8YnEFPH.md +344 -0
- md/train/By41BjA9YQ/By41BjA9YQ.md +529 -0
- md/train/Byl5NREFDr/Byl5NREFDr.md +353 -0
- md/train/F1vEjWK-lH_/F1vEjWK-lH_.md +444 -0
- md/train/GzHjhdpk-YH/GzHjhdpk-YH.md +0 -0
- md/train/H1WgVz-AZ/H1WgVz-AZ.md +434 -0
- md/train/H1e8wsCqYX/H1e8wsCqYX.md +397 -0
- md/train/HJaDJZ-0W/HJaDJZ-0W.md +294 -0
- md/train/HJcSzz-CZ/HJcSzz-CZ.md +319 -0
- md/train/HJgJtT4tvB/HJgJtT4tvB.md +414 -0
- md/train/HJl0jiRqtX/HJl0jiRqtX.md +620 -0
- md/train/Hke0V1rKPS/Hke0V1rKPS.md +329 -0
- md/train/HktRlUlAZ/HktRlUlAZ.md +357 -0
- md/train/HyexAiA5Fm/HyexAiA5Fm.md +502 -0
- md/train/HylVB3AqYm/HylVB3AqYm.md +302 -0
- md/train/JXAyJeYqUkZ/JXAyJeYqUkZ.md +248 -0
- md/train/NJS8kp15zzH/NJS8kp15zzH.md +180 -0
- md/train/S1gUsoR9YX/S1gUsoR9YX.md +319 -0
- md/train/S1xSSTNKDB/S1xSSTNKDB.md +335 -0
- md/train/SJQO7UJCW/SJQO7UJCW.md +279 -0
- md/train/SJky6Ry0W/SJky6Ry0W.md +244 -0
- md/train/SJzwb2RcK7/SJzwb2RcK7.md +323 -0
- md/train/SkgewU5ll/SkgewU5ll.md +332 -0
- md/train/Sy3fJXbA-/Sy3fJXbA-.md +282 -0
- md/train/SygLehCqtm/SygLehCqtm.md +290 -0
- md/train/SyxS0T4tvS/SyxS0T4tvS.md +350 -0
- md/train/YwpZmcAehZ/YwpZmcAehZ.md +313 -0
- md/train/a2Gr9gNFD-J/a2Gr9gNFD-J.md +257 -0
- md/train/d3k38LTDCyO/d3k38LTDCyO.md +305 -0
- md/train/eXlxB3aLOe/eXlxB3aLOe.md +265 -0
- md/train/fylclEqgvgd/fylclEqgvgd.md +487 -0
- md/train/l2UWXn5iBQI/l2UWXn5iBQI.md +341 -0
- md/train/n4IMHNb8_f/n4IMHNb8_f.md +374 -0
- md/train/pbXQtKXwLS/pbXQtKXwLS.md +398 -0
- md/train/r1q7n9gAb/r1q7n9gAb.md +0 -0
- md/train/r1xCMyBtPS/r1xCMyBtPS.md +296 -0
- md/train/rkYTTf-AZ/rkYTTf-AZ.md +291 -0
- md/train/rkgOLb-0W/rkgOLb-0W.md +474 -0
- md/train/rkxQ-nA9FX/rkxQ-nA9FX.md +0 -0
- md/train/ry831QWAb/ry831QWAb.md +252 -0
- md/train/uSQQH7Fj5U/uSQQH7Fj5U.md +366 -0
- md/train/v5gjXpmR8J/v5gjXpmR8J.md +391 -0
- md/train/yILzFBjR0Y/yILzFBjR0Y.md +309 -0
md/train/1YLJDvSx6J4/1YLJDvSx6J4.md
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING FROM PROTEIN STRUCTURE WITH GEOMETRIC VECTOR PERCEPTRONS
|
| 2 |
+
|
| 3 |
+
Bowen Jing∗, Stephan Eismann∗, Patricia Suriana, Raphael J.L. Townshend, Ron O. Dror Stanford University {bjing, seismann, psuriana, raphael, rondror}@cs.stanford.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Learning on 3D structures of large biomolecules is emerging as a distinct area in machine learning, but there has yet to emerge a unifying network architecture that simultaneously leverages the geometric and relational aspects of the problem domain. To address this gap, we introduce geometric vector perceptrons, which extend standard dense layers to operate on collections of Euclidean vectors. Graph neural networks equipped with such layers are able to perform both geometric and relational reasoning on efficient representations of macromolecules. We demonstrate our approach on two important problems in learning from protein structure: model quality assessment and computational protein design. Our approach improves over existing classes of architectures on both problems, including state-ofthe-art convolutional neural networks and graph neural networks. We release our code at https://github.com/drorlab/gvp.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many efforts in structural biology aim to predict, or derive insights from, the structure of a macromolecule (such as a protein, RNA, or DNA), represented as a set of positions associated with atoms or groups of atoms in 3D Euclidean space. These problems can often be framed as functions mapping the input domain of structures to some property of interest—for example, predicting the quality of a structural model or determining whether two molecules will bind in a particular geometry. Thanks to their importance and difficulty, such problems, which we broadly refer to as learning from structure, have recently developed into an exciting and promising application area for deep learning (Graves et al., 2020; Ingraham et al., 2019; Pereira et al., 2016; Townshend et al., 2019; Won et al., 2019).
|
| 12 |
+
|
| 13 |
+
Successful applications of deep learning are often driven by techniques that leverage the problem structure of the domain—for example, convolutions in computer vision (Cohen & Shashua, 2017) and attention in natural language processing (Vaswani et al., 2017). What are the relevant considerations in the domain of learning from structure? Using proteins as the most common example, we have on the one hand the arrangement and orientation of the amino acid residues in space, which govern the dynamics and function of the molecule (Berg et al., 2002). On the other hand, proteins also possess relational structure in terms of their amino-acid sequence and the residue-residue interactions that mediate the aforementioned protein properties (Hammes-Schiffer & Benkovic, 2006). We refer to these as the geometric and relational aspects of the problem domain, respectively.
|
| 14 |
+
|
| 15 |
+
Recent state-of-the-art methods for learning from structure leverage one of these two aspects. Commonly, such methods employ either graph neural networks (GNNs), which are expressive in terms of relational reasoning (Battaglia et al., 2018), or convolutional neural networks (CNNs), which operate directly on the geometry of the structure. Here, we present a unifying architecture that bridges these two families of methods to leverage both aspects of the problem domain.
|
| 16 |
+
|
| 17 |
+
We do so by introducing geometric vector perceptrons (GVPs), a drop-in replacement for standard multi-layer perceptrons (MLPs) in aggregation and feed-forward layers of GNNs. GVPs operate directly on both scalar and geometric features—features that transform as a vector under a rotation of spatial coordinates. GVPs therefore allow for the embedding of geometric information at nodes and edges without reducing such information to scalars that may not fully capture complex geometry. We postulate that our approach makes it easier for a GNN to learn functions whose significant features are both geometric and relational.
|
| 18 |
+
|
| 19 |
+
Our method (GVP-GNN) can be applied to any problem where the input domain is a structure of a single macromolecule or of molecules bound to one another. In this work, we specifically demonstrate our approach on two problems connected to protein structure: computational protein design and model quality assessment. Computational protein design (CPD) is the conceptual inverse of protein structure prediction, aiming to infer an amino acid sequence that will fold into a given structure. Model quality assessment (MQA) aims to select the best structural model of a protein from a large pool of candidate structures and is an important step in structure prediction (Cheng et al., 2019). Our method outperforms existing methods on both tasks.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
ML methods for learning from protein structure largely fall into one of three types, operating on sequential, voxelized, or graph-structured representations of proteins. We briefly discuss each type and introduce state-of-the-art examples for MQA and CPD to set the stage for our experiments later.
|
| 24 |
+
|
| 25 |
+
Sequential representations In traditional models of learning from protein structure, each amino acid is represented as a feature vector using hand-crafted representations of the 3D structural environment. These representations include residue contacts (Olechnovic & Venclovas, 2017), ori- ˇ entations or positions collectively projected to local coordinates (Karasikov et al., 2019), physicsinspired energy terms (O’Connell et al., 2018; Uziela et al., 2017), or context-free grammars of protein topology (Greener et al., 2018). The structure is then viewed as a sequence or collection of such features which can be fed into a 1D convolutional network, RNN, or dense feedforward network. Although these methods only indirectly represent the full 3D structure of the protein, a number of them, such as ProQ4 (Hurtado et al., 2018), VoroMQA (Olechnovic & Venclovas, 2017), ˇ and SBROD (Karasikov et al., 2019), are competitive in assessments of MQA.
|
| 26 |
+
|
| 27 |
+
Voxelized representations In lieu of hand-crafted representations of structure, 3D convolutional neural networks (CNNs) can operate directly on the positions of atoms in space, encoded as occupancy maps in a voxelized 3D volume. The hierarchical convolutions of such networks are easily compatible with the detection of structural motifs, binding pockets, and the specific shapes of other important structural features, leveraging the geometric aspect of the domain. A number of CPD methods (Anand et al., 2020; Zhang et al., 2019; Shroff et al., 2019) and the MQA methods 3DCNN (Derevyanko et al., 2018) and Ornate (Pages et al., 2019) exemplify the power of this approach. \`
|
| 28 |
+
|
| 29 |
+
Graph-structured representations A protein structure can also be represented as a proximity graph over amino acid nodes, reducing the challenge of representing a collective structural neighborhood in a single feature vector to that of representing individual edges. Graph neural networks (GNNs) can then perform complex relational reasoning over structures (Battaglia et al., 2018)—for example, identifying key relationships among amino acids, or flexible structural motifs described as a connectivity pattern rather than a rigid shape. Recent state-of-the-art GNNs include Structured Transformer (Ingraham et al., 2019) on CPD, ProteinSolver (Strokach et al., 2020) on CPD and mutation stability prediction, and GraphQA (Baldassarre et al., 2020) on MQA. These methods vary in their representation of geometry: while some, such as ProteinSolver and GraphQA, represent edges as a function of their length, others, such as Structured Transformer, indirectly encode the 3D geometry of the proximity graph in terms of relative orientations and other scalar features.
|
| 30 |
+
|
| 31 |
+
# 3 METHODS
|
| 32 |
+
|
| 33 |
+
Our architecture seeks to combine the strengths of CNN and GNN methods in learning from biomolecular structure by improving the latter’s ability to reason geometrically. The GNNs described in the previous section encode the 3D geometry of the protein by encoding vector features (such as node orientations and edge directions) in terms of rotation-invariant scalars, often by defining a local coordinate system at each node. We instead propose that these features be directly represented as geometric vectors—features in $\mathbb { R } ^ { 3 }$ which transform appropriately under a change of spatial coordinates—at all steps of graph propagation.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: (A) Schematic of the geometric vector perceptron illustrating Algorithm 1. Given a tuple of scalar and vector input features $( \mathbf { s } , \mathbf { V } )$ , the perceptron computes an updated tuple $( { \bf s } ^ { \prime } , { \bf V } ^ { \prime } )$ . $\mathbf { s } ^ { \prime }$ is a function of both s and V. (B) Illustration of the structure-based prediction tasks. In computational protein design (top), the goal is to predict an amino acid sequence that would fold into a given protein backbone structure. Individual atoms are represented as colored spheres. In model quality assessment (bottom), the goal is to predict the quality score of a candidate structure, which measures the similarity of the candidate with respect to the experimentally determined structure (in gray).
|
| 37 |
+
|
| 38 |
+
This conceptual shift has two important ramifications. First, the input representation is more efficient: instead of encoding the orientation of a node by its relative orientation with all of its neighbors, we only have to represent one absolute orientation per node. Second, it standardizes a global coordinate system across the entire structure, which allows geometric features to be directly propagated without transforming between local coordinates. For example, representations of arbitrary positions in space—including points that are not themselves nodes—can be easily propagated across the graph by Euclidean vector addition. We postulate this allows the GNN to more easily access global geometric properties of the structure. The key challenge with this representation, however, is to perform graph propagation in a way that simultaneously preserves the full expressive power of the original GNN while maintaining the rotation invariance provided by the scalar representations. We do so by introducing a new module, the geometric vector perceptron, to replace dense layers in a GNN.
|
| 39 |
+
|
| 40 |
+
# 3.1 GEOMETRIC VECTOR PERCEPTRONS
|
| 41 |
+
|
| 42 |
+
The geometric vector perceptron is a simple module for learning vector-valued and scalar-valued functions over geometric vectors and scalars. That is, given a tuple $( \mathbf { s } , \mathbf { V } )$ of scalar features $\mathbf { s } \in \mathbb { R } ^ { n }$ and vector features $\mathbf { V } \in \mathbb { R } ^ { \nu \times 3 }$ , we compute new features $( \mathbf { s } ^ { \prime } , \mathbf { V } ^ { \prime } ) \in \mathbb { R } ^ { m } \times \mathbb { R } ^ { \mu \times 3 }$ . The computation is illustrated in Figure 1A and formally described in Algorithm 1.
|
| 43 |
+
|
| 44 |
+
At its core, the GVP consists of two separate linear transformations $\mathbf { W } _ { m } , \mathbf { W } _ { h }$ for the scalar and vector features, followed by nonlinearities $\sigma , \sigma ^ { + }$ . However, before the scalar features are transformed, we concatenate the $L _ { 2 }$ norm of the transformed vector features $\mathbf { V } _ { h }$ ; this allows us to extract rotation-invariant information from the input vectors $\mathbf { V }$ . An additional linear transformation $\mathbf { W } _ { \mu }$ is inserted just before the vector nonlinearity to control the output dimensionality independently of the number of norms extracted.
|
| 45 |
+
|
| 46 |
+
The GVP is conceptually simple, yet provably possesses the desired properties of invariance/equivariance and expressiveness. First, the vector and scalar outputs of the GVP are equivariant and invariant, respectively, with respect to an arbitrary composition $R$ of rotations and reflections in 3D Euclidean space — i.e., if $\mathbf { G } \mathbf { V } \mathbf { P } ( \mathbf { s } , \mathbf { V } ) = ( \mathbf { s } ^ { \prime } , \mathbf { V } ^ { \prime } )$ then
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname { G V P } ( \mathbf { s } , R ( \mathbf { V } ) ) = ( \mathbf { s } ^ { \prime } , R ( \mathbf { V } ^ { \prime } ) )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
# Algorithm 1 Geometric vector perceptron
|
| 53 |
+
|
| 54 |
+
Input: Scalar and vector features (s, V) ∈ Rn × Rν×3 .
|
| 55 |
+
Output: Scalar and vector features $( \mathbf { s } ^ { \prime } , \mathbf { V } ^ { \prime } ) \in \mathbb { R } ^ { m } \times \mathbb { R } ^ { \mu \times 3 }$ .
|
| 56 |
+
$h \operatorname* { m a x } ( \nu , \mu )$
|
| 57 |
+
GVP: Vh ← WhV ∈ Rh×3 Vµ ← WµVh ∈ Rµ×3 sh ← kVhk (row-wise) $\in \mathbb { R } ^ { h }$ vµ ← kVµk (row-wise) $\in \mathbb { R } ^ { \mu }$ sh+n ← concat (sh, s) ∈ Rh+n sm ← Wmsh+n + b ∈ Rm s0 ← σ (sm) ∈ Rm $\mathbf { V } ^ { \prime } \sigma ^ { + } ( \mathbf { v } _ { \mu } ) \odot \mathbf { V } _ { \mu }$ (row-wise multiplication) ∈ Rµ×3
|
| 58 |
+
return $( \mathbf { s } ^ { \prime } , \mathbf { V } ^ { \prime } )$
|
| 59 |
+
|
| 60 |
+
This is due to the fact that the only operations on vector-valued inputs are scalar multiplication, linear combination, and the $L _ { 2 }$ norm.1 We include a formal proof in Appendix A.
|
| 61 |
+
|
| 62 |
+
In addition, the GVP architecture can approximate any continuous rotation- and reflection-invariant scalar-valued function of $\mathbf { V }$ . More precisely, let $G _ { s }$ be a GVP defined with $n , \mu = 0 \quad$ —that is, one which transforms vector features to scalar features. Then for any function ${ f } : \mathbb { R } ^ { \nu \times 3 } \mathbb { R }$ invariant with respect to rotations and reflections in 3D, there exists a functional form $G _ { s }$ able to $\epsilon$ -approximate $f$ , given mild assumptions.
|
| 63 |
+
|
| 64 |
+
Theorem. Let $R$ describe an arbitrary rotation and/or reflection in $\mathbb { R } ^ { 3 }$ . For $\nu \geq 3$ let $\Omega ^ { \nu } \subset \mathbb { R } ^ { \nu \times 3 }$ be the set of all ${ \bf V } = \left[ { \bf v } _ { 1 } , \quad \ldots , \quad { \bf v } _ { \nu } \right] ^ { T } \in \mathbb { R } ^ { \nu \times 3 }$ such that $\mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { v } _ { 3 }$ are linearly independent and $0 < | | \mathbf { v } _ { i } | | _ { 2 } \leq b$ for all $i$ and some finite $b > 0$ . Then for any continuous $F : \Omega ^ { \nu } \to \mathbb { R }$ such that $F ( R ( \mathbf { V } ) ) \ : = \ : F ( \mathbf { V } )$ and for any $\epsilon > 0$ , there exists a form $f ( \mathbf { V } ) \ = \ \mathbf { w } ^ { T } G _ { s } ( \mathbf { V } )$ such that $| F ( \mathbf { V } ) - f ( \mathbf { V } ) | < \epsilon$ for all $\mathbf { V } \in \Omega ^ { \nu }$ .
|
| 65 |
+
|
| 66 |
+
We include a formal proof in Appendix A. As a corollary, a GVP with nonzero $n , \mu$ is also able to approximate similarly-defined functions over the full input domain Rn × Rν×3.
|
| 67 |
+
|
| 68 |
+
In addition to the GVP layer itself, we use a version of dropout that drops entire vector channels at random (as opposed to coordinates within vector channels). We also introduce layer normalization for the vector features as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r l } { \mathbf { V } \mathbf { V } / \sqrt { \frac { 1 } { \nu } \| \mathbf { V } \| _ { 2 } ^ { 2 } } } & { { } \in \mathbb { R } ^ { \nu \times 3 } } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
That is, we scale the row vectors of $\mathbf { V }$ such that their root-mean-square norm is one. This vector layer norm has no trainable parameters, but we continue to use normal layer normalization on scalar channels with trainable parameters $\gamma , \beta$ .
|
| 75 |
+
|
| 76 |
+
We study our hypothesis that GVPs augment the geometric reasoning ability of GNNs on a synthetic dataset (Appendix B). The synthetic dataset allows us to control the function underlying the groundtruth label in order to explicitly separate geometric and relational aspects in different tasks. The GVP-augmented GNN (or GVP-GNN) matches a CNN on a geometric task and a standard GNN on a relational task. However, when we combine the two tasks in one objective, the GVP-GNN does significantly better than either a GNN or a CNN.
|
| 77 |
+
|
| 78 |
+
# 3.2 REPRESENTATIONS OF PROTEINS
|
| 79 |
+
|
| 80 |
+
The main empirical validation of our architecture is its performance on two real-world tasks: computational protein design (CPD) and model quality assessment (MQA). These tasks, as illustrated in Figure 1B and described in detail in Section 4, are complementary in that one (CPD) predicts a property for each amino acid while the other (MQA) predicts a global property.
|
| 81 |
+
|
| 82 |
+
We represent a protein structure input as a proximity graph with a minimal number of scalar and vector features to specify the 3D structure of the molecule. A protein structure is a sequence of amino acids, where each amino acid consists of four backbone atoms2 and a set of sidechain atoms located in 3D Euclidean space. We represent only the backbone because the sidechains are unknown in CPD, and our MQA benchmark corresponds to the assessment of backbone structure only.
|
| 83 |
+
|
| 84 |
+
Let $\mathrm { X } _ { i }$ be the position of atom $\mathrm { X }$ in the $i$ th amino acid (e.g. $\Nu _ { i }$ is the position of the nitrogen atom in the ith amino acid). We represent backbone structure as a graph $\bar { \boldsymbol { \mathcal { G } } } = ( \mathcal { V } , \mathcal { E } )$ where each node ${ \mathfrak { v } } _ { i } \in \mathcal { V }$ corresponds to an amino acid and has embedding $\mathbf { h } _ { \mathfrak { v } } ^ { ( i ) }$ with the following features:
|
| 85 |
+
|
| 86 |
+
• Scalar features $\{ \sin , \cos \} \circ \{ \phi , \psi , \omega \}$ , where $\phi , \psi , \omega$ are the dihedral angles computed from $\mathrm { C } _ { i - 1 }$ $\mathbf { \epsilon } _ { \cdot 1 } , \mathbf { N } _ { i } , \mathbf { \epsilon }$ $\mathrm { C } \alpha _ { i }$ , $\mathrm { C } _ { i }$ , and $\mathrm { N } _ { i + 1 }$ .
|
| 87 |
+
• The forward and reverse unit vectors in the directions of $\mathbf { C } \alpha _ { i + 1 } - \mathbf { C } \alpha _ { i }$ and $\mathbf { C } \alpha _ { i - 1 } - \mathbf { C } \alpha _ { i }$ , respectively.
|
| 88 |
+
• The unit vector in the imputed direction of $\mathbf { C } \beta _ { i } - \mathbf { C } \alpha _ { i }$ .3 This is computed by assuming tetrahedral geometry and normalizing
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\sqrt { \frac { 1 } { 3 } } ( \mathbf { n } \times \mathbf { c } ) / | | \mathbf { n } \times \mathbf { c } | | _ { 2 } - \sqrt { \frac { 2 } { 3 } } ( \mathbf { n } + \mathbf { c } ) / | | \mathbf { n } + \mathbf { c } | | _ { 2 }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\mathbf { n } = \mathbf { N } _ { i } - \mathbf { C } \alpha _ { i }$ and $\mathbf { c } = \mathbf { C } _ { i } - \mathbf { C } \alpha _ { i }$ . This vector, along with the forward and reverse unit vectors, unambiguously define the orientation of each amino acid residue.
|
| 95 |
+
|
| 96 |
+
• A one-hot representation of amino acid identity, when available.
|
| 97 |
+
|
| 98 |
+
The set of edges is $\mathcal E = \{ { \bf e } _ { j i } \} _ { i \neq j }$ for all $i , j$ where ${ \mathfrak { v } } _ { j }$ is among the $k = 3 0$ nearest neighbors of ${ \mathfrak { v } } _ { i }$ as measured by the distance between their $\mathbf { \boldsymbol { C } } \alpha$ atoms. Each edge has an embedding $\mathbf { h } _ { e } ^ { ( j i ) }$ with the following features:
|
| 99 |
+
|
| 100 |
+
• The unit vector in the direction of $\mathbf { C } \alpha _ { j } - \mathbf { C } \alpha _ { i }$ .
|
| 101 |
+
• The encoding of the distance $| | \mathbf { C } \boldsymbol { \alpha } _ { j } - \mathbf { C } \boldsymbol { \alpha } _ { i } | | _ { 2 }$ in terms of Gaussian radial basis functions.4
|
| 102 |
+
• A sinusoidal encoding of $j - i$ as described in Vaswani et al. (2017), representing distance along the backbone.
|
| 103 |
+
|
| 104 |
+
In our notation, each feature vector $\mathbf { h }$ is a concatenation of scalar and vector features as described above. Collectively, these features are sufficient for a complete description of the protein backbone.
|
| 105 |
+
|
| 106 |
+
# 3.3 NETWORK ARCHITECTURE
|
| 107 |
+
|
| 108 |
+
Our architecture (GVP-GNN) leverages message passing (Gilmer et al., 2017) in which messages from neighboring nodes and edges are used to update node embeddings at each graph propagation step. More explicitly, the architecture takes as input the protein graph defined above and performs graph propagation steps according to:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r c l } { \displaystyle \mathbf { h } _ { m } ^ { ( j \to i ) } } & { : = } & { g ( \mathrm { c o n c a t } ( \mathbf { h } _ { \mathfrak { v } } ^ { ( j ) } , \mathbf { h } _ { e } ^ { ( j \to i ) } ) ) } \\ { \displaystyle \mathbf { h } _ { \mathfrak { v } } ^ { ( i ) } } & { } & { \mathrm { L a y e r N o r m } ( \mathbf { h } _ { \mathfrak { v } } ^ { ( i ) } + \frac { 1 } { k ^ { \prime } } \mathrm { D r o p o u t } ( \sum _ { j : \mathbf { e } _ { j \to i } \in \mathcal { E } } \mathbf { h } _ { m } ^ { ( j \to i ) } ) ) } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Here, $g$ is a sequence of three GVPs, $\mathbf { h } _ { \mathfrak { v } } ^ { ( i ) }$ and $\mathbf { h } _ { e } ^ { ( j i ) }$ are the embeddings of the node $i$ and edge $( j i )$ as above, and $\mathbf { h } _ { m } ^ { ( j i ) }$ represents the message passed from node $j$ to node $i$ . $k ^ { \prime }$ is the number of incoming messages, which is equal to $k$ unless the protein contains fewer than $k$ amino acid residues. Between graph propagation steps, we also use a feed-forward point-wise layer to update the node embeddings at all nodes $i$ :
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbf { h } _ { \mathfrak { v } } ^ { ( i ) } \mathrm { L a y e r N o r m } ( \mathbf { h } _ { \mathfrak { v } } ^ { ( i ) } + \mathrm { D r o p o u t } ( g ( \mathbf { h } _ { \mathfrak { v } } ^ { ( i ) } ) ) )
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $g$ is a sequence of two GVPs. These graph propagation and feed-forward steps update the vector features at each node in addition to its scalar features.
|
| 121 |
+
|
| 122 |
+
In computational protein design, the network learns a generative model over the space of protein sequences conditioned on the given backbone structure. Following Ingraham et al. (2019), we frame this as an autoregressive task and use a masked encoder-decoder architecture to capture the joint distribution over all positions: for each $i$ , the network models the distribution at $i$ based on the complete structure graph, as well as the sequence information at positions $j < i$ . The encoder first performs three graph propagation steps on the structural information only. Then, sequence information is added to the graph, and the decoder performs three further graph propagation steps where incoming messages $\mathbf { h } _ { m } ^ { ( \bar { j } i ) }$ for $j \geq i$ are computed only with the encoder embeddings. Finally, we use one last GVP with 20-way scalar softmax output to predict the probability of the amino acids.
|
| 123 |
+
|
| 124 |
+
In model quality assessment, we use three graph propagation steps and perform regression against the true quality score of a candidate structure, a global scalar property. To obtain a single global representation, we apply a node-wise GVP to reduce all node embeddings to scalars. We then average the representations across all nodes and apply a final dense feed-forward network to output the network’s prediction.
|
| 125 |
+
|
| 126 |
+
Further details regarding training and hyperparameters can be found in Appendix D.
|
| 127 |
+
|
| 128 |
+
# 4 EVALUATION METRICS AND DATASETS
|
| 129 |
+
|
| 130 |
+
Protein design Computational protein design (CPD) is the conceptual inverse of protein structure prediction, aiming to infer an amino acid sequence that will fold into a given structure. CPD is difficult to directly benchmark, as some structures may correspond to a large space of sequences and others may correspond to none at all. Therefore, the proxy metric of native sequence recovery— inferring native sequences given their experimentally determined structures—is often used (Li et al., 2014; O’Connell et al., 2018; Wang et al., 2018). Drawing an analogy between sequence design and language modelling, Ingraham et al. (2019) also evaluate the model perplexity on held-out native sequences. Both metrics rest on the implicit assumption that native sequences are optimized for their structures (Kuhlman & Baker, 2000) and should be assigned high probabilities.
|
| 131 |
+
|
| 132 |
+
To best approximate real-world applications that may require design of novel structures, the held-out evaluation set should bear minimal similarity to the training structures. We use the CATH 4.2 dataset curated by Ingraham et al. (2019) in which all available structures with $40 \%$ nonredudancy are partitioned by their CATH (class, architecture, topology/fold, homologous superfamily) classification. The training, validation, and test splits consist of 18204, 608, and 1120 structures, respectively.
|
| 133 |
+
|
| 134 |
+
We also report results on TS50, an older test set of 50 native structures first introduced by Li et al. (2014). The smaller size of this benchmark also allows a comparison to the computationally expensive physics-based calculations of the fixbb protocol in Rosetta, a software suite well-established in the structural biology community (Das & Baker, 2008). No canonical training and validation sets exist for TS50. To evaluate on TS50, we filter the CATH 4.2 training and validation sets for sequences with less than $30 \%$ similarity (as computed by PSIBLAST) to any sequence in TS50.
|
| 135 |
+
|
| 136 |
+
Model quality assessment Model quality assessment (MQA) aims to select the best structural model of a protein from a large pool of candidate structures.5 The performance of different MQA methods is evaluated every two years in the community-wide Critical Assessment of Structure Prediction (CASP) (Cheng et al., 2019). For a number of recently solved but unreleased structures, called targets, structure generation programs produce a large number of candidate structures. MQA methods are evaluated by how well they predict the GDT-TS score of a candidate structure compared to the experimentally solved structure for that target. GDT-TS is a scalar measure of how similar two protein backbones are after global alignment (Zemla et al., 2001).
|
| 137 |
+
|
| 138 |
+
In addition to accurately predicting the absolute quality of a candidate structure, a good MQA method should also be able to accurately assess the relative model qualities among a pool of candidates for a given target so that the best ones can be selected, perhaps for further refinement. Therefore, MQA methods are commonly evaluated on two metrics: a global correlation between the predicted and ground truth scores, pooled across all targets, and the average per-target correlation among only the candidate structures for a specific target (Cao & Cheng, 2016; Derevyanko et al., 2018; Pages et al., 2019). We follow this convention in our experiments. \`
|
| 139 |
+
|
| 140 |
+
Table 1: GVP-GNN outperforms Structured Transformer and sets a new state-of-the art on the CATH 4.2 protein design test set (and its short and single-chain subsets) in terms of per-residue perplexity (lower is better) and recovery (higher is better). Recovery is reported as the median (over all structures) of the average $\%$ of residues correctly recovered in 100 sampled sequences.
|
| 141 |
+
|
| 142 |
+
<table><tr><td></td><td></td><td colspan="3">Perplexity</td><td colspan="3">Recovery %</td></tr><tr><td>Method</td><td>Type</td><td>Short</td><td>Single-chain</td><td>All</td><td>Short</td><td>Single-chain</td><td>All</td></tr><tr><td>GVP-GNN</td><td>GNN</td><td>7.10</td><td>7.44</td><td>5.29</td><td>32.1</td><td>32.0</td><td>40.2</td></tr><tr><td> Structured GNN</td><td>GNN</td><td>8.31</td><td>8.88</td><td>6.55</td><td>28.4</td><td>28.1</td><td>37.3</td></tr><tr><td>Structured Transformer</td><td>GNN</td><td>8.54</td><td>9.03</td><td>6.85</td><td>28.3</td><td>27.6</td><td>36.4</td></tr></table>
|
| 143 |
+
|
| 144 |
+
We train and validate on 79200 candidate structures for 528 targets submitted to CASP 5-10. We then test GVP-GNN on two MQA datasets. First, we score 20880 stage 1 and stage 2 candidate structures from CASP 11 (84 targets) and 12 (40 targets). This benchmark was first established by Karasikov et al. (2019) and has been used by many recently published methods. Second, to compare with a larger number of methods on more recent structural data, we also score 1472 stage 2 candidate structures from CASP 13 (20 targets). We add the CASP 11-12 structures to our training set to evaluate on CASP 13. Further details on the MQA datasets can be found in Appendix C.
|
| 145 |
+
|
| 146 |
+
# 5 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
Protein design GVP-GNN achieves state-of-the-art performance on CATH 4.2, representing a substantial improvement both in terms of perplexity and sequence recovery over Structured Transformer (Ingraham et al., 2019), a GNN method which was trained using the same training and validation sets (Table 1). Following Ingraham et al. (2019), we report evaluation on short (100 or fewer amino acid residues) and single-chain subsets of the CATH 4.2 test set, containing 94 and 103 proteins, respectively, in addition to the full test set. Although Structured Transformer leverages an attention mechanism on top of a graph-structured representation of proteins, the authors note in ablation studies that removing attention appeared to increase performance. We therefore retrain and compare against a version of Structured Transformer with the attention layers replaced with standard graph propagation operations (Structured GNN). Our method also improves upon this model.
|
| 149 |
+
|
| 150 |
+
On the smaller test set TS50, we achieve $4 4 . 9 \%$ recovery compared to Rosetta’s $30 \%$ and outperform methods based on each of the three classes of structural representations. Overall, we place 2nd out of 9 methods in terms of recovery (see Appendix E). However, the results for this test set should be taken with a grain of salt, given that the different methods did not use canonical training datasets.
|
| 151 |
+
|
| 152 |
+
Model quality assessment We compare GVP-GNN against other single-structure, structure-only methods on the CASP 11-12 test set in Table 2.6 These include the CNN methods 3DCNN (Derevyanko et al., 2018) and Ornate (Pages et al., 2019), the GNN method GraphQA (Baldas- \` sarre et al., 2020), and three methods that use sequential representations—VoroMQA (Olechnovicˇ & Venclovas, 2017), SBROD (Karasikov et al., 2019), and ProQ3D (Uziela et al., 2017). All of these methods learn solely from protein structure,7 with the exception of ProQ3D, which in addition uses sequence profiles based on alignments. We include ProQ3D because it is an improved version of the best single-model method in CASP 11 and CASP 12 (Uziela et al., 2017). GVP-GNN outperforms all other structural methods in both global and per-target correlation, and even performs better than ProQ3D on all but one benchmark. We also train and evaluate DimeNet, a recent 3D-aware GNN architecture which achieves state-of-the-art on many small-molecule tasks (Klicpera et al., 2019), on CASP 11-12. DimeNet does not outperform any of the models in Table 2 (see Appendix E).
|
| 153 |
+
|
| 154 |
+
Table 2: GVP-GNN improves over other single-structure, structure-only methods on CASP 11 and 12 in terms of global (Glob) and mean per-target (Per) Pearson correlation coefficients (higher is better). Each method is classified as one of the three types discussed in Section 2. ProQ3D is set aside as the only method shown which additionally uses sequence-based profiles. For each metric, the top performing structure-only method is in bold, as is the top method overall (if different).
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan="3"></td><td rowspan="3"></td><td colspan="4">CASP 11</td><td colspan="4">CASP 12</td></tr><tr><td colspan="2">Stage 1</td><td colspan="2">Stage 2</td><td colspan="2">Stage 1</td><td colspan="2">Stage 2</td></tr><tr><td>Type Glob</td><td>Per</td><td>Glob</td><td>Per</td><td>Glob</td><td>Per</td><td>Glob</td><td>Per</td></tr><tr><td>GVP-GNN</td><td>GNN</td><td>0.84</td><td>0.66</td><td>0.87</td><td>0.45</td><td>0.79</td><td>0.73</td><td>0.82</td><td>0.62</td></tr><tr><td>3DCNN</td><td>CNN</td><td>0.59</td><td>0.52</td><td>0.64</td><td>0.40</td><td>0.49</td><td>0.44</td><td>0.61</td><td>0.51</td></tr><tr><td>Ornate</td><td>CNN</td><td>0.64</td><td>0.47</td><td>0.63</td><td>0.39</td><td>0.55</td><td>0.57</td><td>0.67</td><td>0.49</td></tr><tr><td>GraphQA</td><td>GNN</td><td>0.83</td><td>0.63</td><td>0.82</td><td>0.38</td><td>0.72</td><td>0.68</td><td>0.81</td><td>0.61</td></tr><tr><td>VoroMQA</td><td>Seq</td><td>0.69</td><td>0.62</td><td>0.65</td><td>0.42</td><td>0.46</td><td>0.61</td><td>0.61</td><td>0.56</td></tr><tr><td>SBROD</td><td>Seq</td><td>0.58</td><td>0.65</td><td>0.55</td><td>0.43</td><td>0.37</td><td>0.64</td><td>0.47</td><td>0.61</td></tr><tr><td>ProQ3D</td><td>Seq</td><td>0.80</td><td>0.69</td><td>0.77</td><td>0.44</td><td>0.67</td><td>0.71</td><td>0.81</td><td>0.60</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 3: GVP-GNN improves over single-structure methods participating in CASP 13 on the 20 evaluated targets. The seven top methods highlighted by the CASP organizers are shown. GVPGNN is the top structure-only method and the top method overall in terms of global correlation.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Method</td><td>Global</td><td>Per-target</td></tr><tr><td>GVP-GNN</td><td>0.888</td><td>0.671</td></tr><tr><td>SASHAN</td><td>0.840</td><td>0.633</td></tr><tr><td>FaeNNz</td><td>0.810</td><td>0.650</td></tr><tr><td>VoroMQA-A</td><td>0.744</td><td>0.595</td></tr><tr><td>VoroMQA-B</td><td>0.726</td><td>0.586</td></tr><tr><td>ProQ3D</td><td>0.847</td><td>0.660</td></tr><tr><td>MULTICOM-NOVEL</td><td>0.652</td><td>0.551</td></tr><tr><td>ProQ4</td><td>0.604</td><td>0.691</td></tr></table>
|
| 161 |
+
|
| 162 |
+
We compare GVP-GNN with all 23 single-structure MQA methods participating in CASP 13 for which complete predictions on the 20 evaluation targets are available. Seven of these methods were highlighted as best-performing by the CASP organizers in Cheng et al. (2019) and are shown along with GVP-GNN in Table 3. These include four methods learning solely from structural features and three also using sequence profiles. SASHAN learns a linear model over secondary structure and contact-based features (Cheng et al., 2019). $\mathrm { F a e N N z } ^ { 8 }$ (Studer et al., 2020), ProQ3D (Uziela et al., 2017), and VoroMQA9 (Olechnovic & Venclovas, 2017) learn a multi-layer perceptron or ˇ statistical potential on top of such structural features. Finally, MULTICOM-NOVEL (Hou et al., 2019) and ProQ4 (Hurtado et al., 2018) employ one-dimensional deep convolutional networks on top of sequential representations. GVP-GNN outperforms all methods in terms of global correlation and outperforms all structure-only methods in per-target correlation. See Appendix E for full results.
|
| 163 |
+
|
| 164 |
+
Finally, because our architecture updates vector features along with scalar features at each node embedding, it is possible to visualize learned vector features in the intermediate layers of the trained MQA network. We show and discuss the interpretability of such features in Appendix F.
|
| 165 |
+
|
| 166 |
+
Ablation studies The methods we have compared against include a number of GNNs (Structured Transformer/GNN, ProteinSolver, GraphQA). We train a number of ablated models for CPD and MQA to identify the aspects of the GVP which most contribute to our performance improvement over these GNNs (Table 4). Replacing the GVP with a vanilla MLP layer or propagating only scalar features both remove direct access to geometric information, forcing the model to learn scalarvalued, indirect representations of geometry. These modifications result in considerable decreases in performance, underscoring the importance of direct access to geometric information. Propagating only the vector features results in an even larger decrease as it both eliminates important scalar input features (such as torsion angles and amino acid identity) and the part of the GVP with approximation guarantees. Therefore, the dual scalar/vector design of the GVP is essential: without either, the best ablated model falls short of Structured GNN on CPD and only matches GraphQA on MQA. Finally, eliminating the second vector transformation $\mathbf { W } _ { \mu }$ results in a slight decrease in performance. Therefore, all architectural elements contributed to our improvement over state-of-the-art.
|
| 167 |
+
|
| 168 |
+
Table 4: Ablations of the GVP architecture decrease performance on CPD and MQA. We include Structured GNN and GraphQA as state-of-the-art GNN references for CPD and MQA, respectively. Metrics are defined the same way as in Tables 1 (CPD) and 2 (MQA).
|
| 169 |
+
|
| 170 |
+
<table><tr><td></td><td colspan="2">CPD</td><td colspan="4">MQA</td></tr><tr><td></td><td colspan="2">CATH 4.2 All</td><td colspan="2">CASP 11 Stage 2</td><td colspan="2">CASP 12 Stage 2</td></tr><tr><td>Modification</td><td>Perplexity</td><td>Recovery</td><td>Global</td><td>Per-target</td><td>Global</td><td>Per-target</td></tr><tr><td>None</td><td>5.29</td><td>40.2</td><td>0.87</td><td>0.45</td><td>0.82</td><td>0.62</td></tr><tr><td>MLP layer</td><td>7.76</td><td>30.6</td><td>0.84</td><td>0.36</td><td>0.79</td><td>0.59</td></tr><tr><td>Only scalars</td><td>7.31</td><td>32.4</td><td>0.84</td><td>0.38</td><td>0.83</td><td>0.59</td></tr><tr><td>Only vectors</td><td>11.05</td><td>23.2</td><td>0.56</td><td>0.16</td><td>0.57</td><td>0.39</td></tr><tr><td>NoWμ</td><td>5.85</td><td>37.1</td><td>0.86</td><td>0.41</td><td>0.81</td><td>0.60</td></tr><tr><td>Structured GNN</td><td>6.55</td><td>37.3</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>GraphQA</td><td>1</td><td>1</td><td>0.82</td><td>0.38</td><td>0.81</td><td>0.61</td></tr></table>
|
| 171 |
+
|
| 172 |
+
# 6 CONCLUSION
|
| 173 |
+
|
| 174 |
+
In this work, we developed the first architecture designed specifically for learning on dual relational and geometric representations of 3D macromolecular structure. At its core, our method, GVP-GNN, augments graph neural networks with computationally simple layers that perform expressive geometric reasoning over Euclidean vector features. Our method possesses desirable theoretical properties and empirically outperforms existing architectures on learning quality scores and sequence designs, respectively, from protein structure.
|
| 175 |
+
|
| 176 |
+
The equivariance of GVP layers with respect to 3D translations and rotations also highlights a similarity to methods that leverage irreducible representations of $S O ( 3 )$ to define equivariant convolutions on point clouds (Thomas et al., 2018; Anderson et al., 2019). These methods allow for equivariant representations of higher-order tensors, but due to their complexity and computational cost, their applications have until recently been limited to small molecules (Eismann et al., 2020). Our architecture presents an alternative, relatively lightweight approach to equivariance that is wellsuited for large biomolecules and biomolecular complexes.
|
| 177 |
+
|
| 178 |
+
In further work, we hope to apply our architecture to other important structural biology problem areas, including protein complexes, RNA structure, and protein-ligand interactions.
|
| 179 |
+
|
| 180 |
+
# ACKNOWLEDGEMENTS
|
| 181 |
+
|
| 182 |
+
We acknowledge support from the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Scientific Discovery through Advanced Computing (SciDAC) program, and Intel Corporation. SE is supported by a Stanford Bio-X Bowes fellowship. RJLT is supported by the U.S. Department of Energy, Office of Science Graduate Student Research (SCGSR) program. We thank Tri Dao, Trenton Chang, and all members of the Dror group for feedback and discussions.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Namrata Anand, Raphael Ryuichi Eguchi, Alexander Derry, Russ B Altman, and Possu Huang. Protein sequence design with a learned potential. bioRxiv, 2020.
|
| 187 |
+
|
| 188 |
+
Brandon Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant molecular neural networks. arXiv preprint arXiv:1906.04015, 2019.
|
| 189 |
+
|
| 190 |
+
Federico Baldassarre, David Menendez Hurtado, Arne Elofsson, and Hossein Azizpour. Graphqa: ´ Protein model quality assessment using graph convolutional network. 2019.
|
| 191 |
+
|
| 192 |
+
Federico Baldassarre, David Menndez Hurtado, Arne Elofsson, and Hossein Azizpour. GraphQA: protein model quality assessment using graph convolutional networks. Bioinformatics, 2020.
|
| 193 |
+
|
| 194 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 195 |
+
|
| 196 |
+
Jeremy M Berg, John L Tymoczko, and Lubert Stryer. Biochemistry, W.H. Freeman and Company, 2002.
|
| 197 |
+
|
| 198 |
+
Renzhi Cao and Jianlin Cheng. Protein single-model quality assessment by feature-based probability density functions. Scientific reports, 6:23990, 2016.
|
| 199 |
+
|
| 200 |
+
Sheng Chen, Zhe Sun, Lihua Lin, Zifeng Liu, Xun Liu, Yutian Chong, Yutong Lu, Huiying Zhao, and Yuedong Yang. To improve protein sequence profile prediction through image captioning on pairwise residue distance map. Journal of Chemical Information and Modeling, 2019.
|
| 201 |
+
|
| 202 |
+
Jianlin Cheng, Myong-Ho Choe, Arne Elofsson, Kun-Sop Han, Jie Hou, Ali HA Maghrabi, Liam J McGuffin, David Menendez-Hurtado, Kliment Olechnovi ´ c, Torsten Schwede, et al. Estimation of ˇ model accuracy in casp13. Proteins: Structure, Function, and Bioinformatics, 87(12):1361–1377, 2019.
|
| 203 |
+
|
| 204 |
+
Nadav Cohen and Amnon Shashua. Inductive bias of deep convolutional networks through pooling geometry. In International Conference on Learning Representations, 2017.
|
| 205 |
+
|
| 206 |
+
George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303–314, 1989.
|
| 207 |
+
|
| 208 |
+
Rhiju Das and David Baker. Macromolecular modeling with rosetta. Annu. Rev. Biochem., 77: 363–382, 2008.
|
| 209 |
+
|
| 210 |
+
Georgy Derevyanko, Sergei Grudinin, Yoshua Bengio, and Guillaume Lamoureux. Deep convolutional networks for quality assessment of protein folds. Bioinformatics, 34(23):4046–4053, 2018.
|
| 211 |
+
|
| 212 |
+
Stephan Eismann, Raphael JL Townshend, Nathaniel Thomas, Milind Jagota, Bowen Jing, and Ron O Dror. Hierarchical, rotation-equivariant neural networks to select structural models of protein complexes. Proteins: Structure, Function, and Bioinformatics, 2020.
|
| 213 |
+
|
| 214 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263–1272, 2017.
|
| 215 |
+
|
| 216 |
+
Jordan Graves, Jacob Byerly, Eduardo Priego, Naren Makkapati, S Vince Parish, Brenda Medellin, and Monica Berrondo. A review of deep learning methods for antibodies. Antibodies, 9(2):12, 2020.
|
| 217 |
+
|
| 218 |
+
Joe G Greener, Lewis Moffat, and David T Jones. Design of metalloproteins and novel protein folds using variational autoencoders. Scientific reports, 8(1):1–12, 2018.
|
| 219 |
+
|
| 220 |
+
Sharon Hammes-Schiffer and Stephen J Benkovic. Relating protein motion to catalysis. Annu. Rev. Biochem., 75:519–541, 2006.
|
| 221 |
+
|
| 222 |
+
Jie Hou, Renzhi Cao, and Jianlin Cheng. Deep convolutional neural networks for predicting the quality of single protein structural models. bioRxiv, pp. 590620, 2019.
|
| 223 |
+
|
| 224 |
+
David Menendez Hurtado, Karolis Uziela, and Arne Elofsson. Deep transfer learning in the assess- ´ ment of the quality of protein models. arXiv preprint arXiv:1804.06281, 2018.
|
| 225 |
+
|
| 226 |
+
John Ingraham, Vikas Garg, Regina Barzilay, and Tommi Jaakkola. Generative models for graphbased protein design. In Advances in Neural Information Processing Systems, pp. 15794–15805, 2019.
|
| 227 |
+
|
| 228 |
+
Mikhail Karasikov, Guillaume Pages, and Sergei Grudinin. Smooth orientation-dependent scoring \` function for coarse-grained protein quality assessment. Bioinformatics, 35(16):2801–2808, 2019.
|
| 229 |
+
|
| 230 |
+
Johannes Klicpera, Janek Groß, and Stephan Gunnemann. Directional message passing for molec-¨ ular graphs. In International Conference on Learning Representations, 2019.
|
| 231 |
+
|
| 232 |
+
Brian Kuhlman and David Baker. Native protein sequences are close to optimal for their structures. Proceedings of the National Academy of Sciences, 97(19):10383–10388, 2000.
|
| 233 |
+
|
| 234 |
+
Zhixiu Li, Yuedong Yang, Eshel Faraggi, Jian Zhan, and Yaoqi Zhou. Direct prediction of profiles of sequences compatible with a protein structure by neural networks with fragment-based local and energy-based nonlocal profiles. Proteins: Structure, Function, and Bioinformatics, 82(10): 2565–2573, 2014.
|
| 235 |
+
|
| 236 |
+
James O’Connell, Zhixiu Li, Jack Hanson, Rhys Heffernan, James Lyons, Kuldip Paliwal, Abdollah Dehzangi, Yuedong Yang, and Yaoqi Zhou. Spin2: Predicting sequence profiles from protein structures using deep neural networks. Proteins: Structure, Function, and Bioinformatics, 86(6): 629–633, 2018.
|
| 237 |
+
|
| 238 |
+
Kliment Olechnovic and ˇ Ceslovas Venclovas. Voromqa: Assessment of protein structure quality ˇ using interatomic contact areas. Proteins: Structure, Function, and Bioinformatics, 85(6):1131– 1145, 2017.
|
| 239 |
+
|
| 240 |
+
Guillaume Pages, Benoit Charmettant, and Sergei Grudinin. Protein model quality assessment using \` 3d oriented convolutional neural networks. Bioinformatics, 35(18):3313–3319, 2019.
|
| 241 |
+
|
| 242 |
+
Janaina Cruz Pereira, Ernesto Raul Caffarena, and Cicero Nogueira dos Santos. Boosting dockingbased virtual screening with deep learning. Journal of chemical information and modeling, 56 (12):2495–2506, 2016.
|
| 243 |
+
|
| 244 |
+
Yifei Qi and John ZH Zhang. Densecpd: Improving the accuracy of neural-network-based computational protein sequence design with densenet. Journal of Chemical Information and Modeling, 60(3):1245–1252, 2020.
|
| 245 |
+
|
| 246 |
+
Raghav Shroff, Austin W Cole, Barrett R Morrow, Daniel J Diaz, Isaac Donnell, Jimmy Gollihar, Andrew D Ellington, and Ross Thyer. A structure-based deep learning framework for protein engineering. bioRxiv, pp. 833905, 2019.
|
| 247 |
+
|
| 248 |
+
Alexey Strokach, David Becerra, Carles Corbi-Verge, Albert Perez-Riba, and Philip M Kim. Fast and flexible protein design using deep graph neural networks. Cell Systems, 11(4):402–411, 2020.
|
| 249 |
+
|
| 250 |
+
Gabriel Studer, Christine Rempfer, Andrew M Waterhouse, Rafal Gumienny, Juergen Haas, and Torsten Schwede. Qmeandiscodistance constraints applied on model quality estimation. Bioinformatics, 36(6):1765–1771, 2020.
|
| 251 |
+
|
| 252 |
+
Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018.
|
| 253 |
+
|
| 254 |
+
Raphael Townshend, Rishi Bedi, Patricia Suriana, and Ron Dror. End-to-end learning on 3d protein structure for interface prediction. In Advances in Neural Information Processing Systems, pp. 15616–15625, 2019.
|
| 255 |
+
|
| 256 |
+
Karolis Uziela, David Menendez Hurtado, Nanjiang Shu, Bj ´ orn Wallner, and Arne Elofsson. ¨ Proq3d: improved model quality assessments using deep learning. Bioinformatics, 33(10):1578– 1580, 2017.
|
| 257 |
+
|
| 258 |
+
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.
|
| 259 |
+
|
| 260 |
+
Jingxue Wang, Huali Cao, John ZH Zhang, and Yifei Qi. Computational protein design with deep learning neural networks. Scientific reports, 8(1):1–9, 2018.
|
| 261 |
+
|
| 262 |
+
Jonghun Won, Minkyung Baek, Bohdan Monastyrskyy, Andriy Kryshtafovych, and Chaok Seok. Assessment of protein model structure accuracy estimation in casp13: Challenges in the era of deep learning. Proteins: Structure, Function, and Bioinformatics, 87(12):1351–1360, 2019.
|
| 263 |
+
|
| 264 |
+
Adam Zemla, Ceslovas Venclovas, John Moult, and Krzysztof Fidelis. Processing and evaluation of ˇ predictions in casp4. Proteins: Structure, Function, and Bioinformatics, 45(S5):13–21, 2001.
|
| 265 |
+
|
| 266 |
+
Yuan Zhang, Yang Chen, Chenran Wang, Chun-Chao Lo, Xiuwen Liu, Wei Wu, and Jinfeng Zhang. Prodconn: Protein design using a convolutional neural network. Proteins: Structure, Function, and Bioinformatics, 2019.
|
| 267 |
+
|
| 268 |
+
# A PROPERTIES OF GEOMETRIC VECTOR PERCEPTRONS
|
| 269 |
+
|
| 270 |
+
# A.1 EQUIVARIANCE AND INVARIANCE
|
| 271 |
+
|
| 272 |
+
The vector and scalar outputs of the GVP are equivariant and invariant, respectively, with respect to an arbitrary composition of rotations and reflections in 3D Euclidean space described by $R$ i.e.,
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\operatorname { G V P } ( ( \mathbf { s } , R ( \mathbf { V } ) ) ) = ( \mathbf { s } ^ { \prime } , R ( \mathbf { V } ^ { \prime } ) )
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Proof. We can write the transformation described by $R$ as multiplying $\mathbf { V }$ with a unitary matrix $\mathbf { U } \in \mathbb { R } ^ { 3 \times 3 }$ from the right. The $\mathrm { L _ { 2 } }$ -norm, scalar multiplications, and nonlinearities are defined rowwise as in Algorithm 1. We consider scalar and vector outputs separately. The scalar output, as a function of the inputs, is
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\mathbf { s } ^ { \prime } = \sigma ( \mathbf { W } _ { m } [ \mathbf { | \mathbf { W } _ { h } \mathbf { V } | } ] { 2 } ] + \mathbf { b } )
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
Since $\left\| \mathbf { W } _ { h } \mathbf { V U } \right\| _ { 2 } = \left\| \mathbf { W } _ { h } \mathbf { V } \right\| _ { 2 }$ , we conclude $\mathbf { s } ^ { \prime }$ is invariant. Similarly the vector output is
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathbf { V } ^ { \prime } = \sigma ^ { + } \left( \| \mathbf { W } _ { \mu } \mathbf { W } _ { h } \mathbf { V } \| _ { 2 } \right) \odot \mathbf { W } _ { \mu } \mathbf { W } _ { h } \mathbf { V }
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
The row-wise scaling can also be viewed as left-multiplication by a diagonal matrix $\mathbf { D }$ . Since $\left\| \mathbf { W } _ { \mu } \mathbf { W } _ { h } \mathbf { V } \right\| _ { 2 } = \left\| \mathbf { W } _ { \mu } \mathbf { W } _ { h } \mathbf { V } \mathbf { U } \right\| _ { 2 }$ , $\mathbf { D }$ is invariant. Since
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\mathbf { D W } _ { \mu } \mathbf { W } _ { h } ( \mathbf { V U } ) = \left( \mathbf { D W } _ { \mu } \mathbf { W } _ { h } \mathbf { V } \right) \mathbf { U }
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
we conclude that $\mathbf { V } ^ { \prime }$ is equivariant.
|
| 297 |
+
|
| 298 |
+
# A.2 APPROXIMATION OF ROTATION-INVARIANT FUNCTIONS
|
| 299 |
+
|
| 300 |
+
The GVP inherits an analogue of the Universal Approximation property Cybenko (1989) of standard dense layers. If $R$ describes an arbitrary rotation or reflection in 3D Euclidean space, we show that the GVP architecture can approximate arbitrary scalar-valued functions invariant under $R$ and defined over $\Omega ^ { \nu } \subset \mathbb { R } ^ { \nu \times 3 }$ , the bounded subset of $\mathbb R ^ { \bar { \nu } \times 3 }$ whose elements can be canonically oriented based on three linearly independent vector entries. Without loss of generality, we assume the first three vector entries can be used.
|
| 301 |
+
|
| 302 |
+
The machinery corresponding to such approximations corresponds to a GVP $G _ { s }$ with only vector inputs, only scalar outputs, and a sigmoidal nonlinearity $\sigma$ ; followed by a dense layer. This can also be viewed as the sequence of matrix multiplication with $\mathbf { W } _ { h }$ , taking the $\mathrm { L _ { 2 } }$ -norm, and a dense network with one hidden layer. Such machinery can be extracted from any two consecutive GVPs (assuming a sigmoidal $\sigma$ ).
|
| 303 |
+
|
| 304 |
+
We restate the theorem from the main text:
|
| 305 |
+
|
| 306 |
+
Theorem. Let $R$ describe an arbitrary rotation and/or reflection in $\mathbb { R } ^ { 3 }$ . For $\nu \geq 3$ let $\Omega ^ { \nu } \subset \mathbb { R } ^ { \nu \times 3 }$ be the set of all ${ \bf V } = [ \pmb { v } _ { 1 } , \quad \dots , \quad \pmb { v } _ { \nu } ] ^ { T } \in \mathbb { R } ^ { \nu \times 3 }$ such that ${ \pmb v } _ { 1 } , { \pmb v } _ { 2 } , { \pmb v } _ { 3 }$ are linearly independent and $0 \leq \| \pmb { v } _ { i } \| _ { 2 } \leq b$ for all i and some finite $b > 0$ . Then for any continuous $F : \Omega ^ { \nu } \to \mathbb { R }$ such that $F ( R ( \mathbf { V } ) ) \ : = \ : F ( \mathbf { V } )$ and for any $\epsilon > 0$ , there exists a form $f ( \mathbf { V } ) \ = \ \mathbf { w } ^ { T } G _ { s } ( \mathbf { V } )$ such that $| F ( \mathbf { V } ) - f ( \mathbf { V } ) | < \epsilon$ for all $\mathbf { V } \in \Omega$ .
|
| 307 |
+
|
| 308 |
+
Proof. The idea is to write $F$ as a composition $F = \tilde { F } \circ \omega$ and $\omega = h \circ y$ . We show that multiplication with $\mathbf { W } _ { h }$ and and taking the $\mathrm { L _ { 2 } }$ -norm can compute $y$ , and that the dense network with one hidden layer can approximate $\tilde { F } \circ h$ .
|
| 309 |
+
|
| 310 |
+
Call an element $\mathbf { V } \in \Omega ^ { \nu }$ oriented if $\pmb { v } _ { 1 } = x _ { 1 } \mathbf { e } _ { x }$ , $v _ { 2 } = x _ { 2 } \mathbf { e } _ { x } + y _ { 2 } \mathbf { e } _ { y }$ , and $v _ { 3 } = x _ { 3 } \mathbf { e } _ { x } + y _ { 3 } \mathbf { e } _ { y } + z _ { 3 } \mathbf { e } _ { z }$ , with $x _ { 1 } , y _ { 2 } , z _ { 3 } > 0$ . Define $\omega : \Omega ^ { \nu } \to \mathbb { R } ^ { 3 \nu - 3 }$ to be the orientation function that orients its input and then extracts the vector of $3 \nu - 3$ coefficients, $[ x _ { 1 } , x _ { 2 } , y _ { 2 } , x _ { 3 } , y _ { 3 } , z _ { 3 } , \ldots , x _ { i } , y _ { i } , z _ { i } , \ldots ] ^ { T }$ . These
|
| 311 |
+
|
| 312 |
+
elements can be written as
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { l c l } { x _ { 1 } } & { = } & { \left\| v _ { 1 } \right\| _ { 2 } } \\ { x _ { i } } & { = } & { v _ { i } \cdot v _ { 1 } / x _ { 1 } , \quad i \geq 2 } \\ { y _ { 2 } } & { = } & { \sqrt { \left\| v _ { 2 } \right\| _ { 2 } ^ { 2 } - x _ { 2 } ^ { 2 } } } \\ { y _ { i } } & { = } & { \left( v _ { i } \cdot v _ { 2 } - x _ { i } x _ { 2 } \right) / y _ { 2 } , \quad i \geq 3 } \\ { z _ { 3 } } & { = } & { \sqrt { \left\| v _ { 3 } \right\| _ { 2 } ^ { 2 } - x _ { 3 } ^ { 2 } - y _ { 3 } ^ { 2 } } } \\ { z _ { i } } & { = } & { \left( v _ { i } \cdot v _ { 3 } - x _ { i } x _ { 3 } - y _ { i } y _ { 3 } \right) / z _ { 3 } , \quad i \geq 4 } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
and are invariant under rotation and reflection, because they are defined using only the norms and inner products of the $\mathbf { v } _ { i }$ . Then $F = \tilde { F } \circ \omega$ , where $\tilde { F } : [ - b , \dot { b } ] ^ { 3 \nu - 3 } \to \mathbb { R }$ .
|
| 319 |
+
|
| 320 |
+
The key insight is that if we construct $\mathbf { W } _ { h }$ such that the rows of $\mathbf { W } _ { h } \mathbf { V }$ are the original vectors $\mathbf { v } _ { i } , \forall i$ and all differences ${ \bf v } _ { i } - { \bf v } _ { j } , \forall i , j \le \operatorname* { m i n } ( i , 3 )$ , then we can compute $\omega ( \mathbf { V } )$ from the row-wise norms of $\mathbf { W } _ { h } \mathbf { V }$ . That is, $\omega = h \circ y$ where $\mathbf { y } = y ( \mathbf { V } ) = \| { \cdot } \| _ { 2 } \odot ( \mathbf { W } _ { h } \mathbf { V } ) \in \mathbb { R } ^ { 4 \nu - 6 }$ and $h$ is an application of the cosine law. The GVP precisely computes $\mathbf { y }$ as an intermediate step: we can write $G _ { s } ( \mathbf { V } ) = \sigma \odot ( \mathbf { W } _ { m } \mathbf { y } + \mathbf { b } )$ . It remains to show that there exists a form $\widetilde { f } ( \mathbf { y } ) = \mathbf { w } ^ { T } [ \sigma \odot ( \mathbf { W } _ { m } \mathbf { y } + \mathbf { b } ) ]$ that $\epsilon$ -approximates $\tilde { F } \circ h : [ - 2 b , 2 b ] ^ { 4 \nu - 6 } \mathbb { R }$ . Up to a translation and uniform scaling of the hypercube, this is the result of the Universal Approximation Theorem (Cybenko, 1989). □
|
| 321 |
+
|
| 322 |
+
# B SYNTHETIC TASKS
|
| 323 |
+
|
| 324 |
+
We perform controlled experiments on a synthetic dataset in order to analyze the benefits of the GVP architecture and determine if it indeed improves the geometric and joint geometric-relational reasoning abilities of GNNs.
|
| 325 |
+
|
| 326 |
+
Dataset The synthetic dataset is designed to mimic the essential qualities of the domain of protein structures. Each “structure” consists of $n = 1 0 0$ random points in $\mathbb { R } ^ { 3 }$ , distributed uniformly in the ball of radius $r = 1 0$ , with the constraint that no two points are less than distance $d = 2$ apart. Each position is also associated with a random unit vector (a “sidechain”) to endow it with an orientation. Three points are randomly chosen and are labelled as “special”; these will be used to define the learning tasks. We generate $2 0 \mathrm { k }$ “structures” and split them $80 \%$ train : $10 \%$ validation : $10 \%$ test.
|
| 327 |
+
|
| 328 |
+
In the voxelized representation of a data point, the volume is voxelized into unit cubes. Each point is partitioned into a neighborhood of eight voxels by trilinear interpolation, such that exact coordinate information is retained. Separate channels are used for the special and non-special points. The “sidechains” are represented with a set of $n = 1 0 0$ points located at the ends of the unit vectors and mapped into a third channel.
|
| 329 |
+
|
| 330 |
+
In the graph-structured representation of a data point, a proximity graph is drawn with $k = 1 0$ nearest neighbors. Each node is labelled with a one-hot encoding of its type (“special” or “nonspecial”) and each edge with its Euclidean length. In the vanilla GNN, orientation information is encoded by additionally including all three dot products in each edge embedding. In the GVP-GNN, each node embedding contains the node’s “sidechain” vector, and each edge embedding contains a unit vector indicating the direction of the edge.
|
| 331 |
+
|
| 332 |
+
Tasks We identify two regression tasks to exemplify geometric and relational reasoning, respectively. In the “Off-center” task, the network predicts the distance from the centroid of the three special points to the centroid of the entire structure. In the “Perimeter” task, the network predicts the perimeter of the triangle defined by the three special points. We characterize the former as primarily geometric, as it requires reasoning about global properties of the 3D shape, in particular points in space that are not themselves nodes, and the latter as primarily relational, as it involves distances between three specific pairs of nodes. Finally, to represent a problem with geometric and relational aspects, in the “Combined” task we attempt to predict the difference of the (normalized) off-center and perimeter objectives.
|
| 333 |
+
|
| 334 |
+
Models We train a 3-layer shallow CNN and a 3-layer GNN with a single-layer feed-forward network. These are compared against a GVP-GNN that is otherwise identical to the standard GNN. To reflect the spirit of the synthetic experiment, all models have the same intermediate dimensionality of 32 (4 vector and 20 scalar channels in the GVP-GNN), we use the same training procedure for all models, and no hyperparameter tuning or architecture search is performed.
|
| 335 |
+
|
| 336 |
+
Results The results of the synthetic experiments are shown in Table 5. The vanilla GNN significantly outperforms the CNN on the perimeter task, while the CNN significantly outperforms the GNN on the off-center task, supporting our conceptual framework of the relative strengths of the two architectures. However, the GVP-GNN matches (and even outperforms) the CNN on the geometric task while maintaining the GNN’s performance on the relational task. It additionally significantly outperforms both models on the combined task. On the basis of these results, the GVP appears successful in combining the strengths of the CNN and GNN into a single architecture.
|
| 337 |
+
|
| 338 |
+
Table 5: Performance of the three compared model architectures on the off-center (geometric), perimeter (relational), and combined objectives. The MSE losses are standardized such that predicting a constant value (i.e. the mean) would result in unit loss. Results are reported as the mean $\pm$ S.D. over $k = 5$ random splits, where the best of three random seeds is taken for each split.
|
| 339 |
+
|
| 340 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Off-center r (geometric)</td><td>Perimeter (relational)</td><td>Combined</td></tr><tr><td>CNN</td><td>59k</td><td>0.319 ±0.014</td><td>0.532 ±0.028</td><td>0.522 ± 0.016</td></tr><tr><td>GNN</td><td>40k</td><td>0.871 ± 0.045</td><td>0.128 ± 0.009</td><td>0.421 ± 0.025</td></tr><tr><td>GVP-GNN</td><td>22k</td><td>0.206 ± 0.024</td><td>0.106 ± 0.006</td><td>0.155 ± ( 0.024</td></tr></table>
|
| 341 |
+
|
| 342 |
+
# C MQA DATASETS: FURTHER DETAILS
|
| 343 |
+
|
| 344 |
+
The MQA training and validation dataset includes 528 targets from CASP 5-10 and 150 candidate structures per target. These targets are partitioned at random into 480 training targets and 48 validation targets. We include native structures for training and validation to make use of the greatest range of GDT-TS scores. We do not include native structures for testing in order to mimic CASP and real-world applications and because other methods were not tested on native structures.
|
| 345 |
+
|
| 346 |
+
In the CASP assessments, stage 1 refers to a set of 20 candidate structures per target and stage 2 to a set of 150 candidate structures per target (5 from each structure prediction server). Both sets are pre-designated by the CASP organizers.
|
| 347 |
+
|
| 348 |
+
There has been slight inconsistency in the literature with regards to the exact composition of the CASP 11 and 12 test sets. We use the list established by Karasikov et al. (2019) because nearly all recent methods have been benchmarked on this set at some point. The CASP 13 test set includes 1472 stage 2 candidate structures from the following 20 targets: T0950, T0951, T0953s1, T0953s2, T0954, T0955, T0957s1, T0957s2, T0958, T0960, T0963, T0966, T0968s1, T0968s2, T1003, T1005, T1008, T1009, T1011, T1016. These were the targets for which candidate structures, submitted predictions, and ground-truth scores were publicly available (obtained as described by Baldassarre et al. (2020)) at the time of writing. The exact numbers of targets and structures in each set can be found in Table 6.
|
| 349 |
+
|
| 350 |
+
Table 6: MQA datasets
|
| 351 |
+
|
| 352 |
+
<table><tr><td>Dataset</td><td># Targets</td><td># Structures</td><td>Includes natives?</td></tr><tr><td>Training</td><td>480</td><td>72000</td><td>Yes</td></tr><tr><td>Validation</td><td>48</td><td>7200</td><td>Yes</td></tr><tr><td>CASP 11 stage 1</td><td>84</td><td>1680</td><td>No</td></tr><tr><td>CASP 11 stage 2</td><td>83</td><td>12450</td><td>No</td></tr><tr><td>CASP 12 stage 1</td><td>40</td><td>800</td><td>No</td></tr><tr><td>CASP 12 stage 2</td><td>40</td><td>5950</td><td>No</td></tr><tr><td>CASP 13 stage 2</td><td>20</td><td>1472</td><td>No</td></tr></table>
|
| 353 |
+
|
| 354 |
+
# D TRAINING AND HYPERPARAMETERS
|
| 355 |
+
|
| 356 |
+
To train the MQA model to perform regression against the model quality score, we use a sum of an absolute loss and a pairwise loss. That is, for each training step we intake pairs $i , j$ where $i , j$ are candidate structures for the same target and compute
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\mathcal { L } = H ( y ^ { ( i ) } - \hat { y } ^ { ( i ) } ) + H ( y ^ { ( j ) } - \hat { y } ^ { ( j ) } ) + H \left( ( y ^ { ( i ) } - y ^ { ( j ) } ) - ( \hat { y } ^ { ( i ) } - \hat { y } ^ { ( j ) } ) \right)
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
where $H$ is the Huber loss. When reshuffling at the beginning of each epoch, we also randomly pair up the candidate structures for each target. Interestingly, adding the pairwise term also improves global correlation, likely because the much larger number of possible pairs makes it more difficult to overfit.
|
| 363 |
+
|
| 364 |
+
To train the CPD model to perform classification / discrete generative modelling, we use the crossentropy / negative log likelihood loss.
|
| 365 |
+
|
| 366 |
+
For both the MQA and CPD model, we use node and hidden embeddings with 16 vector and 100 scalar channels and edge embeddings with 1 vector and 32 scalar channels. The input node and edge features are first transformed by a sequence of GVPs to these dimensionalities before graph propagation. In all training runs, we use the Adam optimizer to perform mini-batch gradient descent. Batches are constructed by grouping structures of similar size to have a maximum of 1800 residues per batch for CPD and 3000 residues per batch for MQA. We also tune the following hyperparameters over a total of 70 training runs:
|
| 367 |
+
|
| 368 |
+
• Learning rate in the range of $1 0 ^ { - 4 }$ to $1 0 ^ { - 3 }$ • Dropout probability in the range of $1 0 ^ { - 4 }$ to $1 0 ^ { - 1 }$ • Number of graph propagation layers in the range of 3 to 6 • Relative weight of the MQA pairwise loss in the range of 0 to 2
|
| 369 |
+
|
| 370 |
+
All models are implemented in TensorFlow 2.1 and trained for a maximum of 100 epochs. This takes around two days for both models on a single Titan X GPU. However, we note that the GPU memory, not compute power, is the bottleneck when training, based on the the average volatile GPU usage. We therefore anticipate that the runtime can be further optimized.
|
| 371 |
+
|
| 372 |
+
# E ADDITIONAL RESULTS
|
| 373 |
+
|
| 374 |
+
# E.1 DIMENET ON MQA
|
| 375 |
+
|
| 376 |
+
DimeNet (Klicpera et al., 2019) is a recent GNN architecture designed to incorporate the 3D geometry of small molecule graphs by encoding relative edge orientations in a local spherical Bessel basis. DimeNet and our architecture are similar in that both seek to leverage geometric aspects of a problem domain on top of graph-structured representations. However, unlike our architecture, Dimenet uses rotation-invariant features to indirectly encode geometry into its message-passing operations. Additionally, it updates edge embeddings by propagating messages between each pair of neighboring edges. While this paradigm appears well-suited for the domain of learning from small molecules, it does not scale well to large protein structure graphs. In evaluating DimeNet on MQA, we could only extend the distance cutoff to 7.5 angstroms, while 30 neighbors corresponds to roughly 13 angstroms. DimeNet does not perform comparably to our model, or to previous GNNs designed for learning from structure such as GraphQA (Table 7).
|
| 377 |
+
|
| 378 |
+
# E.2 MQA: RESULTS ON CASP 13
|
| 379 |
+
|
| 380 |
+
We report results for all 23 single-structure methods assessed in CASP 13 for which scores on all 20 targets are available (Table 8). The following 7 methods were excluded because they do not report results for some targets: LamoureuxLab, SBROD-server, SBROD, 3DCNN, MESHI-server, SBROD-plus, FALCON-QA, and Grudinin. We do include comparisons with LamoureuxLab (previously 3DCNN), 3DCNN (previously Ornate), and SBROD on CASP 11-12. All of the methods highlighted as top-performing by the CASP organizers in Cheng et al. (2019) are in our comparison for CASP 13. All predictions were obtained from the CASP download center as described by Baldassarre et al. (2020).
|
| 381 |
+
|
| 382 |
+
Table 7: Comparison of our GVP architecture, DimeNet, and the GraphQA, another GNN-based MQA method, on CASP 11-12. As in the main text, the global and mean per-target Pearson correlations are shown. DimeNet does not perform comparably to either GVP-GNN or GraphQA.
|
| 383 |
+
|
| 384 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">CASP 11 Stage 2</td><td colspan="2">CASP 12 Stage 2</td></tr><tr><td>Global</td><td>Per-target</td><td>Global</td><td>Per-target</td></tr><tr><td>GVP-GNN</td><td>0.87</td><td>0.45</td><td>0.82</td><td>0.62</td></tr><tr><td>GraphQA</td><td>0.82</td><td>0.38</td><td>0.81</td><td>0.61</td></tr><tr><td>DimeNet</td><td>0.61</td><td>0.30</td><td>0.62</td><td>0.47</td></tr></table>
|
| 385 |
+
|
| 386 |
+
Table 8: Comparison of GVP-GNN against all 23 available single-structure MQA methods in CASP 13 sorted by global correlation. The total number of predictions is shown, which may be less than 1472 even though they include all 20 targets. GVP-GNN is the best-performing method in terms of global correlation. In terms of per-target correlation, GVP-GNN outperforms all other structure-only methods and also all methods using sequence profiles except for ProQ4 and two ProQ3D variants.
|
| 387 |
+
|
| 388 |
+
<table><tr><td>Method</td><td>Global</td><td>Per-target</td><td>Predictions</td><td>Structure only?</td></tr><tr><td>GVP-GNN</td><td>0.888</td><td>0.671</td><td>1472</td><td>Yes</td></tr><tr><td>ProQ3D</td><td>0.847</td><td>0.660</td><td>1467</td><td>No</td></tr><tr><td>SASHAN</td><td>0.840</td><td>0.633</td><td>1472</td><td>Yes</td></tr><tr><td>MESHI-corr-server</td><td>0.838</td><td>0.651</td><td>1472</td><td>Yes</td></tr><tr><td>ProQ3</td><td>0.822</td><td>0.576</td><td>1468</td><td>No</td></tr><tr><td>MESHI</td><td>0.813</td><td>0.666</td><td>1472</td><td>Yes</td></tr><tr><td>MESHI-enrich-server</td><td>0.813</td><td>0.666</td><td>1472</td><td>Yes</td></tr><tr><td>FaeNNz</td><td>0.810</td><td>0.650</td><td>1472</td><td>Yes</td></tr><tr><td>ProQ3D-CAD</td><td>0.803</td><td>0.673</td><td>1468</td><td>No</td></tr><tr><td>ProQ3D-IDDT</td><td>0.803</td><td>0.687</td><td>1467</td><td>No</td></tr><tr><td>ProQ2</td><td>0.802</td><td>0.577</td><td>1472</td><td>No</td></tr><tr><td>ProQ3D-TM</td><td>0.791</td><td>0.654</td><td>1467</td><td>No</td></tr><tr><td>MASS1</td><td>0.776</td><td>0.582</td><td>1472</td><td>Yes</td></tr><tr><td>VoroMQA-A</td><td>0.744</td><td>0.595</td><td>1472</td><td>Yes</td></tr><tr><td>VoroMQA-B</td><td>0.726</td><td>0.586</td><td>1472</td><td>Yes</td></tr><tr><td>MASS2</td><td>0.689</td><td>0.584</td><td>1472</td><td>Yes</td></tr><tr><td>MULTICOM-NOVEL</td><td>0.652</td><td>0.551</td><td>1472</td><td>No</td></tr><tr><td>ProQ4</td><td>0.604</td><td>0.691</td><td>1472</td><td>No</td></tr><tr><td>PLU-AngularQA</td><td>0.577</td><td>0.460</td><td>1472</td><td>Yes</td></tr><tr><td>Bhattacharya-Server</td><td>0.577</td><td>0.501</td><td>1452</td><td>No</td></tr><tr><td>Bhattacharya-SingQ</td><td>0.498</td><td>0.525</td><td>1452</td><td>No</td></tr><tr><td>Kiharalab</td><td>0.375</td><td>0.565</td><td>1472</td><td>No</td></tr><tr><td>PLU-TopQA</td><td>0.239</td><td>0.049</td><td>1472</td><td>Yes</td></tr><tr><td>Jagodzinski-Cao-QA</td><td>0.180</td><td>0.341</td><td>1472</td><td>Yes</td></tr></table>
|
| 389 |
+
|
| 390 |
+
# E.3 CPD: RESULTS ON TS50
|
| 391 |
+
|
| 392 |
+
We compare against a number of recent CPD methods on the TS50 test set in Table 9.10 These include two CNNs (ProDCoNN and DenseCPD), a distance-map method (SBROF), and sequential representation methods (Wang’s model and SPIN2). We also evaluate the GNN ProteinSolver on TS50 by sampling 100 sequences with temperature 1 (the default setting) for each structure using the public web server. No canonical training and validation sets exist for TS50. Therefore, in order to evaluate on TS50, we remove sequences with more than $30 \%$ similarity from the CATH 4.2 training and validation sets and retrain our model. We outperform all other methods with the exception of DenseCPD, a CNN method with canonical orientations. Interestingly, DenseCPD leverages the same underlying representation as ProDCoNN, yet achieves remarkably better performance. The main difference between the two methods is that ProDCoNN has 4 convolutional layers and DenseCPD has 21 layers organized into dense residual blocks.
|
| 393 |
+
|
| 394 |
+
Table 9: Sequence recovery on TS50. Recovery for GVP-GNN and ProteinSolver is as defined in Table 1; recovery for other methods, which model residues independently, is just classification accuracy. GVP-GNN is the second best-performing method, behind the CNN method DenseCPD. There is no canonical training and validation set for methods evaluated on TS50.
|
| 395 |
+
|
| 396 |
+
<table><tr><td>Method</td><td>Recovery %</td></tr><tr><td>GVP-GNN</td><td>44.9</td></tr><tr><td>DenseCPD (Qi & Zhang,2020)</td><td>50.7</td></tr><tr><td>ProDCoNN (Zhang et al.,2019)</td><td>40.7</td></tr><tr><td>SBROF (Chen et al., 2019)</td><td>39.2</td></tr><tr><td>SPIN2 (O'Connell et al., 2018)</td><td>33.6</td></tr><tr><td>Wang's model (Wang et al., 2018)</td><td>33.0</td></tr><tr><td>ProteinSolver (Strokach et al., 2020)</td><td>30.8</td></tr><tr><td>SPIN (Li et al., 2014)</td><td>30.3</td></tr><tr><td>Rosetta</td><td>30.0</td></tr></table>
|
| 397 |
+
|
| 398 |
+
# F VISUALIZATION AND INTERPRETATION OF LEARNED FEATURES
|
| 399 |
+
|
| 400 |
+
The geometric vector perceptron updates the vector features, in addition to scalar features, at node embeddings during graph propagation. Therefore, while the input vector channels represent the forward and reverse directions at each amino acid, the intermediate layers represent learned vector features. Could some of these features correspond to interpretable properties of the structure? Among a total of 64 intermediate vector channels learned by the MQA model, a few appeared visually interpretable and are shown on selected structures in Figure 2. We caution against generalizing from the necessarily small number of images that could be manually inspected, but find these preliminary visualizations intriguing.
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 2: Four different learned vector channels of the MQA model are visualized on four separate structures. The backbone is represented as a chain of points, and each vector is rooted at the position of the amino acid node to which it belongs. From left to right: the vectors appear to A) point in the direction of motion that would make the protein more compact; B) point along the central axis of the alpha helix; C) point outwards from the structure; and D) point inwards into the structure.
|
md/train/6nbpPqUCIi7/6nbpPqUCIi7.md
ADDED
|
Binary file (52.4 kB). View file
|
|
|
md/train/86NHK__yFDl/86NHK__yFDl.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TTT++: When Does Self-Supervised Test-Time Training Fail or Thrive?
|
| 2 |
+
|
| 3 |
+
Yuejiang Liu Parth Kothari Bastien van Delft
|
| 4 |
+
|
| 5 |
+
# Baptiste Bellot-Gurlet Taylor Mordan Alexandre Alahi
|
| 6 |
+
|
| 7 |
+
École Polytechnique Fédérale de Lausanne (EPFL)
|
| 8 |
+
|
| 9 |
+
{firstname.lastname}@epfl.ch
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Test-time training (TTT) through self-supervised learning (SSL) is an emerging paradigm to tackle distributional shifts. Despite encouraging results, it remains unclear when this approach thrives or fails. In this work, we first provide an indepth look at its limitations and show that TTT can possibly deteriorate, instead of improving, the test-time performance in the presence of severe distribution shifts. To address this issue, we introduce a test-time feature alignment strategy utilizing offline feature summarization and online moment matching, which regularizes adaptation without revisiting training data. We further scale this strategy in the online setting through batch-queue decoupling to enable robust moment estimates even with limited batch size. Given aligned feature distributions, we then shed light on the strong potential of TTT by theoretically analyzing its performance post adaptation. This analysis motivates our use of more informative self-supervision in the form of contrastive learning for visual recognition problems. We empirically demonstrate that our modified version of test-time training, termed $T T T + +$ , outperforms state-of-the-art methods by significant margins on several benchmarks. Our result indicates that storing and exploiting extra information, in addition to model parameters, can be a promising direction towards robust test-time adaptation. Our code is available at https://github.com/vita-epfl/ttt-plus-plus.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Machine learning models often struggle to generalize under distribution shifts. Even a perceptually mild shift between training and test data, e.g., JPEG compression, may cause severe prediction errors [1]. One popular family of methods to address this challenge is to learn an invariant representation across domains by making use of labelled training data and unlabelled test data simultaneously [2–5]. However, revisiting training data at test time can be impractical due to increasing privacy concerns, inflating sizes of datasets as well as many other real-world constraints. This shortcoming prompts a more challenging yet appealing test-time adaptation paradigm: given a trained model, how can we adapt it from one domain to another on the fly, without access to training data and human annotations?
|
| 18 |
+
|
| 19 |
+
One promising approach towards this goal is test-time training (TTT) through self-supervision [6]. The key idea of TTT is simple and straightforward: train the model on two tasks, namely a main task and a self-supervised learning (SSL) task, and update the model based only on the SSL task at test time. This technique implemented with self-supervised rotation prediction has shown encouraging results for improving the robustness of image classifiers under a variety of distributional shifts. Yet, its empirical performance is still inferior to other families of test-time algorithms [7, 8].
|
| 20 |
+
|
| 21 |
+
In this paper, we first take an in-depth look at TTT with emphasis on its limitations. Our analysis starts with a basic question: can TTT always mitigate the effects of distributional shifts? Through an illustrative problem, we show that the TTT framework can lead to surprising failures, deteriorating the test accuracy rather than improving it. This problem is largely attributed to the unconstrained update from the SSL task that interfere with the main task. To address this issue, we introduce a test-time feature alignment strategy by means of offline feature summarization and online moment matching: once training completes, we compute the mean and covariance matrix of training features and store them as part of the model, referred to as offline feature summarization; at test time, we encourage the test feature distribution to be close to the training one by matching the moments estimated online with those pre-computed offline, a process referred to as online moment matching.
|
| 22 |
+
|
| 23 |
+
One practical challenge for online feature alignment lies in scaling the strategy to problems with a large number of classes, as obtaining a robust estimate of moments often requires at least a handful of samples per class. To mitigate this issue, we draw inspiration from recent literature [9] and decouple the sample size from the batch size for moment estimates. Specifically, we maintain a large dynamic queue of encoded features and progressively update it in a mini-batch manner. This modification enables effective feature alignment even with limited batch size, greatly improving its viability in the online test-time setting.
|
| 24 |
+
|
| 25 |
+
Finally, we shed light on the strong potential of TTT through a theoretical analysis of the test accuracy after adaptation. In particular, we derive a lower bound of the test accuracy on the main task and show that it is expected to grow rapidly when the SSL task gets closer to the main task. These findings motivate our integration of contrastive representation learning [9–12], as a strong instance of SSL, into the TTT framework in visual recognition problems.
|
| 26 |
+
|
| 27 |
+
By combining the three proposed components, we devise an improved version of test-time training, termed $T T T + +$ . Experimental results show that $\mathrm { T T T } { + } { + }$ significantly outperforms other recent methods by significant margins on various robustness benchmarks. Our results suggest that exploiting extra information, including both task-specific information in the form of strong self-supervision and domain-specific information in the form of feature summarization, can be a promising direction to enhance the effectiveness of test-time adaptation.
|
| 28 |
+
|
| 29 |
+
# 2 Background
|
| 30 |
+
|
| 31 |
+
# 2.1 Related Work
|
| 32 |
+
|
| 33 |
+
Test-time Adaptation. Adapting machine learning models based on test samples has garnered growing interests in both generative problems such as super-resolution [13], image synthesis [14] and image manipulation [15], and discriminative problems like image classification [16]. Our work is focused on the latter one in the presence of distributional shifts. Several recent works [16, 17] have shown the advantage of adapting the learned classifier to new test domains in the unsupervised manner, without revisiting the source data. One simplest form is to replace the batch-norm statistics estimated on the training set with those on test examples [17]. Another line of work proposed to adapt the model parameters by exploiting the predicted labels on test examples, such as entropy minimization [8] and pseudo-labeling [7]. While these methods yield promising results on some benchmarks, they are inherently restricted to classification problems and often vulnerable under large distribution shifts [18].
|
| 34 |
+
|
| 35 |
+
More closely related to ours, [6] proposed test-time training through self-supervised learning, e.g., predicting the type of image rotations. This approach does not involve any assumptions about the output for the main task and is therefore more generic. It has been successfully applied to a variety of problems, such as instance tracking [19] and reinforcement learning [20]. Nevertheless, it was shown empirically inferior to other test-time algorithms [8]. Our work provides an in-depth analysis of its limitations, introduces simple yet effective remedies, and consolidates more theoretical grounds.
|
| 36 |
+
|
| 37 |
+
Feature Alignment. Aligning the distributions of training and test samples in the feature space is commonly used for domain adaptation. Previous feature alignment methods fall into two main categories: minimizing a divergence measure, such as MMD [21], Coral [22] and CMD [23], or encouraging the domain confusion through adversarial training [5, 24]. However, most of these methods rely on the co-existence of source and target data, and thus cannot be readily applied to the test-time setting where source data is not available. Our work revisits the critical role of feature alignment for test-time training and proposes a simple and practical strategy that enables online feature alignment, even with a limited batch size.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Illustration of a failure case where TTT hurts robustness under distributional shifts. (a) The predictive model reaches high accuracy on both the main classification task, i.e., separating red and blue data points, and the auxiliary self-supervised task, i.e., separating circles and crosses, in the training domain. (b) Given a large distributional shift, test samples are encoded into a new subspace, resulting in limited accuracy on both tasks. (c) Without any constraints on the feature distribution, TTT may result in an updated encoder severely overfitting to the SSL task, and consequently deteriorate the accuracy on the main task, as opposed to improving it.
|
| 41 |
+
|
| 42 |
+
Self-Supervised Learning. Self-supervised learning is a powerful paradigm to learn rich representations from unlabeled samples. Stunning progress has been made in recent years by designing informative self-supervised tasks [11, 12, 25–28] and stabilizing the training process [9, 29]. Prior works are mainly focused on unsupervised pre-training, whereas our work looks into the importance of incorporating strong self-supervised learning methods for test-time adaptation.
|
| 43 |
+
|
| 44 |
+
# 2.2 Preliminary: Test-Time Training
|
| 45 |
+
|
| 46 |
+
Test-time training (TTT) [6] is a general framework for adapting neural network models to a new test distribution based on unlabeled samples. Different from the conventional approach that trains the model only on the task of interest, TTT considers two tasks: a main task and an auxiliary SSL task. The model is trained on both tasks simultaneously with a multi-task architecture composed of one shared encoder $g$ and two separate heads $\pi _ { m }$ and $\pi _ { s }$ respectively. Given a labeled training dataset $D = \{ ( x _ { i } , y _ { i } ) \} _ { i \in \{ 1 , . . . , N \} }$ , the model is trained to minimize two losses jointly:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathcal { L } _ { t r a i n } ( D ; g , \pi _ { m } , \pi _ { s } ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } _ { m } ( x _ { i } , y _ { i } ; g , \pi _ { m } ) + \lambda \mathcal { L } _ { s } ( x _ { i } ; g , \pi _ { s } ) ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\lambda$ is a hyper-parameter to balance the two tasks.
|
| 53 |
+
|
| 54 |
+
In the presence of distributional shifts, the learned model often struggles to directly generalize to a new test set $D ^ { \prime } = \{ x _ { i } ^ { \prime } \} _ { i \in \{ 1 , \dots , N ^ { \prime } \} }$ . The core idea of TTT is to fine-tune the encoder $g$ based on the self-supervised task with the test examples,
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathcal { L } _ { T T T } ( D ^ { \prime } ; g ^ { \prime } ) = \frac { 1 } { N ^ { \prime } } \sum _ { i = 1 } ^ { N ^ { \prime } } \mathcal { L } _ { s } ( x _ { i } ^ { \prime } ; g ^ { \prime } ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
with the hope that the updated model $\pi _ { m } \circ g ^ { \prime }$ yields improved results on the main task.
|
| 61 |
+
|
| 62 |
+
TTT instantiated with a self-supervised rotation prediction task has been demonstrated effective for improving the robustness of image classifiers under common distributional shifts [6]. However, it was shown inferior to other families of test-time adaptation methods [7, 8]. We will next look into its strengths and limitations, and propose an improved version for better adaptation performance.
|
| 63 |
+
|
| 64 |
+
# 3 When Does Test-Time Training Fail?
|
| 65 |
+
|
| 66 |
+
In this section, we first throw light on a caveat of test-time training under large distributional shifts, and subsequently introduce practical solutions tailored for the test-time setting.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Our modified version of test-time training $\mathrm { ( T T T + + ) }$ ). Our method consists of three stages: model training, offline feature summarization, and online test-time adaptation. (i) During training, the model is optimized for the main task and an auxiliary contrastive self-supervised task jointly. (ii) Once training completes, we summarize the feature distributions after the encoder and the self-supervised head in the form of first and second-order moments. (iii) At test time, we adapt the encoder through online feature alignment (Sec. 3.2) and self-supervised learning (Sec. 4.2). In case of limited batch size, we maintain a large dynamic queue of feature vectors for robust moment estimates (Sec. 3.3).
|
| 70 |
+
|
| 71 |
+
# 3.1 Illustrative Example of Failures
|
| 72 |
+
|
| 73 |
+
One implicit assumption behind TTT is that the encoder update based on SSL can counter the effect of the underlying distributional shift on the main task. This assumption, however, is likely broken under large shifts and results in unexpected adaptation failures. To illustrate this limitation, we introduce a simple toy problem in Figure 1, where the main task and the SSL task are defined as classifying colors and symbols of encoded features in the 2-dimensional latent space. We consider an ideal scenario where the two tasks are highly correlated such that a well-trained model can attain high accuracies on both of them in the training domain. Nevertheless, in the presence of a significant distributional shift, the model may still suffer from substantial prediction errors in the test domain.
|
| 74 |
+
|
| 75 |
+
In this scenario, while TTT may restore the discriminative power of the learned representation for the main task to a certain degree, the unconstrained self-supervised adaptation may yield severe overfitting to the auxiliary SSL task. As a consequence, the performance on the main task can even deteriorate as opposed to improving. This phenomenon is not restricted to our illustration and also occurs in practice, as shown in Section 5.1.
|
| 76 |
+
|
| 77 |
+
# 3.2 Online Feature Alignment
|
| 78 |
+
|
| 79 |
+
As illustrated in the toy example above, simply applying self-supervised adaptation at test time can lead to arbitrarily poor results. To address this issue, we introduce an online feature alignment strategy to ensure robust adaptation at test time. The core idea of our strategy is to impose a constraint over the feature space during TTT such that the feature distribution of test examples remains close to that in the training domain. While some feature alignment techniques such as MMD [2] and adversarial training [24] have been widely used for domain adaptation, they often rely on sampling from training and test domains concurrently, which is impractical in the test-time setting. We, therefore, turn to classical divergence measures that can be estimated independently for each distribution. More specifically, we use the square distance of the first and second moments between two feature distributions, inspired by DDC [30] and Coral [22], to approximate the domain discrepancy. This design choice allows us to summarize the distribution of training features in a compact format and store it as part of the model, eliminating the need to revisit the training data during test-time adaptation.
|
| 80 |
+
|
| 81 |
+
Concretely, once training completes, we perform an offline feature summarization step that characterizes the disempirical mean ure vectors in the trainiand covariance matrix $Z = \{ z _ { 1 } ^ { T } , \dots , z _ { N } ^ { T } \}$ h the. The $\begin{array} { r } { \mu _ { z } = \frac { 1 } { N } \sum _ { i } ^ { N } z _ { i } } \end{array}$ $\begin{array} { r } { \Sigma _ { Z } = \frac { 1 } { N - 1 } \big ( Z ^ { T } Z - ( I ^ { T } Z ) ^ { T } ( I ^ { T } Z ) \big ) } \end{array}$ former is essentially equivalent to the channel-wise batch normalization statistics while the latter is more informative yet light-weight for computation and storage. At test time, we regularize the self-supervised adaptation by minimizing the distance between the feature statistics estimated from a mini-batch of test samples, i.e., $\mu _ { z } ^ { \prime }$ and $\Sigma _ { z } ^ { \prime }$ , and the pre-stored quantities about the training domain:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal { L } _ { f , z } = \left\| \mu _ { z } - \mu _ { z } ^ { \prime } \right\| _ { 2 } ^ { 2 } + \left\| \Sigma _ { z } - \Sigma _ { z } ^ { \prime } \right\| _ { F } ^ { 2 } ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\lVert \cdot \rVert _ { 2 }$ is the Euclidean norm and $\left\| \cdot \right\| _ { F }$ is the Frobenius norm.
|
| 88 |
+
|
| 89 |
+
The basic form of online moment matching can be limiting in that the low-order statistics may be insufficient to fully capture complex distributions in high dimensions, e.g., 2048 for the standard ResNet-50. To alleviate this issue, we align the feature distributions at both the output of the encoder and the output of the self-supervised head, which are of lower dimensions, e.g., 128 in the case of contrastive learning described in Sec. 4.2. Our final objective at test time is a weighted combination of the self-supervised loss $\mathcal { L } _ { s }$ , the feature alignment loss at the encoder $\mathcal { L } _ { f , z }$ and that at the self-supervised head $\mathcal { L } _ { f , s }$ ,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } _ { T T T + + } = \mathcal { L } _ { s } + \lambda _ { z } \mathcal { L } _ { f , z } + \lambda _ { s } \mathcal { L } _ { f , s } ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\lambda _ { z }$ and $\lambda _ { s }$ are hyper-parameters controlling the emphasis on each term.
|
| 96 |
+
|
| 97 |
+
# 3.3 Online Dynamic Queue
|
| 98 |
+
|
| 99 |
+
One practical challenge for online feature alignment lies in scaling the strategy to problems having large numbers of classes. Intuitively, a good estimate of moments of the entire distribution needs at least a handful of samples per class. As a consequence, the demand for sample size grows linearly with the number of classes, for instance, over $\mathord { \sim } 1 0 0 0$ samples are required in the case of CIFAR-100. However, the computational resources during deployment are often limited to accommodate such a large batch size in the test-time setting.
|
| 100 |
+
|
| 101 |
+
To overcome this challenge, we draw inspiration from recent literature [9] and maintain a dynamic queue of encoded features to decouple the batch size from the sample size for moment estimates. More specifically, we construct a dynamic queue that contains a few batches of feature vectors encoded at test time. We progressively update the queue by appending the latest mini-batch and popping out the oldest one, as illustrated in Figure 2. This batch-queue decoupling allows us to collect a large and consistent pool of samples for online moment matching, even with a very limited batch size.
|
| 102 |
+
|
| 103 |
+
By integrating the online moment matching and batch-queue decoupling, our test-time algorithm takes into account both the discriminative power and the marginal distribution of the updated representations, enabling more robust adaptation under various settings. It is worth noting that the current moment matching strategy is just a particular instance of the online feature alignment scheme. It can be naturally extended to incorporate higher-order statistics [23, 31] to bring further performance gain at the cost of larger space and computational complexities.
|
| 104 |
+
|
| 105 |
+
# 4 When Does Test-Time Training Thrive?
|
| 106 |
+
|
| 107 |
+
Given properly aligned feature distribution, we next look into the potential of test-time training given strong SSL tasks. We first derive a lower bound of the test accuracy in general scenarios and then analyze it in a specific setup where the performance on the main task can be directly estimated. These analyses motivate our use of more informative self-supervised learning for test-time training.
|
| 108 |
+
|
| 109 |
+
# 4.1 Theoretical Results
|
| 110 |
+
|
| 111 |
+
We consider a training set comprised of samples drawn from the joint distribution $\mathbb { P } _ { X , Y _ { m } , Y _ { s } }$ , where $X , Y _ { m }$ and $Y _ { s }$ are random variables corresponding to the training samples, the main task labels and the self-supervised labels respectively. Similarly, the test set consists of samples drawn from the joint distribution $\mathbb { P } _ { X ^ { \prime } , Y _ { m } ^ { \prime } , Y _ { s } ^ { \prime } }$ . In the presence of distribution shift, $\mathbb { P } _ { X , Y _ { m } , Y _ { s } }$ and $\mathbb { P } _ { X ^ { \prime } , Y _ { m } ^ { \prime } , Y _ { s } ^ { \prime } }$ are not identical. However, we make the following assumption about label distribution in our analysis.
|
| 112 |
+
|
| 113 |
+
Assumption 1. The training and test labels are equal in distribution, $Y _ { m } \ { \overset { d } { = } } \ Y _ { m } ^ { \prime }$ , $Y _ { s } \ { \overset { d } { = } } \ Y _ { s } ^ { \prime }$ and $( Y _ { m } , Y _ { s } ) \overset { d } { = } ( Y _ { m } ^ { \prime } , Y _ { s } ^ { \prime } ) .$ .
|
| 114 |
+
|
| 115 |
+
In addition, we restrict our analysis to the scenarios where both two tasks can be solved perfectly during training.
|
| 116 |
+
|
| 117 |
+
Assumption 2. There exist an encoder g and classifiers $\pi _ { m }$ and $\pi _ { s }$ such that $\mathbb { P } ( \pi _ { m } ( g ( X ) ) = Y _ { m } ) =$ 1 and $\bar { \mathbb { P } } ( \pi _ { s } ( g ( X ) ) = Y _ { s } ) = 1$ .
|
| 118 |
+
|
| 119 |
+
During TTT, the shared encoder $g$ is updated to $g ^ { \prime }$ such that the self-supervised head $\pi _ { s }$ fits the test data. Given our proposed online feature alignment in Equation 4, we assume the encoded features in the training and test domains, i.e., $Z$ and $Z ^ { \prime }$ , have the following property.
|
| 120 |
+
|
| 121 |
+
Assumption 3. The marginal feature distribution and the conditional feature distributions at test time are aligned with their counterparts during training, that is, $Z { \overset { d } { = } } Z ^ { \prime }$ and $( Z \mid Y _ { s } = k ) \overset { d } { = } ( Z ^ { \prime } \mid$ $Y _ { s } ^ { \prime } = k$ ) for all classes $k$ in the SSL task.
|
| 122 |
+
|
| 123 |
+
nder these assumptions, we consider the outcome of test-time training in the worst-case scena
|
| 124 |
+
|
| 125 |
+
Theorem 1. The prediction accuracy on the main task is lower bounded:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
{ \mathbb { P } } ( \pi _ { m } ( Z ^ { \prime } ) = Y _ { m } ^ { \prime } ) \geq \sum _ { y _ { s } } { \mathbb { P } } ( Y _ { s } = y _ { s } ) \operatorname* { m a x } \left\{ 0 , 2 \left( \operatorname* { m a x } _ { y _ { m } } { \mathbb { P } } ( Y _ { m } = y _ { m } \mid Y _ { s } = y _ { s } ) - 0 . 5 \right) \right\} .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Proof. Please refer to Section A.1 in the supplementary material.
|
| 132 |
+
|
| 133 |
+
Theorem 1 highlights the importance of the relation between the main task and the SSL task for the test accuracy after adaptation. More specifically, the SSL task needs to be informative with respect to the main task to guarantee the performance, i.e., knowing the SSL class $y _ { s }$ makes a main class $y _ { m }$ highly probable, or equivalently $\mathbb { P } ( Y _ { m } = y _ { m } \mid Y _ { s } = y _ { s } )$ is large, leading to a greater lower bound.
|
| 134 |
+
|
| 135 |
+
To further understand the impact of the task relation on test-time training, we next consider a particular setting, where the encoded features fully overfit to the SSL task (e.g., lengthy test-time training) and become independent of the main task label given the SSL label. Under this condition, the prediction accuracy on the main task can be directly estimated as follows.
|
| 136 |
+
|
| 137 |
+
Theorem 2. If $Z ^ { \prime } \perp \perp Y _ { m } ^ { \prime } \mid Y _ { s } ^ { \prime }$ , then the prediction accuracy on the main task is given by
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathbb { P } \big ( \pi _ { m } ( Z ^ { \prime } ) = Y _ { m } ^ { \prime } \big ) = \sum _ { y _ { s } } \left[ \mathbb { P } \big ( Y _ { s } = y _ { s } \big ) \sum _ { y _ { m } } \mathbb { P } \big ( Y _ { m } = y _ { m } \mid Y _ { s } = y _ { s } \big ) ^ { 2 } \right] .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
Proof. Please refer to Section A.2 in the supplementary material.
|
| 144 |
+
|
| 145 |
+
Intuitively, if the encoded features do not contain more information than the SSL labels about the main task, the accuracy of the main classifier $\pi _ { m }$ only depends on the property of the SSL task. In particular, the square term on the right-hand side of Equation 6 emphasizes the paramount importance of designing a closely related SSL task. When the two tasks diverge, the test accuracy drops quadratically fast, leading to ineffective adaptation.
|
| 146 |
+
|
| 147 |
+
# 4.2 Test-Time Training through Contrastive Learning
|
| 148 |
+
|
| 149 |
+
Our theoretical analysis above reveals the importance of incorporating an SSL task highly correlated with the main task for test-time training. One practical way to quantify the relation between two tasks is to measure the transferability of the representation learned from one task to another [32]. Given the remarkable results of contrastive methods for visual representation pre-training [9, 12, 33, 34], we hypothesize that they would also be suitable choices for test-time training. We thus replace the rotation prediction task with SimCLR [12] in the context of visual recognition. Given a mini-batch of $B$ images, we augment each image to two views. We consider the two augmented views from the same original instance as a positive pair and treat the other pairs as negative ones. The feature vector $z _ { i } = g ( \bar { x } _ { i } )$ of each image $x _ { i }$ is projected to a lower-dimensional space $h _ { i } = \pi _ { s } ( z _ { i } )$ through our self-supervised head. The projected hidden embeddings from a positive pair $< h _ { i } , h _ { j } >$ are encouraged to be closer than those from the negative ones through the following loss,
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\mathcal { L } _ { s } = - \log \frac { \exp ( \sin ( h _ { i } , h _ { j } ) / \tau ) } { \sum _ { k = 1 } ^ { 2 B } \mathbb { 1 } _ { k \neq i } \exp ( \sin ( h _ { i } , h _ { k } ) / \tau ) } ,
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where $\tau$ is a temperature scaling parameter. The distance between projected embeddings is measured by cosine similarity $\mathrm { s i m } ( u , v ) \stackrel { \smile } { = } u ^ { T } v / ( \| u \| \| v \| )$ .
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 3: Qualitative comparison of TTT [6] and our $\mathrm { T T } \mathrm { + + }$ on the inter-twinning moons problem in the presence of large translation and rotation shifts. The vanilla TTT drives the decision boundary further away from a desired one due to a severe feature misalignment, marked by the dashed arrow in the feature PCA visualization. In comparison, our method adapts the decision boundary to the test domain more effectively.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 4: Quantitative comparison of TTT [6] and our $\mathrm { T T } \mathrm { + + }$ on the inter-twinning moons problem under 150 different setups. Standard deviations are visualized in shaded regions. Our method (left) is particularly advantageous under large shifts, i.e., low test accuracy before adaptation, and (right) greatly benefits from a higher correlation, i.e., larger label agreement, between the main and SSL tasks.
|
| 162 |
+
|
| 163 |
+
# 5 Experiments
|
| 164 |
+
|
| 165 |
+
We empirically validate our proposed method in four scenarios: synthetic toy problem, common image corruptions, natural domain shifts, and sim-to-real transfer.
|
| 166 |
+
|
| 167 |
+
We consider the following baselines throughout our experiments:
|
| 168 |
+
|
| 169 |
+
• Test: the model in the training domain is directly evaluated on the test data without any adaptation;
|
| 170 |
+
• Test-time normalization (BN) [35] updates the batch normalization statistics of the trained network according to the test data;
|
| 171 |
+
• Test-time entropy minimization (TENT) [8] updates the batch normalization statistics of the trained network by minimizing the entropy of the model predictions on the test data;
|
| 172 |
+
• Source Hypothesis Transfer (SHOT) [36] freezes the classifier module and updates only the feature extraction module by exploiting the concepts of information maximization and self-supervised pseudo-labeling during testing;
|
| 173 |
+
• Test-time training (TTT-R) [6] trains the network jointly on the main task and a rotation-based SSL task in the source domain; during test, TTT-R continues to train on the rotation-based task in the target domain.
|
| 174 |
+
|
| 175 |
+
We also evaluate the following ablated versions of our method:
|
| 176 |
+
|
| 177 |
+
• Test-time feature alignment (TFA) aligns the first-order and second-order statistics of the source and target distributions during testing (Section 3.2 and 3.3);
|
| 178 |
+
• Test-time contrastive learning (TTT-C) trains the network jointly on the main task and a contrastive learning (SSL) task in the source domain; during test, TTT-C continues to update the encoder based on contrastive learning in the target domain (Section 4.2).
|
| 179 |
+
|
| 180 |
+
The full version of our method, improved test-time training $\mathbf { \left( T T + \right) }$ ), combines TFA and TTT-C.
|
| 181 |
+
|
| 182 |
+
# 5.1 Synthetic Toy Problem
|
| 183 |
+
|
| 184 |
+
We first evaluate our method on the inter-twinning moons problem [4, 37], where the main task is to predict the moon class of a given data point and the SSL task is to predict on which side of the hyperplane (i.e., linear separator between the two moons) the data point lies on. The relation (label agreement) between the two tasks depends on the separation distance between the two moons. To solve both tasks simultaneously, we build a small neural network that consists of a 2-layer MLP as the shared encoder and two 2-layer MLPs as separate task heads. Each hidden layer contains 8 neurons. The learned model attains over $9 9 \%$ accuracy on both the main and SSL tasks in the training domain. We simulate a variety of distributional shifts through translation and rotation of all data points.
|
| 185 |
+
|
| 186 |
+
Figure 3 shows the decision boundaries and encoded features from the vanilla TTT and our proposed $\mathrm { T T T } { + } { + }$ in a particular test case of large distributional shift. TTT not only fails to improve the classification accuracy but even pushes the decision boundary further away from a desired one due to the severe feature distribution mismatch, as evidenced in the PCA visualization. In comparison, our $\mathrm { T T T } { + } { + }$ yields substantial performance gain, boosting the test accuracy from $50 \%$ to $93 \%$ , thanks to the reduced feature distributional shift enforced by the proposed online moment matching.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 5: Classification error $( \% )$ on CIFAR10-C [1].
|
| 190 |
+
|
| 191 |
+
Table 1: Average classification error $( \% )$ on CIFAR10-C/100-C [1] and CIFAR10.1 [40]
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Method</td><td>C10-C</td><td>C100-C</td><td>C10.1</td></tr><tr><td>Test</td><td>29.1</td><td>61.2</td><td>12.1</td></tr><tr><td>BN [41]</td><td>15.7</td><td>43.3</td><td>14.1</td></tr><tr><td>TTT-R [6]</td><td>14.3</td><td>40.4</td><td>11.0</td></tr><tr><td>SHOT [36]</td><td>14.7</td><td>38.1</td><td>11.1</td></tr><tr><td>TENT [8]</td><td>12.6</td><td>36.3</td><td>13.4</td></tr><tr><td>TFA (Ours)</td><td>11.9</td><td>35.8</td><td>12.1</td></tr><tr><td>TTT-C (Ours)</td><td>10.7</td><td>36.9</td><td>9.7</td></tr><tr><td>TTT++ (Ours)</td><td>9.8</td><td> 34.1</td><td>9.5</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Figure 4 summarizes the quantitative results of our methods as well as the vanilla counterpart under 150 different simulated setups. As shown on the left graph, when the domain shift only causes mild test errors on the main task, both the original TTT and our $\mathrm { T T T } { \cdot } + +$ yield strong adaptation results. However, the effectiveness of TTT deteriorates quickly along with the growth of domain shift, as reflected on the lower test accuracy. In comparison, our proposed $\mathrm { T T T } { + } { + }$ demonstrates clear advantages under large shifts, e.g., when the test accuracy before adaptation is around 0.5. We further examine the impact of the relation between the main and SSL tasks on the adaptation performance by varying the separation distance between the two moons. The simulation results confirm the high potential of test-time training given improved SSL tasks, as analyzed in Section 4.1.
|
| 196 |
+
|
| 197 |
+
# 5.2 Common Image Corruption
|
| 198 |
+
|
| 199 |
+
We further assess the robustness of our method against common image corruptions. Following the evaluation protocol of previous work [8], we train ResNet-50 [38] on CIFAR10/CIFAR100 [39] and test it on the CIFAR10-C/CIFAR100-C [1] datasets, which contain 15 types of algorithmically generated corruptions, such as noise, blur and snow effects. We use a batch size of 256 for test-time adaptation. In addition, we use a dynamic queue containing 16 batches of feature vectors for online feature alignment on CIFAR100-C.
|
| 200 |
+
|
| 201 |
+
Figure 5 shows the quantitative results under each type of image corruption. The average results on CIFAR10-C and CIFAR100-C are reported in Table 1. Our $\mathrm { T T T } { + } { + }$ clearly outperforms the prior state-of-the-art test-time methods on CIFAR10-C and CIFAR100-C. In particular, incorporating a strong self-supervision task (TTT-C) already suffices to perform on par or better than TENT. Adding test-time feature alignment (TFA) on top of that yields an additional $\sim 8 \%$ relative reduction in terms of the test error.
|
| 202 |
+
|
| 203 |
+
# 5.3 Natural Domain Shift
|
| 204 |
+
|
| 205 |
+
We next demonstrate the efficacy of our method $\mathrm { T T T } { + } { + }$ to tackle natural distribution shifts. We again use the pre-trained ResNet-50 and test it on CIFAR10.1 [40], a recently collected test set subject to natural distributional shift. Despite its high perceptual similarity with the CIFAR10 dataset, the CIFAR10.1 typically leads to a drop of accuracy $4 \%$ to $10 \%$ ) for a wide range of deep models [40].
|
| 206 |
+
|
| 207 |
+
Table 1 summarizes the results of various test-time algorithms on CIFAR10.1. Previous batch-normbased methods perform poorly and even degrade model accuracy. This phenomenon is tied to their implicit assumption that different samples and spatial locations are shifted in a similar manner [18], which is true for algorithmically generated image corruptions but does not hold on CIFAR-10.1. In contrast, $\mathrm { T T T } { + } { + }$ is more generic and yields stronger performance under the natural distribution shift.
|
| 208 |
+
|
| 209 |
+
# 5.4 Sim-to-Real Transfer
|
| 210 |
+
|
| 211 |
+
We finally validate the effectiveness of our method on the VisDA-C dataset [42], a challenging large-scale benchmark of synthetic-to-real object classification. As shown in Table 2, prior methods that are fairly competitive under image corruptions, such as BN [41] and TENT [8], are not effective on VisDA-C. We conjecture that this is attributed to their strong restrictions over the adaptable parameters at test time. In contrast, our proposed method is more flexible, allows the model to update the entire encoder, and thus achieves compelling results on VisDA-C. Furthermore, the test-time feature alignment plays a crucial role in this synthetic-to-real domain adaptation problem, providing $\sim 1 3 \%$ performance boost on top of the TTT-C.
|
| 212 |
+
|
| 213 |
+
Table 2: Classification error $( \% )$ on the large-scale VisDA-C dataset [42].
|
| 214 |
+
|
| 215 |
+
<table><tr><td>Method</td><td>plane</td><td>bcycl</td><td>bus</td><td>car</td><td>horse</td><td>knife</td><td>mcycl</td><td>person</td><td>plant</td><td>sktbrd</td><td>train</td><td>truck</td><td>Per-class</td></tr><tr><td>Test</td><td>56.52</td><td>88.71</td><td>62.77</td><td>30.56</td><td>81.88</td><td>99.03</td><td>17.53</td><td>95.85</td><td>51.66</td><td>77.86</td><td>20.44</td><td>99.51</td><td>58.72</td></tr><tr><td>BN [41]</td><td>44.38</td><td>56.98</td><td>33.24</td><td>55.28</td><td>37.45</td><td>66.60</td><td>16.55</td><td>59.02</td><td>43.55</td><td>60.72</td><td>31.07</td><td>82.98</td><td>48.12</td></tr><tr><td>TENT [8]</td><td>13.43</td><td>77.98</td><td>20.17</td><td>48.15</td><td>21.72</td><td>82.45</td><td>12.37</td><td>35.78</td><td>21.06</td><td>76.41</td><td>34.11</td><td>98.93</td><td>42.73</td></tr><tr><td>SHOT [36]</td><td>5.73</td><td>13.64</td><td>23.33</td><td>42.69</td><td>7.93</td><td>86.99</td><td>19.17</td><td>19.97</td><td>11.63</td><td>11.09</td><td>15.06</td><td>43.26</td><td>25.04</td></tr><tr><td>TFA (Ours)</td><td>28.25</td><td>32.03</td><td>33.67</td><td>64.77</td><td>20.49</td><td>56.63</td><td>22.52</td><td>36.30</td><td>24.84</td><td>35.20</td><td>25.31</td><td>64.24</td><td>39.58</td></tr><tr><td>TTT-C (Ours)</td><td>5.46</td><td>32.23</td><td>25.42</td><td>37.03</td><td>7.84</td><td>85.20</td><td>9.14</td><td>23.80</td><td>11.72</td><td>11.00</td><td>7.74</td><td>56.87</td><td>25.72</td></tr><tr><td>TTT++ (Ours)</td><td>4.13</td><td>26.20</td><td>21.60</td><td>31.70</td><td>7.43</td><td>83.30</td><td>7.83</td><td>21.10</td><td>7.03</td><td>7.73</td><td>6.91</td><td>51.40</td><td>22.46</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 3: Classification error $( \% )$ results from online feature alignment with or without a dynamic queue of feature vectors on the CIFAR100-C under level-5 fog corruption. Sample size $=$ Batch size $\times \#$ Batches. Given a fixed batch size, enlarging the queue size leads to similar results as having a larger batch size.
|
| 218 |
+
|
| 219 |
+
<table><tr><td></td><td colspan="3">w/o queue</td><td colspan="4">w/ queue</td></tr><tr><td>Sample Size</td><td>64</td><td>128</td><td>256</td><td>64×2</td><td>64×4</td><td>64×8</td><td>64 ×16</td></tr><tr><td>Test Error</td><td>40.31</td><td>38.67</td><td>37.01</td><td>39.84</td><td>37.37</td><td>36.18</td><td>36.02</td></tr></table>
|
| 220 |
+
|
| 221 |
+
# 5.5 Effect of Batch-Queue Decoupling
|
| 222 |
+
|
| 223 |
+
To verify the effects of batch-queue decoupling, we compare the results of online feature alignment with different sample sizes. Table 3 summarizes the test errors on CIFAR100 under the level-5 fog corruption. As expected, larger sample sizes generally lead to lower classification errors. Interestingly, while the performance of using a dynamic queue is slightly worse than its counterpart of the same sample size from a single large batch, enlarging the queue size always yields stronger results. For instance, given a small batch size of 64, using a dynamic queue maintaining 512 or 1024 feature vectors from 8 or 16 consecutive batches respectively is more advantageous than the vanilla moment matching based on a batch size of 256 samples. This result corroborates the benefit of integrating a dynamic queue into our proposed feature alignment framework, for enhancing the scalability in the online setting.
|
| 224 |
+
|
| 225 |
+
# 5.6 Design Choice for Moment Matching
|
| 226 |
+
|
| 227 |
+
As discussed in Section 3, our proposed online feature alignment can be instantiated with different orders of moments and applied at various layers. To understand the effects of the detailed design choices, we empirically compare our proposed version against several ablated variants in Table 4. Irrespective of the layer choice, our proposed online feature alignment consistently results in reduced classification error. Nevertheless, moment matching applied to the self-supervised head alone leads to lower test error compared to applying it to the feature extractor output in 11 out of 15 types of corruption. We conjecture that the strong performance of the former one is attributed to the lower dimensionality of the feature vector, which allows for a more accurate estimate of feature statistics. The best result comes from the online feature alignment at the outputs of both the encoder and the projection head, which validates our design choice in Section 3.2.
|
| 228 |
+
|
| 229 |
+
We further validate the choice of divergence measure through an ablation study. The online feature alignment using the second-order moment (covariance) leads to clearly better results than the one using the first-order moment (mean). It is also evident that the online feature alignment is most effective when both the mean and the covariance are taken into account.
|
| 230 |
+
|
| 231 |
+
Table 4: Classification error $( \% )$ on CIFAR10-C [1] with different versions of online feature alignment. Taking into account both the first and second-order moments at two different layers is better than the other counterparts in terms of the robustness against most types of image corruptions.
|
| 232 |
+
|
| 233 |
+
<table><tr><td>TFA</td><td>brit</td><td>contr</td><td>defoc</td><td>elast</td><td>fog</td><td>frost</td><td>gauss</td><td>glass</td><td>impul</td><td>jpeg</td><td>motn</td><td>pixel</td><td>shot</td><td>snow</td><td>zoom</td></tr><tr><td>w/oLf.s</td><td>7.96</td><td>7.57</td><td>9.4</td><td>17.24</td><td>14.38</td><td>12.54</td><td>14.62</td><td>21.05</td><td>21.4</td><td>12.68</td><td>11.92</td><td>10.7</td><td>13.7</td><td>12.74</td><td>7.32</td></tr><tr><td>w/oLf,z</td><td>7.85</td><td>7.84</td><td>9.18</td><td>16.51</td><td>14.33</td><td>11.99</td><td>13.79</td><td>20.08</td><td>20.17</td><td>12.42</td><td>12.02</td><td>10.5</td><td>12.78</td><td>13.28</td><td>7.44</td></tr><tr><td>w/£</td><td>7.49</td><td>7.56</td><td>9.62</td><td>18.62</td><td>19.22</td><td>12.72</td><td>16.02</td><td>25.07</td><td>25.17</td><td>13.43</td><td>13.63</td><td>11.22</td><td>15.04</td><td>15.11</td><td>7.77</td></tr><tr><td>w/o μ</td><td>7.43</td><td>7.37</td><td>8.90</td><td>15.92</td><td>12.98</td><td>11.57</td><td>13.46</td><td>19.27</td><td>18.95</td><td>11.87</td><td>11.11</td><td>9.97</td><td>12.81</td><td>11.76</td><td>7.04</td></tr><tr><td>Full</td><td>7.44</td><td>7.40</td><td>8.89</td><td>15.73</td><td>12.82</td><td>11.49</td><td>12.94</td><td>18.46</td><td>19.13</td><td>11.66</td><td>10.77</td><td>9.93</td><td>12.67</td><td>11.73</td><td>7.03</td></tr></table>
|
| 234 |
+
|
| 235 |
+
# 6 Conclusion and Discussions
|
| 236 |
+
|
| 237 |
+
In this work, we conduct an in-depth analysis of the limitations and potential of self-supervised test-time training. We draw attention to the risk of feature distribution mismatch, which is critical but largely overlooked in recent test-time algorithms. We shed light on the strong potential of this approach by analyzing the growth of test accuracy given improved SSL tasks. These analyses inspire three proposed modifications, namely online feature alignment, batch-queue decoupling and contrastive test-time training, which yield state-of-the-art results on multiple robustness benchmarks. Our results suggest the advantages of bringing additional task-specific and domain-specific information in a compact format for test-time adaptation. We hope these findings will motivate researchers and practitioners to rethink what should be stored, in addition to weight parameters, for the robust deployment of machine learning models.
|
| 238 |
+
|
| 239 |
+
Limitations. In this work, we restrain feature summarization to first and second-order moments. Yet, the low-order statistics may be insufficient to characterize the complex distribution of highdimensional features. Developing more advanced summarization methods tailored for test-time adaptation is an interesting avenue for future work. In addition, there may exist a considerable gap between our theoretical analysis and the empirical results, when the stated assumptions do not hold. For instance, neither the classification heads nor the feature alignment is perfect in practice. More theoretical guarantees can be valuable for the practical use of test-time adaptation in safety-critical scenarios.
|
| 240 |
+
|
| 241 |
+
Open Questions. In our experiments, we only consider the standard ResNet-50 as the backbone architecture and share the whole feature extractor between the main task and self-supervised task. Yet, recent literature [30, 43] has shown that different layers capture different levels of semantic granularity. The impact of architectural design on test-time training remains an open question. Furthermore, while we empirically compare our proposed method against other families of test-time adaptation algorithms, these techniques exploit different supervisory signals extracted from unlabeled data, which can be complementary to each other. Blending these techniques into a unified framework is another interesting direction to explore in the future.
|
| 242 |
+
|
| 243 |
+
Societal Impact. Our work aims at expanding the current horizon of machine learning algorithms for test-time adaptation. For applications where humans’ lives are at risk, such as autonomous driving, trust, safety, robustness are all mandatory keywords. The field has made amazing progress when the training and testing environments are highly similar. What happens when a machine gets deployed in a new environment? We, humans, have an innate capability for handling such shifts. We believe that machines should have the same capability as humans. Indeed, there is a long way to go. Nevertheless, we hope that our work will foster more research in analyzing and devising algorithms for robust and effective adaptation at test time.
|
| 244 |
+
|
| 245 |
+
# Acknowledgements
|
| 246 |
+
|
| 247 |
+
This work was supported by the Swiss National Science Foundation under the Grant 2OOO21- L92326, Honda R&D Co. Ltd, EPFL Open Science fund and Valeo. We thank Sudeep Salgia, Tao Lin, Lingjun Meng, Yifan Sun for helpful inputs to our early drafts and anonymous reviewers for valuable comments.
|
| 248 |
+
|
| 249 |
+
References
|
| 250 |
+
[1] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019.
|
| 251 |
+
[2] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning Transferable Features with Deep Adaptation Networks. In International Conference on Machine Learning, pages 97–105. PMLR, June 2015. ISSN: 1938-7228.
|
| 252 |
+
[3] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I. Jordan. Deep Transfer Learning with Joint Adaptation Networks. In Proceedings of the 34th International Conference on Machine Learning, pages 2208–2217. PMLR, July 2017. ISSN: 2640-3498.
|
| 253 |
+
[4] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, January 2016.
|
| 254 |
+
[5] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial Discriminative Domain Adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7167–7176, 2017.
|
| 255 |
+
[6] Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-Time Training with Self-Supervision for Generalization under Distribution Shifts. In Proceedings of the 37th International Conference on Machine Learning, pages 9229–9248. PMLR, November 2020. ISSN: 2640-3498.
|
| 256 |
+
[7] Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In International Conference on Machine Learning (ICML), pages 6028–6039, July 13–18 2020.
|
| 257 |
+
[8] Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully Test-Time Adaptation by Entropy Minimization. In International Conference on Learning Representations, September 2020.
|
| 258 |
+
[9] 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, pages 9729–9738, 2020.
|
| 259 |
+
[10] Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality Reduction by Learning an Invariant Mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition - Volume 2 (CVPR’06), volume 2, pages 1735–1742, New York, NY, USA, 2006. IEEE.
|
| 260 |
+
[11] Zhirong Wu, Yuanjun Xiong, Stella Yu, and Dahua Lin. Unsupervised Feature Learning via Non-parametric Instance Discrimination. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3733–3742, June 2018. ISSN: 2575-7075.
|
| 261 |
+
[12] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A Simple Framework for Contrastive Learning of Visual Representations. In Proceedings of the 37th International Conference on Machine Learning, pages 1597–1607. PMLR, November 2020. ISSN: 2640- 3498.
|
| 262 |
+
[13] Assaf Shocher, Nadav Cohen, and Michal Irani. Zero-Shot Super-Resolution Using Deep Internal Learning. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3118–3126, June 2018. ISSN: 2575-7075.
|
| 263 |
+
[14] Yuejiang Liu, Parth Kothari, and Alexandre Alahi. Collaborative Sampling in Generative Adversarial Networks. Proceedings of the AAAI Conference on Artificial Intelligence, 34(04):4948– 4956, April 2020. Number: 04.
|
| 264 |
+
[15] David Bau, Hendrik Strobelt, William Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. Semantic photo manipulation with a generative image prior. ACM Transactions on Graphics, 38(4):59:1–59:11, July 2019.
|
| 265 |
+
|
| 266 |
+
[16] Jogendra Nath Kundu, Naveen Venkat, Rahul M. V, and R. Venkatesh Babu. Universal SourceFree Domain Adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4544–4553, 2020.
|
| 267 |
+
|
| 268 |
+
[17] Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. Advances in Neural Information Processing Systems, 33, 2020.
|
| 269 |
+
|
| 270 |
+
[18] Collin Burns and Jacob Steinhardt. Limitations of Post-Hoc Feature Alignment for Robustness. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2525–2533, 2021.
|
| 271 |
+
|
| 272 |
+
[19] Yang Fu, Sifei Liu, Umar Iqbal, Shalini De Mello, Humphrey Shi, and Jan Kautz. Learning to Track Instances without Video Annotations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8680–8689, 2021.
|
| 273 |
+
|
| 274 |
+
[20] Nicklas Hansen, Rishabh Jangir, Yu Sun, Guillem Alenyà, Pieter Abbeel, Alexei A. Efros, Lerrel Pinto, and Xiaolong Wang. Self-Supervised Policy Adaptation during Deployment. In International Conference on Learning Representations, September 2020.
|
| 275 |
+
|
| 276 |
+
[21] Arthur Gretton, Karsten M. Borgwardt, Malte J. Rasch, Bernhard Schölkopf, and Alexander Smola. A Kernel Two-Sample Test. Journal of Machine Learning Research, 13(25):723–773, 2012.
|
| 277 |
+
|
| 278 |
+
[22] Baochen Sun, Jiashi Feng, and Kate Saenko. Correlation Alignment for Unsupervised Domain Adaptation. In Gabriela Csurka, editor, Domain Adaptation in Computer Vision Applications, Advances in Computer Vision and Pattern Recognition, pages 153–171. Springer International Publishing, Cham, 2017.
|
| 279 |
+
|
| 280 |
+
[23] Werner Zellinger, Thomas Grubinger, Edwin Lughofer, Thomas Natschläger, and Susanne Saminger-Platz. Central Moment Discrepancy (CMD) for Domain-Invariant Representation Learning. International Conference on Learning Representations, International Conference on Learning Representations, November 2016. 00283.
|
| 281 |
+
|
| 282 |
+
[24] Yaroslav Ganin and Victor Lempitsky. Unsupervised Domain Adaptation by Backpropagation. In Proceedings of the 32nd International Conference on Machine Learning, pages 1180–1189. PMLR, June 2015. ISSN: 1938-7228.
|
| 283 |
+
|
| 284 |
+
[25] Mehdi Noroozi and Paolo Favaro. Unsupervised Learning of Visual Representations by Solving Jigsaw Puzzles. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, editors, European Conference on Computer Vision, pages 69–84, Cham, 2016. Springer International Publishing.
|
| 285 |
+
|
| 286 |
+
[26] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep Clustering for Unsupervised Learning of Visual Features. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss, editors, Computer Vision – ECCV 2018, Lecture Notes in Computer Science, pages 139–156, Cham, 2018. Springer International Publishing.
|
| 287 |
+
|
| 288 |
+
[27] Yuejiang Liu, Qi Yan, and Alexandre Alahi. Social NCE: Contrastive Learning of SociallyAware Motion Representations. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 15118–15129, 2021.
|
| 289 |
+
|
| 290 |
+
[28] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging Properties in Self-Supervised Vision Transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9650–9660, 2021.
|
| 291 |
+
|
| 292 |
+
[29] Xinlei Chen and Kaiming He. Exploring Simple Siamese Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15750–15758, 2021.
|
| 293 |
+
|
| 294 |
+
[30] Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep Domain Confusion: Maximizing for Domain Invariance. arXiv:1412.3474 [cs], December 2014. arXiv: 1412.3474.
|
| 295 |
+
|
| 296 |
+
[31] Chao Chen, Zhihang Fu, Zhihong Chen, Sheng Jin, Zhaowei Cheng, Xinyu Jin, and Xiansheng Hua. HoMM: Higher-Order Moment Matching for Unsupervised Domain Adaptation. Proceedings of the AAAI Conference on Artificial Intelligence, 34(04):3422–3429, April 2020. Number: 04.
|
| 297 |
+
|
| 298 |
+
[32] Amir R. Zamir, Alexander Sax, William Shen, Leonidas J. Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling Task Transfer Learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3712–3722, 2018.
|
| 299 |
+
|
| 300 |
+
[33] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent: A new approach to self-supervised Learning. arXiv:2006.07733 [cs, stat], September 2020. 00623 arXiv: 2006.07733.
|
| 301 |
+
|
| 302 |
+
[34] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised Learning of Visual Features by Contrasting Cluster Assignments. arXiv:2006.09882 [cs], January 2021. 00403 arXiv: 2006.09882.
|
| 303 |
+
|
| 304 |
+
[35] Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Removing covariate shift improves robustness against common corruptions. CoRR, abs/2006.16971, 2020.
|
| 305 |
+
|
| 306 |
+
[36] Jian Liang, Dapeng Hu, and Jiashi Feng. Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation. In International Conference on Machine Learning, pages 6028–6039. PMLR, November 2020. ISSN: 2640-3498.
|
| 307 |
+
|
| 308 |
+
[37] Pascal Germain, Amaury Habrard, François Laviolette, and Emilie Morvant. A PAC-Bayesian Approach for Domain Adaptation with Specialization to Linear Classifiers. In Proceedings of the 30th International Conference on Machine Learning, pages 738–746. PMLR, May 2013. ISSN: 1938-7228.
|
| 309 |
+
|
| 310 |
+
[38] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 311 |
+
|
| 312 |
+
[39] A. Krizhevsky. Learning multiple layers of features from tiny images, 2009.
|
| 313 |
+
|
| 314 |
+
[40] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do ImageNet Classifiers Generalize to ImageNet? In Proceedings of the 36th International Conference on Machine Learning, pages 5389–5400. PMLR, May 2019. ISSN: 2640-3498.
|
| 315 |
+
|
| 316 |
+
[41] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis R. Bach and David M. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop and Conference Proceedings, pages 448–456. JMLR.org, 2015.
|
| 317 |
+
|
| 318 |
+
[42] Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. Visda: The visual domain adaptation challenge. ArXiv, abs/1710.06924, 2017.
|
| 319 |
+
|
| 320 |
+
[43] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How Transferable Are Features in Deep Neural Networks? In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14, pages 3320–3328, Cambridge, MA, USA, 2014. MIT Press.
|
| 321 |
+
|
| 322 |
+
[44] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised Contrastive Learning. arXiv:2004.11362 [cs, stat], April 2020. arXiv: 2004.11362.
|
md/train/B1eY_pVYvB/B1eY_pVYvB.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EFFICIENT AND INFORMATION-PRESERVING FUTURE FRAME PREDICTION AND BEYOND
|
| 2 |
+
|
| 3 |
+
Wei ${ { \bf { Y } } { \bf { u } } ^ { 1 } }$ , Yichao $\mathbf { L u } ^ { 1 }$ , Steve Easterbrook1, Sanja Fidler1,2,3
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Toronto 2Vector Institute, Canada
|
| 6 |
+
3NVIDIA
|
| 7 |
+
{gnosis,yichao,sme,fidler}@cs.toronto.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Applying resolution-preserving blocks is a common practice to maximize information preservation in video prediction, yet their high memory consumption greatly limits their application scenarios. We propose CrevNet, a Conditionally Reversible Network that uses reversible architectures to build a bijective two-way autoencoder and its complementary recurrent predictor. Our model enjoys the theoretically guaranteed property of no information loss during the feature extraction, much lower memory consumption and computational efficiency. The lightweight nature of our model enables us to incorporate 3D convolutions without concern of memory bottleneck, enhancing the model’s ability to capture both short-term and long-term temporal dependencies. Our proposed approach achieves state-of-the-art results on Moving MNIST, Traffic4cast and KITTI datasets. We further demonstrate the transferability of our self-supervised learning method by exploiting its learnt features for object detection on KITTI. Our competitive results indicate the potential of using CrevNet as a generative pre-training strategy to guide downstream tasks.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep learning has enjoyed tremendous success in recent years due to its ability to capture complex dependencies and non-linearities in large datasets (Krizhevsky et al. (2012); He et al. (2016); Gomez et al. (2017)). Excellent performance has been achieved on a wide range of supervised machine learning tasks, ranging from image classification (He et al. (2016)) and object detection (Ren et al. (2015)) to speech recognition (Amodei et al. (2016)). Despite the significant breakthrough in supervised learning, the potential of applying deep architectures to unsupervised learning problems remains largely unexplored. Lately there has been a surge of interest in the task of video prediction, i.e., to predict future frames of a video sequence (Wang et al. (2017; 2018); Denton et al. (2017); Denton & Fergus (2018); Villegas et al. (2017); Lee et al. (2018)). The significance of video prediction primarily lies in its potential of discovering dynamics in the physical world. The self-supervised nature of video prediction aligns well with how humans learn, without requiring large amounts of labeled data. In addition, videos can provide an abundant and virtually unlimited source of visual information. This allows video prediction models to serve as a generative pre-training strategy of feature representation learning for a variety of downstream supervised tasks.
|
| 16 |
+
|
| 17 |
+
To date, most of the existing models for video prediction employ a hybrid of convolutional and recurrent layers as the underlying architecture (Wang et al. (2017); Shi et al. (2015); Lotter et al. (2016)). Such architectural design enables the model to simultaneously exploit the ability of convolutional units to model spatial relationships and the potential of recurrent units to capture temporal dependencies. Despite their prevalence in the literature, classical video prediction architectures suffer from two major limitations. Firstly, in dense prediction tasks such as video prediction, models are required to make pixel-wise predictions, which emphasizes the demand for the preservation of information through layers. Prior works attempt to address such demand through the extensive use of resolution-preserving blocks (Wang et al. (2017; 2018); Kalchbrenner et al. (2016)). Nevertheless, these resolution-preserving blocks are not guaranteed to preserve all the relevant information, and they greatly increase the memory consumption and computational cost of the models. The second drawback of existing video prediction models is that they cannot efficiently take advantage of 3D convolutions, as that would make these already cumbersome architectures even larger. 3D convolutions have been shown to be a very effective alternative to RNNs to capture temporal relations in a variety of video tasks (Liu et al. (2018); Carreira & Zisserman (2017)), and thus desirable to exploit.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: The pipeline of our proposed CrevNet where a single two-way autoencoder serves as both encoder and decoder. CrevNet first observes a warm-up video sequence and then starts a multi-frame video prediction without refeeding its own predictions.
|
| 21 |
+
|
| 22 |
+
Recently, reversible architectures (Dinh et al. (2014); Gomez et al. (2017); Jacobsen et al. (2018)) have attracted attention due to their light memory demand and their information preserving property by design. However, the effectiveness of reversible models remains greatly unexplored in the video literature. In this paper, we introduce a novel, conditionally reversible video prediction model, CrevNet, in the sense that when conditioned on previous hidden states, it can exactly reconstruct the input from its predictions. The contribution of this work can be summarized as follows:
|
| 23 |
+
|
| 24 |
+
• We introduce a two-way autoencoder that uses the forward and backward passes of an invertible network as encoder and decoder (Fig 1). The volume-preserving two-way autoencoder not only greatly reduces the memory demand and computational cost, but also enjoys the theoretically guaranteed property of no information loss. The lightweight nature of our model enables us to incorporate 3D convolutions without concern of memory bottleneck. We propose the reversible predictive module (RPM), as illustrated in Fig 2b, which extends the reversibility from spatial to temporal domain. RPM, together with the two-way autoencoder, provides a conditionally reversible architecture (CrevNet) for spatiotemporal learning. CrevNet achieves the state-of-the-art results on Moving MNIST, Traffic4cast and KITTI. We evaluate the effectiveness of features learnt from self-supervision by adapting our CrevNet for object detection on KITTI. Our competitive results indicate the potential of using CrevNet as a generative pre-training strategy to guide downstream CV tasks.
|
| 25 |
+
|
| 26 |
+
# 2 APPROACH
|
| 27 |
+
|
| 28 |
+
We first outline the general pipeline of our method. Our CrevNet consists of two subnetworks, an autonencoder network with an encoder $\mathcal { E }$ , decoder $\mathcal { D }$ and a recurrent predictor $\mathcal { P }$ bridging encoder and decoder. Let $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { w \times h \times c }$ represent the $t _ { \mathrm { t h } }$ frame in video $x$ , where $w , h .$ , and $c$ denote its width, height, and the number of channels. Given $x _ { 0 : t - 1 }$ , the model predicts the next frame $\hat { x } _ { t }$ as follows:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\hat { x } _ { t } = \mathcal { D } ( \mathcal { P } ( \mathcal { E } ( x _ { t - 1 } ) | x _ { 0 : t - 2 } ) )
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
In the case of 3D convolution, $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { k \times w \times h \times c }$ denotes the short video clip from $t$ to $t + k - 1$ instead of a single frame at timestep $t$ , where $k$ is the temporal dimension of input or output. During the multi-frame generation process without access to the ground truth frames, the model uses its previous predictions instead.
|
| 35 |
+
|
| 36 |
+
# 2.1 THE INVERTIBLE TWO-WAY AUTOENCODER
|
| 37 |
+
|
| 38 |
+
We propose a bijective two-way autoencoder based on the additive coupling layer introduced in NICE (Dinh et al. (2014)). We begin with describing the building block of the two-way autoencoder
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: The network architecture of CrevNet (Better viewed in color). The input video frames are first reshaped and split channelwise into two groups. These two groups are passed to the two-way autoencoder (a) for feature extraction, and then to the predictor made up of multiple reversible predictive modules (b). The transformed high-level features produced by predictor are then passed back through the decoding pass of (a), shown here as a representative block (c) to yield its prediction.
|
| 42 |
+
|
| 43 |
+
(Fig 2a). Formally, the input $x$ is first reshaped and split channelwise into two groups, denoted as $x ^ { 1 }$ and $x ^ { 2 }$ . During the forward pass of each building block, one group, e.g. $x ^ { 1 }$ , passes through several convolutions and activations and is then added to another group, $x ^ { \bar { 2 } }$ , like a residual block:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\hat { x } ^ { 2 } = x ^ { 2 } + \mathcal { F } _ { 1 } ( x ^ { 1 } ) \qquad \hat { x } ^ { 1 } = x ^ { 1 } + \mathcal { F } _ { 2 } ( \hat { x } ^ { 2 } )
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\mathcal { F }$ is a composite non-linear operator consisting of convolutions and activations, and ${ \hat { x } } ^ { 1 }$ and ${ \hat { x } } ^ { 2 }$ are the updated $x ^ { 1 }$ and $x ^ { 2 }$ . Note that $x ^ { 1 }$ and $x ^ { 2 }$ can be simply recovered from ${ \hat { x } } ^ { 2 }$ and ${ \hat { x } } ^ { 1 }$ by the inverse computation (Fig 2c) as follows:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
x ^ { 1 } = \hat { x } ^ { 1 } - \mathcal { F } _ { 2 } ( \hat { x } ^ { 2 } ) \qquad x ^ { 2 } = \hat { x } ^ { 2 } - \mathcal { F } _ { 1 } ( x ^ { 1 } )
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Multiple building blocks are stacked in an alternating fashion between $x ^ { 1 }$ and $x ^ { 2 }$ to construct a two-way autoencoder, as shown in Fig 2a. A series of the forward and inverse computations builds a one-to-one and onto, i.e. bijective , mapping between the input and features. Such invertibility ensures that there is no information loss during the feature extraction, which is presumably more favorable for video prediction since the model is expected to restore the future frames with finegrained details. To enable the invertibility of the entire autoencoder, our two-way autoencoder uses a bijective downsampling, pixel shuffle layer (Shi et al. (2016)), that changes the shape of feature from $( w , h , c )$ to $( w / n , \bar { h } / n , \bar { c } \times n ^ { 2 } )$ . The resulting volume-preserving architecture can greatly reduce its memory consumption compared with the existing resolution-preserving methods.
|
| 56 |
+
|
| 57 |
+
We further argue that for generative tasks, e.g. video prediction, we can effectively utilize a single two-way autoencoder, and to use its forward and backward pass as the encoder and the decoder, respectively. The predicted frame $\hat { x } _ { t }$ is thus given by
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\hat { x } _ { t } = \mathcal { E } ^ { - 1 } ( \mathcal { P } ( \mathcal { E } ( x _ { t - 1 } ) | x _ { 0 : t - 2 } ) )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where ${ { \mathcal { E } } ^ { - 1 } }$ is the backward pass of $\mathcal { E }$ . Our rationale is that, such setting would not only reduce the number of parameters in the model, but also encourage the model to explore the shared feature space between the inputs and the targets. As a result, our method does not require any form of information sharing, e.g. skip connection, between the encoder and decoder. In addition, our two-way autoencoder can enjoy a lower computational cost at the multi-frame prediction phase where the encoding pass is no longer needed and the predictor directly takes the output from previous timestep as input, as shown in Fig 1, since $\mathcal { E } ( \mathcal { E } ^ { - 1 } )$ is an identity mapping .
|
| 64 |
+
|
| 65 |
+
# 2.2 REVERSIBLE PREDICTIVE MODULE
|
| 66 |
+
|
| 67 |
+
In this section, we describe the second part of our video prediction model, the predictor $\mathcal { P }$ , which computes dependencies along both the space and time dimensions. Although the traditional stackedConvRNN layers architecture is the most straightforward choice of predictor, we find that it fails to establish a consistent temporal dependency when equipped with our two-way autoencoder through experiments. Therefore, we propose a novel reversible predictive module (RPM), which can be regarded as a recurrent extension of the two-way autoencoder. In the RPM, we substitute all standard convolutions with layers from the ConvRNN family (e.g. ConvLSTM or spatiotemporal LSTM) and introduce a soft attention (weighting gates) mechanism to form a weighted sum of the two groups instead of the direct addition. The main operations of RPM used in this paper are given as follows:
|
| 68 |
+
|
| 69 |
+
ConvRNN
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l } & { h _ { t } ^ { 1 } = \mathrm { C o n v R N N } ( x _ { t } ^ { 1 } , h _ { t - 1 } ^ { 1 } ) } \\ & { g _ { t } = \phi ( W _ { 2 } * \mathrm { R e L U } ( W _ { 1 } * h _ { t } ^ { 1 } + b _ { 1 } ) + b _ { 2 } ) } \\ & { \hat { x _ { t } ^ { 2 } } = ( 1 - g _ { t } ) \odot x _ { t } ^ { 2 } + g _ { t } \odot h _ { t } ^ { 1 } } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Attention module
|
| 76 |
+
|
| 77 |
+
Weighted sum
|
| 78 |
+
|
| 79 |
+
where $\boldsymbol { x } _ { t } ^ { 1 }$ and $\boldsymbol { x } _ { t } ^ { 2 }$ denote two groups of features at timestep $t$ , $h _ { t } ^ { 1 }$ denote the hidden states of ConvRNN layer, $\phi$ is sigmoid activation, $^ *$ is the standard convolution operator and $\odot$ is the Hadamard product. The architecture of reversible predictive module is also shown in Fig 2b. RPM adopts a similar architectural design as the two-way autoencoder to ensure a pixel-wise alignment between the input and the output, i.e. each position of features can be traced back to certain pixel, and thus make it compatible with our two-way autoencoder. It also mitigates the vanishing gradient issues across stacked layers since the coupling layer provides a nice property w.r.t. the Jacobian (Dinh et al. (2014)). In addition, the attention mechanism in the RPM enables the model to focus on objects in motion instead of background, which further improves the video prediction quality. Similarly, multiple RPMs alternate between the two groups to form a predictor. We call this predictor conditionally reversible since, given $h _ { t - 1 }$ , we are able to reconstruct $x _ { t - 1 }$ from $\hat { x } _ { t }$ if there are no numerical errors:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
x _ { t - 1 } = \mathcal { E } ^ { - 1 } ( \mathcal { P } ^ { - 1 } ( \mathcal { E } ( \hat { x } _ { t } ) | h _ { t - 1 } ) )
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\mathcal { P } ^ { - 1 }$ is the inverse computation of the predictor $\mathcal { P }$ . We name the video prediction model using two-way autoencoder as its backbone and RPMs as its predictor CrevNet. Another key factor of RPM is the choice of ConvRNN. In this paper, we mainly employ ConvLSTM (Shi et al. (2015)) and spatiotemporal LSTM (ST-LSTM, Wang et al. (2017)) to enable a fair comparison with baselines.
|
| 86 |
+
|
| 87 |
+
# 2.3 3D CONVOLUTIONS
|
| 88 |
+
|
| 89 |
+
3D convolutions are proposed to address the shortcomings of standard 2D convolutions. The major difference between 2D-CNNs and 3D-CNNs is that at each time step 2D-CNNs take as input one video frame, while 3D-CNNs read in and output a short video clip containing $k$ continuous video frames. By applying convolutions on the temporal dimension along with the spatial dimension, models equipped with 3D convolution filters can not only extract representative spatiotemporal features, but also learn to produce consistent video clip at each generation, which further improve the quality of long-term prediction. In some cases, e.g. sequences are too short, we will use 2 consecutive frames stacked in the channel dimension instead as input at each timestep to assemble a valid warm-up sequence for ConvRNN.
|
| 90 |
+
|
| 91 |
+
# 3 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
# 3.1 LONG-TERM PREDICTION—MOVING MNIST
|
| 94 |
+
|
| 95 |
+
Moving MNIST (Srivastava et al. (2015)) is a synthetically generated dataset that contains an infinite number of sequences of length 20. Each sequence shows how 2 digits move at a constant speed and bounce inside a $6 4 \times 6 4$ frame, where each handwritten digit is randomly sampled from the MNIST dataset. By assigning different initial locations and velocities to each digit, it is possible to generate an unlimited number of sequences, thus enabling us to accurately evaluate the performance of each model without the concern of data insufficiency issues. In the default setting, models are trained to predict 10 future frames after observing 10 prior frames in the sequence. Although the dynamics of Moving MNIST seems to be simple at first glance. It is quite hard to generate consistent future frames in the task of long-term prediction as digits can bounce or occlude each other frequently.
|
| 96 |
+
|
| 97 |
+
Datasets and Setup: The general architecture of CrevNet used on Moving MNIST is composed of a 36-layer two-way autoencoder and 8 RPMs. All variants of CrevNet are trained by using the Adam optimizer with a starting learning rate of $5 \times 1 0 ^ { - 4 }$ to minimize MSE. The training process is stopped
|
| 98 |
+
|
| 99 |
+
after 300, 000 iterations with the batch size of 16 and evaluated with a fixed test set containing 5, 000 sequences. To ensure that all samples in the test set are unseen by the model, digits in the training set and the testing set are separately sampled from two mutually exclusive subsets of MNIST.
|
| 100 |
+
|
| 101 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">MNIST-2</td><td colspan="2">MNIST-3 MSE</td><td rowspan="2">Memory (1 sample)</td><td rowspan="2">FLOPS (1 frame)</td></tr><tr><td>SSIM</td><td>MSE</td><td>Human</td><td>SSIM</td><td></td></tr><tr><td>ConvLSTM (Shi et al. (2015))</td><td>0.707</td><td>103.3</td><td>0.923</td><td>0.695</td><td>127.3</td><td>1043 MB</td><td>107.4 G</td></tr><tr><td>FRNN (Oliu et al. (2018))</td><td>0.819</td><td>68.4</td><td>0.848</td><td>0.791</td><td>90.4</td><td>717MB</td><td>80.1G</td></tr><tr><td>VPN (Kalchbrenner et al. (2016))</td><td>0.870</td><td>70.0</td><td>0.831</td><td>0.820</td><td>85.6</td><td>5206MB</td><td>309.6 G</td></tr><tr><td>PredRNN (Wang et al. (2017))</td><td>0.869</td><td>56.8</td><td>0.837</td><td>0.822</td><td>83.1</td><td>1666 MB</td><td>192.9 G</td></tr><tr><td>PredRNN++ (Wang et al. (2018))</td><td>0.898</td><td>46.5</td><td>0.781</td><td>0.864</td><td>68.4</td><td>2017MB</td><td>106.8 G</td></tr><tr><td>E3D-LSTM (Wang et al. (2019))</td><td>0.910</td><td>41.3</td><td>0.706</td><td>0.870</td><td>62.4</td><td>2695 MB</td><td>381.3 G</td></tr><tr><td>CrevNet+ConvLSTM</td><td>0.928</td><td>38.5</td><td>0.602</td><td>0.886</td><td>57.2</td><td>130 MB</td><td>0.919 G</td></tr><tr><td>CrevNet + ST-LSTM</td><td>0.949</td><td>22.3</td><td>0.558</td><td>0.916</td><td>40.6</td><td>195MB</td><td>1.618 G</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 1: Quantitative evaluation of different methods on Moving MNIST. All metrics are averaged over the 10 predictions. Lower MSE and higher SSIM indicates better prediction accuracy.
|
| 104 |
+
|
| 105 |
+
We compare CrevNet to six popular benchmark models from the literature: (i) ConvLSTM (Shi et al. (2015)), (ii) FRNN (Oliu et al. (2018)), (iii) VPN (Kalchbrenner et al. (2016)), (iv) PredRNN (Wang et al. (2017)) , (v) PredRNN $^ { + + }$ (Wang et al. (2018)), and (vi) E3D-LSTM (Wang et al. (2019)),. All baselines are implemented and optimized by following their corresponding protocols. To test our model in a more challenging setting, we also extend Moving MNIST to a 3-digit version where digits are more likely to occlude each other.
|
| 106 |
+
|
| 107 |
+
Results: The performance of each model in terms of per-frame MSE and the Structural Similarity Index Measure (SSIM) (Wang et al. (2004)) is presented in Table 1. CrevNet outperforms all previous methods by a wide margin on both metrics while memory consumption of all CrevNet variants is significantly lower than that of other baselines. In particular, CrevNet with ConvLSTM only uses 130 MB memory per sample and is still capable of yielding results better than any baselines.
|
| 108 |
+
|
| 109 |
+
To analyze the contribution of each module, we conduct an ablation study on both ConvLSTM and ST-LSTM with respect to 3D convolution, two-way autoencoder and RPM and summarize the results in Table 2. Note that we do not include the quantitative results of the combination of two-way autoencoder and stack-ConvRNN predictor because it fails to produce consistent long-term generations and we choose UNet (Ronneberger et al. (2015)) as an alternative to our two-way autoencoder. We can observe a significant improvement over ConvLSTM after we embed it into our CrevNet framework, indicating the effectiveness of reversible architectures. Also, integrating 3D convolution can consistently enhance the performance of all architectures. To further show the superior performance of CrevNet, we evaluate it on a harder 3-digit setting. Results are shown in the right column of Table 1. Compared with the 2-digit setting, all models suffer a deterioration in quantitative performance due to the more frequent occurrence of overlapping digits. Nevertheless, our CrevNet still achieves the best result.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3: An extremely hard sequence of Moving MNIST where two digits are continuously overlapped during the warm-up phase.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Model</td><td>ConvLSTM MSE SSIM|</td><td>ST-LSTM MSE SSIM</td></tr><tr><td>Stacked-RNN</td><td>103.3 0.707</td><td>56.8 0.869</td></tr><tr><td>3D Stacked-RNN</td><td>85.8 0.785</td><td>46.2 0.878</td></tr><tr><td>UNet+StackedRNN 83.5</td><td>0.793</td><td>58.8 0.865</td></tr><tr><td>UNet+RPM</td><td>63.4 0.855</td><td>50.2 0.896</td></tr><tr><td>CrevNet w/o 3D</td><td>50.2 0.888</td><td>40.4 0.916</td></tr><tr><td>CrevNet + 3D</td><td>38.5 0.928</td><td>22.3 0.949</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 2: An ablation study w.r.t. 3D convolution, RPM and two-way autoencoder. All metrics are averaged over the 10 predictions.
|
| 117 |
+
|
| 118 |
+
In Fig 3 , our qualitative analysis shows how each model performs on an extremely hard case of Moving MNIST where two digits are continuously overlapped during the warm-up phase.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: The visual comparison of Traffic4cast. The red boxes track some dynamics successfully captured by our CrevNet. Better viewed large.
|
| 122 |
+
|
| 123 |
+
As we can see, our model is the only model that can differentiate the overlapping digits. The information-preserving property of the two-way autoencoder enables our method to reconstruct every fine detail of moving digits after occlusion while baselines typically only restore the basic shape of these numbers. In fact, our CrevNet works almost perfectly on Moving MNIST, with most of its generations being visually indistinguishable from groundtruth.
|
| 124 |
+
|
| 125 |
+
We perform a human study to assess the fidelity of the video clips generated by different models. We presented pairs of video clips to human judges, where each pair consists of a video clip from the test set together with the prediction generated by the model. The judges were asked to decide which of the two video clips is more likely to be the groundtruth. To make each trail blind, the judges were not informed which model is used for generation and two sequences were randomly displayed on either side of the screen. We totally collected 2439 responses made by 58 human subjects and then calculated the probability that human judges answered correctly. The results are reported in Table 1. The accuracy of $5 5 . 8 \%$ suggests that subjects could hardly detect the difference and their decisions were very close to random guesses.
|
| 126 |
+
|
| 127 |
+
# 3.2 SHORT-TERM PREDICTION—TRAFFIC FLOW FORECASTING
|
| 128 |
+
|
| 129 |
+
Next, we evaluate our model on a more complicated real-world dataset, Traffic4cast (IARAI (2019)), which collects the traffic statuses of 3 big cities over a year at a 5-minute interval. Traffic forecasting can be straightforwardly defined as video prediction task by its spatiotemporal nature. However, this dataset is quite challenging for the following reasons. (1). High resolution: The frame resolution of Traffic4cast is $4 9 5 \times 4 3 6$ , which is the highest among all datasets. Existing resolution-preserving methods can hardly be adapted to this dataset since they all require extremely large memory and computation. Even if these models can be fitted in GPUs, they still do not have large enough receptive fields to capture the meaningful dynamics as vehicles can move up to 100 pixels between consecutive frames. (2). Complicated nonlinear dynamics: Valid data points only reside on the hidden roadmap of each city, which is not explicitly provided in this dataset. Moving vehicles on these curved roads along with tangled road conditions will produce very complex nonlinear behaviours. It also involves many unobservable conditions or random events like weather and car accidents.
|
| 130 |
+
|
| 131 |
+
Datasets and Setup: Each frame in Traffic4cast dataset is a $4 9 5 \times 4 3 6 \times 3$ heatmap, where the last dimension records 3 traffic statuses representing volume, mean speed and major direction at given location. The architecture of CrevNet is the same as the one we used on Moving MNIST. As we mentioned before, the existing resolution-preserving methods cannot handle such high resolution input. Thus, to make the comparison possible, we add U-Net encoder-decoder to the baseline models including ConvLSTM and ST-LSTM. We train each model to predict next 3 frames (the next 15 minutes) from 9 observations and evaluate prediction with MSE criterion.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Model</td><td>CrevNet</td><td>UNet+ST-LSTM</td><td>UNet+ConvLSTM丨Best Team</td><td></td><td>2nd Best Team</td></tr><tr><td>MSE</td><td>9.340×10-3</td><td>9.725× 10-3</td><td>9.846 ×10-3</td><td>9.559×10-3</td><td>9.717 × 10-3</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 3: Quantitative evaluation on Traffic4cast. Lower MSE indicates better prediction accuracy.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: The visual comparison of next-frame predictions on Caltech Pedestrian.
|
| 139 |
+
|
| 140 |
+
Results: The quantitative comparison including the best two results on the leaderboard before the submission of this paper is provided in Table 3. Unlike all previous state-of-the-art methods, CrevNet does not suffer from high memory consumption so that we were able to train our model in a single V100 GPU. The invertibility of two-way autoencoder preserves all necessary information for spatiotemporal learning and allows our model to generate sharp and reasonable predictions. As illustrated in Fig 4, our model can identify and remember the hidden roadmap of each city through the learning of complicated nonlinear dynamics and accurately predict how traffic system will evolve.
|
| 141 |
+
|
| 142 |
+
# 3.3 NEXT-FRAME PREDICTION AND BEYOND—CAR-MOUNTED CAMERA VIDEO
|
| 143 |
+
|
| 144 |
+
The real-world videos are usually long-term unpredictable because of the intrinsic randomness and the lack of necessary information. Thus, the common practice for datasets like KITTI (Geiger et al. (2012)), a car-mounted camera video dataset, is to perform next-frame prediction. In this section, we further demonstrate the superior performance of our CrevNet by conducting experiments on KITTI and Caltech Pedestrian (Dollár et al. (2009)). Compared with the previous two settings, carmounted camera videos dataset presents another level of difficulty for video prediction as it describes various nonlinear three-dimensional dynamics of multiple moving objects including backgrounds. Furthermore, as our well-trained model is capable of generating authentic future frames, it should spontaneously learn at least the shape and location of all moving objects, which indicates that the learnt features are very informative for downstream tasks. For example, in the case of object detection, these features can be incorporated to estimate more accurate locations and sizes of bounding boxes. Therefore, we also explore the effectiveness of our self-supervised learning method on the 2D object detection on KITTI.
|
| 145 |
+
|
| 146 |
+
# 3.3.1 VIDEO PREDICTION
|
| 147 |
+
|
| 148 |
+
Datasets and Setup: We follow the same protocol used in PredNet (Lotter et al. (2016)) for preprocessing and evaluation. We first center-crop all video frames and resize them into $1 2 8 \times 1 6 0$ . We compare our proposed method with 4 state-of-the-art benchmark models. Models are trained on KITTI dataset to predict the next frame after 10-frame warm-up and are evaluated on Caltech Pedestrian. The architecture of CrevNet used on KITTI is composed of a 48-layer two-way autoencoder and 40 RPMs. Note that it is the memory efficiency of our method that allows us to deploy such deep model. Since our model also possess good capability of long-term prediction. We add a 12-frame prediction comparison with CycleGAN (Kwon & Park (2019)) and PredNet (Lotter et al. (2016)).
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 6: The visual comparison of 12-frame prediction on Caltech Pedestrian. Notice how well CrevNet captures the detail and geometry of the buildings in the background, and the overall shading.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Model</td><td colspan="2">Next-Frame</td><td>3rd</td><td>6th</td><td>9th</td><td>12th</td><td>Average</td></tr><tr><td></td><td>PSNR</td><td>SSIM</td><td colspan="5">SSIM</td></tr><tr><td>Copy-Last-Frame Dual Motion GAN (Liang et al. (2017))</td><td>23.3</td><td>0.779 0.899</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ContextVP (Byeon et al. (2018)) PredNet (Lotter et al. (2016))</td><td>28.7 27.6</td><td>0.921 0.905</td><td>0.72</td><td>0.66</td><td>0.61</td><td>0.58</td><td>0.701</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CycleGAN (Kwon & Park (2019))</td><td>29.2</td><td>0.919</td><td>0.83</td><td>0.73</td><td>0.67</td><td>0.63</td><td>0.752</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CrevNet</td><td>29.3</td><td>0.925</td><td>0.84</td><td>0.76</td><td>0.70</td><td>0.65</td><td>0.776</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 4: Quantitative evaluation of different methods on the Caltech Pedestrian dataset. Higher PSNR or SSIM means better prediction accuracy.
|
| 156 |
+
|
| 157 |
+
Results: Performance of different models in terms of PSNR and SSIM is displayed in Table 4. CrevNet outperforms all baselines in both next-frame and multi-frame prediction regimes. Visual comparisons are provided in Fig 5 and Fig 6. Especially, in the case of 12-frame generation, we can observe that compared with our method, PredNet suffers severely from the famous error propagation of RNN issue while CycleGAN produces realistic yet physically inconsistent predictions.
|
| 158 |
+
|
| 159 |
+
# 3.3.2 2D OBJECT DETECTION
|
| 160 |
+
|
| 161 |
+
Datasets and Setup: KITTI provides three prior frames of unlabeled data for each labeled image. This allows us to run our CrevNet to extract useful spatiotemporal features for object detection. All video sequences were recorded at $1 0 \ : \mathrm { H z }$ with resolution of $1 2 4 2 \times 3 7 5$ . We first resize each frame to $4 1 6 \times 1 2 8$ and finetune our best model on the video prediction task solely. The combinations of features extracted by our two-way autoencoder and attention masks of the target frame are then fed into the detection head for the further training. Note that we do not update the weights of CrevNet at this stage to purely demonstrate the power of self-supervised learning. Two image-based detection models, SqueezeDet and RRC, are compared as baselines. We also add an experiment on transfer learning of features learnt by PredNet on KITTI as comparison. To be consistent with related work, we use SSD (Liu et al. (2016)) as detection head.
|
| 162 |
+
|
| 163 |
+
Table 5: Quantitative evaluation of different methods on 2D KITTI detection in term of Average Precision (AP). The numbers in the "Best Results on the Leaderboard " are achieved by different best models on each class according to the default ranking mechanism on the Leaderboard.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2">Backbone</td><td rowspan="2">Add-ons</td><td colspan="3">Car L</td><td colspan="3">Pedestrain M</td><td colspan="3">Cyclist</td><td rowspan="2">mAP</td></tr><tr><td>E</td><td>M</td><td>H</td><td>E</td><td></td><td>H</td><td>E</td><td>M</td><td>H</td></tr><tr><td>SqueezeDet RRC</td><td>(Wu et al. (2017)) (Ren et al. (2017))</td><td>90.4 90.61</td><td>87.1 90.23</td><td>78.9 87.44</td><td>81.4 84.16</td><td>71.3 75.33</td><td>68.5 70.39</td><td>87.6 84.96</td><td>80.3 76.49</td><td>78.1 65.46</td><td>80.4 80.56</td></tr><tr><td colspan="2">Best Results on the Leaderboard</td><td>91.96</td><td>91.97</td><td>84.57</td><td>88.27</td><td>81.73</td><td>75.29</td><td>84.28</td><td>79.24</td><td>71.22</td><td>83.17</td></tr><tr><td>PredNet</td><td>(Lotter et al. (2016))</td><td>59.05</td><td>41.61</td><td>37.53</td><td>50.88</td><td>47.51</td><td>43.44</td><td>46.25</td><td>43.79</td><td>38.66</td><td>45.41</td></tr><tr><td>CrevNet</td><td>attention mask + extracted features</td><td>91.53 91.94</td><td>90.95 91.84</td><td>85.71 85.97</td><td>89.31 89.66</td><td>82.55 83.17</td><td>75.21 75.80</td><td>85.51 87.33</td><td>80.41 80.91</td><td>71.52 72.21</td><td>83.63 84.31</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Results: The results of all experiments and baselines can be found in Table 5. Surprisingly, our CrevNet even outperforms the combination of the best model on each class in term of mAP. Since our model is capable of capturing the motion information, it is sensitive to the small (hard) moving objects. However, the motion information alone is not sufficient for object detection due to the appearance of relatively static objects. Therefore, we can observe a performance boost after we incorporate the features extracted by our two-way autoencoder. Another advantage of our method is that it can provide a better localization of bounding box since the learnt features of CrevNet remain the pixel-wise alignment with the input and output frame. Finally, thanks to the lightweight nature of our CrevNet, our best detection model can run at 6.8 FPS at the testing time.
|
| 168 |
+
|
| 169 |
+
# 4 RELATED WORK
|
| 170 |
+
|
| 171 |
+
Deep Learning in Video Prediction: Mainstream video prediction models can mostly be categorized into two frameworks, stacked ConvRNNs and encoder-predictor-decoder models. The former framework attempts to design a new spatiotemporal module and then stacks multiple such modules to form the final model, while the latter usually utilizes an autoencoder to project video frames into their latent representations and then employs a recurrent neural network to model the temporal transformations. PredNet (Lotter et al. (2016)) is a good representative of stacked ConvRNNs framework. In PredNet, each ConvLSTM layer produces a layer-specific prediction at every time step to transmit an error term to the next layer. This model works well for predicting the next frame, but fails to maintain its performance in a long-term setting. To tackle long-term predictions, PredRNN (Wang et al. (2017)) proposed a new spatiotemporal LSTM, which allows memory to flow both vertically and horizontally. PredRNN $^ { + + }$ (Wang et al. (2018)) further improved the results by rearranging spatial and temporal memory in a cascaded mechanism, and by using a gradient highway architecture to ease the optimization. E3D-LSTM (Wang et al. (2019)) effectively recalled the previous memory states and also proposed to include 3D convolutions to enhance its performance. ContextVP (Byeon et al. (2018)) introduced a fully context-aware architecture consisting of parallel multi-dimensional LSTM units and blending units. Methods from stacked ConvRNNs family usually yield more accurate deterministic predictions but they consume considerable GPU memory and computational power as they abandon downsampling to prevent information loss.
|
| 172 |
+
|
| 173 |
+
The encoder-predictor-decoder framework, on the other hand, provides more flexibility than its counterpart. MCNET (Villegas et al. (2017)) and DrNet (Denton et al. (2017)) decompose the content and motion in videos by building their corresponding encoders and then integrate this disentangled information to yield the next frame. Retrospective CycleGAN (Kwon & Park (2019)) combines sequential adversarial loss with frame adversarial loss, which encourages the model to generate frames that are visually similar to authentic images. In terms of modeling stochasticity, SVG (Denton & Fergus (2018)) and SAVG (Lee et al. (2018)) utilize a prior inference network to mimic the uncertainty in the environment, and then embed it into a deterministic generative model to produce stochastic video frames. VPN (Kalchbrenner et al. (2016)) estimates the discrete joint distribution of the raw pixel values in a video using the well-established PixelCNNs. It is worth noticing that VPN employs a resolution-preserving encoder to circumvent the information loss, showing the need for an efficient information-preserving encoder in the community.
|
| 174 |
+
|
| 175 |
+
Comparison with Related Works: To the best of our knowledge, our CrevNet is the first conditionally reversible model in the video prediction literature. There are three prior arts, E3D-LSTM (Wang et al. (2019)), FRNN (Oliu et al. (2018)) and VideoFlow (Kumar et al. (2019)), having some similarities with our CrevNet. While E3D-LSTM also employs 3D convolutions, their implementation is essentially equivalent to applying two 2D convolutional operations, as there is no shared filter on the temporal dimension. Similar to CrevNet, FRNN reduces its computational cost by eliminating the need to re-encode the output of decoder. However, FRNN has a substantially different architecture compared to CrevNet. While the encoder and decoder in our model do not need information sharing at all, FRNN relies heavily on the sharing of the hidden states between them. Although VideoFlow also utilizes invertible transformation. This approach is very different from ours because: (1). VideoFlow is built upon Glow, a very memory-consuming architecture. Such memory limits preclude the use of 3D convolutions, or even from training the model with Adam. (2). They use ANN to model temporal relationship. As such, VideoFlow cannot capture complex dynamics. (3). So far, VideoFlow has only been applied to stochastic video generation instead of deterministic video prediction.
|
| 176 |
+
|
| 177 |
+
The Reversible and Invertible Architectures: The idea of the coupling layer was initially introduced in NICE (Dinh et al. (2014)) so as to make the computation of the determinant of the Jacobian and inverse Jacobian trival. Inspired by additive coupling layer, RevNet (Gomez et al. (2017)) introduced a reversible block that allowed the reconstruction of activations of each layer from that of the next layer, thus eliminating the need to store activations between downsampling and significantly reducing its memory consumption. The follow-up work by (Jacobsen et al. (2018)) further proposed an invertible extension, i-RevNet, which enabled the model to preserve all information of input through layers while still being capable of extracting a useful representation for classification.
|
| 178 |
+
|
| 179 |
+
# 5 CONCLUSION
|
| 180 |
+
|
| 181 |
+
We described a novel conditionally reversible network, CrevNet, for pixel-level prediction of future frames in videos. The originality of our model lies in our use of the reversible two-way autoencoder and the accompanying reversible predictive module. Such architectural design enables the model to preserve fine-grained information without significant memory and computation overhead. CrevNet achieves state-of-the-art results on both synthetic and real-world datasets. The subsequent detection experiments demonstrate the potential of CrevNet to be a continuous self-supervised learning system to enhance downstream CV tasks, as shown in the case of BERT (Devlin et al. (2018)) for NLP tasks.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Dario Amodei, Sundaram Ananthanarayanan, Rishita Anubhai, Jingliang Bai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Qiang Cheng, Guoliang Chen, et al. Deep speech 2: Endto-end speech recognition in english and mandarin. In International Conference on Machine Learning, pp. 173–182, 2016.
|
| 186 |
+
|
| 187 |
+
Wonmin Byeon, Qin Wang, Rupesh Kumar Srivastava, and Petros Koumoutsakos. Contextvp: Fully context-aware video prediction. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 753–769, 2018.
|
| 188 |
+
|
| 189 |
+
Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6299–6308, 2017.
|
| 190 |
+
|
| 191 |
+
Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1174–1183, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/denton18a.html.
|
| 192 |
+
|
| 193 |
+
Emily L Denton et al. Unsupervised learning of disentangled representations from video. In Advances in Neural Information Processing Systems, pp. 4417–4426, 2017.
|
| 194 |
+
|
| 195 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 196 |
+
|
| 197 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 198 |
+
|
| 199 |
+
Piotr Dollár, Christian Wojek, Bernt Schiele, and Pietro Perona. Pedestrian detection: A benchmark. 2009 IEEE Conference on Computer Vision and Pattern Recognition, 2009.
|
| 200 |
+
|
| 201 |
+
Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 3354–3361. IEEE, 2012.
|
| 202 |
+
|
| 203 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in Neural Information Processing Systems, pp. 2211–2221, 2017.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
IARAI. Traffic4cast: Traffic map movie forecasting. https://www.iarai.ac.at/ traffic4cast, 2019. Accessed: 2019-09-25.
|
| 208 |
+
|
| 209 |
+
Jörn-Henrik Jacobsen, Arnold Smeulders, and Edouard Oyallon. i-revnet: Deep invertible networks. arXiv preprint arXiv:1802.07088, 2018.
|
| 210 |
+
|
| 211 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. arXiv preprint arXiv:1610.00527, 2016.
|
| 212 |
+
|
| 213 |
+
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.
|
| 214 |
+
|
| 215 |
+
Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A flow-based generative model for video. arXiv preprint arXiv:1903.01434, 2019.
|
| 216 |
+
|
| 217 |
+
Yong-Hoon Kwon and Min-Gyu Park. Predicting future frames using retrospective cycle gan. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1811–1820, 2019.
|
| 218 |
+
|
| 219 |
+
Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
|
| 220 |
+
|
| 221 |
+
Xiaodan Liang, Lisa Lee, Wei Dai, and Eric P Xing. Dual motion gan for future-flow embedded video prediction. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1744–1752, 2017.
|
| 222 |
+
|
| 223 |
+
Kun Liu, Wu Liu, Chuang Gan, Mingkui Tan, and Huadong Ma. T-c3d: Temporal convolutional 3d network for real-time action recognition. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 224 |
+
|
| 225 |
+
Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pp. 21–37. Springer, 2016.
|
| 226 |
+
|
| 227 |
+
William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. arXiv preprint arXiv:1605.08104, 2016.
|
| 228 |
+
|
| 229 |
+
Marc Oliu, Javier Selva, and Sergio Escalera. Folded recurrent neural networks for future video prediction. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 716–731, 2018.
|
| 230 |
+
|
| 231 |
+
Jimmy Ren, Xiaohao Chen, Jianbo Liu, Wenxiu Sun, Jiahao Pang, Qiong Yan, Yu-Wing Tai, and Li Xu. Accurate single stage detector using recurrent rolling convolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5420–5428, 2017.
|
| 232 |
+
|
| 233 |
+
Shaoqing Ren, Kaiming He, Ross Girprerhick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
|
| 234 |
+
|
| 235 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pp. 234–241. Springer, 2015.
|
| 236 |
+
|
| 237 |
+
Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1874–1883, 2016.
|
| 238 |
+
|
| 239 |
+
Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pp. 802–810, 2015.
|
| 240 |
+
|
| 241 |
+
Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International conference on machine learning, pp. 843–852, 2015.
|
| 242 |
+
|
| 243 |
+
Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. arXiv preprint arXiv:1706.08033, 2017.
|
| 244 |
+
|
| 245 |
+
Yunbo Wang, Mingsheng Long, Jianmin Wang, Zhifeng Gao, and S Yu Philip. Predrnn: Recurrent neural networks for predictive learning using spatiotemporal lstms. In Advances in Neural Information Processing Systems, pp. 879–888, 2017.
|
| 246 |
+
|
| 247 |
+
Yunbo Wang, Zhifeng Gao, Mingsheng Long, Jianmin Wang, and Philip S Yu. PredRNN $^ { + + }$ : Towards a resolution of the deep-in-time dilemma in spatiotemporal predictive learning. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 5123–5132, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/wang18b.html.
|
| 248 |
+
|
| 249 |
+
Yunbo Wang, Lu Jiang, Ming-Hsuan Yang, Li-Jia Li, Mingsheng Long, and Li Fei-Fei. Eidetic 3d LSTM: A model for video prediction and beyond. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1lKS2AqtX.
|
| 250 |
+
|
| 251 |
+
Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004.
|
| 252 |
+
|
| 253 |
+
Bichen Wu, Forrest Iandola, Peter H Jin, and Kurt Keutzer. Squeezedet: Unified, small, low power fully convolutional neural networks for real-time object detection for autonomous driving. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 129–137, 2017.
|
| 254 |
+
|
| 255 |
+
# A CONVLSTM AND ST-LSTM
|
| 256 |
+
|
| 257 |
+
The key equations of ConvLSTM are shown as belows.
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
\begin{array} { r l } & { i _ { t } = \sigma \big ( W _ { x i } \ast \mathcal { X } _ { t } + W _ { h i } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { i } \big ) } \\ & { f _ { t } = \sigma \big ( W _ { x f } \ast \mathcal { X } _ { t } + W _ { h f } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { f } \big ) } \\ & { \mathcal { C } _ { t } ^ { l } = f _ { t } \circ \mathcal { C } _ { t - 1 } ^ { l } + i _ { t } \circ \operatorname { t a n h } \bigl ( W _ { x c } \ast \mathcal { X } _ { t } + W _ { h c } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { c } \bigr ) } \\ & { o _ { t } = \sigma \big ( W _ { x o } \ast \mathcal { X } _ { t } + W _ { h o } \ast \mathcal { H } _ { t - 1 } ^ { l } + W _ { c o } \circ \mathcal { C } _ { t } ^ { l } + b _ { o } \big ) } \\ & { \mathcal { H } _ { t } ^ { l } = o _ { t } \circ \operatorname { t a n h } ( \mathcal { C } _ { t } ^ { l } ) } \end{array}
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
where $^ *$ denotes the convolution operator and $\circ$ denotes the Hadamard product. Based on ConvLSTM, spatiotemporal LSTM (ST-LSTM) in PredRNN adds another vertical memory flow to enhance the long-term temporal dependency as follow.
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\begin{array} { r l } & { i _ { t } = \sigma ( W _ { x i } \ast \mathcal { X } _ { t } + W _ { h i } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { i } ) } \\ & { f _ { t } = \sigma ( W _ { x f } \ast \mathcal { X } _ { t } + W _ { h f } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { f } ) } \\ & { \mathcal { C } _ { t } ^ { l } = f _ { t } \circ \mathcal { C } _ { t - 1 } ^ { l } + i _ { t } \circ \operatorname { t a n h } ( W _ { x c } \ast \mathcal { X } _ { t } + W _ { h c } \ast \mathcal { H } _ { t - 1 } ^ { l } + b _ { c } ) } \\ & { \dot { u } _ { t } ^ { l } = \sigma ( W _ { x i } ^ { r } \ast \mathcal { X } _ { t } + W _ { m i } \ast \mathcal { M } _ { t } ^ { l - 1 } + b _ { i } ^ { i } ) } \\ & { f _ { t } ^ { \prime } = \sigma ( W _ { x f } ^ { r } \ast \mathcal { X } _ { t } + W _ { m f } \ast \mathcal { M } _ { t } ^ { l - 1 } + b _ { f } ^ { \prime } ) } \\ & { \mathcal { M } _ { t } ^ { l } = f _ { t } ^ { \prime } \circ \mathcal { M } _ { t } ^ { l - 1 } + i _ { t } ^ { \prime } \circ \operatorname { t a n h } ( W _ { x m } \ast \mathcal { X } _ { t } + W _ { m m } \ast \mathcal { M } _ { t } ^ { l - 1 } + b _ { m } ) } \\ & { o _ { t } = \sigma ( W _ { x o } \ast \mathcal { X } _ { t } + W _ { h o } \ast \mathcal { H } _ { t - 1 } ^ { l } + W _ { c o } \circ \mathcal { C } _ { t } ^ { l } + W _ { m o } \circ \mathcal { M } _ { t } ^ { l } + b _ { o } ) } \\ & { \mathcal { H } _ { t } = o _ { t } \mathrm { o t } \operatorname { t a n h } ( W _ { 1 x } | C _ { t } ^ { l } , \mathcal { M } _ { t } ^ { l } | ) } \end{array}
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
where blue part overlaps ConvLSTM. Note that $\mathcal { M } _ { t } ^ { l }$ usually receives information from the previous layer instead of the previous state and the special case is that $\boldsymbol { \mathcal { M } } _ { t } ^ { 1 }$ receives $\mathcal { M } _ { t - 1 } ^ { L }$ to constitute a zigzag information flow. As we can see, ST-LSTM basically doubles the size of feature map and the number of parameters compared with ConvLSTM.
|
| 270 |
+
|
| 271 |
+
# B CONDITIONAL REVERSIBILITY
|
| 272 |
+
|
| 273 |
+
As we mentioned in Section 2.2, conditional reversibility is an interesting property of our CrevNet. In this section, we will provide more details about it. Given $\hat { x } _ { t } ^ { 2 } , x _ { t } ^ { 1 }$ and $h _ { t - 1 } ^ { 1 }$ , the reversible predictive module can recover $\boldsymbol { x } _ { t } ^ { 2 }$ as follow
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\begin{array} { r l } & { h _ { t } ^ { 1 } = \mathrm { C o n v R N N } ( x _ { t } ^ { 1 } , h _ { t - 1 } ^ { 1 } ) } \\ & { g _ { t } = \phi ( W * h _ { t } ^ { 1 } + b ) } \\ & { x _ { t } ^ { 2 } = ( \hat { x } _ { t } ^ { 2 } - g _ { t } \odot h _ { t } ^ { 1 } ) \odot 1 / 1 - g _ { t } } \end{array}
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
Ideally, if there is no numerical error during the calculation, we can get the perfect reconstruction of input by applying this inverse operation repeatedly. In practice, while the most of reverse generations are successful, the inevitable numerical error will still result in some failing cases, especially in the case of a very deep architecture because errors will be amplified layer by layer.
|
| 280 |
+
|
| 281 |
+
C OBJECT DETECTION
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 7: Visualization of 2D Object Detection on KITTI.
|
md/train/B1gjs6EtDr/B1gjs6EtDr.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EFFICIENT CONTENT-BASED SPARSE ATTENTION WITH ROUTING TRANSFORMERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Self-attention has recently been adopted for a wide range of sequence modeling problems. Despite its effectiveness, self-attention suffers quadratic compute and memory requirements with respect to sequence length. Successful approaches to reduce this complexity focused on attention to local sliding windows or a small set of locations independent of content. Our work proposes to learn dynamic sparse attention patterns that avoid allocating computation and memory to attend to content unrelated to the query of interest. This work builds upon two lines of research: it combines the modeling flexibility of prior work on content-based sparse attention with the efficiency gains from approaches based on local, temporal sparse attention. Our model, the Routing Transformer, endows self-attention with a sparse routing module based on online $k$ -means while reducing the overall complexity of attention to $O ( n ^ { 1 . 5 } d )$ from $O ( n ^ { 2 } d )$ for sequence length $n$ and hidden dimension $d$ . We show that our model outperforms comparable sparse attention models on language modeling on Wikitext $- 1 0 3$ (15.8 vs 18.3 perplexity) as well as on image generation on ImageNet-64 (3.43 vs 3.44 bits/dim) while using fewer self-attention layers.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative models of sequences have witnessed rapid progress driven by the application of attention to neural networks. In particular, Bahdanau et al. (2014); Cho et al. (2014); Vaswani et al. (2017) relied on attention to drastically improve the state-of-the art in machine translation. Subsequent research (Radford et al., 2018; Devlin et al., 2018; Liu et al., 2019; Yang et al., 2019) demonstrated the power of self-attention in learning powerful representations of language to address several natural language processing tasks. Self-attention also brought impressive progress for generative modeling outside of language, e.g. image (Parmar et al., 2018; Menick and Kalchbrenner, 2018; Child et al., 2019) and music generation (Huang et al., 2018; Child et al., 2019).
|
| 12 |
+
|
| 13 |
+
Self-attention operates over sequences in a step-wise manner: at every time-step, attention assigns an attention weight to each previous input element (representation of past time-steps) and uses these weights to compute the representation of the current time-step as a weighted sum of the past input elements (Vaswani et al., 2017). Self-attention (Shaw et al., 2018) is a particular case of attention (Bahdanau et al., 2014; Chorowski et al., 2015; Luong et al., 2015).
|
| 14 |
+
|
| 15 |
+
Self-attention is commonly used in auto-regressive generative models. These models generate observations step-by-step, modeling the probability of the next symbol given the previously generated ones. At every time step, self-attentive generative models can directly focus on any part of the previous context. In contrast, recurrent neural networks (RNNs) and convolutional neural networks (CNNs) have direct interactions with only a local neighborhood of context around the current time step.
|
| 16 |
+
|
| 17 |
+
This advantage however comes at a price: unlike recurrent networks or convolution networks, the time and space complexity of self-attention is quadratic in $n$ , the length of the sequence. Specifically, for every position $i \leq n$ , self-attention computes weights for its whole context of length $i$ , which induces a complexity of $\textstyle \sum _ { i \leq n } i = n ( n - 1 ) / 2$ . This makes it difficult to scale attention based models to modeling long sequences. However, long sequences are the norm in many domains, including music, image, speech or video generation.
|
| 18 |
+
|
| 19 |
+
Therefore, an important research direction is to investigate sparse and memory efficient forms of attention in order to scale to tasks with long sequence lengths. Previous work has proposed data independent or fixed sparsity patterns bounding temporal dependencies, such as local or strided attention. At each time step, the model attends only to a fix number of time steps in the past (Child et al., 2019). Extensions to local attention have suggested learning the length of the temporal sparsity for each attention module in the network (Sukhbaatar et al., 2019). These strategies draw their inspiration from RNNs and CNNs and bound their complexity by attending only to representations summarizing a local neighborhood of the current time step. Their attention matrices (matrices containing the attention weights for every pair of previous, current time-step) are natively sparse and requires instantiating only non-zero entries. While these approaches have achieved good results, fixing the sparsity pattern of a content based mechanism such as self-attention can limit its ability to pool in information from large contexts.
|
| 20 |
+
|
| 21 |
+
As an alternative to local attention, Correia et al. (2019) considers content-based sparsity, an approach allowing for arbitrary sparsity patterns. This formulation however does require instantiating a full dense attention matrix prior to sparsification through variants of $L _ { 0 }$ -sparsity or sparsemax approximations (Blondel et al., 2019).
|
| 22 |
+
|
| 23 |
+
The present work builds upon these two lines of research and proposes to retain the modeling flexibility of content-based sparse attention while leveraging the efficiency of natively sparse attention matrices. Our formulation avoids sparsemax variants and relies on clustering of attention instead. Each attention module considers a clustering of the space: the current time-step only attends to context belonging to the same cluster. In other word, the current time-step query is routed to a limited number of context through its cluster assignment. This strategy draws inspiration from the application of $k$ -means clustering to Non-negative Matrix Factorization (NMF) (Lee and Seung, 2001; Ding et al., 2005; Kim and Park, 2008), which is relevant to the sparsification of non-negative matrices like attention matrices.
|
| 24 |
+
|
| 25 |
+
Our proposed model, Routing Transformer, combines our efficient clustered-based sparse attention with classical local attention to reach excellent performance both for language and image generation. These results are obtained without the need to maintain attention matrices larger than batch length which is the case with the segment level recurrence mechanism used in Dai et al. (2019); Sukhbaatar et al. (2019). We present experimental results on language modeling (Wikitext $- 1 0 3$ and enwik-8) and unconditional image generation (ImageNet-64). Routing Transformer sets new state-of-the-art while having comparable or fewer number of self-attention layers and heads, both on Wikitext-103 (15.8 vs 18.3 perplexity) and on ImageNet-64 (3.43 vs 3.44 bits/dim). We also report competitive results on enwik-8 (0.99 vs 0.98 perplexity).
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Attention with Temporal Sparsity: Research on efficient attention neural models parallels the advent of attention-based architectures. In the context of speech recognition, Jaitly et al. (2015) proposed the Neural Transducer which segments sequences in non-overlapping chunks and attention is performed in each chunk independently. Limiting attention to a fixed temporal context around the current prediction has also been explored in Chorowski et al. (2015), while Chiu and Raffel (2017) dynamically segment the sequence into variable sized-chunks.
|
| 30 |
+
|
| 31 |
+
Hierarchical attention strategies have also been explored: the model first considers which part of the inputs should be attended to before computing full attention in a contiguous neighborhood of the selected area (Gregor et al., 2015; Xu et al., 2015; Luong et al., 2015). Later, hierarchical attention has been simplified by Liu et al. (2018) that alternates coarse layers (attending to the whole sequence at a lower temporal resolution) with local layers (attending to a neighborhood of the current prediction).
|
| 32 |
+
|
| 33 |
+
This alternating strategy is also employed by Child et al. (2019), which introduces bounded and strided attention, i.e. attending to a fixed context in the past at a subsampled temporal resolution. This work formalizes such a strategy using a sparse attention formalism, showing how it relates to full attention with a specific sparsity pattern in the attention matrix. It shows that sparse attention is sufficient to get state-of-the-art results in modeling long sequences over language modeling, image generation and music generation. Sukhbaatar et al. (2019) builds upon this work and shows that is it is possible to obtain further sparsity by letting the model learn the length of the temporal context for each attention module. This work also makes use of the attention cache introduced in Dai et al. (2019), a memory mechanism to train models over temporal contexts which extend beyond the length of the training batches.
|
| 34 |
+
|
| 35 |
+
Attention with Content-Based Sparsity: The above work mainly relies on two efficient ideas: attending to less elements by only considering a fixed bounded local context in the past, and attending to less elements by decreasing the temporal resolution of context. These ideas do not allow arbitrary sparsity patterns in attention matrices. Content-based sparse attention has been introduced to allow for richer patterns and more expressive models. Martins and Kreutzer (2017); Malaviya et al. (2018) propose to compute attention weights with variants of sparsemax. Correia et al. (2019) generalizes this approach to every layer in a Transformer using entmax which allows for more efficient inference. This line of work allows for learning arbitrary sparsity attention patterns from data, based on the content of the current query and past context. However, sparsity here cannot be leveraged to improve space and time complexity since sparsemax/entmax formulations require instantiating the full attention matrix prior to sparsification. This is a drawback compared to temporal sparsity approaches. Our work is motivated by bridging this gap and allows for arbitrary sparsity patterns while avoiding to instantiate non-zero entries of attention matrices.
|
| 36 |
+
|
| 37 |
+
Sparse Computation beyond Attention: Learning models with sparse representations/activations for saving time and computation has addressed in the past in various context. Previous work often refers to this goal as gating for conditional computation. Gating techniques relying on sampling and straight-through gradient estimators are common (Bengio et al., 2013; Eigen et al., 2013; Cho and Bengio, 2014). Conditional computation can also be addressed with reinforcement learning (Denoyer and Gallinari, 2014; Indurthi et al., 2019). In the domain of language modeling, a related work is the sparsely gated Mixture-of-experts (MOE) (Shazeer et al., 2017) where sparsity is induced by experts and a trainable gating network controls the routing strategy to each sub-network.
|
| 38 |
+
|
| 39 |
+
# 3 SELF-ATTENTIVE AUTO-REGRESSIVE SEQUENCE MODELING
|
| 40 |
+
|
| 41 |
+
Auto-regressive sequence models decompose the probability of a sequence $\mathbf { x } = ( x _ { 1 } , \ldots , x _ { n } )$ as
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
p ( \mathbf { x } ) = \prod _ { i = 1 } ^ { n } p _ { \theta } ( x _ { i + 1 } | \boldsymbol { x } _ { \le i } ) .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
In neural models, the conditional distribution $p _ { \theta } ( x _ { i + 1 } | x _ { \leq i } )$ is modeled by a neural network with learned parameters $\theta$ and these parameters are typically learned to maximize the likelihood of the training data. In particular, Transformer architectures have shown to reach state-of-the-art accuracy in several domains, including language modeling (Vaswani et al., 2017; Radford et al., 2018), image generation (Parmar et al., 2018) and music generation (Huang et al., 2018). Transformer models compose a series of attention modules. Each module refines the input representation by taking a weighted average of the representations from the previous modules.
|
| 48 |
+
|
| 49 |
+
For every module, the input representation is a sequence of $n$ vectors $\mathbf { x } = ( x _ { 1 } , \ldots , x _ { n } )$ from a continuous space of dimension $d$ . Thus one may actually treat the input sequence as a $n \times d$ matrix $X$ . A self-attention layer operates on this representation. It first applies three linear projections,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
Q = X W _ { Q } , \quad K = X W _ { K } , \quad V = X W _ { V } ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $Q , K$ and $V$ are referred to as keys, queries and values, while $W _ { Q } , W _ { K } , W _ { V }$ are learned projection matrices.
|
| 56 |
+
|
| 57 |
+
The key and the query matrices determine the $n \times n$ attention matrix $A = \operatorname { s o f t m a x } \left( Q K ^ { \top } \right)$ , where the softmax operator over matrices denotes that the softmax function has been applied to each row. $A$ may be interpreted as a matrix of weights in $[ 0 , 1 ]$ where $A _ { i j }$ denotes how much query position $i$ at the next layer must pay attention to key position $j$ at the previous layer. In the case of self-attention for auto-regressive models, queries attend only over keys from previous time-steps, i.e.
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
A = \operatorname { s o f t m a x } \left( \operatorname { l t r } ( Q K ^ { \top } ) \right)
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where ltr denotes the lower triangular operator. Given the attention matrix $A$ , the next layer representation $X ^ { \prime }$ is computed simply as $A V$ . In summary,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
X _ { i } ^ { \prime } = \sum _ { j \leq i } ^ { n } A _ { i j } V _ { j } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
In practice, Transformer (Vaswani et al., 2017) adds several extensions to this basic self-attention mechanism. In particular, the result $X ^ { \prime }$ of performing self-attention is scaled by $1 / { \sqrt { d } }$ . Moreover, each layer relies on multiple attention heads, i.e. each layer performs multiple projections onto triplet (queries, keys, values) and attention is performed for each head. The attention results from all heads are then concatenated. This strategy allows each head to specialize on different aspects of the input sequence. In addition, Transformer further processes the result of attention through a learnable non-linear transformation (multi-layer perceptron, mlp) followed by a residual connection and a normalization step, i.e.
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { l c r } { { X ^ { \prime } = \mathrm { l a y e r n o r m } ( X ^ { \prime } + X ) } } \\ { { X ^ { \prime \prime } = \mathrm { l a y e r n o r m } ( \mathrm { m l p } ( X ^ { \prime } ) + X ) , } } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where layernorm denotes the parameterized normalization step from Ba et al. (2016). A full Transformer model is therefore a chain of attention modules (Eq. 6) preceded by an embedding module (learnable representation for symbols and their positions) and followed by a logistic classification module (learnable linear classifier to predict the next symbol).
|
| 76 |
+
|
| 77 |
+
Our work is interested in the application of the Transformer to long sequences, a challenging problem since space and time complexity of attention is quadratic in sequence length $n$ . We describe various approaches to sparse attention including ours in the next section.
|
| 78 |
+
|
| 79 |
+
# 4 EFFICIENT CONTENT-DEPENDENT SPARSE ATTENTION
|
| 80 |
+
|
| 81 |
+
Attention-based models can be problematic for long sequences. For a sequence of length $n$ , the full attention matrix $A$ , as introduced in Section 3, is $n \times n$ -dimensional and can be prohibitive to instantiate. This motivates sparse attention models, i.e. models relying on attention matrices which have a majority of zero entries.
|
| 82 |
+
|
| 83 |
+
For each query, a sparse attention model defines a set of keys which can be attended to. In the following, we introduce the set $S _ { i }$ as the set of key positions that the query at position $i$ can attend to, i.e.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
X _ { i } ^ { \prime } = \sum _ { j \in S _ { i } } A _ { i j } V _ { j } .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
For example, classical causal self attention can attend to every key prior to the current query, which translates to $S _ { i } = \{ j \mid j < i \}$ . Most previous work on attention sparsity defined such sets purely based on positions, independently of actual query and key vectors. For example, local attention (Luong et al., 2015) considers attending only to a $k$ -long time window prior to the current query, $S _ { i } = \bar { \{ j | i - k \leq j < i \} } ,$ . Child et al. (2019) propose block sparse attention where half the heads perform local attention, and half the heads perform strided attention given by $S _ { i } = \{ j \ | \ i - j$ $( \mathrm { m o d } \ k ) = 0 , j < i \}$ . Sukhbaatar et al. (2019) is also a variant of local attention where the cardinality of $| S _ { i } |$ is learned from data with an $L _ { 1 }$ penalty to trade-off sparsity with modeling accuracy.
|
| 90 |
+
|
| 91 |
+
These local attention sparsity variants are effective in practice since correlation between observations naturally decrease with time for many problems. In our experiments, we actually find that local attention is a surprisingly strong baseline in both image generation and language modeling: for e.g., a scaled up ImageTransformer (Parmar et al., 2018) gets 3.48 bits/dim compared to the 3.44 bits/dim reported in (Child et al., 2019). Similarly, scaled up versions of Transformer with local attention and the relative positional encoding scheme of Shaw et al. (2018) are able to get 19.8 perplexity on Wikitext $- 1 0 3$ and 1.10 bits per byte on enwik-8, while the state-of-the-art results using Transformer-XL (Dai et al., 2019) are 18.3 and 0.99 respectively. From an efficiency perspective, local attention is also interesting since sparsity patterns are regular, contiguous in memory and known in advance.
|
| 92 |
+
|
| 93 |
+
In this work, however, we are interested in a more generic formulation of attention sparsity and would like the sparsity pattern to be informed by the data, i.e., $\begin{array} { r } { \boldsymbol { S } = f ( \mathbf { x } ) } \end{array}$ . This approach has several modeling advantages: it can accommodate data without a clear ordering over observations. For temporal data, it can also discover patterns with greater sparsity if some types of queries have a longer lasting effect on future observations than others. Content-based sparse attention should however be carefully implemented if we need to avoid instantiating full attention matrices at any point in time.
|
| 94 |
+
|
| 95 |
+
For instance, Correia et al. (2019) infer sparsity from data but their formulation instantiates a full attention matrix before finding its sparse counterpart. Next section explains how a natively sparse approach can actually be devised inspired by non-negative matrix factorization (NMF).
|
| 96 |
+
|
| 97 |
+
# 4.1 CLUSTER ATTENTION WITH NON-NEGATIVE LOW RANK APPROXIMATIONS
|
| 98 |
+
|
| 99 |
+
For any given $n \times n$ matrix $A$ , a low-rank non-negative approximation to it is of the form $H = F G ^ { \top }$ where $\bar { F , G } \in \mathbb { R } ^ { n \times k }$ and $F , G \geq 0$ . This factorization can be interpreted as follows: $n$ total items are routed to $k$ representatives determined by the attention matrix $F$ , while each of the representative $k$ items perform full attention on the $n$ items determined by matrix $G$ . Therefore, the whole attention matrix passes through a bottleneck of size $k$ .
|
| 100 |
+
|
| 101 |
+
NMF studies algorithms to find such approximations (Tandon and Sra, 2010), for instance minimizing the Frobenius norm,
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
H = \arg \operatorname* { m i n } _ { G ^ { \top } G = I , F , G \geq 0 } \left\| A - F G ^ { \top } \right\| ^ { 2 } .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Different algorithms have been proposed for that problem, with different trade-offs in terms of theoretical guarantees, actual accuracy and efficiency (Lee and Seung, 2001; Hoyer, 2004; Gemulla et al., 2011). In particular, $k$ -means clustering (Lloyd, 1982) has been studied as a tractable approximation to non-negative low-rank matrix factorization problem (Ding et al., 2005; Kim and Park, 2008).
|
| 108 |
+
|
| 109 |
+
This relation between $k$ -means and NMF motivates our work but cannot however be applied directly in our case. In particular, we want to avoid instantiating $A$ before approximating it. Furthermore, although we are interested in low rank sparsity patterns, our application context does not require $H$ itself to be low rank. We therefore propose a simpler strategy where $k$ -means is applied to find the routing pattern, while the attention matrix itself remains full rank. Moreover, our approach maintains a single set of cluster centroids shared across examples, which allows for fast training and inference. We describe this strategy in the next section.
|
| 110 |
+
|
| 111 |
+
# 4.2 ROUTING ATTENTION WITH CLUSTERING
|
| 112 |
+
|
| 113 |
+
Our strategy follows the motivation we delineated in the previous section: we model sparse attention matrices with a low rank sparsity patterns relying on $k$ -means clustering. Our strategy first assigns queries and keys to clusters. Then only queries and keys from the same cluster are considered for attention.
|
| 114 |
+
|
| 115 |
+
Precisely, our model projects keys $K$ and queries $Q$ into a routing matrix $R \in \mathbb { R } ^ { n \times d }$ as follows
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
R = [ Q , K ] \left[ W _ { R } \right]
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $W _ { R }$ is a fixed random orthonormal $d \times d$ routing projection matrix. The vectors of $R$ undergo $k$ -means clustering in order to factorize the full attention matrix. The clustering parameters are the centroid vectors $( \mu _ { 1 } , \cdot \cdot \cdot , \mu _ { k } ) \in \mathbb { R } ^ { k \times d }$ . These parameters are model parameters shared across sequences. There are learned online along with the rest of the parameters, as delineated in Bottou and Bengio (1995). Once cluster membership for each position $i$ in the sequence is determined, we denote with $C _ { i }$ the cluster corresponding to the routing vector $R _ { i }$ . This allows us to define our sparse attention strategy as
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
X _ { i } ^ { \prime } = \sum _ { j \in C _ { i } , j \leq i } A _ { i j } V _ { j }
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $C _ { i }$ denotes the cluster of the vector $R _ { i }$ . In summary, queries are routed to keys belonging to the same cluster. Therefore, our attention sparsity pattern is of rank $k$ , i.e. $F G ^ { \mathsf { T } }$ where $F$ and $G$ are binary matrices denoting cluster memberships of queries and keys respectively. Note that since we route both queries and keys via the routing matrix $R$ , it follows that $F = G$ . It is important to note that this low rank property only concerns the sparsity pattern, while the resulting attention matrix $\operatorname { l t r } ( F G ^ { \top } * A ) = \operatorname { l t r } ( { \dot { F } } F ^ { \top } * { \dot { A } } )$ can however be of higher rank ( $^ *$ denotes element-wise product).
|
| 128 |
+
|
| 129 |
+
As a last technical point, we work with keys and values which are unitary vectors, projecting them onto the unit ball immediately before computing them. This differentiable normalization (Ba et al.,
|
| 130 |
+
|
| 131 |
+
2016) is useful to link cluster memberships with proximity of queries and keys, as outlined below. We also assume that the max norm of $W _ { Q }$ and $W _ { K }$ are close to each other - for more details see Appendix A. This can be enforced by adding an auxiliary loss or by explicitly setting $W _ { Q } = W _ { K }$ . Since $W _ { R }$ is a distance preserving transform, we can write
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { \| R _ { i } - R _ { j } \| ^ { 2 } = \| W _ { R } ( Q _ { i } + K _ { i } ) - W _ { R } ( Q _ { j } + K _ { j } ) \| ^ { 2 } } \\ & { \qquad \gtrapprox \| W _ { R } \| ^ { 2 } \left( \| Q _ { i } - K _ { j } \| ^ { 2 } + \| Q _ { j } - K _ { i } \| ^ { 2 } \right) } \\ & { \qquad = 4 - 2 \left( Q _ { i } ^ { \top } K _ { j } + Q _ { j } ^ { \top } K _ { i } \right) . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Thus, it follows that $\begin{array} { r } { \| R _ { i } - R _ { j } \| \le \varepsilon \Rightarrow Q _ { i } ^ { \top } K _ { j } + Q _ { j } ^ { \top } K _ { i } \ge 2 - \varepsilon ^ { 2 } / 2 } \end{array}$ . This means that, $\| R _ { i } - R _ { j } \| \leq$ $\varepsilon \Rightarrow Q _ { i } ^ { \top } K _ { j } \geq 1 - \varepsilon ^ { 2 } / 4$ . Therefore, when two time steps $i > j$ are assigned the same cluster due to a small $\| R _ { i } - R _ { j } \|$ distance, it also means that their attention weight $Q _ { i } ^ { \top } K _ { j }$ is high. This analysis shows that our clustering routing strategy preserves large attention weights as non-zero entries.
|
| 138 |
+
|
| 139 |
+
Since, we route attention via the matrix $R$ we dub our model Routing Transformer. The computational complexity of this variant of sparse attention is $O ( n k d + n ^ { 2 } d / k )$ . Cluster assignments correspond to the first term, i.e. it compares $n$ routing vectors to all $k$ centroids in a space of size $d$ . Query/key dot products corresponds to the second term, i.e. assuming balanced clusters, each of the $n$ queries is compared to √ $n / k$ in its cluster through a dot product of dimension $d$ . Therefore the optimal choice of $k$ is $\sqrt { n }$ as in Child et al. (2019), thereby reducing overall memory and computational cost to $O \left( n ^ { 1 . 5 } \dot { d } \right)$ instead of $O ( n ^ { 2 } d )$ (Vaswani et al., 2017).
|
| 140 |
+
|
| 141 |
+
In practice, we apply regular online $k$ -means to train the cluster centroids. However, in order to infer balanced routing patterns, we define the sets $C _ { i }$ to be of equal size roughly $n / k \sim \sqrt { n }$ , i.e. for every centroid $\mu _ { i }$ we sort tokens by distance to $\mu _ { i }$ and cluster membership is determined by this threshold (top-k). This strategy is simple and efficient. In particular, it guarantees that all clusters have the same size, which is extremely interesting in terms of computational efficiency on parallel hardware like graphic cards. As a downside, this assignment does not guarantee that each point belongs to a single cluster. In the future, we want to investigate using balanced variants of $k$ -means (Malinen and Fränti, 2014) which is not common in an online setting.
|
| 142 |
+
|
| 143 |
+
# 5 EXPERIMENTS
|
| 144 |
+
|
| 145 |
+
We evaluate our sparse attention model on various generative modeling tasks including text and image generation. The following sections report our results on Wikitext $- 1 0 3$ (Merity et al., 2016), enwik-8 (Mahoney, 2011), as well as ImageNet-64. We find that local attention is a surprisingly strong baseline and that our Routing Transformer outperforms Transformer-XL (Dai et al., 2019) and the Sparse Transformer model of (Child et al., 2019) on all tasks. In all our models, we allocate half the heads to do local attention and the other half to route attention as in Equation 10. We use the Adam optimizer (Kingma and Ba, 2014) with learning rate $2 \times 1 0 ^ { - 4 }$ with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 8$ following the learning rate schedule described in Vaswani et al. (2017).
|
| 146 |
+
|
| 147 |
+
# 5.1 WIKITEXT-103
|
| 148 |
+
|
| 149 |
+
Wikitext-103 (Merity et al., 2016) is a large public benchmark data-set for testing long term dependencies in word-level language models. It contains over 100 million tokens from 28K articles extracted from Wikipedia with an average of 3.6K tokens per article, which makes it a reference data-set to model long-term textual dependencies. We train a 10 layer Routing Transformer with 16 heads using the relative position encoding of Shaw et al. (2018) and with attention and ReLU dropout rate of 0.3 each. For routing attention as in Section 4.2 we choose $k = 1 6$ and attention window to be 256 during both training and evaluation. We describe our results in Table 2 and compare it to other recent work on sparse or recurrent attention such as Adaptive Inputs (Baevski and Auli, 2018) and TransformerXL (Dai et al., 2019) as well as a local attention with relative position encoding baseline (Huang et al., 2018). We find that local attention is a great inductive bias for sparse attention and is better than the adaptive methods proposed in Baevski and Auli (2018); Sukhbaatar et al. (2019). Moreover, our Routing Transformer model is able to get a test perplexity of 15.8 improving on the 18.3 obtained by TransformerXL (Dai et al., 2019) while having fewer self-attention layers, and without the need for segment level recurrence.
|
| 150 |
+
|
| 151 |
+
# 5.2 ENWIK-8
|
| 152 |
+
|
| 153 |
+
The enwik-8 (Mahoney, 2011) is a data-set to benchmark text compression algorithms in the context of the Hutter prize. This data-set consists of the first 100M bytes of unprocessed Wikipedia. It is typically used to evaluate character-level language models. Similar to the prior work of Dai et al. (2019); Child et al. (2019) we use a sequence length $n = 8 1 9 2$ and benchmark our results against various baselines including local attention. We train a 24 layer model with 8 attention heads with an attention and ReLU dropout rate of 0.4 each and using the relative position encoding of Shaw et al. (2018). For routing attention as in Section 4.2 we set $k = 3 2$ and attention window 256. We report perplexity of 0.99 like TransformerXL and Sparse Transformer, slightly under 0.98 from Adaptive Transformer. We show how samples of our model differs from Transformer with local attention in Appendix C.
|
| 154 |
+
|
| 155 |
+
# 5.3 IMAGENET $6 4 \times 6 4$
|
| 156 |
+
|
| 157 |
+
In order to evaluate the ability of our model to capture long term dependencies on a modality other than text, we report results on the ImageNet $6 4 \times 6 4$ data-set as used in Child et al. (2019). For auto-regressive image generation, this data-set consists of images of $6 4 \times 6 4 \times 3$ bytes represented as long sequences of length 12, 288 presented in raster scan, red-green-blue order. We train a 24 layer model with 16 attention heads, with half the heads performing local attention, and the other half routing attention as in Section 3. For routing attention we set $k = 8$ , attention window 2048, batch size 1 and train our model for roughly 70 epochs as in (Child et al., 2019). We compare our model to a scaled-up ImageTransformer model with local attention (Parmar et al., 2018) and the SparseTransformer model of Child et al. (2019).
|
| 158 |
+
|
| 159 |
+
We find that local attention (Parmar et al., 2018) is a strong baseline for image generation, obtaining 3.48 bits/dim when scaled up to 24 layers and 16 heads, compared to later work like Sub-scale Pixel Networks (SPN) (Menick and Kalchbrenner, 2018). Our Routing Transformer model achieves a performance of 3.425 bits/dim (see Table 1) compared to the previous state-of-the-art of 3.437 bits/dim (Child et al., 2019), thereby showing the advantage of the content based sparsity formulation of Section 4.2.
|
| 160 |
+
|
| 161 |
+
Table 1: Results on image generation on ImageNet $6 4 \times 6 4$ in bits/dim.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Model</td><td></td><td></td><td>|Layers|Heads|Bits/dim</td></tr><tr><td>Glow (Kingma and Dhariwal, 2018)</td><td></td><td></td><td>3.81</td></tr><tr><td>PixelCNN(Van den Oord et al., 2016)</td><td></td><td></td><td>3.57</td></tr><tr><td>PixelSNAIL (Chen et al., 2017)</td><td></td><td></td><td>3.52</td></tr><tr><td>SPN (Menick and Kalchbrenner, 2018)</td><td>=</td><td>、</td><td>3.52</td></tr><tr><td>ImageTransformer (Parmar etal., 2018)</td><td>24</td><td>16</td><td>3.48</td></tr><tr><td>Sparse Transformer (Child et al., 2019)</td><td>48</td><td>16</td><td>3.44</td></tr><tr><td>Routing Transformer</td><td>24</td><td>16</td><td>3.43</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 2: Results on language modeling on Wikitext $- 1 0 3$ data-set. Local Transformer refers to Transformer (Vaswani et al., 2017) with relative position encoding (Shaw et al., 2018) together with local attention. Perplexity is reported on the test set.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Model</td><td></td><td></td><td>Layers|Heads|Perplexity</td></tr><tr><td>LSTMs (Grave et al., 2016)</td><td></td><td>=</td><td>40.8</td></tr><tr><td>QRNNs (Merity et al., 2018)</td><td>=</td><td>1</td><td>33.0</td></tr><tr><td>Adaptive Transformer (Sukhbaatar et al., 2019)</td><td>36</td><td>8</td><td>20.6</td></tr><tr><td>Local Transformer</td><td>16</td><td>16</td><td>19.8</td></tr><tr><td>Adaptive Input (Baevski and Auli, 2018)</td><td>16</td><td>16</td><td>18.7</td></tr><tr><td>TransformerXL (Dai et al., 2019)</td><td>18</td><td>16</td><td>18.3</td></tr><tr><td>Routing Transformer</td><td>10</td><td>16</td><td>15.8</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 3: Results on language modeling on enwik-8 data-set. Local Transformer refers to Transformer (Vaswani et al., 2017) with relative position encoding (Shaw et al., 2018) together with local attention. Bits per byte (bpc) is reported on the test set.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model</td><td></td><td></td><td>|Layers |Heads 丨Bits per byte</td></tr><tr><td>T64 (Al-Rfou et al., 2019)</td><td>64</td><td>2</td><td>1.13</td></tr><tr><td>Local Transformer</td><td>24</td><td>8</td><td>1.10</td></tr><tr><td>TransformerXL (Dai et al., 2019)</td><td>24</td><td>8</td><td>0.99</td></tr><tr><td>Sparse Transformer (Child et al., 2019)</td><td>30</td><td>8</td><td>0.99</td></tr><tr><td>Adaptive Transformer (Sukhbaatar et al., 2019)</td><td>24</td><td>8</td><td>0.98</td></tr><tr><td>Routing Transformer</td><td>12</td><td>8</td><td>0.99</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 6 ANALYSIS
|
| 174 |
+
|
| 175 |
+
We evaluate the difference in attention patterns between local and routed attention and compute the Jensen-Shannon divergence between local attention and routed attention for a random subset of heads in our network on the Wikitext-103 data-set. The divergence is computed over the entire sequence length of 4096. We average over 10 runs and all the self-attention layers, and report means and standard deviations of the JSD in Table 4. For mean JSD per layer, see Appendix B. Note that the JSD is always non-negative and is upper-bounded by 0.6931 when computed using the natural logarithm. We observe that the divergence between the different local heads is always very low compared to the divergence between local and routing attention heads, which is almost always very close to the upper-bound of 0.6931. Divergence between different routing attention heads falls somewhere in between, being closer to the upper-bound. This shows that the attention distribution inferred by the routing attention of Section 4.2 is highly non-local in nature and different heads specialize in attending to very different parts of the input.
|
| 176 |
+
|
| 177 |
+
<table><tr><td></td><td></td><td> JSD(localllocal) | JSD(local||routing) | JSD(routingllrouting)</td></tr><tr><td>0.1776±0.0649|0.6044±0.0181</td><td></td><td>0.4181 ± 0.0415</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 4: Jensen-Shannon divergence between the attention distributions of a random local attention head and a random head that routes attention as in Section 3 averaged across all layers on the Wikitext $- 1 0 3$ data-set. We report means and standard deviations computed over 10 runs.
|
| 180 |
+
|
| 181 |
+
# 7 CONCLUSION
|
| 182 |
+
|
| 183 |
+
Transformer models constitutes the state-of-the-art in auto-regressive generative models for sequential data. Their space-time complexity is however quadratic in sequence length, due to their attention modules. Our work proposes a sparse attention model, the Routing Transformer. It relies on contentbased sparse attention motivated by non-negative matrix factorization. Compared with local attention models, it does not require fixed attention patterns but enjoys similar space-time complexity. In contrast with prior work on content-based sparse attention, it does not require computing a full attention matrix but still selects sparsity patterns based on content similarity.
|
| 184 |
+
|
| 185 |
+
Our experiments over text and image generation draw two main conclusions. First, we show that a carefully tuned local attention model establishes a strong baseline on modern benchmark, even compared to recent state-of-the-art models. Second, we show that the Routing Transformer redefines the state-of-the-art in large long sequence benchmarks of Wikitext-103 and ImageNet-64, while being very close to do so on enwik-8 as well. Our analysis also shows that routed attention modules offer complementary attention patterns when compared to local attention.
|
| 186 |
+
|
| 187 |
+
Overall, our work contributes an efficient attention mechanism that applies to the modeling of long sequences and redefines the state of the art for auto-regressive generative modeling. Our approach could prove useful in domains where the inputs are already sparse, such as 3D point clouds, social networks or protein interactions.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones. Character-level language modeling with deeper self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3159–3166, 2019. 8
|
| 192 |
+
|
| 193 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. URL http://arxiv.org/abs/1607.06450. 4, 5
|
| 194 |
+
|
| 195 |
+
Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. arXiv preprint arXiv:1809.10853, 2018. 6, 7
|
| 196 |
+
|
| 197 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. URL http://arxiv.org/abs/ 1409.0473. 1
|
| 198 |
+
|
| 199 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. 3
|
| 200 |
+
|
| 201 |
+
Mathieu Blondel, André F. T. Martins, and Vlad Niculae. Learning classifiers with fenchel-young losses: Generalized entropies, margins, and algorithms. In The 22nd International Conference on Artificial Intelligence and Statistics, AISTATS 2019, 16-18 April 2019, Naha, Okinawa, Japan, pages 606–615, 2019. URL http://proceedings.mlr.press/v89/blondel19a. html. 2
|
| 202 |
+
|
| 203 |
+
Leon Bottou and Yoshua Bengio. Convergence properties of the k-means algorithms. In Advances in neural information processing systems, pages 585–592, 1995. 5
|
| 204 |
+
|
| 205 |
+
Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. arXiv preprint arXiv:1712.09763, 2017. 7
|
| 206 |
+
|
| 207 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. 1, 2, 4, 6, 7, 8
|
| 208 |
+
|
| 209 |
+
Chung-Cheng Chiu and Colin Raffel. Monotonic chunkwise attention. arXiv preprint arXiv:1712.05382, 2017. 2
|
| 210 |
+
|
| 211 |
+
Kyunghyun Cho and Yoshua Bengio. Exponentially increasing the capacity-to-computation ratio for conditional computation in deep learning. arXiv preprint arXiv:1406.7362, 2014. 3
|
| 212 |
+
|
| 213 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. URL http://arxiv.org/abs/1406.1078. 1
|
| 214 |
+
|
| 215 |
+
Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. In Advances in neural information processing systems, pages 577–585, 2015. 1, 2
|
| 216 |
+
|
| 217 |
+
Gonçalo M. Correia, Vlad Niculae, and André F. T. Martins. Adaptively sparse transformers, 2019. 2, 3, 5
|
| 218 |
+
|
| 219 |
+
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. arXiv preprint arXiv:1901.02860, 2019. 2, 3, 4, 6, 7, 8
|
| 220 |
+
|
| 221 |
+
Ludovic Denoyer and Patrick Gallinari. Deep sequential neural network. arXiv preprint arXiv:1410.0510, 2014. 3
|
| 222 |
+
|
| 223 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. 1
|
| 224 |
+
|
| 225 |
+
Chris Ding, Xiaofeng He, and Horst D Simon. On the equivalence of nonnegative matrix factorization and spectral clustering. In Proceedings of the 2005 SIAM International Conference on Data Mining, pages 606–610. SIAM, 2005. 2, 5
|
| 226 |
+
|
| 227 |
+
David Eigen, Marc’Aurelio Ranzato, and Ilya Sutskever. Learning factored representations in a deep mixture of experts. arXiv preprint arXiv:1312.4314, 2013. 3
|
| 228 |
+
|
| 229 |
+
Rainer Gemulla, Erik Nijkamp, Peter J. Haas, and Yannis Sismanis. Large-scale matrix factorization with distributed stochastic gradient descent. In SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’11, 2011. 5
|
| 230 |
+
|
| 231 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016. 7
|
| 232 |
+
|
| 233 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015. 2
|
| 234 |
+
|
| 235 |
+
Patrik O Hoyer. Non-negative matrix factorization with sparseness constraints. Journal of machine learning research, 5(Nov):1457–1469, 2004. 5
|
| 236 |
+
|
| 237 |
+
Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Ian Simon, Curtis Hawthorne, Noam Shazeer, Andrew M Dai, Matthew D Hoffman, Monica Dinculescu, and Douglas Eck. Music transformer: Generating music with long-term structure. 2018. 1, 3, 6
|
| 238 |
+
|
| 239 |
+
Sathish Reddy Indurthi, Insoo Chung, and Sangha Kim. Look harder: A neural machine translation model with hard attention. In Proceedings of the 57th Conference of the Association for Computational Linguistics, pages 3037–3043, 2019. 3
|
| 240 |
+
|
| 241 |
+
Navdeep Jaitly, David Sussillo, Quoc V Le, Oriol Vinyals, Ilya Sutskever, and Samy Bengio. A neural transducer. arXiv preprint arXiv:1511.04868, 2015. 2
|
| 242 |
+
|
| 243 |
+
Jingu Kim and Haesun Park. Sparse nonnegative matrix factorization for clustering. Technical report, Georgia Institute of Technology, 2008. 2, 5
|
| 244 |
+
|
| 245 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980. 6
|
| 246 |
+
|
| 247 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pages 10215–10224, 2018. 7
|
| 248 |
+
|
| 249 |
+
Daniel D Lee and H Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in neural information processing systems, pages 556–562, 2001. 2, 5
|
| 250 |
+
|
| 251 |
+
Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. arXiv preprint arXiv:1801.10198, 2018. 2
|
| 252 |
+
|
| 253 |
+
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. arXiv preprint arXiv:1901.11504, 2019. 1
|
| 254 |
+
|
| 255 |
+
Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2): 129–137, 1982. 5
|
| 256 |
+
|
| 257 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-based neural machine translation. arXiv preprint arXiv:1508.04025, 2015. 1, 2, 4
|
| 258 |
+
|
| 259 |
+
Matt Mahoney. Large text compression benchmark. URL: http://www. mattmahoney. net/text/text. html, 2011. 6, 7
|
| 260 |
+
|
| 261 |
+
Chaitanya Malaviya, Pedro Ferreira, and André F. T. Martins. Sparse and constrained attention for neural machine translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 370–376, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-2059. URL https: //www.aclweb.org/anthology/P18-2059. 3
|
| 262 |
+
|
| 263 |
+
Mikko I Malinen and Pasi Fränti. Balanced k-means for clustering. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pages 32–41. Springer, 2014. 6
|
| 264 |
+
|
| 265 |
+
André F. T. Martins and Julia Kreutzer. Learning what’s easy: Fully differentiable neural easy-first taggers. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 349–362, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1036. URL https://www.aclweb.org/anthology/ D17-1036. 3
|
| 266 |
+
|
| 267 |
+
Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018. 1, 7
|
| 268 |
+
|
| 269 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016. 6
|
| 270 |
+
|
| 271 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An analysis of neural language modeling at multiple scales. arXiv preprint arXiv:1803.08240, 2018. 7
|
| 272 |
+
|
| 273 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018. 1, 3, 4, 7
|
| 274 |
+
|
| 275 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/research-covers/languageunsupervised/language understanding paper. pdf, 2018. 1, 3
|
| 276 |
+
|
| 277 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018. 1, 4, 6, 7, 8
|
| 278 |
+
|
| 279 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017. 3
|
| 280 |
+
|
| 281 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. arXiv preprint arXiv:1905.07799, 2019. 2, 4, 6, 7, 8
|
| 282 |
+
|
| 283 |
+
R. Tandon and S. Sra. Sparse nonnegative matrix approximation: new formulations and algorithms. Technical Report 193, Max Planck Institute for Biological Cybernetics, Tübingen, Germany, September 2010. 5
|
| 284 |
+
|
| 285 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pages 4790–4798, 2016. 7
|
| 286 |
+
|
| 287 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, 2017. URL http: //arxiv.org/abs/1706.03762. 1, 3, 4, 6, 7, 8
|
| 288 |
+
|
| 289 |
+
Kelvin Xu, Jimmy Lei Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. 2
|
| 290 |
+
|
| 291 |
+
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. 1
|
| 292 |
+
|
| 293 |
+
# A MATRIX NORM ANALYSIS
|
| 294 |
+
|
| 295 |
+
In order to formally derive Equation 11, we assume that the linear projection matrices $W _ { Q }$ and $W _ { K }$ used to infer the queries and keys respectively are close to each other in max norm. More precisely, we assume the existence of a $\delta \geq 0$ such that $\left\| W _ { Q } - W _ { K } \right\| _ { \infty } \leq \delta$ . This assumption implies that for any vector $u \in \mathbb { R } ^ { d }$ it holds that:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
u W _ { Q } \leq u W _ { K } + \delta \mathbf { 1 } \left\| u \right\| _ { \infty } ,
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where the inequality is entry-wise and 1 is the vector in $\mathbb { R } ^ { d }$ with all 1’s. In this case we first show that for any pair $i , j$ the queries and keys satisfy the following:
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
\begin{array} { r l } & { ( Q _ { i } - K _ { j } ) ^ { \top } ( Q _ { j } - K _ { i } ) = ( X _ { i } W _ { Q } - X _ { j } W _ { K } ) ^ { \top } ( X _ { j } W _ { Q } - X _ { i } W _ { K } ) } \\ & { \qquad \leq ( \delta { \mathbf { 1 } \| X _ { i } \| _ { \infty } } + ( X _ { i } - X _ { j } ) W _ { K } ) ^ { \top } ( \delta { \mathbf { 1 } \| X _ { j } \| _ { \infty } } - ( X _ { i } - X _ { j } ) W _ { K } ) } \\ & { \qquad \leq \delta ^ { 2 } \| { \mathbf { 1 } \| ^ { 2 } \operatorname* { m a x } \{ \| X _ { i } \| _ { \infty } , \| X _ { j } \| _ { \infty } \} ^ { 2 } } - \| ( X _ { i } - X _ { j } ) W _ { K } \| ^ { 2 } } \end{array}
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
Therefore, for small enough $\delta$ , we get that $( Q _ { i } - Q _ { j } ) ^ { \top } ( Q _ { j } - K _ { i } ) \lessapprox 0$ and so Equation 11 follows:
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\begin{array} { r l } & { \| R _ { i } - R _ { j } \| ^ { 2 } = \| W _ { R } ( Q _ { i } + K _ { i } ) - W _ { R } ( Q _ { j } + K _ { j } ) \| ^ { 2 } } \\ & { \qquad = \| W _ { R } \| ^ { 2 } \left( \| Q _ { i } - K _ { j } \| ^ { 2 } + \| Q _ { j } - K _ { i } \| ^ { 2 } - 2 ( Q _ { i } - K _ { j } ) ^ { \top } ( Q _ { j } - K _ { i } ) \right) } \\ & { \qquad \gtrapprox \| W _ { R } \| ^ { 2 } \left( \| Q _ { i } - K _ { j } \| ^ { 2 } + \| Q _ { j } - K _ { i } \| ^ { 2 } \right) . } \end{array}
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
Note that a special case of this assumption is when $W _ { Q } = W _ { K }$ , i.e. queries and keys are shared, in which case $\delta = 0$ .
|
| 314 |
+
|
| 315 |
+
# B JENSEN-SHANNON DIVERGENCE OF ATTENTION DISTRIBUTIONS
|
| 316 |
+
|
| 317 |
+
In Table 4 we presented the Jensen-Shannon divergence between random local heads and random routing attention heads averaged across the 10 layers of the Routing Transformer model on Wikitext $- 1 0 3$ . Table 5 presents the mean and standard deviations of the JSD per layer instead of averaging them.
|
| 318 |
+
|
| 319 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>JSD(local || local)</td><td rowspan=1 colspan=1> JSD(locallrouting) | JSD(routingllrouting)</td><td rowspan=1 colspan=1> JSD(locallrouting) | JSD(routingllrouting)</td></tr><tr><td rowspan=1 colspan=1>layer0</td><td rowspan=1 colspan=1>0.0038 ± 0.0018</td><td rowspan=1 colspan=1>0.4706 ± 0.0319</td><td rowspan=10 colspan=1>0.1579 ± 0.05760.5820 ± 0.01040.4015 ± 0.01210.4144 ± 0.02640.4191 ± 0.08790.4687 ± 0.04490.5175 ± 0.04690.4350 ± 0.01390.4268 ± 0.02910.3581 ± 0.0019</td></tr><tr><td rowspan=1 colspan=1>layer 1</td><td rowspan=1 colspan=1>0.3071 ± 0.1217</td><td rowspan=1 colspan=1>0.6674 ± 0.0153</td></tr><tr><td rowspan=1 colspan=1>layer2</td><td rowspan=1 colspan=1>0.2164 ± 0.0803</td><td rowspan=1 colspan=1>0.5896 ± 0.0249</td></tr><tr><td rowspan=1 colspan=1>layer3</td><td rowspan=1 colspan=1>0.1163 ± 0.0336</td><td rowspan=2 colspan=1>0.6047 ± 0.01810.6266 ± 0.0062</td></tr><tr><td rowspan=1 colspan=1>layer4</td><td rowspan=1 colspan=1>0.1840 ± 0.0562</td></tr><tr><td rowspan=1 colspan=1>layer5</td><td rowspan=1 colspan=1>0.2284 ± 0.0225</td><td rowspan=2 colspan=1>0.6463 ± 0.01550.6471 ± 0.0040</td></tr><tr><td rowspan=1 colspan=1>layer6</td><td rowspan=1 colspan=1>0.1901 ± 0.0525</td></tr><tr><td rowspan=1 colspan=1>layer7</td><td rowspan=1 colspan=1>0.1566 ± 0.0685</td><td rowspan=1 colspan=1>0.5798 ± 0.0235</td></tr><tr><td rowspan=1 colspan=1>layer8</td><td rowspan=1 colspan=1>0.1638 ± 0.0739</td><td rowspan=1 colspan=1>0.5993 ± 0.0148</td></tr><tr><td rowspan=1 colspan=1>layer9</td><td rowspan=1 colspan=1>0.2095 ± 0.0560</td><td rowspan=1 colspan=1>0.6127 ± 0.0053</td></tr></table>
|
| 320 |
+
|
| 321 |
+
Table 5: Jensen-Shannon divergence between the attention distributions of a random local attention head and a random head that routes attention as in Section 3 per layer on the Wikitext-103 dataset. We report means and standard deviations computed over 10 runs and use the natural logarithm so that divergences are upper-bounded by 0.6931.
|
| 322 |
+
|
| 323 |
+
# C SAMPLES
|
| 324 |
+
|
| 325 |
+
We generate samples from the Routing Transformer model for the task of character level language modeling on the enwik-8 data-set. We compare the generation to that from a Local Transformer model with the same number of self-attention layers and attention heads. For both the models we generate unconditional samples using random sampling with a temperature of 1.0. The generation from the Routing Transformer is in Table 6 while the generation from Local Transformer is in Table 7, with spelling mistakes highlighted in red. Comparing the two samples we see that the Local Transformer makes significantly more spelling mistakes, especially for long words and phrases.
|
| 326 |
+
|
| 327 |
+
<table><tr><td>Modern Least Rule to bon air and dogmatic television articles several systems: expanding the world usually.The story differs,that would its part flex poetry will support the very little able to put the name by oppose the stories and motorcycle transecurity and biggest life, see the guardian article and looks extraction of large story in storage by meanching up biggest among other items. During that time,Nevis had biggest the Very left record of the party's tissues. The London meaning;biggest guardians of the West; in the 198Os and 198Os.The composer Albert Director boards the capture to the beginning. The Son Revised publicity and Revisionism board was way of to enough a descendant the President solely changed from [[Eddie Tellingl], but in fact that assembly was to become common. The President has poor party detonation the decisions; Telling guards [[Pope University of New York]], especially [[Canes CombustionlCanes],and thus [[bankruptcylbankruptcy]] student [Advisor]] include the latter that the swash of its populatiis churches, not in steel [Libertarianism peaceful anti-instancelsave the matter's pieces]],and has been languaged efforts taken in 58,OoO sections of anthropic perimeter. The great precision exists in 2OO4,with an assistant to feature vault on other great Peaceful themes in America, the nose of highly [[artificial rate]]es,the discussions of cause, simply soon because they order to setting out the institution political party activity.As of 2004, anthropology saves them as chiefs derivation from the princess of the Executability can be run all</td></tr><tr><td>down by deriving the executability to understand the scientific additional British family traitirity. These intermediate are unproperly equipped, more unprofitability the officiely competite mass best science fiction between the notion of a brought Executive school. This project proves the materiel of controversy and high-school intervention and thoughts of as specurety. [Danceholding]],one can specure even as the mission to bind its dusting intervention. At its original time, he current in the cost of moral intervention, in an 2OO6 slight, tracement saw for the passagecomic belief between the city and applying its uncurrent binary placement, one applies to specure the [biographylbiographyll of regions, his conserved reference election in the letter the most part of the [Dominicus]]. [Algebraizing theorylAlgebrric]] [[critic]]s,which operate the [[third typelthird]] of uncut in to the [[militity]] of the country,her brother's deduction may not be denying cases of militity. In the period,[[Bninity Memoryll</td></tr><tr><td>plus how [Jewish PhilologylPhilosophyl] with a series of voruments of each other can be defined as part of [[p-cyclic memory]],which have been ruleful out for military conventions and have unknown orders,of their proposition (because of the political magnitude circumference of other classness and [forgeryll). This highly proposing not with a member of [John Hope (fiction)lJohn Hope]]: Their chief acceptance,or that rapidly proposes C-them by bluetooth sentiments another time.The sentence of the [[North American Executive DepartmentlDED]] was did not believe the pocket currently by critic,and the reaction by 2OO4 roughly 400 people and King John Hope was used by the capabalance of other executive organizers in the circumstance of the chief post-John chief of the 3000 pects. Independences improved [North American_powers_turning_ in_the_educationlnorth of the Education]] For throughout the end of [[199O]].After prizes of those of the John Hope,Generic Atempts - from London rivers Genero helped to prevent any anti-country packaging in London.Long term helped by all the Jury before the Council of Zoroastries develop for packet (since [[199Oll) which conspires, anypreventing them,which offered the Native American forces to meet them up them to be referred to unto [[first Friendlsouthwest the first VO]]. The symbol was based on the canon of [[St. Franciscol] that bring through this force,some position of north the Graduate Agency (which constituted a third) or the other medium in the Friend.Military as</td></tr></table>
|
| 328 |
+
|
| 329 |
+
0 ]]oter sonries as refrien ritu] serm host teen serm hostul ritu’; baron, in one ritu’;. Refriendamonium rite host teen confriendamonium in the ritu’s role of ritual resolution. The ritual monitor was baron mentalists for hostilities on the rational series; this river was dubion until the confriendamonitor, emerged with this concept into intermedies in one witnessing. They introduced the series of not confriendamonium (very relief). They continued to increase the time / India’s power down. The ritual production to batted conway choosing by the products of the whole choosing as happens as [[alignment]], and an aircraft happened to the kind. As it returned to the operation of the whole producting the large small scale axis. They were reproduced as logts (intwiting they also affected this drip to the easily life) and our shall materials and provided a relative shallow to the motorum. Batted chirality as to the operations of the ANCUP system material to comment adults was bad, as an invasive shallow to be pressure that the program, the subject of ANCUP has been celebrated, since the easily long easily more commonly functions should easily be proved to prevent and group divisions. Batted chirality from the relative community that the controversies came under the writing community led to the legal revolt From the time and from a program that they had become explicitly especially in the following year. In [[1984]], and depictions of the government by a subject were used, proved by manticians, confering from their structure at [[Mid From Los Angeles|Los Angeles]], disputes control and implementing the programming of Hannibal at least proposionals of the [[dependency of Philharmos and Winds would make control of the protest actress from much of their sources, making any process thates of [[contention]] of channing the column to inland any time where at neardy Rube. Philharmos gives protest to any great b(axis). Namely one of his reigns characterization of unofficial competitive structural did attempt to win some results, myrmonisms, which have been successfully greatly monthly. But Anamos meant that his reasons to his harmonists analog was cold and officials success, quickly denominate a Japanese continued to bring the army various times some full terms of the suffix of an obficial réligious religions were surcessful older in Coloniaas and was set. One London, last names, comprising him to succedulate to him deeper. Over the remarkable Submission was, Submission might be a mussel upon his loyal rebuilding dynasty, a program and young by Coloniaas (erasmol), the troops law, with their humans. Less, Miss missions and Cathar with their significance, the troops led by the massive society of the Holy Roman Holy Mission document in the Coloniaan Committee, hence is headby which the course of Summoniacs, ”Black Writers”, recognizing him the body, Suspense), within the next member of the troops. ;ref name=Cathar Lesson de Les Rise is derived from the 1990s. Suspense that she missed the course of the erasmolents, part of the character in the member of the 1990s Character acted in some of his coar, the 4 bill belonging to the eight members of the member of the 1990s. It was threatened in 1997, and let directly affluencing in saltiming exponents within the study emerge in the 1990s and [[canon]]s working in 1992, and roadly fought in other sections to saltimine races. But failed to thought in the significant shot [[Leibniz]]. (Fulham banned 1990 to 1999, when primitively [[eldest]]), his deadly 299 primitive style of ”Aghai 2001”. Symmonists were silicated by the [[Joey Forces]] and Net. Making the eldest years, he published a finite similar racing, revealed by him a straight just greatly killed beyond a latest-sale public bridge that two great first soundtracking, which ”’Bolumeck Coal”’. ”[[Mononymile]] beginning, Dom., the head of the same racing of him of the eldest day1. Japanese amount in the storm of the sense of Caw celebrated on Monthly appearing instead of cross-music. When overslanding”’ (which during his visual) is raised in both the placement and which different from the storm, recent elements, Bolumeck Winters Sense Miller which runs up raising ameth.;Caj is analogy.
|
md/train/B1l3M64KwB/B1l3M64KwB.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HOW MANY WEIGHTS ARE ENOUGH : CAN TENSOR FACTORIZATION LEARN EFFICIENT POLICIES ?
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep reinforcement learning requires a heavy price in terms of sample efficiency and overparameterization in the neural networks used for function approximation. In this work, we employ tensor factorization in order to learn more compact representations for reinforcement learning policies. We show empirically that in the low-data regime, it is possible to learn online policies with 2 to 10 times less total coefficients, with little to no loss of performance. We also leverage progress in second order optimization, and use the theory of wavelet scattering to further reduce the number of learned coefficients, by foregoing learning the topmost convolutional layer filters altogether. We evaluate our results on the Atari suite against recent baseline algorithms that represent the state-of-the-art in data efficiency, and get comparable results with an order of magnitude gain in weight parsimony.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The successes of reinforcement learning (thereafter ’RL’), and specifically deep RL, come at a heavy computational price. It is well known that achieving human-level performance in domains such as Atari (Sutton & Barto, 2018; Mnih et al., 2013; Hessel et al., 2017) requires hundreds of millions of frames of environment interaction. As such, the problem of sample efficiency in RL is of critical importance. Several tracks of concurrent research are being investigated, and have reduced by orders of magnitude the number of environment interactions required for good performance beyond the previous benchmark of biologically-inspired episodic control methods (Blundell et al., 2016; Pritzel et al., 2017) to a couple hours of human gameplay time (van Hasselt et al., 2019; Kaiser et al., 2019).
|
| 12 |
+
|
| 13 |
+
However, while the data-efficiency of RL methods has seen recent drastic performance gains, the function approximators they use still require millions of learned weights, potentially still leaving them heavily overparameterized. Independently motivated by biological facts like the behavioural readiness of newborn animals, several authors (Gaier & Ha, 2019; Cuccu et al., 2018; Wang et al., 2019) have recently looked at doing away with learning so many weights for RL tasks. Smaller networks not only train faster, but may yet offer another avenue for gains in the form of better generalization (Zhang et al., 2016). Recent work from Gaier & Ha (2019) studies the effect of inductive bias of neural architectures in RL ; they forego training altogether, but transfer networks that only obtain ’better than chance performance on MNIST’. In similar fashion, Wang et al. (2019) investigate the effect of random projections in the restricted setting of imitation learning. Finally, Cuccu et al. (2018) manage human-level performance on the Atari suite using a separate dictionary learning procedure for their features, bypassing the usual end-to-end learning paradigm. The perspective of neural architecture search applied to RL appears difficult, if not computationally inextricable.
|
| 14 |
+
|
| 15 |
+
Concurrently, the study of biologically-inspired models of learning has exhibited two mathematical characterizations that might be critical in explaining how biological learning takes place so efficiently. First, the low-rank properties of learned perceptual manifolds (Chung et al., 2018; 2016) are giving rise to a rich theory borrowing from statistical physics. Second, another well known line of work has identified Gabor filters, and more generally wavelet filter-like structures, in the actual visual cortex of animals (Jones & Palmer, 1987), and linked those to sparsity-promoting methods and dictionary learning (Olshausen & Field, 1996; 1997; Hyvarinen & Hoyer, 2001). But these ¨ breakthroughs have not, so far, been reflected as inductive priors in the shape of modifications in deep RL neural networks architectures, which remain fairly fixed on the Atari domain.
|
| 16 |
+
|
| 17 |
+
Therefore the following questions remain: how parsimonious do function approximators in RL need to be, in order to maintain good performance? And can we be at once sample-efficient and weightefficient ? In this work, we turn to the mathematical theories of tensor factorization (Cichocki et al., 2009), second-order optimization (Amari, 1998; Martens & Grosse, 2015) and wavelet scattering (Mallat, 2011) to answer this question positively and empirically, in a model-free setting.
|
| 18 |
+
|
| 19 |
+
We propose to use these methods in order to save weights and therefore favour convergence of policies:
|
| 20 |
+
|
| 21 |
+
• We replace dense, fully-connected layers with tensor regression layers. • Optionally, we replace the topmost layer in the convolutional architecture with a scattering layer; the deeper convolutional layers are left untouched. • The (positive) impact of second-order optimization is also evaluated.
|
| 22 |
+
|
| 23 |
+
To the best of our knowledge, this is the first time those fields have been combined together in this context, and that tensor factorization is applied to deep RL.
|
| 24 |
+
|
| 25 |
+
# 2 BACKGROUND & RELATED WORK
|
| 26 |
+
|
| 27 |
+
# 2.1 DEEP REINFORCEMENT LEARNING
|
| 28 |
+
|
| 29 |
+
We consider the standard Markov Decision Process framework as in Sutton $\&$ Barto (2018). This setting is characterised by a tuple $\langle S , A , T , R , \gamma \rangle$ , where $S$ is a set of states, $A$ a set of actions, $R$ a reward function that is the immediate, intrinsic desirability of a certain state, $T$ a transition dynamics and $\gamma \in [ 0 , 1 ]$ a discount factor. The purpose of the RL problem is to to find a policy $\pi$ , which represents a mapping from states to a probability distribution over actions, that is optimal, i.e., that maximizes the expected cumulative discounted return $\scriptstyle \sum _ { k = 0 } ^ { \infty } \gamma ^ { k } R _ { t + k + 1 }$ at each state $s _ { t } ~ \in ~ S$ In Q-learning, the policy is given implicitly by acting greedily or $\epsilon$ -greedily with respect to learned action-value functions $\boldsymbol { q } ^ { \pi } ( s , a )$ , that are learned following the Bellman equation. In deep $Q$ -learning, $q _ { \theta }$ becomes parameterized by the weights $\theta$ of a neural network and one minimizes the expected Bellman loss :
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\mathbb { E } \left( R _ { t + 1 } + \gamma _ { t + 1 } \operatorname* { m a x } _ { a ^ { \prime } } q _ { \theta } \left( S _ { t + 1 } , a ^ { \prime } \right) - q _ { \theta } \left( S _ { t } , A _ { t } \right) \right) ^ { 2 }
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
In practice, this is implemented stochastically via uniform sampling of transitions in an experience replay buffer, as is done in the seminal paper Mnih et al. (2013). Several algorithmic refinements to that approach exist. First, Double Q-learning (van Hasselt et al., 2015) proposes to decouple learning between two networks in order to alleviate the Q-value overestimation problem. Second, dueling Q-networks (Wang et al., 2015) explicitly decompose the learning of an action-value function $q _ { \theta } ( s , a )$ as the sum of an action-independent state-value, much like what is traditionally done in policy gradient methods (Sutton & Barto, 2018), implemented via a two-headed neural network architecture. Finally, prioritized RL (Schaul et al., 2015) proposes to replace the uniform sampling of transitions in the experience replay buffer with importance sampling, by prioritizing those transitions that present the most Bellman error (those transitions that are deemed the most ’surprising’ by the agent). Fortunato et al. (2017) use extra weights to learn the variance of the exploration noise in a granular fashion, while Bellemare et al. (2017) propose to learn a full distribution of action-values for each action and state. Combined, those methods form the basis of the Rainbow algorithm in Hessel et al. (2017).
|
| 36 |
+
|
| 37 |
+
# 2.2 TENSOR FACTORIZATION
|
| 38 |
+
|
| 39 |
+
Here we introduce notations and concepts from the tensor factorization literature. An intuition is that the two main decompositions below, $C P$ and Tucker decompositions, can be understood as multilinear algebra analogues of SVD or eigendecomposition.
|
| 40 |
+
|
| 41 |
+
CP decomposition. A tensor $\mathcal { X } \in \mathbb { R } ^ { I _ { 1 } \times I _ { 2 } \times \dots \times I _ { N } }$ , can be decomposed into a sum of $R$ rank-1 tensors, known as the Canonical-Polyadic decomposition, where $R$ is the rank of the decomposition. Its purpose is to find vectors u(1)k , u(2)k , · $\mathbf { u } _ { k } ^ { ( 1 ) } , \mathbf { u } _ { k } ^ { \top { 2 } ) } , \cdots , \mathbf { u } _ { k } ^ { ( N ) }$ , for $k = [ 1 \ldots R ]$ , as well as a vector of weights
|
| 42 |
+
|
| 43 |
+
$\pmb { \lambda } \in \mathbb { R } ^ { R }$ such that:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\mathcal { X } = \sum _ { k = 1 } ^ { R } \underbrace { \lambda _ { k } \mathbf { u } _ { k } ^ { ( 1 ) } \circ \mathbf { u } _ { k } ^ { ( 2 ) } \circ \cdot \cdot \cdot \circ \mathbf { u } _ { k } ^ { ( N ) } } _ { \mathrm { r a n k - 1 ~ c o m p o n e n t s } }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Tucker decomposition. A tensor $\mathcal { X } \in \mathbb { R } ^ { I _ { 1 } \times I _ { 2 } \times \dots \times I _ { N } }$ , can be decomposed into a low rank approximation including a core $\mathcal { G } \in \mathbb { R } ^ { R _ { 1 } \times R _ { 2 } \times \cdots \times R _ { N } }$ and a set of projection factors $\big ( \mathbf { U } ^ { ( 0 ) } , \cdots , \mathbf { U } ^ { ( \bar { N } - 1 ) } \big )$ , with $\mathbf { U } ^ { ( k ) } \in \mathbb { R } ^ { R _ { k } , \hat { I } _ { k } } , k \in \left( 0 , \cdots , N - 1 \right)$ that, when projected along the corresponding dimension of the core, reconstruct the full tensor $\mathcal { X }$ . The tensor in its decomposed form can be written:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\boldsymbol { \mathcal { X } } = \boldsymbol { \mathcal { G } } \times _ { 1 } \mathbf { U } ^ { ( 1 ) } \times _ { 2 } \mathbf { U } ^ { ( 2 ) } \times \cdots \times _ { N } \mathbf { U } ^ { ( N ) } = \left[ \boldsymbol { \mathcal { G } } ; \mathbf { U } ^ { ( 1 ) } , \cdots , \mathbf { U } ^ { ( N ) } \right]
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Tensor regression layer. For two tensors $\begin{array} { r l r l r l } { { \mathcal { X } } } & { { } } & { \in } & { { } } & { \mathbb { R } ^ { K _ { 1 } \times \cdots \times K _ { x } \times I _ { 1 } \times \cdots \times I _ { N } } } \end{array}$ and $\qquad \mathcal { V } \qquad \in$ $\mathbb { R } ^ { I _ { 1 } \times \dots \times I _ { N } \times L _ { 1 } \times \dots \times L _ { y } }$ , we denote by $\begin{array} { r l r } { \langle { \mathcal X } , { \mathcal y } \rangle _ { N } } & { { } \in } & { \mathbb { R } ^ { K _ { 1 } \times \cdots \times K _ { x } \times L _ { 1 } \times \cdots \times L _ { y } } } \end{array}$ the contraction of $\mathcal { X }$ by $\mathcal { V }$ along their $N$ last modes; their generalized inner product is
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\langle \mathcal { X } , \mathcal { Y } \rangle _ { N } = \sum _ { i _ { 1 } = 1 } ^ { I _ { 1 } } \sum _ { i _ { 2 } = 1 } ^ { I _ { 2 } } \cdots \sum _ { i _ { n } = 1 } ^ { I _ { N } } \mathcal { X } _ { \ldots , i _ { 1 } , i _ { 2 } , \ldots , i _ { n } } \mathcal { Y } _ { i _ { 1 } , i _ { 2 } , \ldots , i _ { n } , \ldots }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
This makes it possible to define a tensor regression layer (Kossaifi et al., 2017b) that is differentiable and learnable end-to-end by gradient descent. Let us denote by $\mathcal { X } ~ \in ~ \mathbb { R } ^ { I _ { 1 } \times I _ { 2 } \times \dots \times I _ { N } }$ the input activation tensor for a sample and $\mathbf { y } \in \mathbb { R } ^ { I _ { N } }$ the label vector. A tensor regression layer estimates the regression weight tensor $\mathcal { W } \in { \dot { \mathbb { R } } } ^ { I _ { 1 } \times I _ { 2 } \times \dots \times I _ { N } }$ under a low-rank decomposition. In the case of a Tucker decomposition (as per our experiments) with ranks $( R _ { 1 } , \cdots , R _ { N } )$ , we have :
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathbf { y } = \langle \mathcal { X } , \mathcal { W } \rangle _ { N } + \mathbf { b } \qquad \mathrm { w i t h } \ \mathcal { W } = \mathcal { G } \times _ { 1 } \mathbf { U } ^ { ( 1 ) } \times _ { 2 } \mathbf { U } ^ { ( 2 ) } \cdot \cdot \cdot \times _ { N } \mathbf { U } ^ { ( N ) }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
as $\mathcal { G } \in \mathbb { R } ^ { R _ { 1 } \times \cdots \times R _ { N } }$ , $\mathbf { U } ^ { ( k ) } \in \mathbb { R } ^ { I _ { k } \times R _ { k } }$ for each $k$ in $[ 1 \ldots N ]$ and ${ \bf U } ^ { ( N ) } \in \mathbb { R } ^ { 1 \times R _ { N } }$
|
| 68 |
+
|
| 69 |
+
# 2.3 WAVELET SCATTERING
|
| 70 |
+
|
| 71 |
+
The wavelet scattering transform was originally introduced by Mallat (2011) and Bruna & Mallat (2012) as a non-linear extension to the classical wavelet filter bank decomposition. Its principle is as follows. Denoting by $x \circledast y [ n ]$ the 2-dimensional, circular convolution of two signals $x [ n ]$ and $y [ n ]$ , let us assume that we have pre-defined two wavelet filter banks available $\left\{ \psi _ { \lambda _ { 1 } } ^ { ( 1 ) } [ n ] \right\} _ { \lambda _ { 1 } \in \Lambda _ { 1 } }$ ¶ψ(2)λ2 [n]©λ2∈Λ2 , with $\lambda _ { 1 }$ and $\lambda _ { 2 }$ two frequency indices. These wavelet filters correspond to high frequencies, so we also give ourselves the data of a lowpass filter $\phi _ { J } [ n ]$ . Finally, and by opposition to traditional linear wavelet transforms, we also assume a given nonlinearity $\rho ( t )$ . Then the scattering transform is given by coefficients of order 0,1, and 2, respectively :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r l } { S _ { 0 } x [ n ] = x \circledast \phi _ { J } [ n ] } & { } \\ { S _ { 1 } x \left[ n , \lambda _ { 1 } \right] = \rho \left( x \circledast \psi _ { \lambda _ { 1 } } ^ { ( 1 ) } \right) \circledast \phi _ { J } [ n ] } & { \lambda _ { 1 } \in \Lambda _ { 1 } } \\ { S _ { 2 } x \left[ n , \lambda _ { 1 } , \lambda _ { 2 } \right] = \rho \left( \rho \left( x \circledast \psi _ { \lambda _ { 1 } } ^ { ( 1 ) } \right) \circledast \psi _ { \lambda _ { 2 } } ^ { ( 2 ) } \right) \circledast \phi _ { J } [ n ] } & { \lambda _ { 1 } \in \Lambda _ { 1 } , \lambda _ { 2 } \in \Lambda _ { 2 } \left( \lambda _ { 1 } \right) } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
This can effectively be understood and implemented as a two-layer convolutional neural network whose weights are not learned but rather frozen and given by the coefficients of wavelets $\psi$ and $\phi$ (with Gabor filters as a special case (Mallat, 1998)). The difference with traditional filter banks comes from the iterated modulus/nonlinear activation function applied at each stage, much like in traditional deep learning convolutional neural networks. The generic mathematical definition involves order $n$ iterated scatterings, in the vein of $S _ { i } x$ above, but sometimes restricts nonlinearity $\rho$ to be a modulus function $| \cdot |$ . In practice, the potential of scattering transforms to accelerate learning by providing ready-made convolutional layers has been investigated in Oyallon et al. (2013) and Oyallon et al. (2018) and is a subject of active ongoing research. Scattering will be the second of our weight-saving methods.
|
| 78 |
+
|
| 79 |
+
# 2.4 SECOND ORDER OPTIMIZATION WITH K-FAC
|
| 80 |
+
|
| 81 |
+
While stochastic gradient descent is usually performed purely from gradient observations derived from auto-differentiation, faster, second order optimization methods first multiply the weights’ $\theta$ gradient vector $\nabla _ { \theta }$ by a preconditioning matrix, yielding the weight update $\theta _ { n + 1 } \dot { ~ } \dot { ~ } \dot { ~ } \theta _ { n } - \eta \dot { G } _ { n } ^ { - 1 } \nabla _ { \theta }$ with $\eta$ a step size. In the case of second order methods, the matrix $G _ { n } ^ { - 1 }$ is chosen to act as a tractable iterative approximation to the inverse Hessian or Empirical Fisher Information Matrix (Amari, 1998) of the neural network model in question. Kronecker-factored approximate curvature or K-FAC (Martens $\&$ Grosse, 2015) enforces a Kronecker decomposition of the type $G = A \otimes B$ , with $A$ and $B$ being smaller, architecture-dependent matrices. Unlike the above methods, K-FAC has been applied as a plug-in in the deep RL literature and shown to promote both anytime convergence properties as well as terminal accuracies (Wu et al., 2017).
|
| 82 |
+
|
| 83 |
+
# 3 OBSERVATIONS AND METHODS
|
| 84 |
+
|
| 85 |
+
# 3.1 EXPLORING TRAINED AGENTS
|
| 86 |
+
|
| 87 |
+
Stability of trained dense layers eigenvalues. In order to assess experimentally if tensor factorization can make sense in RL, we investigate the eigenvalues of the dense layers of a deep RL agent. Unlike the traditional supervised learning setting, the input data distribution to RL function approximators shifts as the agent explores its environment; as such, concentration properties of the eigenvalues of the linear layers cannot be guaranteed all the way throughout training. Since conditioning techniques such as batch normalization (Ioffe & Szegedy, 2015) are rarely used in deep RL, this is all the more important. Our experiments (see figure 1) show that the distribution of eigenvalues does not seem to widen significantly, at least during the initial phases of training we care about.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 1: Eigenvalue histograms of the value-based linear layer during training. 50 agent runs dataefficient Rainbow (van Hasselt et al., 2019), of 100,000 steps on the Atari game Road Runner.
|
| 91 |
+
|
| 92 |
+
Furthermore and interestingly, it does not seem to deviate significantly from the one observed at initialization. All together, this suggests there might be some merit in learning low-rank policies.
|
| 93 |
+
|
| 94 |
+
# 3.2 ARCHITECTURAL MODIFICATIONS
|
| 95 |
+
|
| 96 |
+
Baseline. We then proceed to build upon the well-known Rainbow algorithm (Hessel et al., 2017). Rainbow uses a fairly standard shallow convolutional architecture like the seminal DQN paper of Mnih et al. (2013), and is an oft-cited baseline on the Atari suite. In spite of its performance, Rainbow often requires dozens of millions of a single game’s frames in order to perform well. Very recently, a ’data-efficient’ efficient version of Rainbow has been proposed by van Hasselt et al. (2019), with a view to match or beat the latest state-of-the-art results achieved by model-based RL methods. This is achieved with no major change in network architecture, but via a selection of mildly handtuned hyperparameters favouring efficiency against wall-clock running time (see appendix). We do take this as a baseline.
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 2: Our architectural approach consists in replacing hidden layers in deep RL agents with tensor regression (top). Optionally we substitute the topmost convolutional layer with scattering (middle), and combine both methods (bottom).
|
| 100 |
+
|
| 101 |
+
Changes. We modify the architecture of the neural network function approximators used, in accordance with the principles described above, combining them to reflect inductive biases promoting fewer learnable parameters:
|
| 102 |
+
|
| 103 |
+
• We replace the fully-connected, linear layers used in Rainbow and data-efficient Rainbow with tensor regression layers (Kossaifi et al., 2017b) in order to learn low-rank policies (ranks in appendix). We use either the K-FAC second order stochastic optimizer, or the standard ADAM optimizer (Kingma & Ba, 2014). Optimization with K-FAC yields better results ceteris paribus and therefore works to counter performance loss due to using fewer weights. We combine the two methods with various rank (and therefore weight compression) ratios, targetting sensible compression ratios guided by deep learning intuition; and evaluate those on the same subset of Atari games as both van Hasselt et al. (2019); Kaiser et al. (2019). When possible, we replace the first convolutional layer in the approximating neural network with a scattering layer for further gains in terms of learnable weights. In that way, we investigate the impact of not actually learning one of the convolutional layer weights. Deep RL, paradoxically, tends to use shallow network architectures with two or three convolutional layers only, which makes it very fit for scattering methods. But since learned convolutional features discriminate well between high and low rewards, the promise of fully unsupervised scattering layers seems remote, without resorting to further ad-hoc methods like dictionary learning. Therefore we limit ourselves to one-step (one single layer) scatterings.
|
| 104 |
+
|
| 105 |
+
This is illustrated in figure 2. We then proceed to evaluate the merit of these changes.
|
| 106 |
+
|
| 107 |
+
# 4 EXPERIMENTAL RESULTS
|
| 108 |
+
|
| 109 |
+
# 4.1 PRIORITIZED TENSORIZED DQN
|
| 110 |
+
|
| 111 |
+
Proof of concept. We begin with showing proof of concept on the simple Pong Atari game. Our experimental setup consists in our own implementation of prioritized double DQN as a baseline (Schaul et al., 2015; van Hasselt et al., 2015). We replaced the densely connected layer of the original DQN architecture with a tensor regression layer implementing Tucker decomposition for different Tucker ranks, yielding different network compression factors.
|
| 112 |
+
|
| 113 |
+
Qualitative behaviour. First results, both in terms of learning performance and compression factor, can be seen in figure 3. Our two main findings are that first, the final performance of the agent remains unaffected by the tensor factorization, even with high compression rates - with respect to all network weights - of five times. In line with intuition, larger compression rates do however cause more delays in learning. Second, tensor factorization negatively affects stability during training - in tough compression regimes, the plateauing phases of learning curves feature occasional noisy drawdowns, illustrating the increased difficulty of learning, as seen in figure 4. Interestingly, approximation errors incurred by tensor regression noise do sometimes have poor consequences illustrated by those drawdowns, but overall seem to behave as additional exploration noise.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Prioritized tensorized DQN on Atari Pong. Original learning curve versus several learning curves for five different Tucker ranks factorizations and therefore parameter compression rates (3 different random seeds each, with a 30 episodes moving average for legibility). Best viewed in colour.
|
| 119 |
+
Figure 4: Focus on a typical single run of the tensorized DQN learning (score vs. number of thousand episodes). The overall shape of the typical learning curve is preserved, but drawdowns in the plateauing phase do appear.
|
| 120 |
+
|
| 121 |
+
# 4.2 DATA-EFFICIENT RAINBOW ON ATARI
|
| 122 |
+
|
| 123 |
+
Evaluation protocol. For all our Atari experiments, we used OpenAI Gym (Brockman et al., 2016), and a combination of PyTorch (Paszke et al., 2017), TensorLy (Kossaifi et al., 2016) and Kymatio (Andreux et al., 2018) for auto-differentiation. We evaluated our agents in the low-data regime of
|
| 124 |
+
|
| 125 |
+
100,000 steps, on half the games, with 3 different random seeds for reproducibility (Henderson et al., 2017), taking the data-efficient Rainbow agent (van Hasselt et al., 2019) as our baseline. Our specific hyperparameters are described in appendix. We report our results in tables 1 and 2.
|
| 126 |
+
Table 1: Mean episode returns as reported in baselines SimPLe (Kaiser et al., 2019) and data-efficient Rainbow (van Hasselt et al., 2019), versus our agents, on 26 Atari games. ’Denoised’ is the NoisyNet ablation of Rainbow; ’TRL’ shows the performance of the data-efficient Rainbow with tensor regression layers substituted for linear ones.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Game</td><td>SimPLe</td><td>Rainbow</td><td>Denoised</td><td>TRL 2.5x</td><td>TRL 5x</td><td>TRL 10x</td></tr><tr><td>alien</td><td>405</td><td>740</td><td>684</td><td>688</td><td>454</td><td>566</td></tr><tr><td>amidar</td><td>88</td><td>189</td><td>154</td><td>118</td><td>86</td><td>84</td></tr><tr><td>assault</td><td>369</td><td>431</td><td>321</td><td>543</td><td>521</td><td>513</td></tr><tr><td>asterix</td><td>1090</td><td>471</td><td>500</td><td>459</td><td>554</td><td>363</td></tr><tr><td>bank_heist</td><td>8</td><td>51</td><td>77</td><td>59</td><td>134</td><td>42</td></tr><tr><td>battle_zone</td><td>5184</td><td>10125</td><td>9378</td><td>14466</td><td>13466</td><td>5744</td></tr><tr><td>boxing</td><td>9</td><td>0.2</td><td>1</td><td>-2</td><td>-2</td><td>-5</td></tr><tr><td>breakout</td><td>13</td><td>2</td><td>3</td><td>2</td><td>2</td><td>4</td></tr><tr><td>chopper_command</td><td>1247</td><td>862</td><td>1293</td><td>1255</td><td>1243</td><td>1106</td></tr><tr><td>crazy_climber</td><td>39828</td><td>16185</td><td>9977</td><td>3928</td><td>4225</td><td>2340</td></tr><tr><td>demon_attack</td><td>170</td><td>508</td><td>450</td><td>362</td><td>263</td><td>175</td></tr><tr><td>freeway</td><td>20</td><td>28</td><td>28</td><td>26</td><td>25</td><td>24</td></tr><tr><td>frostbite</td><td>255</td><td>867</td><td>1101</td><td>659</td><td>912</td><td>231</td></tr><tr><td>gopher</td><td>771</td><td>349</td><td>391</td><td>278</td><td>255</td><td>396</td></tr><tr><td>hero</td><td>1295</td><td>6857</td><td>3013</td><td>5351</td><td>3732</td><td>3321</td></tr><tr><td> jamesbond</td><td>125</td><td>302</td><td>295</td><td>215</td><td>213</td><td>218</td></tr><tr><td>kangaroo</td><td>323</td><td>779</td><td>1002</td><td>804</td><td>715</td><td>400</td></tr><tr><td>krull</td><td>4540</td><td>2852</td><td>2656</td><td>2333</td><td>2275</td><td>2308</td></tr><tr><td>kung_fu_master</td><td>17257</td><td>14346</td><td>4037</td><td>9392</td><td>4764</td><td>4031</td></tr><tr><td>ms_pacman</td><td>763</td><td>1204</td><td>1053</td><td>818</td><td>838</td><td>517</td></tr><tr><td>pong</td><td>5</td><td>-19</td><td>-20</td><td>-20</td><td>-19</td><td>-21</td></tr><tr><td>private_eye</td><td>58</td><td>98</td><td>100</td><td>51</td><td>100</td><td>1128</td></tr><tr><td>qbert</td><td>560</td><td>1153</td><td>672</td><td>697</td><td>581</td><td>733</td></tr><tr><td>road_runner</td><td>5169.4</td><td>9600</td><td>5426</td><td>6965</td><td>3914</td><td>1319</td></tr><tr><td>seaquest</td><td>371</td><td>354</td><td>387</td><td>345</td><td>350</td><td>287</td></tr><tr><td>up_n_down</td><td>2153</td><td>2877</td><td>5123</td><td>2197</td><td>2302</td><td>2179</td></tr><tr><td colspan="2">Average (vs.Rainbow)</td><td>100%</td><td>118%</td><td>96%</td><td>90%</td><td>71%</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 1 shows proof of concept of the online learning of low-rank policies, with a loss of final performance varying in proportion to the compression in the low-rank linear layers, very much like in the deep learning literature (Kossaifi et al., 2017a;b). The number of coefficients in the original data-efficient Rainbow is of the order of magnitude of 1M and varies depending on the environment and its action-space size. The corresponding tensor regression layer ranks are in appendix, and chosen to target 400k, 200k and $1 0 0 \mathrm { k }$ coefficients respectively. While individual game results tend to decrease monotonously with increasing compression, we observe that they are noisy due to the nature of exploration in RL, and average scores reported correspond to the intuition that performance seems to decrease fast after a certain overparameterization threshold is crossed. To take this noisy character into account, we take care to be conservative and report the average of the final three episodes of the learned policy after 80k, 90k and $1 0 0 \mathrm { k }$ steps, respectively.
|
| 131 |
+
|
| 132 |
+
Denoised baseline. So as to not muddy the discussion and provide fair baselines, we do report on the NoisyNet (Fortunato et al., 2017) ablation of Rainbow (’Denoised’ columns), as the NoisyLinear layer doubles up the number of coefficients required and actually performs worse in our experiments. Its principle is that the variance of exploration noise represents a criticial tradeoff for performance (too little and one stalls, too much and one risks catastrophic updates), so it is sensible to treat it as a parameter to learn. However, in order to decouple both factors of overparametrization and exploration in the discussion of deep RL performance, we simply use a fixed exploration schedule. This denoised exploration baseline is an ablation we can then compare our tensorized methods to.
|
| 133 |
+
|
| 134 |
+
Second-order optimization. We then proceed to assess the impact of second-order optimization in architecture by substituting ADAM optimization for K-FAC, and introducing scattering, in table 2. In spite of our conservative reporting, the efficiency boost from using a second order scheme more than makes up for low-rank approximation error ( $109 \%$ performance) with five times less coefficients than van Hasselt et al. (2019), and learning with a full order of magnitude less coefficients $9 8 \%$ performance) is made possible by the combination of K-FAC and TRL. The results however do show a sharp drop in average performance when scattering is added. Interestingly enough some games perform relatively very well with that method, simultaneously showing proof of viability and of additional work required.
|
| 135 |
+
|
| 136 |
+
Table 2: Mean episode returns of our low-rank agents with second-order optimization and scattering. The Scattering column also includes KFAC optimization and TRL 5x, resulting in around $1 0 \mathrm { x }$ total weights efficiency gains.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Game</td><td>KFAC+Denoised</td><td>KFAC+TRL5x</td><td>KFAC+TRL10x</td><td>Scattering</td></tr><tr><td>alien</td><td>996</td><td>734</td><td>643</td><td>441</td></tr><tr><td>amidar</td><td>163</td><td>101</td><td>98</td><td>84</td></tr><tr><td>assault</td><td>501</td><td>491</td><td>496</td><td>434</td></tr><tr><td>asterix</td><td>537</td><td>549</td><td>526</td><td>502</td></tr><tr><td>bank_heist</td><td>100</td><td>73</td><td>57</td><td>29</td></tr><tr><td>battle_zone</td><td>8622</td><td>15178</td><td>6156</td><td>4311</td></tr><tr><td>boxing</td><td>0</td><td>-4</td><td>-1</td><td>-9</td></tr><tr><td>breakout</td><td>3</td><td>3</td><td>2</td><td>2</td></tr><tr><td>chopper_command</td><td>692</td><td>611</td><td>1302</td><td>441</td></tr><tr><td>crazy_climber</td><td>14242</td><td>12377</td><td>3546</td><td>740</td></tr><tr><td>demon_attack</td><td>582</td><td>434</td><td>318</td><td>692</td></tr><tr><td>freeway</td><td>26</td><td>26</td><td>24</td><td>19</td></tr><tr><td>frostbite</td><td>1760</td><td>718</td><td>1483</td><td>654</td></tr><tr><td>gopher</td><td>363</td><td>341</td><td>265</td><td>172</td></tr><tr><td>hero</td><td>4188</td><td>6284</td><td>4206</td><td>4127</td></tr><tr><td> jamesbond</td><td>263</td><td>327</td><td>217</td><td>48</td></tr><tr><td>kangaroo</td><td>2085</td><td>613</td><td>588</td><td>391</td></tr><tr><td>krull</td><td>2855</td><td>3441</td><td>3392</td><td>772</td></tr><tr><td>kung_fu_master</td><td>8481</td><td>10738</td><td>7357</td><td>233</td></tr><tr><td>ms-pacman</td><td>1137</td><td>920</td><td>867</td><td>613</td></tr><tr><td>pong</td><td>-19.3</td><td>-19</td><td>-19</td><td>-20</td></tr><tr><td>private_eye</td><td>56</td><td>100</td><td>100</td><td>0</td></tr><tr><td>qbert</td><td>731</td><td>520</td><td>538</td><td>475</td></tr><tr><td>road_runner</td><td>4516</td><td>8493</td><td>7224</td><td>1278</td></tr><tr><td>seaquest</td><td>349</td><td>317</td><td>520</td><td>213</td></tr><tr><td>up_n_down</td><td>2557</td><td>2291</td><td>2108</td><td>993</td></tr><tr><td>Average (vs.Rainbow)</td><td>114%</td><td>109%</td><td>98%</td><td>55%</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 5 CONCLUSION
|
| 141 |
+
|
| 142 |
+
We have demonstrated that in the low-data regime, it is possible to leverage biologically plausible characterizations of experience data (namely low-rank properties and wavelet scattering separability) to exhibit architectures that learn policies with an order of magnitude less weights than current state-of-the-art baselines, essentially without loss of performance, and in an online fashion. In particular, this provides a compelling alternative to methods like policy distillation (Rusu et al., 2015; Czarnecki et al., 2019). We do hope that this will lead to even further progress towards sample efficiency and speedy exploration methods. Further work will, first, focus on thorough evaluation and research of scattering architectures in order to achieve further gains, and second investigate additional, orthogonal biologically-friendly research directions such as promoting sparsity via, for instance, $L ^ { 1 }$ regularization. Finally, we are excited by the potential of tensor factorization to offer shared core tensors for policies in multi-task and meta-learning.
|
| 143 |
+
|
| 144 |
+
# REFERENCES
|
| 145 |
+
|
| 146 |
+
Shunichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10:251–276, 1998.
|
| 147 |
+
|
| 148 |
+
M. Andreux, T. Angles, G. Exarchakis, R. Leonarduzzi, G. Rochette, L. Thiry, J. Zarka, S. Mallat, J. anden, E. Belilovsky, J. Bruna, V. Lostanlen, M. J. Hirn, E. Oyallon, S. Zhang, C. Cella, and ´ M. Eickenberg. Kymatio: Scattering Transforms in Python. arXiv e-prints, December 2018.
|
| 149 |
+
|
| 150 |
+
M. G. Bellemare, W. Dabney, and R. Munos. A Distributional Perspective on Reinforcement Learning. arXiv e-prints, July 2017.
|
| 151 |
+
|
| 152 |
+
C. Blundell, B. Uria, A. Pritzel, Y. Li, A. Ruderman, J. Z Leibo, J. Rae, D. Wierstra, and D. Hassabis. Model-Free Episodic Control. arXiv e-prints, June 2016.
|
| 153 |
+
|
| 154 |
+
G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI Gym. arXiv e-prints, June 2016.
|
| 155 |
+
|
| 156 |
+
J. Bruna and S. Mallat. Invariant Scattering Convolution Networks. arXiv e-prints, March 2012.
|
| 157 |
+
|
| 158 |
+
S. Chung, D. D. Lee, and H. Sompolinsky. Linear readout of object manifolds. , 93(6):060301, June 2016. doi: 10.1103/PhysRevE.93.060301.
|
| 159 |
+
|
| 160 |
+
S. Chung, D. D. Lee, and H. Sompolinsky. Classification and Geometry of General Perceptual Manifolds. Physical Review X, 8(3):031003, July 2018. doi: 10.1103/PhysRevX.8.031003.
|
| 161 |
+
|
| 162 |
+
Andrzej Cichocki, Rafal Zdunek, Anh Huy Phan, and Sh. Amari. Nonnegative Matrix and Tensor Factorizations - Applications to Exploratory Multi-way Data Analysis and Blind Source Separation. 2009.
|
| 163 |
+
|
| 164 |
+
G. Cuccu, J. Togelius, and P. Cudre-Mauroux. Playing Atari with Six Neurons. arXiv e-prints, June 2018.
|
| 165 |
+
|
| 166 |
+
W. M. Czarnecki, R. Pascanu, S. Osindero, S. M. Jayakumar, G. Swirszcz, and M. Jaderberg. Distilling Policy Distillation. arXiv e-prints, February 2019.
|
| 167 |
+
|
| 168 |
+
M. Eickenberg, G. Exarchakis, M. Hirn, S. Mallat, and L. Thiry. Solid harmonic wavelet scattering for predictions of molecule properties. , 148(24):241732, June 2018. doi: 10.1063/1.5023798.
|
| 169 |
+
|
| 170 |
+
M. Fortunato, M. Gheshlaghi Azar, B. Piot, J. Menick, I. Osband, A. Graves, V. Mnih, R. Munos, D. Hassabis, O. Pietquin, C. Blundell, and S. Legg. Noisy Networks for Exploration. arXiv e-prints, June 2017.
|
| 171 |
+
|
| 172 |
+
A. Gaier and D. Ha. Weight Agnostic Neural Networks. arXiv e-prints, June 2019.
|
| 173 |
+
|
| 174 |
+
P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup, and D. Meger. Deep Reinforcement Learning that Matters. arXiv e-prints, September 2017.
|
| 175 |
+
|
| 176 |
+
M. Hessel, J. Modayil, H. van Hasselt, T. Schaul, G. Ostrovski, W. Dabney, D. Horgan, B. Piot, M. Azar, and D. Silver. Rainbow: Combining Improvements in Deep Reinforcement Learning. arXiv e-prints, October 2017.
|
| 177 |
+
|
| 178 |
+
Aapo Hyvarinen and Patrik O. Hoyer. A two-layer sparse coding model learns simple and complex¨ cell receptive fields and topography from natural images. Vision Research, 41:2413–2423, 2001.
|
| 179 |
+
|
| 180 |
+
S. Ioffe and C. Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. arXiv e-prints, February 2015.
|
| 181 |
+
|
| 182 |
+
Jeffrey P. Jones and Larry A. Palmer. An evaluation of the two-dimensional gabor filter model of simple receptive fields in cat striate cortex. Journal of neurophysiology, 58 6:1233–58, 1987.
|
| 183 |
+
|
| 184 |
+
L. Kaiser, M. Babaeizadeh, P. Milos, B. Osinski, R. H Campbell, K. Czechowski, D. Erhan, C. Finn, P. Kozakowski, S. Levine, A. Mohiuddin, R. Sepassi, G. Tucker, and H. Michalewski. ModelBased Reinforcement Learning for Atari. arXiv e-prints, March 2019.
|
| 185 |
+
|
| 186 |
+
D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. arXiv e-prints, December 2014.
|
| 187 |
+
J. Kossaifi, Y. Panagakis, A. Anandkumar, and M. Pantic. TensorLy: Tensor Learning in Python. arXiv e-prints, October 2016.
|
| 188 |
+
J. Kossaifi, A. Khanna, Z. C. Lipton, T. Furlanello, and A. Anandkumar. Tensor Contraction Layers for Parsimonious Deep Nets. arXiv e-prints, June 2017a.
|
| 189 |
+
J. Kossaifi, Z. C. Lipton, A. Khanna, T. Furlanello, and A. Anandkumar. Tensor Regression Networks. arXiv e-prints, July 2017b.
|
| 190 |
+
S. Mallat. Group Invariant Scattering. arXiv e-prints, January 2011.
|
| 191 |
+
Stephane Mallat. ´ A Wavelet Tour of Signal Processing. 1998.
|
| 192 |
+
James Martens and Roger B. Grosse. Optimizing neural networks with kronecker-factored approximate curvature. ArXiv, abs/1503.05671, 2015.
|
| 193 |
+
V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing Atari with Deep Reinforcement Learning. arXiv e-prints, December 2013.
|
| 194 |
+
Bruno A. Olshausen and David J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381:607–609, 1996.
|
| 195 |
+
Bruno A. Olshausen and David J. Field. Sparse coding with an overcomplete basis set: A strategy employed by v1? Vision Research, 37:3311–3325, 1997.
|
| 196 |
+
E. Oyallon, S. Mallat, and L. Sifre. Generic Deep Networks with Wavelet Scattering. arXiv e-prints, December 2013.
|
| 197 |
+
E. Oyallon, S. Zagoruyko, G. Huang, N. Komodakis, S. Lacoste-Julien, M. Blaschko, and E. Belilovsky. Scattering Networks for Hybrid Representation Learning. arXiv e-prints, September 2018.
|
| 198 |
+
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.
|
| 199 |
+
A. Pritzel, B. Uria, S. Srinivasan, A. Puigdomenech, O. Vinyals, D. Hassabis, D. Wierstra, and \` C. Blundell. Neural Episodic Control. arXiv e-prints, March 2017.
|
| 200 |
+
A. A. Rusu, S. Gomez Colmenarejo, C. Gulcehre, G. Desjardins, J. Kirkpatrick, R. Pascanu, V. Mnih, K. Kavukcuoglu, and R. Hadsell. Policy Distillation. arXiv e-prints, November 2015.
|
| 201 |
+
T. Schaul, J. Quan, I. Antonoglou, and D. Silver. Prioritized Experience Replay. arXiv e-prints, November 2015.
|
| 202 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, second edition, 2018. URL http://incompleteideas.net/book/the-book-2nd. html.
|
| 203 |
+
H. van Hasselt, A. Guez, and D. Silver. Deep Reinforcement Learning with Double Q-learning. arXiv e-prints, September 2015.
|
| 204 |
+
H. van Hasselt, M. Hessel, and J. Aslanides. When to use parametric models in reinforcement learning? arXiv e-prints, June 2019.
|
| 205 |
+
R. Wang, C. Ciliberto, P. Amadori, and Y. Demiris. Random Expert Distillation: Imitation Learning via Expert Policy Support Estimation. arXiv e-prints, May 2019.
|
| 206 |
+
Z. Wang, T. Schaul, M. Hessel, H. van Hasselt, M. Lanctot, and N. de Freitas. Dueling Network Architectures for Deep Reinforcement Learning. arXiv e-prints, November 2015.
|
| 207 |
+
Y. Wu, E. Mansimov, S. Liao, R. Grosse, and J. Ba. Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation. arXiv e-prints, August 2017.
|
| 208 |
+
C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. arXiv e-prints, November 2016.
|
| 209 |
+
|
| 210 |
+
# A APPENDIX
|
| 211 |
+
|
| 212 |
+
HYPERPARAMETERS AND REPRODUCIBILITY
|
| 213 |
+
|
| 214 |
+
Hyperparameters are as follows. First, our specific architecture-modified hyperparameters:
|
| 215 |
+
|
| 216 |
+
Table 3: Our additional, architecture-specific hyperparameters.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Specific architecture hyperparameters</td><td>Value</td></tr><tr><td>Scattering maximum log-scale J</td><td>3</td></tr><tr><td>Scattering volume width M</td><td>1</td></tr><tr><td>Scattering tensor input shape</td><td>(1,4,84,84)</td></tr><tr><td>Scattering tensor output shape</td><td>(1,16,11,11)</td></tr><tr><td>Scattering type</td><td>Harmonic 3D,see Andreux et al. (2018); Eickenberg et al. (2018)</td></tr><tr><td></td><td>128</td></tr><tr><td>Hidden linear layer rank constraint, 2.5x compression Final linear layer rank constraint, 2.5x compression</td><td>48</td></tr><tr><td>Hidden linear layer rank constraint,5x compression</td><td>32</td></tr><tr><td>Final linear layer rank constraint,5x compression</td><td>48</td></tr><tr><td>Hidden linear layer rank constraint,1Ox compression</td><td>16</td></tr><tr><td>Final linear layer rank constraint,1Ox compression</td><td>10</td></tr><tr><td>KFAC Tikhonov regularization parameter</td><td></td></tr><tr><td>KFAC Update frequency for inverses</td><td>0.1</td></tr><tr><td></td><td>100</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Furthermore, we mirror the Data-Efficient Rainbow van Hasselt et al. (2019) baseline:
|
| 221 |
+
Table 4: Data-efficient Rainbow agent hyperparameters, as per van Hasselt et al. (2019).
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Data-efficient Rainbow hyperparameters</td><td>Value</td></tr><tr><td>Grey-scaling</td><td>True</td></tr><tr><td>Observation down-sampling</td><td>(84,84)</td></tr><tr><td>Frames stacked</td><td>4</td></tr><tr><td>Action repetitions</td><td>4</td></tr><tr><td>Reward clipping</td><td>[-1, 1]</td></tr><tr><td>Terminal on loss of life</td><td>True</td></tr><tr><td>Max frames per episode</td><td>108K</td></tr><tr><td>Update</td><td>Distributional Double Q</td></tr><tr><td>Target network update period*</td><td>every 2000 updates</td></tr><tr><td>Support of Q-distribution</td><td>51 bins</td></tr><tr><td>Discount factor</td><td>0.99</td></tr><tr><td>Minibatch size</td><td>32</td></tr><tr><td>Optimizer</td><td>Adam</td></tr><tr><td>Optimizer: first moment decay</td><td>0.9</td></tr><tr><td>Optimizer: second moment decay</td><td>0.999</td></tr><tr><td>Optimizer: e</td><td>0.00015</td></tr><tr><td>Max gradient norm</td><td>10</td></tr><tr><td>Priority exponent</td><td>0.5</td></tr><tr><td>Priority correction**</td><td>0.4→1</td></tr><tr><td>Hardware</td><td>NVidia 1080TiGPU</td></tr><tr><td>Noisy nets parameter</td><td>0.1</td></tr><tr><td>Training frames</td><td>400,000</td></tr><tr><td>Min replay size for sampling</td><td>1600</td></tr><tr><td>Memory size</td><td>unbounded</td></tr><tr><td>Replay period every</td><td>1 steps</td></tr><tr><td>Multi-step return length</td><td>20</td></tr><tr><td>Q network:channels</td><td>32,64</td></tr><tr><td>Q network: filter size</td><td>5 5,5 5</td></tr><tr><td>Q network: stride</td><td>5,5</td></tr><tr><td>Q network: hidden units</td><td>256</td></tr><tr><td></td><td></td></tr><tr><td>Optimizer: learning rate</td><td>0.0001</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Our codebase is available on request.
|
| 226 |
+
|
| 227 |
+
STANDARD DEVIATIONS FOR SCORE RUNS
|
| 228 |
+
Table 5: Standard deviations across seeds for runs presented Table 1.
|
| 229 |
+
|
| 230 |
+
<table><tr><td>Game</td><td>Denoised</td><td>TRL 2.5x</td><td>TRL 10x</td></tr><tr><td>alien</td><td>684±7</td><td>688 ±123</td><td>566±38</td></tr><tr><td>amidar</td><td>154 ± 21</td><td>118 ±12</td><td>84±15</td></tr><tr><td>assault</td><td>321 ± 224</td><td>543 ± 94</td><td>513± 64</td></tr><tr><td>asterix</td><td>500 ±124</td><td>459 ± 91</td><td>363 ± 66</td></tr><tr><td>bank_heist</td><td>77±23</td><td>59± 22</td><td>42±2</td></tr><tr><td>battle_zone</td><td>9378 ± 2042</td><td>14466 ± 2845</td><td>5744 ± 575</td></tr><tr><td>boxing</td><td>1±2</td><td>-2±1</td><td>-5±1</td></tr><tr><td>breakout</td><td>3 ±1.5</td><td>2±1</td><td>4±0.3</td></tr><tr><td>chopper_command</td><td>1293 ± 445</td><td>1255 ± 215</td><td>1106 ± 124</td></tr><tr><td>crazy_climber</td><td>9977 ± 3744</td><td>3928 ± 221</td><td>2340 ± 595</td></tr><tr><td>demon_attack</td><td>450 ± 49</td><td>362 ± 147</td><td>175±7</td></tr><tr><td>freeway</td><td>28 ±0.6</td><td>26±0</td><td>24 ± 0.5</td></tr><tr><td>frostbite</td><td>1101 ± 355</td><td>659 ± 523</td><td>231±1</td></tr><tr><td>gopher</td><td>391 ± 46</td><td>278 ±39</td><td>396 ± 24</td></tr><tr><td>hero</td><td>3013 ± 90</td><td>5351 ± 1948</td><td>3321 ± 598</td></tr><tr><td> jamesbond</td><td>295±57</td><td>215 ±42</td><td>218 ±22</td></tr><tr><td>kangaroo</td><td>1002 ± 587</td><td>804 ± 289</td><td>400 ± 278</td></tr><tr><td>krull</td><td>2656 ± 180</td><td>2333 ± 309</td><td>2308 ± 268</td></tr><tr><td>kung_fu_master</td><td>4037 ± 2962</td><td>9392 ± 6289</td><td>4031 ± 3068</td></tr><tr><td>ms_pacman</td><td>1053 ±193</td><td>818 ±94</td><td>517 ±38</td></tr><tr><td>pong</td><td>-20 ± 0.4</td><td>-20±0</td><td>-21 ± 0.1</td></tr><tr><td>private_eye</td><td>100±0</td><td>51± 59</td><td>1128 ± 1067</td></tr><tr><td>qbert</td><td>672 ± 144</td><td>697 ± 78</td><td>733 ± 291</td></tr><tr><td>road_runner</td><td>5426 ± 2830</td><td>6965 ± 6569</td><td>1319± 216</td></tr><tr><td>seaquest</td><td>387 ± 24</td><td>345 ± 40</td><td>287±87</td></tr><tr><td>up_n_down</td><td>5123 ± 3146</td><td>2197 ± 231</td><td>2179 ±178</td></tr><tr><td>Game</td><td>KFAC+Denoised</td><td>KFAC+TRL10x</td><td>Scattering</td></tr><tr><td>alien</td><td>996 ± 180</td><td>643 ± 51</td><td>441 ± 90</td></tr><tr><td>amidar</td><td>163 ± 15</td><td>98 ±26</td><td>84 ±11</td></tr><tr><td>assault</td><td>501 ± 85</td><td>496 ±129</td><td>434±304</td></tr><tr><td>asterix</td><td>537 ± 96</td><td>526 ±64</td><td>502 ± 91</td></tr><tr><td>bank_heist</td><td>100 ±14</td><td>57 ± 36</td><td>29 ±13</td></tr><tr><td>battle_zone</td><td>8622 ± 5358</td><td>6156 ± 1951</td><td>4311 ± 1517</td></tr><tr><td>boxing</td><td>0±2</td><td>-1±3</td><td>-9 ±12</td></tr><tr><td>breakout</td><td>3±1</td><td>2±2</td><td>2±0</td></tr><tr><td>chopper_command</td><td>692 ± 81</td><td>1302 ± 328</td><td>441 ± 80</td></tr><tr><td>crazy_climber</td><td>14242 ± 2936</td><td>3546 ±1231</td><td>740 ± 291</td></tr><tr><td>demon_attack</td><td>582 ±130</td><td>318 ±168</td><td>92±232</td></tr><tr><td>freeway</td><td>26±0</td><td>24±0</td><td>19 ±1</td></tr><tr><td>frostbite</td><td>1760 ± 448</td><td>1483 ± 466</td><td>654 ± 709</td></tr><tr><td>gopher</td><td>363 ±4</td><td>265 ± 67</td><td>172 ±3</td></tr><tr><td>hero</td><td>4188 ±1635</td><td>4206 ±1862</td><td>4127 ±1074</td></tr><tr><td>jamesbond</td><td>263 ±22</td><td>217±68</td><td>48±10</td></tr><tr><td>kangaroo</td><td>2085 ± 2055</td><td>588±5</td><td>391±52</td></tr><tr><td>krull</td><td>2855 ± 156</td><td>3392 ± 2205</td><td>772± 560</td></tr><tr><td>kung_fu_master</td><td>8481 ± 8270</td><td>7357 ± 9200</td><td>233± 205</td></tr><tr><td>ms_pacman</td><td>1137 ± 180</td><td>867 ±128</td><td>613 ±159</td></tr><tr><td>pong</td><td>-19 ± 0.6</td><td>-19 ±1</td><td>-20±0</td></tr><tr><td>private_eye</td><td>56±42</td><td>100±0</td><td>0±0</td></tr><tr><td>qbert</td><td>731 ± 256</td><td>538 ±114</td><td>475 ± 161</td></tr><tr><td>road_runner</td><td>4516 ± 2869</td><td>7224±4598</td><td>1278 ±463</td></tr><tr><td>seaquest</td><td>349 ± 63</td><td>520 ±97</td><td>213 ±96</td></tr><tr><td>_n_down</td><td>2557 ± 641</td><td>2108 ± 298</td><td>993 ± 244</td></tr></table>
|
| 231 |
+
|
| 232 |
+
Table 6: Standard deviations across seeds for runs presented Table 2.
|
md/train/BJuWrGW0Z/BJuWrGW0Z.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DYNAMIC NEURAL PROGRAM EMBEDDINGS FOR PRO-GRAM REPAIR
|
| 2 |
+
|
| 3 |
+
Ke Wang∗ University of California Davis, CA 95616, USA kbwang@ucdavis.edu
|
| 4 |
+
|
| 5 |
+
Rishabh Singh Microsoft Research Redmond, WA 98052, USA risin@microsoft.com
|
| 6 |
+
|
| 7 |
+
Zhendong Su University of California Davis, CA 95616, USA su@ucdavis.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Neural program embeddings have shown much promise recently for a variety of program analysis tasks, including program synthesis, program repair, codecompletion, and fault localization. However, most existing program embeddings are based on syntactic features of programs, such as token sequences or abstract syntax trees. Unlike images and text, a program has well-defined semantics that can be difficult to capture by only considering its syntax (i.e. syntactically similar programs can exhibit vastly different run-time behavior), which makes syntaxbased program embeddings fundamentally limited. We propose a novel semantic program embedding that is learned from program execution traces. Our key insight is that program states expressed as sequential tuples of live variable values not only capture program semantics more precisely, but also offer a more natural fit for Recurrent Neural Networks to model. We evaluate different syntactic and semantic program embeddings on the task of classifying the types of errors that students make in their submissions to an introductory programming class and on the CodeHunt education platform. Our evaluation results show that the semantic program embeddings significantly outperform the syntactic program embeddings based on token sequences and abstract syntax trees. In addition, we augment a search-based program repair system with predictions made from our semantic embedding and demonstrate significantly improved search efficiency.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Recent breakthroughs in deep learning techniques for computer vision and natural language processing have led to a growing interest in their applications in programming languages and software engineering. Several well-explored areas include program classification, similarity detection, program repair, and program synthesis. One of the key steps in using neural networks for such tasks is to design suitable program representations for the networks to exploit. Most existing approaches in the neural program analysis literature have used syntax-based program representations. Mou et al. (2016) proposed a convolutional neural network over abstract syntax trees (ASTs) as the program representation to classify programs based on their functionalities and detecting different sorting routines. DeepFix (Gupta et al., 2017), SynFix (Bhatia & Singh, 2016), and sk p (Pu et al., 2016) are recent neural program repair techniques for correcting errors in student programs for MOOC assignments, and they all represent programs as sequences of tokens. Even program synthesis techniques that generate programs as output, such as RobustFill (Devlin et al., 2017), also adopt a token-based program representation for the output decoder. The only exception is Piech et al. (2015), which introduces a novel perspective of representing programs using input-output pairs. However, such representations are too coarse-grained to accurately capture program properties — programs with the same input-output behavior may have very different syntactic characteristics. Consequently, the embeddings learned from input-output pairs are not precise enough for many program analysis tasks.
|
| 16 |
+
|
| 17 |
+
Although these pioneering efforts have made significant contributions to bridge the gap between deep learning techniques and program analysis tasks, syntax-based program representations are fundamentally limited due to the enormous gap between program syntax (i.e. static expression) and semantics (i.e. dynamic execution). This gap can be illustrated as follows. First, when a program is executed at runtime, its statements are almost never interpreted in the order in which the corresponding token sequence is presented to the deep learning models (the only exception being straightline programs, i.e., ones without any control-flow statements). For example, a conditional statement only executes one branch each time, but its token sequence is expressed sequentially as multiple branches. Similarly, when iterating over a looping structure at runtime, it is unclear in which order any two tokens are executed when considering different loop iterations. Second, program dependency (i.e. data and control) is not exploited in token sequences and ASTs despite its essential role in defining program semantics. Figure 2 shows an example using a simple max function. On line 8, the assignment statement means variable max val is data-dependent on item. In addition, the execution of this statement depends on the evaluation of the $i f$ condition on line 7, i.e., max val is also control-dependent on item as well as itself. Third, from a pure program analysis standpoint, the gap between program syntax and semantics is manifested in that similar program syntax may lead to vastly different program semantics. For example, consider the two sorting functions shown in Figure 1. Both functions sort the array via two nested loops, compare the current element to its successor, and swap them if the order is incorrect. However, the two functions implement different algorithms, namely Bubble Sort and Insertion Sort. Therefore minor syntactic discrepancies can lead to significant semantic differences. This intrinsic weakness will be inherited by any deep learning technique that adopts a syntax-based program representation.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Bubble sort and insertion sort (code highlighted in shadow box are the only syntactic differences between the two algorithms). Their execution traces for the input vector $A = [ 8 , 5 , 1 , 4$ , 3]are displayed on the right, where, for brevity, only values for variable A are shown.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Example for illustrating program dependency.
|
| 24 |
+
|
| 25 |
+
Table 1: Variable and state traces obtained by executing function max, given a $\operatorname { \mathrm { { r } } } = [ 1 , 5 , 3 ]$ .
|
| 26 |
+
|
| 27 |
+
<table><tr><td>VariableTrace</td><td>State Trace</td></tr><tr><td></td><td>{max_val : -oo} {max_val : -o,item :⊥}</td></tr><tr><td>{item : 1}</td><td>{max_val : -o,item : 1}</td></tr><tr><td>{max_val : 1}</td><td>{max_val :1, item : 1}</td></tr><tr><td>{item : 5}</td><td>{max_val :1,item:5}</td></tr><tr><td>{max_val : 5}</td><td>{max_val : 5,item : 5}</td></tr><tr><td>{item : 3}</td><td>{max_val : 5,item : 3}</td></tr></table>
|
| 28 |
+
|
| 29 |
+
To tackle this aforementioned fundamental challenge, this paper proposes a novel semantic program embedding that is learned from the program’s runtime behavior, i.e. dynamic program execution traces. We execute a program on a set of test cases and monitor/record the program states comprising of variable valuations. We introduce three approaches to embed these dynamic executions: (1) variable trace embedding — consider each variable independently, (2) state trace embedding — consider sequences of program states, each of which comprises of a set of variable values, and (3) hybrid embedding — incorporate dependencies into individual variable sequences to avoid redundant variable values in program states.
|
| 30 |
+
|
| 31 |
+
Our novel program embeddings address the aforementioned issues with the syntactic program representations. The dynamic program execution traces precisely illustrate the program behaves at runtime, and the values for each variable at each program point precisely models the program semantics. Regarding program dependencies, the dynamic execution traces, expressed as a sequential list of tuples (each of which represents the value of a variable at a certain program point), provides an opportunity for Recurrent Neural Network (RNN) to establish the data dependency and control dependency in the program. By monitoring particular value patterns between interacting variables, the RNN is able to model their relationship, leading to more precise semantic representations.
|
| 32 |
+
|
| 33 |
+
Reed & De Freitas (2015) recently proposed using program traces (as a sequence of actions/statements) for training a neural network to learn to execute an algorithm such as addition or sorting. Their notion of program traces is different from our dynamic execution traces consisting of program states with variable valuations. Our notion offers the following advantages: (1) a sequence of program states can be viewed as a sequence of input-output pairs of each executed statement, in other words, sequences of program states provide more robust information than that from sequences of executed statements, and (2) although a sequence of executed statements follows dynamic execution, it is still represented syntactically, and therefore may not adequately capture program semantics. For example, consider the two sorting algorithms in Figure 1. According to Reed & De Freitas (2015), they will have an identical representation $w . r . t .$ statements that modify the variable A, i.e. a repetition of $A [ j ] = A [ j + 1 ]$ and $A [ j + 1 ] = t m p$ for eight times. Our representation, on the other hand, can capture their semantic differences in terms of program states by also only considering the valuation of the variable A.
|
| 34 |
+
|
| 35 |
+
We have evaluated our dynamic program embeddings in the context of automated program repair. In particular, we use the program embeddings to classify the type of mistakes students made to their programming assignments based on a set of common error patterns (described in the appendix). The dataset for the experiments consists of the programming submissions made to Module 2 assignment in Microsoft-DEV204.1X and two additional problems from the Microsoft CodeHunt platform. The results show that our dynamic embeddings significantly outperform syntax-based program embeddings, including those trained on token sequences and abstract syntax trees. In addition, we show that our dynamic embeddings can be leveraged to significantly improve the efficiency of a searchbased program corrector SARFGEN1 (Wang et al., 2017) (the algorithm is presented in the appendix). More importantly, we believe that our dynamic program embeddings can be useful for many other program analysis tasks, such as program synthesis, fault localization, and similarity detection.
|
| 36 |
+
|
| 37 |
+
To summarize, the main contributions of this paper are: (1) we show the fundamental limitation of representing programs using syntax-level features; (2) we propose dynamic program embeddings learned from runtime execution traces to overcome key issues with syntactic program representations; (3) we evaluate our dynamic program embeddings for predicting common mistake patterns students make in program assignments, and results show that the dynamic program embeddings outperform state-of-the-art syntactic program embeddings; and (4) we show how the dynamic program embeddings can be utilized to improve an existing production program repair system.
|
| 38 |
+
|
| 39 |
+
# 2 BACKGROUND: DYNAMIC PROGRAM ANALYSIS
|
| 40 |
+
|
| 41 |
+
This section briefly reviews dynamic program analysis (Ball, 1999), an influential program analysis technique that lays the foundation for constructing our new program embeddings.
|
| 42 |
+
|
| 43 |
+
Unlike static analysis (Nielson et al., 1999), i.e., the analysis of program source code, dynamic analysis focuses on program executions. An execution is modeled by a set of atomic actions, or events, organized as a trace (or event history). For simplicity, this paper considers sequential executions only (as opposed to parallel executions) which lead to a single sequence of events, specifically, the executions of statements in the program. Detailed information about executions is often not readily available, and separate mechanisms are needed to capture the tracing information. An often adopted approach is to instrument a program’s source code (i.e., by adding additional monitoring code) to record the execution of statements of interest. In particular, those inserted instrumentation statements act as a monitoring window through which the values of variables are inspected. This instrumentation process can occur in a fully automated manner, e.g., a common approach is to traverse a program’s abstract syntax tree and insert “write” statements right after each program statement that causes a side-effect (i.e., changing the values of some variables).
|
| 44 |
+
|
| 45 |
+
Consider the two sorting algorithms depicted in Figure 1. If we assume $A$ to be the only variable of interest and subject to monitoring, we can instrument the two algorithms with Console.WriteLine(A) after each program location in the code whenever $A$ is modified2 (i.e. the lines marked by comments). Given the input vector $A = [ 8 , 5 , 1 , 4 , 3 ]$ , the execution traces of the two sorting routines are shown on the right in Figure 1.
|
| 46 |
+
|
| 47 |
+
One of the key benefits of dynamic analysis is its ability to easily and precisely identify relevant parts of the program that affect execution behavior. As shown in the example above, despite the very similar program syntax of bubble sort and insertion sort, dynamic analysis is able to discover their distinct program semantics by exposing their execution traces. Since understanding program semantics is a central issue in program analysis, dynamic analysis has seen remarkable success over the past several decades and has resulted in many successful program analysis tools such as debuggers, profilers, monitors, or explanation generators.
|
| 48 |
+
|
| 49 |
+
# 3 OVERVIEW OF THE APPROACH
|
| 50 |
+
|
| 51 |
+
We now present an overview of our approach. Given a program and the execution traces extracted for all its variables, we introduce three neural network models to learn dynamic program embeddings. To demonstrate the utility of these embeddings, we apply them to predict common error patterns (detailed in Section 5) that students make in their submissions to an online introductory programming course.
|
| 52 |
+
|
| 53 |
+
Variable Trace Embedding As shown in Table 1, each row denotes a new program point where a variable gets updated.3 The entire variable trace consists of those variable values at all program points. As a subsequent step, we split the complete trace into a list of sub-traces (one for each variable). We use one single RNN to encode each sub-trace independently and then perform max pooling on the final states of the same RNN to obtain the program embedding. Finally, we add a one layer softmax regression to make the predictions. The entire workflow is show in Figure 3.
|
| 54 |
+
|
| 55 |
+
State Trace Embedding Because each variable trace is handled individually in the previous approach, variable dependencies/interactions are not precisely captured. To address this issue, we propose the state trace embedding. As depicted in Table 1, each program point $l$ introduces a new program state expressed by the latest variable valuations at $l$ . The entire state trace is a sequence of program states. To learn the state trace embedding, we first use one RNN to encode each program state (i.e., a tuple of values) and feed the resulting RNN states as a sequence to another RNN. Note that we do not assume that the order in which variables values are encoded by the RNN for each program state but rather maintain a consistent order throughout all program states for a given trace. Finally, we feed a softmax regression layer with the final state of the second RNN (shown in Figure 4). The benefit of state trace embedding is its ability to capture dependencies among variables in each program state as well as the relationship among program states.
|
| 56 |
+
|
| 57 |
+
Dependency Enforcement for Variable Trace Embedding Although state trace embedding can better capture program dependencies, it also comes with some challenges, the most significant of which is redundancy. Consider a looping structure in a program. During an iteration, whenever one variable gets modified, a new program state will be created containing the values of all variables, even of those unmodified by the loop. This issue becomes more severe for loops with larger numbers of iterations. To tackle this challenge, we propose the third and final approach, dependency enforcement for variable trace embedding (hereinafter referred as dependency enforcement embedding), that combines the advantages of variable trace embedding (i.e., compact representation of execution traces) and state trace embedding (i.e., precise capturing of program dependencies). In dependency enforcement embedding, a program is represented by separate variable traces, with each variable being handled by a different RNN. In order to enforce program dependencies, the hidden states from different RNNs will be interleaved in a way that simulates the needed data and control dependencies. Unlike variable trace embedding, we perform an average pooling on the final states of all RNNs to obtain the program embedding on which we build the final layer of softmax regression. Figure 5 describes the workflow.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: Variable trace for program embedding.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 4: State trace for program embedding.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 5: Dependency enforcement embedding. Dotted lines denoted dependencies.
|
| 67 |
+
|
| 68 |
+
# 4 DYNAMIC PROGRAM EMBEDDINGS
|
| 69 |
+
|
| 70 |
+
We now formally define the three program embedding models.
|
| 71 |
+
|
| 72 |
+
# 4.1 VARIABLE TRACE MODEL
|
| 73 |
+
|
| 74 |
+
Given a program $P$ , and its variable set $V \left( v _ { 0 } , v _ { 1 } , . . . , v _ { n } \in V \right)$ , a variable trace is a sequence of values a variable has been assigned during the execution of $P$ .4 Let $x _ { t _ { - } v _ { n } }$ denote the value from the variable trace of $v _ { n }$ that is fed to the RNN encoder (Gated Recurrent Unit) at time $t$ as the input, and $h _ { t _ { - } v _ { n } }$ as the resulting RNN’s hidden state. We compute the variable trace embedding for $P$ in Equation (3) as follows $( h _ { T _ { - } v _ { n } }$ denotes the last hidden state of the encoder):
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
{ \begin{array} { r l r l } { h _ { t . v _ { 1 } } = \operatorname { G R U } ( h _ { t - 1 . v _ { 1 } } , x _ { t . v _ { 1 } } ) \qquad } & { ( 1 ) \qquad } & & { } \\ & { \qquad \cdots \qquad } & & { } \\ { h _ { t . v _ { n } } = \operatorname { G R U } ( h _ { t - 1 . v _ { n } } , x _ { t . v _ { n } } ) \qquad } & { ( 2 ) \qquad } & & { \operatorname { E v i d e n c e } = ( \operatorname { W } h _ { P } + b ) } \\ & { h _ { P } = \operatorname { M a x P o o l i n g } ( h _ { T . v _ { 1 } } , \ldots , h _ { T . v _ { n } } ) } & { ( 3 ) \qquad } & & { \operatorname { Y } = \operatorname { s o f t m a x } ( \operatorname { E v i d e n c e } ) } \end{array} }
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
We compute the representation of the program trace by performing max pooling over the last hidden state representation of each variable trace embedding. The hidden states $h _ { t _ { - } v _ { 1 } }$ , . . . , $h _ { t . v _ { n } } , h _ { P } \in \mathbb { R } ^ { k }$ where $k$ denotes the size of hidden layers of the RNN encoder. Evidence denotes the output of a linear model through the program embedding vector $h _ { P }$ , and we obtain the predicted error pattern class $Y$ by using a softmax operation.
|
| 81 |
+
|
| 82 |
+
# 4.2 STATE TRACE MODEL
|
| 83 |
+
|
| 84 |
+
The key idea in state trace model is to embed each program state as a numerical vector first and then feed all program state embeddings as a sequence to another RNN encoder to obtain the program embedding. Suppose $x _ { t _ { - } v _ { n } }$ is the value of variable $v _ { n }$ at $t$ -th program state, and $h _ { t _ { - } v _ { n } }$ is the resulting hidden state of the program state encoder. Equation (8) computes the $t { \cdot }$ -th program state embedding. Equations (9-11) encode the sequence of all program state embeddings (i.e., $h _ { t _ { - } v _ { n } }$ , $h _ { t + 1 - v _ { n } }$ , . . . , $h _ { t + m _ { - } v _ { n } } )$ with another RNN to compute the program embedding.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r l } & { h _ { t _ { - } v _ { 1 } } = \mathrm { G R U } ( h _ { t _ { - } v _ { 0 } } , x _ { t _ { - } v _ { 1 } } ) } \\ & { h _ { t _ { - } v _ { 2 } } = \mathrm { G R U } ( h _ { t _ { - } v _ { 1 } } , x _ { t _ { - } v _ { 2 } } ) } \\ & { \qquad \cdots } \\ & { h _ { t _ { - } v _ { n } } = \mathrm { G R U } ( h _ { t _ { - } v _ { n - 1 } } , x _ { t _ { - } v _ { n } } ) } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } & { ~ h _ { t _ { - } v _ { n } } ^ { \prime } = \mathrm { { G R U } } ( h _ { t - 1 . v _ { n } } ^ { \prime } , h _ { t . v _ { n } } ) } \\ & { h _ { t + 1 . v _ { n } } ^ { \prime } = { \mathrm { G R U } } ( h _ { t . v _ { n } } ^ { \prime } , h _ { t + 1 . v _ { n } } ) } \\ & { ~ \cdots } \\ & { ~ h _ { P } = \mathrm { { G R U } } ( h _ { t + m - 1 . v _ { n } } ^ { \prime } , x _ { t + m . v _ { n } } ) } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$h _ { t _ { - } v _ { 1 } }$ , . . . , $h _ { t _ { - } v _ { n } } \in \mathbb { R } ^ { k _ { 1 } }$ ; $h _ { t _ { - } v _ { n } } ^ { \prime }$ , . . . , $\boldsymbol { h } _ { P } \in \mathbb { R } ^ { k _ { 2 } }$ where $k _ { 1 }$ and $k _ { 2 }$ denote, respectively, the sizes of hidden layers of the first and second RNN encoders.
|
| 95 |
+
|
| 96 |
+
# 4.3 DEPENDENCY ENFORCEMENT FOR VARIABLE TRACE EMBEDDING
|
| 97 |
+
|
| 98 |
+
The motivation behind this model is to combine the advantages of the previous two approaches, i.e. representing the execution trace compactly while enforcing the dependency relationship among variables as much as possible. In this model, each variable trace is handled with a different RNN. A potential issue to be addressed is variable matching/renaming (i.e., $\alpha$ -renaming). In other words same variables may be named differently in different programs. Processing each variable id with a single RNN among all programs in the dataset will not only cause memory issues, but more importantly the loss of precision. Our solution is to (1) execute all programs to collect traces for all variables, (2) perform dynamic time wrapping (Vintsyuk, 1968) on the variable traces across all programs to find the top- $\mathbf { \nabla } \cdot n$ most used variables that account for the vast majority of variable usage, and (3) rename the top- $^ n$ most used variables consistently across all programs, and rename all other variables to a same special variable.
|
| 99 |
+
|
| 100 |
+
Given the same set of variables among all programs, the mechanism of dependency enforcement on the top ones is to fuse the hidden states of multiple RNNs based on how a new value of a variable is produced. For example, in Figure 2 at line 8, the new value of max val is data-dependent on item, and control-dependent on both item and itself. So at the time step when the new value of max val is produced, the latest hidden states of the RNNs encode variable item as well as itself; they together determine the previous state of the RNN upon which the new value of max val is produced. If a value is produced without any dependencies, this mechanism will not take effect. In other words, the RNN will act normally to handle data sequences on its own. In this work we enforce the data-dependency in assignment statement, declaration statement and method calls; and control-dependency in control statements such as $i f$ , for and while statements. Equations (11 and 12) expose the inner workflow. $h _ { L T _ { - } v _ { m } }$ denotes the latest hidden state of the RNN encoding variable trace of $v _ { m }$ up to the point of time $t$ when $x _ { t _ { - } v _ { n } }$ is the input of the RNN encoding variable trace of $v _ { n }$ . $\odot$ denotes element-wise matrix product.
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l } { h _ { t - 1 . v _ { n } } = h _ { L T . v _ { 1 } } \odot h _ { L T . v _ { m } } \odot h _ { L T . v _ { n } } \quad } & { \mathrm { G i v e n ~ } v _ { n } \mathrm { ~ d e p e n d s ~ o n ~ } v _ { 1 } \mathrm { ~ a n d ~ } v _ { m } } \\ { h _ { t . v _ { n } } = \mathrm { G R U } ( h _ { t - 1 . v _ { n } } , x _ { t . v _ { n } } ) \qquad ( 1 2 ) \quad } & { h _ { P } = \mathrm { A v e r a g e P o o l i n g } ( h _ { T . v _ { 1 } } , . . . , h _ { T . v _ { n } } ) } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
# 5 EVALUATION
|
| 107 |
+
|
| 108 |
+
We train our dynamic program embeddings on the programming submissions obtained from Assignment 2 from Microsoft-DEV204.1X: “Introduction to C#” offered on edx and two other problems on Microsoft CodeHunt platform.
|
| 109 |
+
|
| 110 |
+
• Print Chessboard: Print the chessboard pattern using “X” and “O” to represent the squares as shown in Figure 6.
|
| 111 |
+
• Count Parentheses: Count the depth of nesting parentheses in a given string.
|
| 112 |
+
• Generate Binary Digits: Generate the string of binary digits for a given integer.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 6: The desired output for the chessboard exercise.
|
| 116 |
+
|
| 117 |
+
Regarding the three programming problems, the errors students made in their submissions can be roughly classified into low-level technical issues (e.g., list indexing, branching conditions or looping bounds) and high-level conceptual issues (e.g., mishandling corner case, misunderstanding problem requirement or misconceptions on the underlying data structure of test inputs).5
|
| 118 |
+
|
| 119 |
+
In order to have sufficient data for training our models to predict the error patterns, we (1) convert each incorrect program into multiple programs such that each new program will have only one error, and (2) mutate all the correct programs to generate synthetic incorrect programs such that they exhibit similar errors that students made in real program submissions. These two steps allow us to set up a dataset depicted in Table 2. Based on the same set of training data, we evaluate the dynamic embeddings trained with the three network models and compare them with the syntax-based program embeddings (on the same error prediction task) on the same testing data. The syntax-based models include (1) one trained with a RNN that encodes the run-time syntactic traces of programs (Reed & De Freitas, 2015); (2) another trained with a RNN that encodes token sequences of programs; and (3) the third trained with a RNN on abstract syntax trees of programs (Socher et al., 2013).
|
| 120 |
+
|
| 121 |
+
Table 2: Dataset for experimental evaluation.
|
| 122 |
+
|
| 123 |
+
<table><tr><td rowspan=2 colspan=1>Problem</td><td rowspan=1 colspan=2>Program Submissions</td><td rowspan=1 colspan=3>Synthetic Data</td></tr><tr><td rowspan=1 colspan=1>Correct</td><td rowspan=1 colspan=1>Incorrect</td><td rowspan=1 colspan=1>Training</td><td rowspan=1 colspan=1>Validation</td><td rowspan=1 colspan=1>Testing</td></tr><tr><td rowspan=1 colspan=1>Print Chessboard</td><td rowspan=1 colspan=1>2,281</td><td rowspan=1 colspan=1>742</td><td rowspan=1 colspan=1>120K</td><td rowspan=1 colspan=1>13K</td><td rowspan=1 colspan=1>15K</td></tr><tr><td rowspan=1 colspan=1>Count Parentheses</td><td rowspan=1 colspan=1>505</td><td rowspan=1 colspan=1>315</td><td rowspan=1 colspan=1>20K</td><td rowspan=1 colspan=1>2K</td><td rowspan=1 colspan=1>2K</td></tr><tr><td rowspan=1 colspan=1>GenerateBinary Digits</td><td rowspan=1 colspan=1>518</td><td rowspan=1 colspan=1>371</td><td rowspan=1 colspan=1>22K</td><td rowspan=1 colspan=1>3K</td><td rowspan=1 colspan=1>2K</td></tr></table>
|
| 124 |
+
|
| 125 |
+
All models are implemented in TensorFlow. All encoders in each of the trace model have two stacked GRU layers with 200 hidden units in each layer except that the state encoder in the state trace model has one single layer of 100 hidden units. We adopt random initialization for weight initialization. Our vocabulary has 5,568 unique tokens (i.e., the values of all variables at each time step), each of which is embedded into a 100-dimensional vector. All networks are trained using the Adam optimizer (Kingma & Ba, 2014) with the learning and the decay rates set to their default values (learning rate $= 0 . 0 0 0 1$ , beta1 $= 0 . 9$ , bet $1 2 = 0 . 9 9 9$ ) and a mini-batch size of 500. For the variable trace and dependency enforcement models, each trace is padded to have the same length across each batch; for the state trace model, both the number of variables in each program state as well as the length of the entire state trace are padded.
|
| 126 |
+
|
| 127 |
+
During the training of the dependency enforcement model, we have observed that when dependencies become complex, the network suffers from optimization issues, such as diminishing and exploding gradients. This is likely due to the complex nature of fusing hidden states among RNNs, echoing the errors back and forth through the network. We resolve this issue by truncating each trace into multiple sub-sequences and only back-propagate on the last sub-sequence while only feedforwarding on the rest. Regarding the baseline network trained on syntactic traces/token sequences, we use the same encoder architecture (i.e., two layer GRU of 200 hidden units) processing the same 100-dimension embedding vector for each statement/token. As for the AST model, we learn an embedding (100-dimension) for each type of the syntax node by propagating the leaf (a simple look up) to the root through the learned production rules. Finally, we use the root embeddings to represent programs.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Programming Problem</td><td>Variable Trace</td><td> State Trace</td><td>Dependency Enforcement</td><td>Run-Time Syntactic Trace</td><td>Token</td><td>AST</td></tr><tr><td>Print Chessboard</td><td>93.9%</td><td>95.3%</td><td>99.3%</td><td>26.3%</td><td>16.8%</td><td>16.2%</td></tr><tr><td>Count Parentheses</td><td>92.7%</td><td>93.8%</td><td>98.8%</td><td>25.5%</td><td>19.3%</td><td>21.7%</td></tr><tr><td>Generate Binary Digits</td><td>92.1%</td><td>94.5%</td><td>99.2%</td><td>23.8%</td><td>21.2%</td><td>20.9%</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 3: Comparing dynamic program embeddings with syntax-based program embedding in predicting common error patterns made by students.
|
| 132 |
+
|
| 133 |
+
As shown in Table 3, our embeddings trained on execution traces significantly outperform those trained on program syntax (greater than $9 2 \%$ accuracy compared to less than $2 7 \%$ for syntax-based embeddings). We conjecture this is because of the fact that minor syntactic discrepancies can lead to major semantic differences as shown in Figure 1. In our dataset, there are a large number of programs with distinct labels that differ by only a few number of tokens or AST nodes, which causes difficulty for the syntax models to generalize. Even for the simpler syntax-level errors, they are buried in large number of other syntactic variations and the size of the training dataset is relatively small for the syntax-based models to learn precise patterns. In contrast, dynamic embeddings are able to canonicalize the syntactical variations and pinpoint the underlying semantic differences, which results in the trace-based models learning the correct error patterns more effectively even with relatively smaller size of the training data.
|
| 134 |
+
|
| 135 |
+
In addition, we incorporated our dynamic program embeddings into SARFGEN (Wang et al., 2017) — a program repair system — to demonstrate their benefit in producing fixes to correct students errors in programming assignments. Given a set of potential repair candidates, SARFGEN uses an enumerative search-based technique to find minimal changes to an incorrect program. We use the dynamic embeddings to learn a distribution over the corrections to prioritize the search for the repair algorithm.6 To establish the baseline, we obtain the set of all corrections from SARFGEN for each of the real incorrect program to all three problems and enumerate each subset until we find the minimum fixes. On the contrary, we also run another experiment where we prioritize each correction according to the prediction of errors with the dynamic embeddings. It is worth mentioning that one incorrect program may be caused by multiple errors. Therefore, we only predict the top-1 error each time and repair the program with the corresponding corrections. If the program is still incorrect, we repeat this procedure till the program is fixed. The comparison between the two approaches is based on how long it takes them to repair the programs.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Number of Fixes</td><td>Enumerative Search</td><td>Variable Trace Embeddings</td><td>State Trace Embeddings</td><td>Dependency Enforcement Embeddings</td></tr><tr><td>1-2</td><td>3.8</td><td>2.5</td><td>2.8</td><td>3.3</td></tr><tr><td>3-5</td><td>44.7</td><td>3.6</td><td>3.1</td><td>4.1</td></tr><tr><td>6-7</td><td>95.9</td><td>4.2</td><td>3.6</td><td>4.5</td></tr><tr><td>≥8</td><td>128.3</td><td>41.6</td><td>49.5</td><td>38.8</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 4: Comparing the enumerative search with those guided by dynamic program embeddings in finding the minimum fixes. Time is measured in seconds.
|
| 140 |
+
|
| 141 |
+
As shown in Table 4, the more fixes required, the more speedups dynamic program embeddings yield — more than an order of magnitude speedups when the number of fixes is four or greater. When the number of fixes is greater than seven, the performance gain drops significantly due to poor prediction accuracy for programs with too many errors. In other words, our dynamic embeddings are not viewed by the network as capturing incorrect execution traces, but rather new execution traces. Therefore, the predictions become unreliable. Note that we ignored incorrect programs having greater than 10 errors when most experiments run out of memory for the baseline approach.
|
| 142 |
+
|
| 143 |
+
# 6 RELATED WORK
|
| 144 |
+
|
| 145 |
+
There has been significant recent interest in learning neural program representations for various applications, such as program induction and synthesis, program repair, and program completion. Specifically for neural program repair techniques, none of the existing techniques, such as DeepFix (Gupta et al., 2017), SynFix (Bhatia & Singh, 2016) and sk p $\mathrm { P u }$ et al., 2016), have considered dynamic embeddings proposed in this paper. In fact, dynamic embeddings can be naturally extended to be a new feature dimension for these existing neural program repair techniques.
|
| 146 |
+
|
| 147 |
+
Piech et al. (2015) is a notable recent effort targeting program representation. Piech et al. explore the possibility of using input-output pairs to represent a program. Despite their new perspective, the direct mapping between input and output of programs usually are not precise enough, i.e., the same input-output pair may correspond to two completely different programs, such as the two sorting algorithms in Figure 1. As we often observe in our own dataset, programs with the same error patterns can also result in different input-output pairs. Their approach is clearly ineffective for these scenarios.
|
| 148 |
+
|
| 149 |
+
Reed & De Freitas (2015) introduced the novel approach of using execution traces to induce and execute algorithms, such as addition and sorting, from very few examples. The differences from our work are (1) they use a sequence of instructions to represent dynamic execution trace as opposed to using dynamic program states; (2) their goal is to synthesize a neural controller to execute a program as a sequence of actions rather than learning a semantic program representation; and (3) they deal with programs in a language with low-level primitives such as function stack push/pop actions rather than a high-level programming language.
|
| 150 |
+
|
| 151 |
+
As for learning representations, there are several related efforts in modeling semantics in sentence or symbolic expressions (Socher et al., 2013; Zaremba et al., 2014; Bowman, 2013). These approaches are similar to our work in spirit, but target different domains than programs.
|
| 152 |
+
|
| 153 |
+
# 7 CONCLUSION
|
| 154 |
+
|
| 155 |
+
We have presented a new program embedding that learns program representations from runtime execution traces. We have used the new embeddings to predict error patterns that students make in their online programming submissions. Our evaluation shows that the dynamic program embeddings significantly outperform those learned via program syntax. We also demonstrate, via an additional application, that our dynamic program embeddings yield more than 10x speedups compared to an enumerative baseline for search-based program repair. Beyond neural program repair, we believe that our dynamic program embeddings can be fruitfully utilized for many other neural program analysis tasks such as program induction and synthesis.
|
| 156 |
+
|
| 157 |
+
# REFERENCES
|
| 158 |
+
|
| 159 |
+
Thoms Ball. The concept of dynamic analysis. In Proceedings of the 7th European Software Engineering Conference Held Jointly with the 7th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 216–234, 1999.
|
| 160 |
+
|
| 161 |
+
Sahil Bhatia and Rishabh Singh. Automated correction for syntax errors in programming assignments using recurrent neural networks. CoRR, abs/1603.06129, 2016.
|
| 162 |
+
|
| 163 |
+
Samuel R Bowman. Can recursive neural tensor networks learn logical reasoning? arXiv preprint arXiv:1312.6192, 2013.
|
| 164 |
+
|
| 165 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel rahman Mohamed, and Pushmeet Kohli. RobustFill: Neural program learning under noisy I/O. In Proceedings of the 34th International Conference on Machine Learning, pp. 990–998, 2017.
|
| 166 |
+
|
| 167 |
+
Rahul Gupta, Soham Pal, Aditya Kanade, and Shirish K. Shevade. Deepfix: Fixing common c language errors by deep learning. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 168 |
+
|
| 169 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 170 |
+
|
| 171 |
+
Lili Mou, Ge Li, Lu Zhang, Tao Wang, and Zhi Jin. Convolutional neural networks over tree structures for programming language processing. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 172 |
+
|
| 173 |
+
Flemming Nielson, Hanne R. Nielson, and Chris Hankin. Principles of Program Analysis. 1999.
|
| 174 |
+
|
| 175 |
+
Chris Piech, Jonathan Huang, Andy Nguyen, Mike Phulsuksombati, Mehran Sahami, and Leonidas Guibas. Learning program embeddings to propagate feedback on student code. In Proceedings of the 32nd International Conference on Machine Learning, pp. 1093–1102, 2015.
|
| 176 |
+
|
| 177 |
+
Yewen Pu, Karthik Narasimhan, Armando Solar-Lezama, and Regina Barzilay. Sk p: A neural program corrector for moocs. In Companion Proceedings of the 2016 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity, SPLASH Companion 2016, pp. 39–40, 2016.
|
| 178 |
+
|
| 179 |
+
Scott Reed and Nando De Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015.
|
| 180 |
+
|
| 181 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013.
|
| 182 |
+
|
| 183 |
+
Taras K Vintsyuk. Speech discrimination by dynamic programming. Cybernetics, 4(1):52–57, 1968.
|
| 184 |
+
|
| 185 |
+
Ke Wang, Rishabh Singh, and Zhendong Su. Data-driven feedback generation for introductory programming exercises. CoRR, abs/1711.07148, 2017. URL http://arxiv.org/abs/ 1711.07148.
|
| 186 |
+
|
| 187 |
+
Wojciech Zaremba, Karol Kurach, and Rob Fergus. Learning to discover efficient mathematical identities. In Advances in Neural Information Processing Systems, pp. 1278–1286, 2014.
|
| 188 |
+
|
| 189 |
+
# APPENDIX
|
| 190 |
+
|
| 191 |
+
# ERROR PATTERNS
|
| 192 |
+
|
| 193 |
+
Print Chessboard:
|
| 194 |
+
|
| 195 |
+
• Misprinting “O” to “0” or printing lower case instead of upper case characters.
|
| 196 |
+
• Switching across rows are supposed to be the other way around ( i.e. printing OXOXOXOX for odd number rows and XOXOXOXO for even number rows).
|
| 197 |
+
• Printing the first row correctly but failed to make a switch across rows.
|
| 198 |
+
• Printing the entire chessboard as “X” or “O” only.
|
| 199 |
+
• Printing the chessboard correctly but with extra unnecessary characters.
|
| 200 |
+
• Printing the incorrect number of rows.
|
| 201 |
+
• Printing the incorrect number of columns.
|
| 202 |
+
• Printing the characters correctly but in wrong format (i.e. not correctly seperated with the spaces to form the rows).
|
| 203 |
+
• Others.
|
| 204 |
+
|
| 205 |
+
Count Parentheses:
|
| 206 |
+
|
| 207 |
+
• Miss the corner case of empty strings.
|
| 208 |
+
• Mistakenly consider the parenthesis to be symbols rather than “(” or “)”.
|
| 209 |
+
• Mishandling the string of unmatched parentheses.
|
| 210 |
+
• Counting the number of matching parentheses rather then depth.
|
| 211 |
+
• Incorrectly assume nested parentheses are always present.
|
| 212 |
+
• Miscounting the characters which should have been ignored.
|
| 213 |
+
• Others.
|
| 214 |
+
|
| 215 |
+
Generate Binary Digits:
|
| 216 |
+
|
| 217 |
+
• Miss the corner case of integer 0.
|
| 218 |
+
• Misunderstand the binary digits to be underlying bytes of a string.
|
| 219 |
+
• Mistakes in arithmetic calculation regrading shift operations.
|
| 220 |
+
• Adding the binary digits rather than concatenating them to a string.
|
| 221 |
+
• Miss the one on the most significant bit.
|
| 222 |
+
• Others.
|
| 223 |
+
|
| 224 |
+
# Algorithm 1: SARFGEN ’s feedback generation procedure.
|
| 225 |
+
|
| 226 |
+
/\* P: an incorrect program; $P _ { s }$ : all correct solutions function FixGeneration $( P , P _ { s }$ )
|
| 227 |
+
|
| 228 |
+
2 begin // Among $P _ { s }$ identify $P _ { c s }$ to be reference programs to fix $P$
|
| 229 |
+
3 $P _ { c s } $ CandidatesIdentification $( P , P _ { s } )$ // Initialize the minimum number of fixes $k$ to be inifinity
|
| 230 |
+
4 $k \infty$ // Initialize the minimum set of fixes ${ \mathcal { F } } ( P )$
|
| 231 |
+
5 $\mathcal { F } ( P ) \mathrm { n u l l }$
|
| 232 |
+
6 for $P _ { c } \in P _ { c s }$ do // Generates the syntactic discrepencies w.r.t. each $P _ { c }$
|
| 233 |
+
7 $\mathcal { C } ( P , P _ { c } ) \gets$ DiscrepenciesGeneration $( P , P _ { s } )$ // Selecting subsets of $\mathcal { C } ( P , P _ { c } )$ from size of one itll $| \mathcal { C } ( P , P _ { c } ) |$
|
| 234 |
+
8 for $n \in [ 1 , 2 , . . . , | \mathcal { C } ( P , P _ { c } ) | ]$ do
|
| 235 |
+
9 $\mathcal { C } _ { s u b s } ( P , P _ { c } ) \gets \{ x \ : | \ : x \subseteq \mathcal { C } ( P , P _ { c } ) \land | x | = n \}$ // Attemp each subset of $\mathcal { C } ( P , P _ { c } )$
|
| 236 |
+
10 for $\mathcal { C } _ { s u b } ( P , P _ { c } ) \in \mathcal { C } _ { s u b s } ( P , P _ { c } ) \mathbf { d }$ o
|
| 237 |
+
11 $P ^ { \prime } \gets$ PatchApplication( $P$ , $\dot { \mathcal { C } } _ { s u b } ( P , P _ { c } ) )$ ) // Update $k$ if necessary
|
| 238 |
+
12 if isCorrect $P ^ { \prime }$ ) then
|
| 239 |
+
13 if $| P ^ { \prime } | < k$ then
|
| 240 |
+
14 $k | P ^ { \prime } |$
|
| 241 |
+
15 F (P ) ← P 0
|
| 242 |
+
16 return F(P )
|
| 243 |
+
|
| 244 |
+
# Algorithm 2: Incorporate pre-trained model to SARFGEN ’s feedback generation procedure.
|
| 245 |
+
|
| 246 |
+
/\* P, $P _ { s }$ : same as above; $\mathcal { M }$ : learned Model
|
| 247 |
+
|
| 248 |
+
cti , ) 2 begin Among $P _ { s }$ identify $P _ { c s }$ to be reference programs to fix $P$ 3 $P _ { c s } $ CandidatesIdentification $( P , P _ { s } )$ // Initialize the minimum number of fixes $k$ to be inifinity 4 $k \infty$ // Initialize the minimum set of fixes ${ \mathcal { F } } ( P )$ 5 $\mathcal { F } ( P ) \mathrm { n u l l }$ 6 for $P _ { c } \in P _ { c s }$ do // Generates the syntactic discrepencies w.r.t. each $P _ { c }$ 7 $\mathcal { C } ( P , P _ { c } ) \gets$ DiscrepenciesGeneration $( P , P _ { s } )$ // Executing $P$ to extract the dynamic execution trace 8 $\mathcal { T } ( P ) $ DynamicTraceExtraction $( P )$ // Prioritizing subsets of $\mathcal { C } ( P , P _ { c } )$ through pre-trained model 9 $\mathcal { C } _ { s u b s } ( P , P _ { c } ) \gets$ Prioritization $( \mathcal { C } ( P , P _ { c } )$ , T (P ), M) 10 for $\mathcal { C } _ { s u b } ( P , P _ { c } ) \in \mathcal { C } _ { s u b s } ( P , P _ { c } )$ do 11 $P ^ { \prime } \gets$ PatchApplication( $P$ , $\dot { C } _ { s u b } ( P , P _ { c } ) ,$ ) 12 if isCorrect $P ^ { \prime } )$ then 13 if $| P ^ { \prime } | < k$ then 14 $k | P ^ { \prime } |$ 15 F (P ) ← P 0 16 return F(P )
|
md/train/BJx8YnEFPH/BJx8YnEFPH.md
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DATA VALUATION USING REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Quantifying the value of data is a fundamental problem in machine learning. Data valuation has multiple important use cases: (1) building insights about the learning task, (2) domain adaptation, (3) corrupted sample discovery, and (4) robust learning. To adaptively learn data values jointly with the target task predictor model, we propose a meta learning framework which we name Data Valuation using Reinforcement Learning (DVRL). We employ a data value estimator (modeled by a deep neural network) to learn how likely each datum is used in training of the predictor model. We train the data value estimator using a reinforcement signal of the reward obtained on a small validation set that reflects performance on the target task. We demonstrate that DVRL yields superior data value estimates compared to alternative methods across different types of datasets and in a diverse set of application scenarios. The corrupted sample discovery performance of DVRL is close to optimal in many regimes (i.e. as if the noisy samples were known apriori), and for domain adaptation and robust learning DVRL significantly outperforms state-of-the-art by $1 4 . 6 \%$ and $1 0 . 8 \%$ , respectively.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Data is an essential ingredient in machine learning. Machine learning models are well-known to improve when trained on large-scale and high-quality datasets (Hestness et al., 2017; Najafabadi et al., 2015). However, collecting such large-scale and high-quality datasets is costly and challenging. One needs to determine the samples that are most useful for the target task and then label them correctly. Recent work (Toneva et al., 2019) suggests that not all samples are equally useful for training, particularly in the case of deep neural networks. In some cases, similar or even higher test performance can be obtained by removing a significant portion of training data, i.e. low-quality or noisy data may be harmful (Ferdowsi et al., 2013; Frenay & Verleysen, 2014). There are also some scenarios where train-test mismatch cannot be avoided because the training dataset only exists for a different domain. Different methods (Ngiam et al., 2018; Zhu et al., 2019) have demonstrated the importance of carefully selecting the most relevant samples to minimize this mismatch.
|
| 12 |
+
|
| 13 |
+
Accurately quantifying the value of data has a great potential for improving model performance for real-world training datasets which commonly contain incorrect labels, and where the input samples differ in relatedness, sample quality, and usefulness for the target task. Instead of treating all data samples equally, lower priority can be assigned for a datum to obtain a higher performance model – for example in the following scenarios:
|
| 14 |
+
|
| 15 |
+
1. Incorrect label (e.g. human labeling errors).
|
| 16 |
+
2. Input comes from a different distribution (e.g. different location or time).
|
| 17 |
+
3. Input is noisy or low quality (e.g. noisy capturing hardware).
|
| 18 |
+
4. Usefulness for target task (label is very common in the training dataset but not as common in the
|
| 19 |
+
testing dataset).
|
| 20 |
+
|
| 21 |
+
In addition to improving performance in such scenarios, data valuation also enables many new use cases. It can suggest better practices for data collection, e.g. what kinds of additional data would the model benefit the most from. For organizations that sell data, it determines the correct value-based pricing of data subsets. Finally, it enables new possibilities for constructing very large-scale training datasets in a much cheaper way, e.g. by searching the Internet using the labels and filtering away less valuable data.
|
| 22 |
+
|
| 23 |
+
How does one evaluate the value of a single datum? This is a crucial and challenging question. It is straightforward to address at the full dataset granularity: one could naively train a model on the entire dataset and use its prediction performance as the value. However, evaluating the value of each datum is far more difficult, especially for complex models such as deep neural networks that are trained on large-scale datasets. In this paper, we propose a meta learning-based data valuation method which we name Data Valuation using Reinforcement Learning (DVRL). Our method integrates data valuation with the training of the target task predictor model. DVRL determines a reward by quantifying the performance on a small validation set, and uses it as a reinforcement signal to learn the likelihood of each datum being using in training of the predictor model. In a wide range of use cases, including domain adaptation, corrupted sample discovery and robust learning, we demonstrate significant improvements compared to permutation-based strategies (such as Leave-one-out and Influence Function (Koh & Liang, 2017)) and game theory-based strategies (such as Data Shapley (Ghorbani & Zou, 2019)). The main contributions can be summarized as follows:
|
| 24 |
+
|
| 25 |
+
1. We propose a novel meta learning framework for data valuation that is jointly optimized with the target task predictor model.
|
| 26 |
+
2. We demonstrate multiple use cases of the proposed data valuation framework and show DVRL significantly outperforms competing methods on many image, tabular and language datasets.
|
| 27 |
+
3. Unlike previous methods, DVRL is scalable to large datasets and complex models, and its computational complexity is not directly dependent on the size of the training set.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Data valuation: A commonly-used method for data valuation is leave-one-out (LOO). It quantifies the performance difference when a specific sample is removed and assigns it as that sample’s data value. The computational cost is a major concern for LOO – it scales linearly with the number of training samples which means its cost becomes prohibitively high for large-scale datasets and complex models. In addition, there are fundamental limitations in the approximation. For example, if there are two exactly equivalent samples, LOO underestimates the value of that sample even though that sample may be very important. The method of Influence Function (Koh & Liang, 2017) was proposed to approximate LOO in a computationally-efficient manner. It uses the gradient of the loss function with small perturbations to estimate the data value. In order to compute the gradient, Hessian values are needed; however these are prohibitively expensive to compute for neural networks. Approximations for Hessian computations are possible, although they generally result in performance limitations. From data quality assessment perspective, the method of Influence Function inherits the major limitations of LOO.
|
| 32 |
+
|
| 33 |
+
Data Shapley (Ghorbani & Zou, 2019) is another relevant work. Shapley values are motivated by game theory (Shapley, 1953) and are commonly used in feature attribution problems such as relating predictions to input features (Lundberg & Lee, 2017). For Data Shapley, the prediction performance of all possible subsets is considered and the marginal performance improvement is used as the data value. The computational complexity for computing the exact Shapley value is exponential with the number of samples. Therefore, Monte Carlo sampling and gradient-based estimation are used to approximate them. However, even with these approximations, the computational complexity still remains high (indeed much higher than LOO) due to re-training for each test combination. In addition, the approximations may result in fundamental limitations in data valuation performance – e.g. with Monte Carlo approximation, the ratio of tested combinations compared to all possible combinations decreases exponentially. Moreover, in all the aforementioned methods data valuation is decoupled from predictor model training, which limits the performance due to lack of joint optimization.
|
| 34 |
+
|
| 35 |
+
Meta learning-based adaptive learning: There are relevant studies that utilize meta learning for adaptive weight assignment while training for various use cases such as robust learning, domain adaptation, and corrupted sample discovery. ChoiceNet (Choi et al., 2018) explicitly models output distributions and uses the correlations of the output to improve robustness. Xue et al. (2019) estimates uncertainty of predictions to identify the corrupted samples. Li et al. (2019) combines meta learning with standard stochastic gradient update with generated synthetic noise for robust learning. Shen & Sanghavi (2019) alternates the processes of selecting the samples with low loss and model training to improve robustness. Shu et al. (2019) uses neural networks to model the relationship between current loss and the corresponding sample weights, and utilizes a meta-learning framework for robust weight assignment. Kohler et al. (2019) estimates the uncertainty to discover ¨ the noisy labeled data and relabels mislabeled samples to improve the prediction performance of the predictor model. Gold Loss Correction (Hendrycks et al., 2018) uses a clean validation set to recover the label corruption matrix to re-train the predictor model with corrected labels. Learning to Reweight (Ren et al., 2018) proposes a single gradient descent step guided with validation set performance to reweight the training batch. Domain Adaptive Transfer Learning (Ngiam et al., 2018) introduces importance weights (based on the prior label distribution match) to scale the training samples for transfer learning. MentorNet (Jiang et al., 2018) proposes a curriculum learning framework that learns the order of mini-batch for training of the corresponding predictor model. Our method, DVRL, differs from the aforementioned as it directly models the value of the data using learnable neural networks (which we refer to as a data value estimator). To train the data value estimator, we use reinforcement learning with a sampling process. DVRL is model-agnostic and even applicable to non-differentiable target objectives. Learning is jointly performed for the data value estimator and the corresponding predictor model, yielding superior results in all of the use cases we consider.
|
| 36 |
+
|
| 37 |
+
# 3 PROPOSED METHOD
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Block diagram of the DVRL framework for training. A batch of training samples is used as the input to the data value estimator (with shared parameters across the batch) and the output corresponds to selection probabilities: $w _ { i } = h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } )$ of a multinomial distribution. The sampler, based on this multinomial distribution, returns the selection vector $\mathbf { s } = ( s _ { 1 } , . . . , s _ { B _ { s } } )$ where $s _ { i } \in \{ 0 , 1 \}$ and $P ( s _ { i } = 1 ) = w _ { i }$ . The target task predictor model is trained only using the samples with selection vector $s _ { i } = 1$ , using conventional gradient-descent optimization. The selection probabilities $w _ { i }$ rank the samples according to their importance – these are used as data values. The loss of the predictor model is evaluated on a small validation set, which is compared to the moving average of the previous losses $( \delta )$ to determine the reward. Finally, the reinforcement signal guided by this reward updates the data value estimator. Block diagrams for inference are shown in Appendix A.
|
| 41 |
+
|
| 42 |
+
Framework: Let us denote the training dataset as $\mathcal { D } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N } \sim \mathcal { P }$ where $\mathbf { x } _ { i } \in \mathcal X$ is a feature vector in the $d$ -dimensional feature space $\mathcal { X }$ , e.g. $\mathbb { R } ^ { d }$ , and $y _ { i } \in \mathcal { V }$ is a corresponding label in the label space $\mathcal { V }$ , e.g. $\Delta [ 0 , 1 ] ^ { c }$ for classification where $c$ is the number of classes and $\Delta$ is the simplex. We consider a disjoint testing dataset $\mathcal { D } ^ { t } = \{ ( \mathbf { x } _ { j } ^ { t } , y _ { j } ^ { t } ) \} _ { j = 1 } ^ { M } \sim \mathcal { P } ^ { t }$ where the target distribution $\mathcal { P } ^ { t }$ does not need to be the same with the training distribution $\mathcal { P }$ . We assume an availability of a (often small1) validation dataset $\mathcal { D } ^ { v } = \{ ( \mathbf { x } _ { k } ^ { v } , y _ { k } ^ { v } ) \} _ { k = 1 } ^ { L ^ { - } } \sim \mathcal { P } ^ { t }$ that comes from the target distribution $\mathcal { P } ^ { t }$ .
|
| 43 |
+
|
| 44 |
+
The DVRL method (overview in Fig. 1) consists of two learnable functions: (1) the target task predictor model $f _ { \theta }$ , (2) data value estimator model $h _ { \phi }$ . The predictor model $f _ { \theta } : \mathcal { X } \mathcal { Y }$ is trained to minimize a certain weighted loss function $\mathcal { L } _ { f }$ (e.g. Mean Squared Error (MSE) for regression or cross entropy for classification) on training set $\mathcal { D }$ :
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
f _ { \theta } = \arg \operatorname* { m i n } _ { \hat { f } \in \mathcal { F } } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) \cdot \mathcal { L } _ { f } ( \hat { f } ( \mathbf { x } _ { i } ) , y _ { i } ) .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
$f _ { \theta }$ can be any trainable function with parameters $\theta$ , such as a neural network. The data value estimator model $h _ { \phi } : \mathcal { X } \cdot \mathcal { Y } [ 0 , 1 ]$ , on the other hand, is optimized to output weights that determine
|
| 51 |
+
|
| 52 |
+
the distribution of selection likelihood of the samples to train the predictor model $f _ { \theta }$ . We formulate the corresponding optimization problem as:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r l } { \underset { h _ { \phi } } { \operatorname* { m i n } } } & { \mathbb { E } _ { ( \mathbf { x } ^ { v } , y ^ { v } ) \sim P ^ { t } } \Big [ \mathcal { L } _ { h } \big ( f _ { \theta } \big ( \mathbf { x } ^ { v } \big ) , y ^ { v } \big ) \Big ] } \\ { \mathrm { s . t . } } & { f _ { \theta } = \arg \operatorname* { m i n } _ { \hat { f } \in \mathcal { F } } \mathbb { E } _ { ( \mathbf { x } , y ) \sim P } \Big [ h _ { \phi } \big ( \mathbf { x } , y \big ) \cdot \mathcal { L } _ { f } \big ( \hat { f } ( \mathbf { x } ) , y \big ) \Big ] } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $h _ { \phi } ( \mathbf { x } , y )$ represents value of the training sample $\left( \mathbf { x } , y \right)$ . The data value estimator is also a trainable function, such as a neural network. Similar to $\mathcal { L } _ { f }$ , we use MSE or cross entropy for $\mathcal { L } _ { h }$ .
|
| 59 |
+
|
| 60 |
+
Training: To encourage exploration based on uncertainty, we model training sample selection stochastically. Let $w = h _ { \phi } ( \mathbf { x } , y )$ denote the probability that $\left( \mathbf { x } , y \right)$ is used to train the predictor model $f _ { \theta }$ $\mathbf { \varepsilon } _ { \cdot } \ h _ { \phi } ( \mathcal { D } ) = \{ h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ is the probability distribution for inclusion of each training sample. $\mathbf { s } \in \{ 0 , 1 \} ^ { N }$ is a binary vector that represents the selected samples. If $s _ { i } = 1 / 0$ , $\left( \mathbf { x } _ { i } , y _ { i } \right)$ is selected/not selected for training the predictor model. $\begin{array} { r } { \pi _ { \phi } ( \mathcal { D } , \mathbf { s } ) \ = \ \prod _ { i = 1 } ^ { N } \big [ h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) ^ { s _ { i } } \cdot ( 1 - } \end{array}$ $h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) ) ^ { 1 - s _ { i } } ]$ is the probability that certain selection vector s is selected based on $h _ { \phi } ( \mathcal { D } )$ . We assign the outputs of the data value estimator model, $w = h _ { \phi } ( \mathbf { x } , y )$ , as the data values. We can use the data values to rank the dataset samples (e.g. to determine a subset of the training dataset) and to do sample-adaptive training (e.g. for domain adaptation).
|
| 61 |
+
|
| 62 |
+
The predictor model can be trained using standard stochastic gradient descent because it is differentiable with respect to the input. However, gradient descent-based optimization cannot be used for the data value estimator because the sampling process is non-differentiable. There are multiple ways to handle the non-differentiable optimization bottleneck, such as Gumbel-softmax (Jang et al., 2017) or stochastic back-propagation (Rezende et al., 2014). In this paper, we consider reinforcement learning instead, which directly encourages exploration of the policy towards the optimal solution of Eq. (2). We use the REINFORCE algorithm (Williams, 1992) to optimize the policy gradients, with the rewards obtained from a small validation set that approximates performance on the target task. For the loss function $\hat { l } ( \phi )$ :
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l } & { \hat { l } ( \phi ) = \mathbb { E } _ { ( \mathbf { x } ^ { v } , y ^ { v } ) \sim P ^ { t } } \Big [ \mathbb { E } _ { s \sim \pi _ { \phi } ( \mathcal { D } , \cdot ) } \big [ \mathcal { L } _ { h } ( f _ { \theta } ( \mathbf { x } ^ { v } ) , y ^ { v } ) \big ] \Big ] } \\ & { \quad \quad = \displaystyle \int P ^ { t } ( \mathbf { x } ^ { v } ) \Big [ \sum _ { s \in [ 0 , 1 ] ^ { N } } \pi _ { \phi } ( \mathcal { D } , \mathbf { s } ) \cdot \big [ \mathcal { L } _ { h } ( f _ { \theta } ( \mathbf { x } ^ { v } ) , y ^ { v } ) \big ] \Big ] d \mathbf { x } ^ { v } , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
we directly compute the gradient $\nabla _ { \phi } \hat { l } ( \phi )$ as:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { l } { { \displaystyle \nabla _ { \phi } \hat { l } ( \phi ) = \int P ^ { t } ( { \bf x } ^ { v } ) \Big [ \sum _ { s \in [ 0 , 1 ] ^ { N } } \nabla _ { \phi } \pi _ { \phi } ( \mathcal { D } , { \bf s } ) \cdot \big [ \mathcal { L } _ { h } \big ( f _ { \theta } \big ( { \bf x } ^ { v } \big ) , y ^ { v } \big ) \big ] \Big ] d { \bf x } ^ { v } } \ ~ } \\ { { \displaystyle ~ = \int P ^ { t } ( { \bf x } ^ { v } ) \Big [ \sum _ { s \in [ 0 , 1 ] ^ { N } } \nabla _ { \phi } \log \big ( \pi _ { \phi } ( \mathcal { D } , { \bf s } ) \big ) \cdot \pi _ { \phi } \big ( \mathcal { D } , { \bf s } \big ) \cdot \big [ \mathcal { L } _ { h } \big ( f _ { \theta } \big ( { \bf x } ^ { v } \big ) , y ^ { v } \big ) \big ] \Big ] d { \bf x } ^ { v } } \ ~ } \\ { { \displaystyle ~ = \mathbb { E } _ { ( { \bf x } ^ { v } , y ^ { v } ) \sim P ^ { t } } \Big [ \mathbb { E } _ { { \bf s } \sim \pi _ { \phi } ( \mathcal { D } , \cdot ) } \big [ \mathcal { L } _ { h } \big ( f _ { \theta } \big ( { \bf x } ^ { v } \big ) , y ^ { v } \big ) \big ] \nabla _ { \phi } \log \big ( \pi _ { \phi } ( \mathcal { D } , { \bf s } ) \big ) \Big ] , } } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\nabla _ { \phi } \log ( \pi _ { \phi } ( \mathcal { D } , \mathbf { s } ) )$ is
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { l } { \displaystyle \nabla _ { \phi } \log ( \pi _ { \phi } ( \mathcal { D } , \mathbf { s } ) ) = \nabla _ { \phi } \sum _ { i = 1 } ^ { N } \log \Big [ h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) ^ { s _ { i } } \cdot ( 1 - h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) ) ^ { 1 - s _ { i } } \Big ] } \\ { \displaystyle = \sum _ { i = 1 } ^ { N } s _ { i } \nabla _ { \phi } \log \big [ h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) \big ] + ( 1 - s _ { i } ) \nabla _ { \phi } \log \big [ ( 1 - h _ { \phi } ( \mathbf { x } _ { i } , y _ { i } ) ) \big ] . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
To improve the stability of the training, we use the moving average of the previous loss $( \delta )$ , with a window size $( T )$ , as the baseline for the current loss. The pseudo-code is shown in Algorithm 1.
|
| 81 |
+
|
| 82 |
+
Computational complexity: DVRL models the mapping between an input and its value with a learnable function. The training time of DVRL is not directly proportional to the dataset size, but rather dominated by the required number of iterations and per-iteration complexity in Algorithm 1. One way to minimize the computational overhead is to use pre-trained models to initialize the
|
| 83 |
+
|
| 84 |
+
# Algorithm 1 Pseudo-code of DVRL training
|
| 85 |
+
|
| 86 |
+
1: Inputs: Learning rates $\alpha , \beta > 0$ , mini-batch size $B _ { p } , B _ { s } > 0$ , inner iteration count $N _ { I } > 0$ , moving average window $T > 0$ , training dataset $\mathcal { D }$ , validation dataset $\mathcal { D } ^ { v } = \{ ( \mathbf { x } _ { k } ^ { v } , y _ { k } ^ { v } ) \} _ { k = 1 } ^ { L }$
|
| 87 |
+
|
| 88 |
+
2: Initialize parameters $\theta , \phi$ , moving average $\delta = 0$
|
| 89 |
+
|
| 90 |
+
3: while until convergence do
|
| 91 |
+
|
| 92 |
+
4: Sample a mini-batch from the entire training dataset: $\mathcal { D } _ { B } = ( \mathbf { x } _ { j } , y _ { j } ) _ { j = 1 } ^ { B _ { s } } \sim \mathcal { D }$
|
| 93 |
+
5: for $j = 1 , . . . , B _ { s }$ do
|
| 94 |
+
6: Calculate selection probabilities: $w _ { j } = h _ { \phi } ( \mathbf { x } _ { j } , y _ { j } )$
|
| 95 |
+
7: Sample selection vector: $s _ { j } \sim B e r ( w _ { j } )$
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\theta \theta - \alpha \frac { 1 } { B _ { p } } \sum _ { m = 1 } ^ { B _ { p } } \tilde { s } _ { m } \cdot \nabla _ { \theta } \mathcal { L } _ { f } ( f _ { \theta } ( \tilde { \mathbf { x } } _ { m } ) , \tilde { y } _ { m } ) )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
11: Update the data value estimator model network parameters $\phi$
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\phi \phi - \beta \Big [ \frac { 1 } { L } \sum _ { k = 1 } ^ { L } [ \mathcal { L } _ { h } ( f _ { \theta } ( \mathbf { x } _ { k } ^ { v } ) , y _ { k } ^ { v } ) ] - \delta \Big ] \nabla _ { \phi } \log \pi _ { \phi } ( \mathcal { D } _ { B } , ( s _ { 1 } , . . . , s _ { B _ { s } } ) )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
12: Update the moving average baseline $( \delta )$ : $\begin{array} { r } { \delta \gets \frac { T - 1 } { T } \delta + \frac { 1 } { L T } \sum _ { k = 1 } ^ { L } [ \mathcal { L } _ { h } ( f _ { \theta } ( \mathbf { x } _ { k } ^ { v } ) , y _ { k } ^ { v } ) ] } \end{array}$ predictor networks at each iteration. Unlike alternative methods like Data Shapley, we demonstrate the scalability of DVRL to large-scale datasets such as CIFAR-100, and complex models such as ResNet-32 (He et al., 2016) and WideResNet-28-10 (Zagoruyko & Komodakis, 2016). Instead of being exponential in terms of the dataset size, the training time overhead DVRL is only twice of conventional training. Please see Appendix D for further analysis on learning dynamics of DVRL and Appendix B for additional computational complexity discussions.
|
| 108 |
+
|
| 109 |
+
# 4 EXPERIMENTS
|
| 110 |
+
|
| 111 |
+
We evaluate data value estimation quality of DVRL on multiple types of dataset and use cases.
|
| 112 |
+
|
| 113 |
+
Benchmark methods: We consider the following benchmarks: (1) Randomly-assigned values (Random), (2) Leave-one-out (LOO), (3) Data Shapley Value (Data Shapley) (Ghorbani & Zou, 2019). For some experiments, we also compare with (4) Learning to Reweight (Ren et al., 2018), (5) MentorNet (Jiang et al., 2018), and (6) Influence Function (Koh & Liang, 2017).
|
| 114 |
+
|
| 115 |
+
Datasets: We consider 12 public datasets (3 public tabular datasets, 7 public image datasets, and 2 public language datasets) to evaluate DVRL in comparison to multiple benchmark methods. 3 public tabular datasets are (1) Blog, (2) Adult, (3) Rossmann; 7 public image datasets are (4) HAM 10000, (5) MNIST, (6) USPS, (7) Flower, (8) Fashion-MNIST, (9) CIFAR-10, (10) CIFAR-100; 2 public language datasets are (11) Email Spam, (12) SMS Spam. Details can be found in the hyper-links.
|
| 116 |
+
|
| 117 |
+
Baseline predictor models: We consider various machine learning models as the baseline predictor model to highlight the proposed model-agnostic data valuation framework. For Adult and Blog datasets, we use LightGBM (Ke et al., 2017), and for Rossmann dataset, we use XGBoost and multi-layer perceptrons due to their superior performance on the tabular datasets. For Flower, HAM 10000, and CIFAR-10 datasets, we use Inception-v3 with top-layer fine-tuning (pre-trained on ImageNet, (Szegedy et al., 2016)) as the baseline predictor model. For Fashion-MNIST, MNIST, and USPS datasets, we use multinomial logistic regression, and for Email and SMS datasets, we use Naive Bayes model. We also use ResNet-32 (He et al., 2016) and WideResNet-28-10 (Zagoruyko & Komodakis, 2016) as the baseline models for CIFAR-10 and CIFAR-100 datasets in Section 4.3 to demonstrate the scalability of DVRL. For data value estimation network, we use multi-layer perceptrons with ReLU activation as the base architecture. The number of layers and hidden units are optimized with cross-validation.
|
| 118 |
+
|
| 119 |
+
Experimental details: In all experiments, we use Standard Normalizer to normalize the entire features to have zero mean and one standard deviation. We transform categorical variables into one-hot encoded embeddings. We set the inner iteration count $\scriptstyle N _ { I } = 2 0 0$ ) for the predictor network, moving average window $( T { = } 2 0 )$ , and mini-batch size $( B _ { p } { = } 2 5 6 )$ for the predictor network and mini-batch size ( ${ B _ { s } } { = } 2 0 0 0 )$ for the DVE network (large batch size often improves the stability of the reinforcement learning model training (McCandlish et al., 2018)). We set the learning rate to 0.01 $( \beta )$ for the data value estimator (DVE) and 0.001 $( \alpha )$ for the predictor network. As the DVE architecture, for tabular datasets, we use 5-layer perceptrons with 100 hidden units and ReLU; and for image datasets, we use 5-layer perceptrons with 100 hidden units and ReLU on top of the CNN-based architecture used for the predictor network (such as ResNet-32 or WideResNet-28-10 in Table 1). In order to provide further informative signal to DVE, we propose to use an additional input of the difference between the predictions of a separate predictive model (fined-tuned or trained from scratch on the validation set) for the training samples and the original training labels. We simply concatenate this additional input to the hidden states of DVE network. Intuitively, if the training label is corrupted, the additional input would be high; thus, this could be an important signal for DVE to assign low value to this sample. Ablation study for the variants of DVRL can be found in the Appendix C.6.
|
| 120 |
+
|
| 121 |
+
# 4.1 REMOVING HIGH/LOW VALUE SAMPLES
|
| 122 |
+
|
| 123 |
+
Removing low value samples from the training dataset can improve the predictor model performance, especially in the cases where the training dataset contains corrupted samples. On the other hand, removing high value samples, especially if the dataset is small, would decrease the performance significantly. Overall, the performance after removing high/low value samples is a strong indicator for the quality of data valuation.
|
| 124 |
+
|
| 125 |
+
Initially, we consider the conventional supervised learning setting, where all training, validation and testing datasets come from the same distribution (without sample corruption or domain mismatch). We use two tabular datasets (Adult and Blog) with 1,000 training samples and one image dataset (Flower) with 2,000 training samples.2 We use 400 validation samples for tabular datasets and 800 validation samples for the image dataset. Then, we report the prediction performance on the disjoint testing set after removing the high/low value samples based on the estimated data values.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 2: Performance after removing the most (marked with $\times$ ) and least (marked with $\bigcirc$ ) important samples according to the estimated data values in a conventional supervised learning setting.
|
| 129 |
+
|
| 130 |
+
As shown in Fig. 2, even in the absence of sample corruption or domain mismatch, DVRL can marginally improve the prediction performance after removing some portion of the least important samples. Using only ${ \sim } 6 0 \% { - } 7 0 \%$ of the training set (the highest valued samples), DVRL can obtain a similar performance compared to training on the entire dataset. After removing a small portion $( 1 0 \% - 2 0 \% )$ of the most important samples, the prediction performance significantly degrades which indicates the importance of the high valued samples. Qualitatively looking at these samples, we observe them to typically be representative of the target task which can be insightful. Overall, DVRL shows the fastest performance degradation after removing the most important samples and the slowest performance degradation after removing the least important samples in most cases, underlining the superiority of DVRL in data valuation quality compared to competing methods.
|
| 131 |
+
|
| 132 |
+
Next, we focus on the setting of removing high/low value samples in the presence of label noise in the training data. We consider three image datasets: Fashion-MNIST, HAM 10000, and CIFAR10. As noisy samples hurt the performance of the predictor model, an optimal data value estimator with a clean validation dataset should assign lowest values to the noisy samples. With the removal of samples with noisy labels (‘Least’ setting), the performance should either increase, or at least decrease much slower, compared to removal of samples with correct labels (‘Most’ setting). In this experiment, we introduce label noise to $20 \%$ of the samples by replacing true labels with random labels. As can be seen in Fig. 10, for all data valuation methods the prediction performance tends to first slowly increase and then decrease in the ‘Least’ setting; and tends to rapidly decrease in the ‘Most’ setting. Yet, DVRL achieves the slowest performance decrease in ‘Least’ setting and fastest performance decrease in the ‘Most’ setting, reflecting its superiority in data valuation.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Prediction performance after removing the most (marked with $\times$ ) and least (marked with $\bigcirc$ ) important samples according to the estimated data values with $20 \%$ noisy label ratio. Additional results on Blog, HAM 10000, and CIFAR-10 datasets can be found in Appendix C.3. The prediction performance is lower than state of the art due to a smaller training set size and the introduced noise.
|
| 136 |
+
|
| 137 |
+
# 4.2 CORRUPTED SAMPLE DISCOVERY
|
| 138 |
+
|
| 139 |
+
There are some scenarios where training samples may contain corrupted samples, e.g. due to cheap label collection methods. An automated corrupted sample discovery method would be highly beneficial for distinguishing samples with clean vs. noisy labels. Data valuation can be used in this setting by having a small clean validation set to assign low data values to the potential samples with noisy labels. With an optimal data value estimator, all noisy labels would get the lowest data values.
|
| 140 |
+
|
| 141 |
+
We consider the same experimental setting with the previous subsection with $20 \%$ noisy label ratio on 6 datasets. Fig. 4 shows that DVRL consistently outperforms all benchmarks (Data Shapley, LOO and Influence Function). The trend of noisy label discovery for DVRL can be very close to optimal (as if we perfectly knew which samples have noisy labels), particularly for the Adult, CIFAR-10 and Flower datasets. To highlight the stability of DVRL, we provide the confidence intervals of DVRL performance on the corrupted sample discovery in Appendix E.
|
| 142 |
+
|
| 143 |
+
# 4.3 ROBUST LEARNING WITH NOISY LABELS
|
| 144 |
+
|
| 145 |
+
In this section, we consider how reliably DVRL can learn with noisy data in an end-to-end way, without removing the low-value samples as in the previous section. Ideally, noisy samples should get low data values as DVRL converges and a high performance model can be returned. To compare DVRL with two recently-proposed benchmarks: MentorNet (Jiang et al., 2018) and Learning to Reweight (Ren et al., 2018) for this use case, we focus on two complex deep neural networks as the baseline predictor models, ResNet-32 (He et al., 2016) and WideResNet-28-10 (Zagoruyko &
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 4: Discovering corrupted samples in three datasets with $20 \%$ noisy label ratio. ‘Optimal’ saturates at $20 \%$ , perfectly assigning the lowest data value scores to the samples with noisy labels. ‘Random’ does not introduce any knowledge on distinguishing clean vs. noisy labels, and thus the fraction of discovered corrupt samples is proportional to the amount of inspection. More results on Adult, Fashion-MNIST and Flower datasets are in Appendix C.4.
|
| 149 |
+
|
| 150 |
+
Komodakis, 2016), trained on CIFAR-10 and CIFAR-100 datasets. Additional results on other image datasets are in Appendix C.1, and results on robust learning with noisy features are in Appendix C.2.
|
| 151 |
+
|
| 152 |
+
We consider the same experimental setting from Ren et al. (2018) on CIFAR-10 and CIFAR-100 datasets. For the first experiment, we use WideResNet-28-10 as the baseline predictor model and apply $40 \%$ of label noise uniformly across all classes. We use 1,000 clean (noise-free) samples as the validation set and test the performance on the clean testing set. For the second experiment, we use ResNet-32 as the baseline predictor model and apply $40 \%$ background noise (same-class noise to the $40 \%$ of the samples). In this case, we only use 10 clean samples per class as the validation set. We consider five additional benchmarks: (1) Validation Set Only – which only uses clean validation set for training, (2) Baseline – which only uses noisy training set for training, (3) Baseline $^ +$ Finetuning – which is initialized with the trained baseline model on the noisy training set and fine-tuned on the clean validation set, (4) Clean Only $60 \%$ data) – which is trained on the clean training set after removing the training samples with flipped labels, (5) Zero Noise – which uses the original noise-free training set for training ( $100 \%$ clean training data). We exclude Data Shapley and LOO in this experiment due to their prohibitively-high computational complexities.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Noise (predictor model)</td><td colspan="2">Uniform (WideResNet-28-10)</td><td colspan="2">Background (ResNet-32)</td></tr><tr><td>Datasets</td><td>CIFAR-10</td><td>CIFAR-100</td><td>CIFAR-10</td><td>CIFAR-100</td></tr><tr><td>Validation Set Only</td><td>46.64± 3.90</td><td>9.94 ± 0.82</td><td>15.90 ± 3.32</td><td>8.06± 0.76</td></tr><tr><td>Baseline</td><td>67.97 ± 0.62</td><td>50.66 ± 0.24</td><td>59.54 ± 2.16</td><td>37.82 ± 0.69</td></tr><tr><td>Baseline + Fine-tuning</td><td>78.66 ± 0.44</td><td>54.52 ± 0.40</td><td>82.82 ± 0.93</td><td>54.23 ± 1.75</td></tr><tr><td>MentorNet + Fine-tuning</td><td>78.00</td><td>59.00</td><td></td><td></td></tr><tr><td>Learning to Reweight</td><td>86.92 ± 0.19</td><td>61.34 ± 2.06</td><td>86.73 ± 0.48</td><td>59.30 ± 0.60</td></tr><tr><td>DVRL</td><td>89.02 ± 0.27</td><td>66.56 ± 1.27</td><td>88.07 ± 0.35</td><td>60.77 ± 0.57</td></tr><tr><td rowspan="2">Clean Only (60% Data) Zero Noise</td><td>94.08 ± 0.23</td><td>74.55 ± 0.53</td><td>90.66 ± 0.27</td><td>63.50 ± 0.33</td></tr><tr><td>95.78 ± 0.21</td><td>78.32 ± 0.45</td><td>92.68 ± 0.22</td><td>68.12 ± 0.21</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 1: Robust learning with noisy labels. Test accuracy for ResNet-32 and WideResNet-28-10 on CIFAR-10 and CIFAR-100 datasets with $40 \%$ of Uniform and Background noise on labels.
|
| 157 |
+
|
| 158 |
+
As shown in Table 1, DVRL outperforms other robust learning methods in all cases. The performance improvements with DVRL are larger with Uniform noise. Learning to Reweight loses $7 . 1 6 \%$ and $1 3 . 2 1 \%$ accuracy compared to the optimal case (Zero Noise); on the other hand, DVRL only loses $5 . 0 6 \%$ and $7 . 9 9 \%$ accuracy for CIFAR-10 and CIFAR-100 respectively with Uniform noise.
|
| 159 |
+
|
| 160 |
+
# 4.4 DOMAIN ADAPTATION
|
| 161 |
+
|
| 162 |
+
In this section, we consider the scenario where the training dataset comes from a substantially different distribution from the validation and testing sets. Naive training methods (i.e. equal treatment of all training samples) often fail in this scenario (Ganin et al., 2016; Glorot et al., 2011). Data valuation is expected to be beneficial for this task by selecting the samples from the training dataset that best match the distribution of the validation dataset.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Source</td><td>Target</td><td>Task</td><td>Baseline</td><td>Data Shapley</td><td>DVRL</td></tr><tr><td>Google</td><td>HAM10000</td><td>Skin Lesion Classification</td><td>.296</td><td>.378</td><td>.448</td></tr><tr><td>MNIST</td><td>USPS</td><td>Digit Recognition</td><td>.308</td><td>.391</td><td>.472</td></tr><tr><td>Email</td><td>SMS</td><td>Spam Detection</td><td>.684</td><td>.864</td><td>.903</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 2: Domain adaptation setting showing target accuracy. Baseline represents the predictor model which is naively trained on the training set with equal treatment of all training samples.
|
| 167 |
+
|
| 168 |
+
We initially focus on the three cases from Ghorbani & Zou (2019), shown in Table 2. (1) uses Google image search results (cheaply collected dataset) to predict skin lesion classification on HAM 10000 data (clean), (2) uses MNIST data to recognize digit on USPS dataset, (3) uses Email spam data to detect spam in an SMS dataset. The experimental settings are exactly the same with Ghorbani & Zou (2019). Table 2 shows that DVRL significantly outperforms Baseline and Data Shapley in all three tasks. One primary reason is that DVRL jointly optimizes the data value estimator and corresponding predictor model; on the other hand, Data Shapley needs a two step processes to construct the predictor model in domain adaptation setting.
|
| 169 |
+
|
| 170 |
+
Next, we focus on a real-world tabular data learning problem where the domain differences are significant. We consider the sales forecasting problem with the Rossmann Store Sales dataset, which consists of sales data from four different store types. Simple statistical investigation shows a significant discrepancy between the input feature distributions across different store types, meaning there is a large domain mismatch across store types (see Appendix F). To further illustrate distribution difference across the store types, we show the t-SNE analysis on the final layer of a discriminative neural network trained on the entire dataset in Appendix Fig. 11. We consider three different settings: (1) training on all store types (Train on All), (2) training on store types excluding the store type of interest (Train on Rest), and (3) training only on the store type of interest (Train on Specific). In all cases, we evaluate the performance on each store type separately. For example, to evaluate the performance on store type D, Train on All setting uses all four store type datasets for training, Train on Rest setting uses store types A, B and C for training, and Train on Specific setting only uses the store type D for training. Train on Rest is expected to yield the largest domain mismatch between training and testing sets, and Train on Specific yield the minimal.
|
| 171 |
+
|
| 172 |
+
Table 3: Performance of Baseline and DVRL in 3 different settings with 2 different predictor models on the Rossmann Store Sales dataset. Metric is Root Mean Squared Percentage Error (RMSPE, lower the better). We use $79 \%$ of the data as training, $1 \%$ as validation, and $20 \%$ as testing. DVRL outperforms Baseline in all settings.
|
| 173 |
+
|
| 174 |
+
<table><tr><td rowspan="2">Predictor Model (Metric: RMSPE)</td><td rowspan="2">Store Type</td><td colspan="2">Train on All</td><td colspan="2">Train on Rest</td><td colspan="2">Train on Specific</td></tr><tr><td>Baseline</td><td>DVRL</td><td>Baseline</td><td>DVRL</td><td>Baseline</td><td>DVRL</td></tr><tr><td rowspan="4">XGBoost</td><td>A B</td><td>0.1736 0.1996</td><td>0.1594 0.1422</td><td>0.2369</td><td>0.2109</td><td>0.1454</td><td>0.1430</td></tr><tr><td></td><td>0.1839</td><td>0.1502</td><td>0.7716</td><td>0.3607</td><td>0.0880</td><td>0.0824</td></tr><tr><td>C</td><td></td><td></td><td>0.2083</td><td>0.1551</td><td>0.1186</td><td>0.1170</td></tr><tr><td>D</td><td>0.1504</td><td>0.1441</td><td>0.1922</td><td>0.1535</td><td>0.1349</td><td>0.1221</td></tr><tr><td rowspan="4">Neural Networks</td><td>A B</td><td>0.1531</td><td>0.1428</td><td>0.3124</td><td>0.2014</td><td>0.1181</td><td>0.1066</td></tr><tr><td></td><td>0.1529</td><td>0.0979</td><td>0.8072</td><td>0.5461</td><td>0.0683</td><td>0.0682</td></tr><tr><td>C</td><td>0.1620</td><td>0.1437</td><td>0.2153</td><td>0.1804</td><td>0.0682</td><td>0.0677</td></tr><tr><td>D</td><td>0.1459</td><td>0.1295</td><td>0.2625</td><td>0.1624</td><td>0.0759</td><td>0.0708</td></tr></table>
|
| 175 |
+
|
| 176 |
+
We evaluate the performance of Baseline (train the predictor model without data valuation) and DVRL in 3 different settings with 2 different predictor models (XGBoost (Chen & Guestrin, 2016) and Neural Networks (3-layer perceptrons)). As shown in Table 3, DVRL improves the performance in all settings. The improvements are most significant in Train on Rest setting due to the large domain mismatch. For instance, DVRL reduces the error more than $50 \%$ for store type B predictions with XGBoost in comparison to Baseline. In Train on $A l l$ setting, the performance improvement is still significant, showing that DVRL can distinguish the samples from the target distribution. In Appendix G, we demonstrate that DVRL actually prioritizes selection of the samples from the target store type. In Train on Specific setting, the performance improvements are smaller – even without domain mismatch, DVRL can marginally improve the performance by accurately prioritizing the important samples within the same store type. These results further support the conclusions from Fig. 2 in the conventional supervised learning setting that DVRL learns high quality data value scores. Comparison to other domain adaptation benchmarks can be found in Appendix C.5.
|
| 177 |
+
|
| 178 |
+
# 4.5 DISCUSSION: HOW MANY VALIDATION SAMPLES ARE NEEDED?
|
| 179 |
+
|
| 180 |
+
DVRL requires a validation dataset from the target distribution that the testing dataset comes from. Depending on the task, the requirements for the validation dataset may involve being noise-free in labels, being from the same domain, or being high quality. Acquiring such a dataset can be costly in some scenarios and it is desirable to minimize its size requirements.
|
| 181 |
+
|
| 182 |
+
We analyze the impact of the size of the validation dataset on DVRL with 3 different datasets: Adult, Blog, and Fashion MNIST for the use case of corrupted sample discovery. Similar to Section 4.2, we add $20 \%$ noise to the training samples and try to find the corrupted samples with DVRL. As shown in Fig. 5, DVRL achieves reasonable performance with 100 to 400 validation samples. In the Adult dataset, even 10 validation samples are sufficient to achieve a reasonable data valuation quality. Both of these settings are often realistic in real world scenarios.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 5: Number of validation samples needed for DVRL. Discovering corrupted samples in three datasets (Adult, Blog and Fashion MNIST) with various number of validation samples. X-axis represents the fraction of inspected data and y-axis is the fraction of discovered corrupted samples. On Adult and Fashion-MNIST datasets, DVRL needs $\cdot$ and $\cdot$ of inspected samples to identify $\cdot$ of the corrupted samples respectively - merely $\cdot$ and $4 \%$ more than the optimal cases.
|
| 186 |
+
|
| 187 |
+
# 5 CONCLUSIONS
|
| 188 |
+
|
| 189 |
+
In this paper, we propose a meta learning framework, named DVRL, that adaptively learns data values jointly with a target task predictor model. The value of each datum determines how likely it will be used in training of the predictor model. We model this data value estimation task using a deep neural network, which is trained using reinforcement learning with a reward obtained from a small validation set that represents the target task performance. With a small validation set, DVRL can provide computationally highly efficient and high quality ranking of data values for the training dataset that is useful for domain adaptation, corrupted sample discovery and robust learning. We show that DVRL significantly outperforms other techniques for data valuation in various applications on diverse types of datasets.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 785–794. ACM, 2016.
|
| 194 |
+
|
| 195 |
+
Sungjoon Choi, Sanghoon Hong, and Sungbin Lim. Choicenet: Robust learning by revealing output correlations. arXiv preprint arXiv:1805.06431, 2018.
|
| 196 |
+
|
| 197 |
+
Hasan Ferdowsi, Sarangapani Jagannathan, and Maciej Zawodniok. An online outlier identification and removal scheme for improving fault detection performance. IEEE Transactions on Neural Networks and Learning Systems, 25(5):908–919, 2013.
|
| 198 |
+
|
| 199 |
+
B. Frenay and M. Verleysen. Classification in the presence of label noise: A survey. IEEE Transactions on Neural Networks and Learning Systems, 25(5):845–869, 2014.
|
| 200 |
+
|
| 201 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 202 |
+
|
| 203 |
+
Amirata Ghorbani and James Zou. Data shapley: Equitable valuation of data for machine learning. In International Conference on Machine Learning, pp. 2242–2251, 2019.
|
| 204 |
+
|
| 205 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In International Conference on Machine Learning, pp. 513–520, 2011.
|
| 206 |
+
|
| 207 |
+
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.
|
| 208 |
+
|
| 209 |
+
Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In Advances in Neural Information Processing Systems, pp. 10456–10465, 2018.
|
| 210 |
+
|
| 211 |
+
Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory F. Diamos, Heewoo Jun, Hassan Kianinejad, Md. Mostofa Ali Patwary, Yang Yang, and Yanqi Zhou. Deep learning scaling is predictable, empirically. arXiv:1712.00409, 2017.
|
| 212 |
+
|
| 213 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. In International Conference on Learning Representations, 2017.
|
| 214 |
+
|
| 215 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pp. 2309–2318, 2018.
|
| 216 |
+
|
| 217 |
+
Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and TieYan Liu. Lightgbm: A highly efficient gradient boosting decision tree. In Advances in Neural Information Processing Systems, pp. 3146–3154, 2017.
|
| 218 |
+
|
| 219 |
+
Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pp. 1885–1894, 2017.
|
| 220 |
+
|
| 221 |
+
Jan M Kohler, Maximilian Autenrieth, and William H Beluch. Uncertainty based detection and ¨ relabeling of noisy image labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 33–37, 2019.
|
| 222 |
+
|
| 223 |
+
Junnan Li, Yongkang Wong, Qi Zhao, and Mohan S Kankanhalli. Learning to learn from noisy labeled data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5051–5059, 2019.
|
| 224 |
+
|
| 225 |
+
Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pp. 4765–4774, 2017.
|
| 226 |
+
|
| 227 |
+
Sam McCandlish, Jared Kaplan, Dario Amodei, and OpenAI Dota Team. An empirical model of large-batch training. arXiv preprint arXiv:1812.06162, 2018.
|
| 228 |
+
|
| 229 |
+
Maryam M Najafabadi, Flavio Villanustre, Taghi M Khoshgoftaar, Naeem Seliya, Randall Wald, and Edin Muharemagic. Deep learning applications and challenges in big data analytics. Journal of Big Data, 2(1):1, 2015.
|
| 230 |
+
|
| 231 |
+
Jiquan Ngiam, Daiyi Peng, Vijay Vasudevan, Simon Kornblith, Quoc V Le, and Ruoming Pang. Domain adaptive transfer learning with specialist models. arXiv preprint arXiv:1811.07056, 2018.
|
| 232 |
+
|
| 233 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In International Conference on Machine Learning, pp. 4334–4343, 2018.
|
| 234 |
+
|
| 235 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, pp. 1278–1286, 2014.
|
| 236 |
+
|
| 237 |
+
Lloyd S Shapley. A value for n-person games. Contributions to the Theory of Games, 2(28):307– 317, 1953.
|
| 238 |
+
|
| 239 |
+
Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In International Conference on Machine Learning, pp. 5739–5748, 2019.
|
| 240 |
+
|
| 241 |
+
Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. Meta-weightnet: Learning an explicit mapping for sample weighting. arXiv preprint arXiv:1902.07379, 2019.
|
| 242 |
+
|
| 243 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 244 |
+
|
| 245 |
+
Mariya Toneva, Alessandro Sordoni, Remi Tachet des Combes, Adam Trischler, Yoshua Bengio, and Geoffrey J. Gordon. An empirical study of example forgetting during deep neural network learning. In International Conference on Learning Representations, 2019.
|
| 246 |
+
|
| 247 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7167–7176, 2017.
|
| 248 |
+
|
| 249 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229–256, 1992.
|
| 250 |
+
|
| 251 |
+
Cheng Xue, Qi Dou, Xueying Shi, Hao Chen, and Pheng Ann Heng. Robust learning at noisy labeled medical images: Applied to skin lesion classification. arXiv preprint arXiv:1901.07759, 2019.
|
| 252 |
+
|
| 253 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 254 |
+
|
| 255 |
+
Linchao Zhu, Sercan O. Arik, Yi Yang, and Tomas Pfister. Learning to Transfer Learn. arXiv preprint arXiv:1908.11406, 2019.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 6: Block diagram of the proposed DVRL framework at inference time. (a) Data valuation, (b) Prediction. For data valuation, the input is a set of samples and the outputs are the corresponding data values. For prediction, the input is a sample and the output is the corresponding prediction. Both the data value estimator and predictor are fixed (not trained) at inference time.
|
| 259 |
+
|
| 260 |
+
# B COMPUTATIONAL COMPLEXITY
|
| 261 |
+
|
| 262 |
+
DVRL first trains the baseline model using the entire dataset (without re-weighting). Afterwards, we can use this pre-trained baseline model to initialize the predictor network and apply fine-tuning with DVRL update steps. The convergence of the fine-tuning process is much faster than the convergence of training from the scratch.
|
| 263 |
+
|
| 264 |
+
We quantify the computational overhead of DVRL on the CIFAR-100 dataset (consisting $5 0 \mathrm { k }$ training samples) with ResNet-32 as a representative example. Overall, DVRL training takes less than 8 hours (given a pre-trained ResNet-32 model on the entire dataset) on a single NVIDIA Tesla V100 GPU without any hardware optimizations. The pre-training time of ResNet-32 on the entire dataset (without re-weighting) is less than 4 hours; thus the total training time of DVRL is less than 12 hours from the scratch. On the other hand, the training time of Data Shapley (the most competitive benchmark) is more than a week on Fashion MNIST (consisting lower dimensional inputs and less number of classes) with a much simpler predictor model architecture (2-layered convolutional neural networks).
|
| 265 |
+
|
| 266 |
+
At inference, the data value estimator can be used to obtain data value for each sample. The runtime of data valuation is typically much faster (less than 1 ms per sample) than the predictor model (e.g. ResNet-32 model).
|
| 267 |
+
|
| 268 |
+
# C ADDITIONAL RESULTS
|
| 269 |
+
|
| 270 |
+
# C.1 ADDITIONAL RESULTS ON ROBUST LEARNING WITH NOISY LABELS
|
| 271 |
+
|
| 272 |
+
We evaluate how DVRL can provide robustness for learning with noisy labels. We add various levels of label noise, ranging from $0 \%$ to $50 \%$ , to the training sets and evaluate how robust the proposed model (DVRL) is for the noisy dataset. In this experiment, we use three image datasets (CIFAR-10, Flower, and HAM 10000). Note that we initialize the predictor model using pre-trained Inception-v3 networks on ImageNet and only fine-tune the top layer (transfer learning setting).
|
| 273 |
+
|
| 274 |
+
<table><tr><td rowspan=2 colspan=1>Noiseratio</td><td rowspan=1 colspan=6>CIFAR-10</td><td rowspan=1 colspan=3>Flower</td><td rowspan=1 colspan=3>HAM10000</td></tr><tr><td rowspan=1 colspan=2>Clean</td><td rowspan=1 colspan=1>DVRL</td><td rowspan=1 colspan=3>Baseline</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>DVRL</td><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>DVRL</td><td rowspan=1 colspan=1>Baseline</td></tr><tr><td rowspan=1 colspan=1>0%</td><td rowspan=1 colspan=2>.8297</td><td rowspan=1 colspan=1>.8305</td><td rowspan=1 colspan=3>.8297</td><td rowspan=1 colspan=1>.9090</td><td rowspan=1 colspan=1>.9292</td><td rowspan=1 colspan=1>.9090</td><td rowspan=1 colspan=1>.7129</td><td rowspan=2 colspan=1>.7148.7142</td><td rowspan=5 colspan=1>.7129.6746.6199.5508.4819.4132</td></tr><tr><td rowspan=1 colspan=1>10%</td><td rowspan=1 colspan=2>.8281</td><td rowspan=1 colspan=1>.8306</td><td rowspan=1 colspan=3>.7713</td><td rowspan=1 colspan=1>.9057</td><td rowspan=1 colspan=1>.9158</td><td rowspan=1 colspan=1>.7441</td><td rowspan=1 colspan=1>.7094</td></tr><tr><td rowspan=1 colspan=1>20%</td><td rowspan=1 colspan=2>.8285</td><td rowspan=1 colspan=1>.8271</td><td rowspan=1 colspan=3>.6883</td><td rowspan=1 colspan=1>.9026</td><td rowspan=2 colspan=1>.9152.8901</td><td rowspan=2 colspan=1>.5960.4546</td><td rowspan=2 colspan=1>.7098.7063</td><td rowspan=2 colspan=1>.7126.7005</td></tr><tr><td rowspan=1 colspan=1>30%</td><td rowspan=1 colspan=2>.8283</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>.8262</td><td rowspan=1 colspan=1>.5897</td><td rowspan=1 colspan=1>.5897</td><td rowspan=1 colspan=1>.8889</td></tr><tr><td rowspan=1 colspan=1>40%50%</td><td rowspan=1 colspan=2>.8259.8236</td><td rowspan=1 colspan=1>.8259</td><td rowspan=1 colspan=3>.8255.8225</td><td rowspan=1 colspan=1>.4887.3832</td><td rowspan=1 colspan=1>.8620.8542</td><td rowspan=1 colspan=1>.8787.8678</td><td rowspan=1 colspan=1>.2929.2962</td><td rowspan=1 colspan=1>.7028.7009</td><td rowspan=1 colspan=1>.6968.6814</td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 4: Robust learning results with various noise levels on CIFAR-10, Flower, and HAM 10000 datasets. Clean is the performance of the predictor model when it is only trained with the samples with clean labels (e.g. at $20 \%$ noise level, it uses only $80 \%$ clean samples). Baseline is the performance of the predictor model when it is trained with both noisy and clean labels.
|
| 277 |
+
|
| 278 |
+
Noisy labels significantly degrade the prediction performance when they are included in the training dataset (see the increasing differences between Baseline and Clean in Table 4). DVRL demonstrates high robustness up to high noisy label ratio $( 5 0 \% )$ . In some cases (even without noisy labels (i.e. $0 \%$ noise ratio)), the prediction performance even outperforms the Clean case, as DVRL prioritizes some clean samples more than others. Overall, DVRL framework is promising in maintaining high prediction performance even with a significant increase in the amount of noisy labels.
|
| 279 |
+
|
| 280 |
+
# C.2 ADDITIONAL RESULTS ON ROBUST LEARNING WITH NOISY FEATURES
|
| 281 |
+
|
| 282 |
+
In this section, we consider training with noisy input features, with a clean validation set. We independently add Gaussian noise with zero mean and a certain standard deviation of $\sigma$ to each feature in the training set independently. We use two tabular datasets (Adult and Blog) to evaluate the robustness of DVRL on input noise. As can be seen in Table 5, DVRL is robust with noise on the features and the performance gains are higher with larger noise in comparison to Baseline (i.e. treat all the noisy training samples equally), since DVRL can discover the training samples with less corrupted by the additive noise among the entire noisy training samples and provide higher weights on those less noisy samples.
|
| 283 |
+
|
| 284 |
+
<table><tr><td rowspan="2">0</td><td colspan="2">Blog</td><td colspan="2">Adult</td></tr><tr><td>Baseline</td><td>DVRL</td><td>Baseline</td><td>DVRL</td></tr><tr><td>0.1</td><td>0.733</td><td>0.819</td><td>0.802</td><td>0.820</td></tr><tr><td rowspan="3">0.2 0.3 0.4</td><td>0.647</td><td>0.798</td><td>0.753</td><td>0.788</td></tr><tr><td>0.626</td><td>0.766</td><td>0.699</td><td>0.771</td></tr><tr><td>0.623</td><td>0.717</td><td>0.652</td><td>0.725</td></tr></table>
|
| 285 |
+
|
| 286 |
+
Table 5: Testing accuracy when trained with noisy features. $\sigma$ is the standard deviation of the added Gaussian noise, quantifying the level of perturbation on the features.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 7: Prediction performance after removing the most and least important samples, according to the estimated data values. We assume a label noise with $20 \%$ ratio on (a) Blog, (b) HAM 10000, (c) CIFAR-10 datasets.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 8: Discovering corrupted samples in three datasets ((a) Adult, (b) Fashion-MNIST, (c) Flower datasets) in the presence of $20 \%$ noisy labels. ‘Optimal’ saturates at the $20 \%$ of the fraction, perfectly assigning the lowest data value scores to the samples with noisy labels. ‘Random’ does not introduce any knowledge on distinguishing clean vs. noisy labels, and thus the fraction of discovered corrupt samples is proportional to the amount of inspection.
|
| 293 |
+
|
| 294 |
+
# .5 COMPARISON TO OTHER DOMAIN ADAPTATION BENCHMARKS
|
| 295 |
+
|
| 296 |
+
In this subsection, we compare DVRL to two established domain adaptation benchmarks: Adversarial Discriminative Domain Adaptation (ADDA) (Tzeng et al., 2017) and Domain Adversarial Neural Networks (DANN) (Ganin et al., 2016). We use the same experimental settings given in Table 3 using Rossmann Store Sales dataset with neural networks as the predictor model. Table 6 represents the domain adaptation results on ‘Train on all’ and ‘Train on Rest’ settings. As can be seen, DVRL yields superior (or similar in a few cases) compared to the two methods, ADDA and DANN, that are specifically designed for domain adaptation.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Settings</td><td colspan="4">Train on All</td><td colspan="4">Train on Rest</td></tr><tr><td>Methods</td><td>Baseline</td><td>DVRL</td><td>ADDA</td><td>DANN</td><td>Baseline</td><td>DVRL</td><td>ADDA</td><td>DANN</td></tr><tr><td>A</td><td>0.1531</td><td>0.1428</td><td>0.1465</td><td>0.1491</td><td>0.3124</td><td>0.2014</td><td>0.2119</td><td>0.2305</td></tr><tr><td>B</td><td>0.1529</td><td>0.0979</td><td>0.1193</td><td>0.1201</td><td>0.8071</td><td>0.5461</td><td>0.5444</td><td>0.5898</td></tr><tr><td>C</td><td>0.1620</td><td>0.1437</td><td>0.1503</td><td>0.1589</td><td>0.2153</td><td>0.1804</td><td>0.1871</td><td>0.1963</td></tr><tr><td>D</td><td>0.1459</td><td>0.1295</td><td>0.1351</td><td>0.1388</td><td>0.2625</td><td>0.1624</td><td>0.1910</td><td>0.2061</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Table 6: Performance of Baseline, DVRL, ADDA, and DANN in train-on-all and train-on-rest settings with neural networks as the predictor model on the Rossmann Store Sales dataset. Metric is Root Mean Squared Percentage Error (RMSPE, lower the better). We use $79 \%$ of the data as training, $1 \%$ as validation, and $20 \%$ as testing.
|
| 301 |
+
|
| 302 |
+
# C.6 ABLATION STUDIES
|
| 303 |
+
|
| 304 |
+
In this subsection, we analyze the source of gains for three distinct components of DVRL: (1) discrete representations of data value estimator, (2) baseline for stabilizing the RL training, (3) output of the model trained on the clean validation set as the additional input (validation model). We report the corrupted sample discovery results where the experimental settings are same with Section 4.2.
|
| 305 |
+
|
| 306 |
+
<table><tr><td>Models /Datasets</td><td>Blog</td><td>HAM-10000</td><td>CIFAR-10</td></tr><tr><td>DVRL</td><td>47.3%</td><td>60.2%</td><td>68.1%</td></tr><tr><td>DVRL without sampler</td><td>44.9%</td><td>58.3%</td><td>63.7%</td></tr><tr><td>DVRL without baseline</td><td>45.8%</td><td>56.6%</td><td>62.9%</td></tr><tr><td>DVRL without validation model</td><td>43.7%</td><td>57.1%</td><td>64.4%</td></tr><tr><td>Validation model only</td><td>43.1%</td><td>55.9%</td><td>62.3%</td></tr></table>
|
| 307 |
+
|
| 308 |
+
Table 7: Discovering corrupted samples in three datasets with $20 \%$ noisy label ratio. We report the fraction of discovered corrupted samples after inspecting $20 \%$ of the samples with multiple variants of DVRL (the higher the better).
|
| 309 |
+
|
| 310 |
+
As can be seen in Table 7, each component provides an additional gain in DVRL:
|
| 311 |
+
|
| 312 |
+
(1) A straightforward idea is to use the raw outputs of DVE to scale the contributions of each sample in the loss term, without using the sampler. Yet, we show the benefit of the discrete representation of DVE for data selection. The sampler encourages exploration of an extremely large action space in a systematic way. This helps DVE and predictor model to converge to a better optimal solution.
|
| 313 |
+
|
| 314 |
+
(2) Baseline stabilizes the convergence of reinforcement learning; thus, yields higher gains on complex datasets.
|
| 315 |
+
|
| 316 |
+
(3) The output of the validation model itself has informative signal as it achieves high performance (since it is trained with small-scale but high quality data). We observe that this signal helps DVRL, but even without this signal achieves high performance. We also observe that often a larger DVE model (with more iterations) is needed to estimate the data value in the absence of the informative signal from the validation model.
|
| 317 |
+
|
| 318 |
+
Note that we propose to use the output of the validation model as an additional input to the data valuation framework; thus, this can also be regarded as another contribution of our work. Also, the output of the validation model is highly informative in the noisy sample discovery use case but not that significant in other applications such as domain adaptation or performance improvement by low value data removal in standard supervised learning setting.
|
| 319 |
+
|
| 320 |
+
# D LEARNING CURVES OF DVRL
|
| 321 |
+
|
| 322 |
+
Fig. 9 shows the learning curves of DVRL on the noisy data (with $20 \%$ label noise) setting in comparison to the validation log loss without DVRL (directly trained on the noisy data without reweighting) on 2 tabular datasets (Adult and Blog) and 4 image datasets (Fashion-MNIST, Flower, HAM 10000, and CIFAR-10).
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 9: Learning curves of DVRL for 6 datasets with $20 \%$ noisy labels. $\mathbf { X }$ -axis: the number of iterations for data value estimator training, y-axis: validation performance (log loss). (Orange: validation log loss without DVRL, Blue: validation log loss with DVRL)
|
| 326 |
+
|
| 327 |
+
# E CONFIDENCE INTERVALS OF DVRL PERFORMANCE ON CORRUPTED SAMPLE DISCOVERY EXPERIMENTS
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 10: Corrupted sample discovery performance with $9 5 \%$ confidence intervals (computed by 10 independent runs) according to the estimated data values by DVRL. We assume a label noise with $20 \%$ ratio on (a) Adult and Blog, (b) Fashion-MNIST and Flower (c) HAM 10000 and CIFAR-10 datasets.
|
| 331 |
+
|
| 332 |
+
F ROSSMANN DATA STATISTICS & T-SNE ANALYSIS
|
| 333 |
+
Table 8: Rossmann data statistics. Report 25-50-75 percentiles for sales and customers. # represents the number.
|
| 334 |
+
|
| 335 |
+
<table><tr><td rowspan=1 colspan=1>Store Type</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>C</td><td rowspan=1 colspan=1>D</td></tr><tr><td rowspan=1 colspan=2>#of Samples 457042 (54.1%)</td><td rowspan=1 colspan=3>15560 (1.8%) 112968 (13.4%) 258768 (30.6%)</td></tr><tr><td rowspan=1 colspan=5>Sales 1390-1660-1854 2052-2459-2661 1753-1974-2178 2109-2355-2524</td></tr><tr><td rowspan=1 colspan=1>Customers</td><td rowspan=1 colspan=1>169-203-221</td><td rowspan=1 colspan=1>436-492-543</td><td rowspan=1 colspan=1>192-232-259</td><td rowspan=1 colspan=1>224-246-259</td></tr></table>
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 11: t-SNE analyses on the final layer representations of each store type in Rossmann dataset.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
G FURTHER ANALYSIS ON ROSSMANN DATASET IN Train on All SETTING
|
| 342 |
+
Figure 12: Histograms of the training samples from the target store type in Train on All setting based on the sorted data values estimated by DVRL. $\mathbf { \check { X } }$ -axis: the sorted data values (in percentiles), y-axis: counts of training samples from the target store type (in ratio).
|
| 343 |
+
|
| 344 |
+
To further understand the results in Train on All setting, we sorted (in a decreasing order) the training samples by their data values estimated by DVRL and illustrate the distributions of the training samples that come from the target store type. As can be seen in Fig. 12, DVRL prioritizes the training samples which come from the same target store type.
|
md/train/By41BjA9YQ/By41BjA9YQ.md
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LAPLACIAN SMOOTHING GRADIENT DESCENT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a class of very simple modifications of gradient descent and stochastic gradient descent. We show that when applied to a large variety of machine learning problems, ranging from softmax regression to deep neural nets, the proposed surrogates can dramatically reduce the variance and improve the generalization accuracy. The methods only involve multiplying the usual (stochastic) gradient by the inverse of a positive definitive matrix coming from the discrete Laplacian or its high order generalizations. The theory of Hamilton-Jacobi partial differential equations demonstrates that the implicit version of new algorithm is almost the same as doing gradient descent on a new function which (i) has the same global minima as the original function and (ii) is “more convex”. We show that optimization algorithms with these surrogates converge uniformly in the discrete Sobolev $H _ { \sigma } ^ { p }$ sense and reduce the optimality gap for convex optimization problems. We implement our algorithm into both PyTorch and Tensorflow platforms which only involves changing of a few lines of code. The code will be available on Github.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Stochastic gradient descent (SGD) has been the workhorse for solving large-scale machine learning problems (Bottou et al., 2018). It gives rise to a family of algorithms that make training of deep neural nets (DNN) practical, which is believed to somehow implicitly smooth the loss function of the DNN (Jastrzebski et al., 2018). Many efforts have been carried out to improve training and generalization of DNN by directly searching for flat minima (Keskar et al., 2017; Chaudhari et al., 2017; 2016). An alternative view of SGD’s magic comes from the theory of uniform stability (Bousquet & Elisseeff, 2002; Duchi et al., 2011; Hardt et al., 2016; Bottou et al., 2016; Gonen & Shalev-Shwartz, 2017).
|
| 12 |
+
|
| 13 |
+
The noise in SGD, on the one hand, helps gradient-based optimization algorithms circumvent spurious local minima and reach those that generalize well (Schmidhuber, 2014). On the other hand, it slows down the convergence of regular gradient descent (GD). To recover the linear convergence rate for strongly convex functions, several interesting variance reduction algorithms have been proposed, e.g., SAGA (Defazio & Bach, 2014) and SVRG (Johoson & Zhang, 2013). These algorithms have a certain amount of difficulty in training DNN. SAGA has a relatively high space complexity in storing the gradient for many samples. SVRG requires computation of the full batch gradient.
|
| 14 |
+
|
| 15 |
+
In this work, we propose a carefully designed positive definite matrix to smooth and to reduce variance of the (stochastic) gradient on-the-fly. The resulting surrogate tends to reduce noise in SGD and improve training of DNN. We call this procedure Laplacian smoothing. The gradient smoothing can be done by multiplying the gradient by the inverse of the following circulant convolution matrix
|
| 16 |
+
|
| 17 |
+
$$
|
| 18 |
+
\begin{array} { r } { A _ { \sigma } : = \left[ { \begin{array} { c c c c c c } { 1 + 2 \sigma } & { - \sigma } & { 0 } & { . . . } & { 0 } & { - \sigma } \\ { - \sigma } & { 1 + 2 \sigma } & { - \sigma } & { . . . } & { 0 } & { 0 } \\ { 0 } & { - \sigma } & { 1 + 2 \sigma } & { . . . } & { 0 } & { 0 } \\ { . . . } & { . . . } & { . . . } & { . . . } & { . . . } & { . . . } \\ { - \sigma } & { 0 } & { 0 } & { . . . } & { - \sigma } & { 1 + 2 \sigma } \end{array} } \right] } \end{array}
|
| 19 |
+
$$
|
| 20 |
+
|
| 21 |
+
for some positive constant $\sigma \geq 0$ . In fact, we can write $\mathbf { } A _ { \sigma } = I - \sigma L$ , where $\pmb { I }$ is the identity matrix, and $\pmb { L }$ is the discrete one-dimensional Laplacian which acts on indices. We define the (periodic)
|
| 22 |
+
|
| 23 |
+
forward finite difference matrix as
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\pmb { { \cal D } } _ { + } = \left[ \begin{array} { c c c c c c c } { - 1 } & { 1 } & { 0 } & { . . . } & { 0 } & { 0 } \\ { 0 } & { - 1 } & { 1 } & { . . . } & { 0 } & { 0 } \\ { 0 } & { 0 } & { - 1 } & { . . . } & { 0 } & { 0 } \\ { . . . } & { . . . } & { . . . } & { . . . } & { . . . } & { . . . } \\ { 1 } & { 0 } & { 0 } & { . . . } & { 0 } & { - 1 } \end{array} \right] .
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
Then, we have $A _ { \sigma } = I - \sigma D _ { - } D _ { + }$ , where ${ \pmb D } _ { - } = - { \pmb D } _ { + } ^ { \top }$ is the backward finite difference. The resulting Laplacian smoothing stochastic gradient descent (LS-SGD) requires negligible extra computational cost and generalizes better than the standard SGD. When the Hessian has a poor condition number, gradient descent performs poorly. In this case, the derivative increases rapidly in one direction, while increasing slowly in others. Gradient smoothing can avoid jitter along steep directions and help make progress in shallow directions (Li & et al, 2018). Moreover, we show that the operator $A _ { \sigma } ^ { \div 1 }$ plays role as a denoiser which enables better convergence in the presence of a very noisy stochastic gradient. The implicit version of our proposed approach is linked to an unusual HamiltonJacobi partial differential equation (HJ-PDE) whose solution makes the original loss function more convex while retaining its flat (and global) minima, and essentially works on this surrogate function with a much better landscape.
|
| 30 |
+
|
| 31 |
+
# 2 HAMILTON-JACOBI PDES AND CONVEXIFICATION
|
| 32 |
+
|
| 33 |
+
Machine learning problems are generally formulated as finding the optimal parameters $\pmb { w }$ of a parametric function ${ \pmb y } = h ( { \pmb x } , { \pmb w } )$ , such that for an input $_ { \textbf { \em x } }$ , the output $\textbf { { y } }$ is close to the ground-truth. The optimal $\textbf { \em w }$ can be obtained by minimizing an empirical risk function, $f ( X , Y , w ) \bar { \doteq } f ( w )$ , given the training data $\{ X , Y \}$ . We start from the following unusual HJ-PDE with $f ( w )$ as initial condition
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\left\{ \begin{array} { l l } { u _ { t } + \frac { 1 } { 2 } \big \langle \nabla _ { w } u , A _ { \sigma } ^ { - 1 } \nabla _ { w } u \big \rangle = 0 , } & { ( w , t ) \in \Omega \times [ 0 , \infty ) } \\ { u ( w , 0 ) = f ( w ) , } & { w \in \Omega } \end{array} \right.
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
By the Hopf-Lax formula (Evans, 2010), the unique viscosity solution to Eq. (2) is represented by
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
u ( { \pmb w } , t ) = \operatorname* { i n f } _ { { \pmb v } } \Big \{ f ( { \pmb v } ) + \frac { 1 } { 2 t } \big \langle { \pmb v } - { \pmb w } , { \pmb A } _ { \sigma } ( { \pmb v } - { \pmb w } ) \big \rangle \Big \} .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
This viscosity solution $u ( { \boldsymbol { w } } , t )$ makes $f ( w )$ ”more convex”, an intuitive definition and theoretical explanation of ”more convex” can be found in (Chaudhari et al., 2017; 2016), by bringing down the local maxima while retaining and widening local minima. An illustration of this is shown in Fig. 1. If we perform the smoothing GD with proper step size on the function $u ( { \boldsymbol { w } } , t )$ , it is easier to reach the global or at least a flat minima of the original nonconvex function $f ( w )$ .
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: $\begin{array} { r } { f ( \pmb { w } ) = \| \pmb { w } \| ^ { 2 } \big ( 1 + \frac { 1 } { 2 } \sin ( 2 \pi \| \pmb { w } \| ) \big ) } \end{array}$ is made more convex by solving Eq.(2). The plot shows the cross section of the 5D problem with $\sigma = 1$ and different $t$ values.
|
| 49 |
+
|
| 50 |
+
Proposition 1. Suppose $f ( w )$ is differentiable, the LS-GD on $u ( { \boldsymbol { w } } , t )$
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - t \pmb { A } _ { \sigma } ^ { - 1 } \nabla _ { \pmb { w } } u ( \pmb { w } ^ { k } , t )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
is equivalent to the smoothing implicit $G D$ on $f ( w )$
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r } { \pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - t \pmb { A } _ { \sigma } ^ { - 1 } \nabla f ( \pmb { w } ^ { k + 1 } ) . } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
All the proofs here and below are provided in the appendix.
|
| 63 |
+
|
| 64 |
+
# 2.1 LAPLACIAN SMOOTHING GRADIENT DESCENT
|
| 65 |
+
|
| 66 |
+
Laplacian smoothing implicit gradient descent requires inner iterations as used in (Chaudhari et al., 2017), which is computationally expensive. We consider the following explicit scheme
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \gamma _ { k } \pmb { A } _ { \sigma } ^ { - 1 } \nabla f ( \pmb { w } ^ { k } ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Intuitively, compared to the standard GD, this scheme smooths the gradient on-the-fly by an elliptic smoothing operator. We adopt fast Fourier transform (FFT) to compute $A _ { \sigma } ^ { - 1 } \nabla f ( \mathbf { \bar { w } } ^ { k } )$ , which is available in both PyTorch (Paszke et al., 2017) and TensorFlow (Abadi et al., 2016). Given a vector $\textbf { { g } }$ , a smoothed vector $^ d$ can be obtained by computing $d = { \bf \nabla } \cdot { \bf \dot { A } } _ { \sigma } ^ { - 1 } g$ . This is equivalent to ${ \textbf { \em g } } =$ $d - \sigma v * d$ , where $\pmb { v } = [ - 2 , 1 , 0 , \cdots , 0 , 1 ] ^ { \dag }$ and $^ *$ is the convolution operator. Therefore
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
d = \operatorname { i f f } \left( { \frac { \operatorname { f f t } ( g ) } { 1 - \sigma \cdot \operatorname { f f t } ( v ) } } \right) ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where we use component-wise division, fft and ifft are the FFT and inverse FFT, respectively. Hence, the gradient smoothing can be done in quasilinear time. This additional time complexity is almost the same as performing a one step update on the weights vector w. For many machine learning models, we may need to concatenate the parameters into a vector. This reshape might lead to some ambiguity, nevertheless, based on our tests, both row and column majored reshaping work for the LS-GD algorithm. Moreover, in deep learning cases, the weights in different layers might have different physical meanings. We then perform layer-wise gradient smoothing, instead.
|
| 79 |
+
|
| 80 |
+
Remark 1. In image processing, the Sobolev gradient (Jung et al., 2009) involves a multidimensional Laplacian operator which operates on $\textbf { \em w }$ , is different from the one-dimensional discrete Laplacian operator employed in our LS-GD scheme, which operates on indices.
|
| 81 |
+
|
| 82 |
+
We first show that LS-GD can help bypass sharp minima and reach the global minima. We consider the following function, in which we ‘drill’ narrow holes on a smooth convex function,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
f ( x , y , z ) = - 4 e ^ { - \left( ( x - \pi ) ^ { 2 } + ( y - \pi ) ^ { 2 } + ( z - \pi ) ^ { 2 } \right) } - 4 \sum _ { i } \cos ( x ) \cos ( y ) e ^ { - \beta \left( ( x - r \sin ( \frac { i } { 2 } ) - \pi ) ^ { 2 } + ( y - r \cos ( \frac { i } { 2 } ) - \pi ) ^ { 2 } \right) } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where the summation is taken over the index set $\{ i \in \mathbb { N } | 0 \leq i < 4 \pi \}$ , $r$ and $\beta$ are the parameters that determine the location and narrowness of the local minima and are set to 1 and $\frac { 1 ^ { \bullet } } { \sqrt { 5 0 0 } }$ , respectively. We do GD and LS-GD starting from a random point in the neighborhoods of the narrow minima, i.e., $( x _ { 0 } , y _ { 0 } , z _ { 0 } ) \in \{ \bigcup _ { i } U _ { \delta } ( r \sin ( \frac { i } { 2 } ) + \pi , r \cos ( \frac { i } { 2 } ) + \pi ) | \ 0 \leq i < 4 \pi , i \in \mathbb { N } _ { \neq } \} .$ , where $U _ { \delta } ( P )$ is a neighborhood of the point $P$ with radius $\delta$ . Our experiments (Fig. 2) show that, if $\delta \leq 0 . 2$ , GD will converge to narrow local minima, while LS-GD convergences to wider global minima.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Demo of GD and LS-GD. Panel (a) depicts the slice of the function (Eq.(4)) with $z = 2 . 3 4$ panel (b) shows the paths of GD (red) and LS-GD (black). We take the step size to be 0.02 for both GD and LS-GD. $\sigma = 1 . 0$ is utilized for LS-GD.
|
| 92 |
+
|
| 93 |
+
2.2 GENERALIZED SMOOTHING GRADIENT DESCENT
|
| 94 |
+
|
| 95 |
+
We can generalize $A _ { \sigma }$ to the $n$ th order discrete hyper-diffusion operator as follows
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\pmb { I } + ( - 1 ) ^ { n } \sigma \pmb { L } ^ { n } \doteq \pmb { A } _ { \sigma } ^ { n } .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
Each row of the discrete Laplacian operator $\pmb { L }$ consists of an appropriate arrangement of weights in central finite difference approximation to the 2nd order derivative. Similarly, each row of ${ \pmb L } ^ { n }$ is an arrangement of the weights of the central finite difference to approximate the $2 n$ th order derivative.
|
| 102 |
+
|
| 103 |
+
Remark 2. The nth order smoothing operator $\pmb { I } + ( - 1 ) ^ { n } \sigma \pmb { L } ^ { n }$ can only be applied to the problem with dimension at least $2 n + 1$ . Otherwise, we need to add dummy variables to the object function.
|
| 104 |
+
|
| 105 |
+
Again, we apply FFT to compute the smoothed gradient vector. For a given gradient vector $\textbf { { g } }$ , the smoothed surrogate, $( A _ { \sigma } ^ { n } ) ^ { - 1 } { \dot { \pmb { g } } } \doteq { \pmb { d } }$ , can be obtained by solving $\pmb { g } = \pmb { d } + ( - 1 ) ^ { n } \sigma \pmb { v } _ { n } * \pmb { d }$ , where $\pmb { v _ { n } } = ( c _ { n + 1 } ^ { n } , c _ { n + 2 } ^ { n } , \cdots , \overset { \cdot \cdot } { c _ { 2 n + 1 } ^ { n } } , 0 , \cdots , 0 , c _ { 1 } ^ { n } , c _ { 2 } ^ { n } , \cdots , c _ { n - 1 } ^ { n } , c _ { n } ^ { n } )$ is a vector of the same dimension as the gradient to be smoothed. And the coefficient vector $\pmb { c } ^ { n } = ( c _ { 1 } ^ { n } , c _ { 2 } ^ { n } , \cdot \cdot \cdot , c _ { 2 n + 1 } ^ { n } )$ can be obtained recursively by the following formula
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r } { \boldsymbol { c } ^ { 1 } = ( 1 , - 2 , 1 ) , \quad \boldsymbol { c } _ { i } ^ { n } = \left\{ \begin{array} { l l } { 1 } & { i = 1 , 2 n + 1 } \\ { - 2 \boldsymbol { c } _ { 1 } ^ { n - 1 } + \boldsymbol { c } _ { 2 } ^ { n - 1 } } & { i = 2 , 2 n } \\ { \boldsymbol { c } _ { i - 1 } ^ { n - 1 } - 2 \boldsymbol { c } _ { i } ^ { n - 1 } + \boldsymbol { c } _ { i + 1 } ^ { n - 1 } } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Remark 3. The computational complexities for different order smoothing schemes are the same when the FFT is utilized for computing the surrogate gradient.
|
| 112 |
+
|
| 113 |
+
# 3 REDUCE OPTIMALITY GAP IN SGD
|
| 114 |
+
|
| 115 |
+
We show advantages of the LS-(S)GD and generalized schemes for convex optimization. Consider finding the minima $\pmb { x } ^ { * }$ of the quadratic function $f ( { \pmb x } )$ defined in Eq. (5) by different schemes.
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
f ( x _ { 1 } , x _ { 2 } , \cdot \cdot \cdot , x _ { 1 0 0 } ) = \sum _ { i = 1 } ^ { 5 0 } x _ { 2 i - 1 } ^ { 2 } + \sum _ { i = 1 } ^ { 5 0 } \frac { x _ { 2 i } ^ { 2 } } { 1 0 ^ { 2 } } .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
To simulate SGD, we add Gaussian noise to the gradient vector, i.e., at a given point $_ { \textbf { \em x } }$ , we have
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r } { \tilde { \nabla } _ { \epsilon } f ( x ) : = \nabla f ( x ) + \epsilon \mathcal { N } ( \mathbf { 0 } , I ) , } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where the scalar $\epsilon$ controls the noise level, $\mathcal { N } ( \mathbf { 0 } , \pmb { I } )$ is the vector with zero mean and unit variance in each coordinate. The corresponding numerical schemes can be formulated as
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r } { \pmb { x } ^ { k + 1 } = \pmb { x } ^ { k } - \eta _ { k } \big ( \pmb { A } _ { \sigma } ^ { n } \big ) ^ { - 1 } \tilde { \nabla } _ { \epsilon } f ( \pmb { x } ^ { k } ) , } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\sigma$ is the smoothing parameter selected to be 10.0 to kill the intense noise. We take diminishing step sizes with initial values 0.1 for SGD/smoothed SGD; 0.9 and 1.8 for GD/smoothed GD, respectively. Without noise, the smoothing allows us to take larger step sizes, rounding to the first digit, 0.9 and 1.9 are the largest suitable step size for GD and smoothed version here. We compare constant learning rate and exponentially decaying learning rate, i.e., after every 1000 iteration, the learning rate is divided by 10. We apply different schemes that corresponding to $n = 0 , 1 , 2$ in Eq. (6) to the problem Eq. (5), with the initial point $\pmb { x } ^ { 0 } = ( 1 , 1 , \cdots , 1 )$ .
|
| 134 |
+
|
| 135 |
+
Figure. 3 shows the iteration v.s. optimality gap when the constant learning rate is applied to different noise levels. In the noise free case, all three schemes converge linearly, but gradient smoothing has a smaller decay constant due to its increased condition number. When there is noise, our smoothed gradient helps to reduce the optimality gap and converges faster after a few iterations.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 3: Iterations v.s. optimality gap for GD and smoothed GD with order 1 and 2 for the problem in Eq.(5). Constant step size was used.
|
| 139 |
+
|
| 140 |
+
The exponentially decaying learning rate helps our smoothed SGD to reach a point with a smaller optimality gap, and the higher order smoothing further reduce the optimality gap, as shown in Fig. 4. One simple reason for this in the noisy case is because of the noise removal properties of the smoothing operators. The influence of the learning rate is still under investigation. We establish the convergence of our proposed smoothing gradient descent algorithms.
|
| 141 |
+
|
| 142 |
+
We say the objective function $f$ has $L$ -Lipschitz gradient, if for any $\pmb { w } , \pmb { u } \in \mathbb { R } ^ { m }$ , we have $\lVert \nabla f ( \pmb { w } ) -$ $\nabla f ( \pmb { u } ) \| \leq L \| \pmb { w } - \pmb { u } \|$ , and $f$ is $a$ -strongly convex, if $\langle \nabla f ( { \pmb w } ) - \nabla f ( { \pmb u } ) , { \pmb w } - { \pmb u } \rangle \geq a \| { \pmb w } - { \pmb u } \| ^ { 2 }$ . We define the vector norm induced by any matrix $\pmb { A }$ as $\| \pmb { w } \| _ { \pmb { A } } : = \sqrt { \langle \pmb { w } , \pmb { A } \pmb { w } \rangle }$ .
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 4: Iterations v.s. optimality gap for GD and smoothed GD with order 1 and 2 for the problem in Eq.(5). Exponentially decaying step size is utilized here.
|
| 146 |
+
|
| 147 |
+
Proposition 2. Suppose $f$ is convex with the global minimizer $\boldsymbol { w } ^ { * }$ , and $f ^ { * } = f ( w ^ { * } )$ . Consider the following iteration with constant learning rate $\eta > 0$
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\mathbf { \boldsymbol { w } } ^ { k + 1 } = \mathbf { \boldsymbol { w } } ^ { k } - \eta ( \mathbf { \boldsymbol { A } } _ { \sigma } ^ { n } ) ^ { - 1 } \mathbf { \boldsymbol { g } } ^ { k } ,
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $g ^ { k }$ is the sampled gradient in the kth iteration at $\boldsymbol { w } ^ { k }$ satisfying $\mathbb { E } [ \pmb { g } ^ { k } ] = \nabla f ( \pmb { w } ^ { k } )$ . Denote $\begin{array} { r } { G _ { { \pmb A } _ { \sigma } ^ { n } } : = \operatorname* { l i m } _ { K \infty } \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \| \pmb { g } ^ { k } \| _ { ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } \end{array}$ and $\begin{array} { r } { \overline { { \mathbf { w } } } ^ { K } : = \sum _ { k = 0 } ^ { K - 1 } \mathbf { w } ^ { k } / K } \end{array}$ the ergodic average of iterates. Then the optimality gap is
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\operatorname* { l i m } _ { K \to \infty } \mathbb { E } [ f ( \overline { { \pmb { w } } } ^ { K } ) ] - f ^ { * } \leq \frac { \eta G _ { A _ { \sigma } ^ { n } } } { 2 } .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
Note that $\| \pmb { g } \| _ { ( \pmb { A } _ { \sigma } ^ { n } ) ^ { - 1 } }$ generally decreases in $n$ unless $\textbf { { g } }$ is constant, which indicates that a bigger $n$ implies smaller optimality gap. This is consistent with the experimental results above.
|
| 160 |
+
|
| 161 |
+
Proposition 3. Suppose $f$ is $L$ -Lipschitz smooth and $a$ -strongly convex with the global minimizer $\boldsymbol { w } ^ { * }$ . Consider the generalized smoothing gradient descent algorithm
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\begin{array} { r } { \pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \eta _ { k } ( \pmb { A } _ { \sigma } ^ { n } ) ^ { - 1 } \pmb { g } ^ { k } , } \end{array}
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
where $g ^ { k }$ is the sampled gradient in the kth iteration at $\boldsymbol { w } ^ { k }$ satisfying $\mathbb { E } \left[ \pmb { g } ^ { k } \right] \ : = \ : \nabla f ( \pmb { w } ^ { k } )$ and $\mathbb { E } \left[ \| \pmb { g } ^ { k } \| _ { ( { \pmb { A } } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } \right] \leq C _ { 0 } + C _ { 1 } \| \nabla f ( \pmb { w } ^ { k } ) \| ^ { 2 }$ for all $k \in \mathbb N .$ . If we take $\begin{array} { r } { \eta _ { k } = \frac { C } { k + 1 } } \end{array}$ for some $C > 0$ , then we have
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\mathbb { E } \left[ \Vert w ^ { k } - w ^ { * } \Vert _ { A _ { \sigma } ^ { n } } ^ { 2 } \right] = \mathbb { E } \left[ \Vert w ^ { k } - w ^ { * } \Vert ^ { 2 } + \sigma \Vert D _ { + } ^ { n } ( w ^ { k } - w ^ { * } ) \Vert ^ { 2 } \right] = O \left( \frac { 1 } { k + 1 } \right) ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
i.e., we have $H _ { \sigma } ^ { n }$ uniform convergence in $\sigma$ of $\{ w ^ { k } \}$ in expectation. The $H _ { \sigma } ^ { n }$ norm of $\pmb { w }$ is defined by $\| \pmb { w } \| _ { \sigma } ^ { n } : = \| w \| _ { \pmb { A } _ { \sigma } ^ { n } } = \sqrt { \langle \pmb { w } , \pmb { A } _ { \sigma } ^ { n } \pmb { w } \rangle }$ .
|
| 174 |
+
|
| 175 |
+
Proposition 4. Consider the algorithm $\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \eta _ { k } \big ( \pmb { A } _ { \sigma } ^ { n } \big ) ^ { - 1 } \nabla f \big ( \pmb { w } ^ { k } \big )$ . Suppose $f$ is convex and $L$ -Lipschitz smooth. If the step size satisfies $\begin{array} { r } { 0 < \underline { { \eta } } \le \eta \le \bar { \eta } < \frac { 2 } { L } } \end{array}$ . Then $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \| \nabla f ( \pmb { w } ^ { k } ) \| 0 } \end{array}$ . Moreover, if the Hessian $\nabla ^ { 2 } f$ of $f$ ¯is continuous with $\ b { w } ^ { * }$ being the global minimizer of $f$ , and $\bar { \eta } \| \nabla ^ { 2 } f \| < \bar { 1 }$ , then $\lVert \pmb { w } ^ { k } - \pmb { w } ^ { \ast } \rVert _ { \pmb { A } _ { \sigma } ^ { n } } 0$ as $k \infty$ , and the convergence is linear and independent of $\sigma$ .
|
| 176 |
+
|
| 177 |
+
In what follows, we present the noise reduction properties of the proposed smoothing operator $A _ { \sigma } ^ { - 1 }$ . Proposition 5. For any vector $\textbf { \textit { g } } \in \mathbb { R } ^ { m }$ , $d \ = \ A _ { \sigma } ^ { - 1 } g ,$ , let $j _ { \mathrm { m a x } } \ = \ \arg \operatorname* { m a x } _ { i } d _ { i }$ and $j _ { \mathrm { m i n } } \ =$ arg $\operatorname* { m i n } _ { i } d _ { i }$ . We have max ${ \mathrm { \Omega } } _ { i } d _ { i } = d _ { j _ { \operatorname* { m a x } } } \leq g _ { j _ { \operatorname* { m a x } } } \leq \operatorname* { m a x } _ { i } g _ { i }$ and $\mathrm { m i n } _ { i } d _ { i } = d _ { j _ { \mathrm { m i n } } } \geq g _ { j _ { \mathrm { m i n } } } \geq \mathrm { m i n } _ { i } g _ { i }$ . Proposition 6. The operator $A _ { \sigma } ^ { - 1 }$ preserves the sum of components. For any $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ and ${ \pmb d } =$ $A _ { \sigma } ^ { - \bar { 1 } } g _ { \bar { 1 } }$ , we have $\textstyle \sum _ { j } d _ { j } = \sum _ { j } g _ { j }$ , or equivalently, $\mathbf { 1 } ^ { \top } \pmb { d } = \mathbf { 1 } ^ { \top } \pmb { g }$ .
|
| 178 |
+
|
| 179 |
+
Proposition 7. Given any vector $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ and $\pmb { d } = \pmb { A } _ { \sigma } ^ { - 1 } \pmb { g }$ , then
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\| d \| + \sigma \frac { \| D _ { + } d \| ^ { 2 } } { \| d \| } \leq \| g \| .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
The above inequality is strict unless $\mathbf { \omega } _ { g } = d$ is a constant vector. In particular, we have $\| d \| \leq \| g \|$ and $\begin{array} { r } { \| D _ { + } d \| \le \frac { 1 } { \sqrt { \sigma } } \| \pmb { g } \| } \end{array}$ .
|
| 186 |
+
|
| 187 |
+
Let $\textbf { { g } }$ be the noise vector contained in the stochastic gradient, the above results imply that the extreme values in $\pmb { A } _ { \sigma } ^ { - 1 } \pmb { g }$ are smaller than those in $\textbf { { g } }$ (in magnitude), and it also has a much smaller $\ell _ { 2 }$ norm.
|
| 188 |
+
|
| 189 |
+
Proposition 8. For any $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ , define $\begin{array} { r } { \mathrm { V a r } ( \pmb { g } ) : = \frac { 1 } { m } \| \pmb { g } \| ^ { 2 } - \bigg ( \frac { \pmb { 1 } ^ { \top } \pmb { g } } { m } \bigg ) ^ { \frac { \pmb { \zeta } } { 2 } } } \end{array}$ be the variance of components in $\textbf { { g } }$ . Let $\pmb { d } = \pmb { A } _ { \sigma } ^ { - 1 } \pmb { g } ,$ , then
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\mathrm { V a r } ( \pmb { d } ) \leq \mathrm { V a r } ( \pmb { g } ) - 2 \sigma \frac { \| \pmb { D } _ { + } \pmb { d } \| ^ { 2 } } { m } - \sigma ^ { 2 } \frac { \| \pmb { D } _ { + } \pmb { d } \| ^ { 4 } } { m \| \pmb { d } \| ^ { 2 } } .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
The inequality is strict unless $\mathbf { \nabla } _ { \mathbf { { g } } } = d$ is a constant vector.
|
| 196 |
+
|
| 197 |
+
Proposition 8 shows that the component-wise variance of $\pmb { A } _ { \sigma } ^ { - 1 } \pmb { g }$ is considerably less than that of $\textbf { { g } }$ , unless $\textbf { { g } }$ is a constant vector. Our last result shows that $A _ { \sigma } ^ { - 1 } g$ has diminishing $\ell _ { 1 }$ norm of finite difference of all orders. This is an excellent desnoising result.
|
| 198 |
+
|
| 199 |
+
Proposition 9. Given vectors $\textbf { { g } }$ and $\pmb { d } = \pmb { A } _ { \sigma } ^ { - 1 } \pmb { g } ,$ , for any $p \in \mathbb N$ , it holds that $\| D _ { + } ^ { p } d \| _ { 1 } \leq \| D _ { + } ^ { p } g \| _ { 1 }$ .
|
| 200 |
+
The inequality is strict unless $D _ { + } ^ { p } g$ is a constant vector.
|
| 201 |
+
|
| 202 |
+
Remark 4. The above proofs generalize for $n > 1$ , except for Propositions $^ { 5 }$ and 9.
|
| 203 |
+
|
| 204 |
+
# 3.2 SOFTMAX REGRESSION
|
| 205 |
+
|
| 206 |
+
Consider applying the proposed optimization schemes to Softmax regression. We run 200 epochs of SGD and different order smoothing algorithms to maximize the likelihood of Softmax regression with batch size 100. Based on the results from previous section, we apply the exponentially decay learning rate with initial value 0.1 and decay 10 times after every 50 epochs. We train the model with only $1 0 \%$ randomly selected MNIST training data and test the trained model on the entire testing images. We further compare with SVRG under the same setting. Figure. 5 shows the histograms of generalization accuracy of Softmax regression model trained by SGD ((a)); SVRG ((b)); LSSGD (order 1) ((c)); LS-SGD (oder 2) ((d)). It is seen that SVRG improves the generalization with higher average accuracy. But the first and second order smoothing schemes significantly improve averaged generalization accuracy by more than $1 \%$ and reduce the variance over 100 independent trials. The training loss of these 100 experiments by different optimization algorithms are shown in the appendix.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 5: Testing accuracy of Softmax model trained on randomly selected $1 0 \%$ MNIST data.
|
| 210 |
+
|
| 211 |
+
# 4 APPLICATIONS TO DEEP NEURAL NETS
|
| 212 |
+
|
| 213 |
+
4.1 TRAIN NEURAL NETS WITH SMALL BATCH SIZE
|
| 214 |
+
|
| 215 |
+
Many advanced artificial intelligence tasks make high demand on training neural nets with extremely small batch size. The milestone technique for this is group normalization (Wu & He, 2018). In this section, we show that LS-SGD successfully trains DNN with extremely small batch size. We consider LeNet-5 devised by (LeCun et al., 1998) for MNIST classification. Our network architecture is as follows
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
\mathrm { L e N e t - 5 } \mathrm { : i n p u t _ { 2 8 \times 2 8 } \to c o n v _ { 2 0 , 5 , 2 } \to c o n v _ { 5 0 , 5 , 2 } \to f c _ { 5 1 2 } \to s o f t m a x . }
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
The notation $\mathrm { c o n v } _ { c , k , m }$ denotes a 2D convolutional layer with $c$ output channels, each of which is the sum of a channel-wise convolution operation on the input using a learnable kernel of size $k \times k$ , it further adds ReLU nonlinearity and max pooling with stride size $m$ . $\mathrm { f c } _ { 5 1 2 }$ is an affine transformation that transforms the input to a vector of dimension 512. Finally, the tensors are activated by a softmax function. The MNIST data is first passed to the layer $\mathrm { i n p u t } _ { 2 8 \times 2 8 }$ , and further processed by this hierarchical structure. We run 100 epochs of both SGD and LS-SGD with initial learning rate 0.01 and divide by 5 after 50 epochs, and use a weight decay of 0.0001 and momentum of 0.9. Figure. 6(a) plots the generalization accuracy on the test set with the LeNet5 trained with different batch sizes. For each batch size, LS-SGD with $\sigma = 1 . 0$ keeps the testing accuracy more than $9 9 . 4 \%$ , SGD reduce the accuracy to $9 7 \%$ when batch size 4 is used. The classification become just a random guess, when the model is trained by SGD with batch size 2. Small batch size leads to large noise in the gradient, which may make the noisy gradient not along the decent direction, However, Lapacian smoothing rescues this by killing the noise.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 6: (a). Testing accuracy of LeNet5 trained by SGD/LS-SGD on MNIST with various batch sizes. (b). The evolution of the pre-activated ResNet56’s training and generalization accuracy by SGD and LS-SGD. (Start from the 20-th epoch.)
|
| 225 |
+
|
| 226 |
+
# 4.2 IMPROVE GENERALIZATION ACCURACY
|
| 227 |
+
|
| 228 |
+
The skip connections in ResNet smooth the landscape of the loss function of the classical CNN (He et al., 2016; Li et al., 2017). This means that ResNet has fewer sharp minima. On Cifar10 (Krizhevsky, 2009), we compare the performance of LS-SGD and SGD on ResNet with the preactivated ResNet56 as an illustration. We take the same training strategy as that used in (He et al., 2016), except that we run 200 epochs with the learning rate decaying by a factor of 5 after every 40 epochs. For ResNet, instead of applying LS-SGD for all epochs, we only use LS-SGD in the first 40 epochs, and the remaining training is carried out by SGD. The parameter $\sigma$ is set to 1.0. Figure 6(b) depicts one path of the training and generalization accuracy of the neural nets trained by SGD and LS-SGD, respectively. It is seen that, even though the training accuracy obtained by SGD is higher than that by LS-SGD, the generalization is however inferior to that of LS-SGD. We conjecture that this is due to the fact that SGD gets trapped into some sharp but deeper minimum, which fits better than a flat minimum but generalizes worse. We carry out 25 replicas of this experiments, the histograms of the corresponding accuracy are shown in Fig. 7.
|
| 229 |
+
|
| 230 |
+

|
| 231 |
+
Figure 7: The histogram of the generalization accuracy of the pre-activated ResNet56 on Cifar10 trained with LS-SGD over 25 independent experiments.
|
| 232 |
+
|
| 233 |
+
# 4.3 TRAINING WASSERSTERIN GAN
|
| 234 |
+
|
| 235 |
+
Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) are notoriously delicate and unstable to train (Arjovsky & Bottou, 2017). In (M. Arjovsky & Bottou, 2017), Wasserstein-GANs (WGANs) are introduced to combat the instability in the training GANs. In addition to being more robust in training parameters and network architecture, WGANs provide a reliable estimate of the Earth Mover (EM) metric which correlates well with the quality of the generated samples. Nonetheless, WGANs training becomes unstable with a large learning rate or when used with a momentum based optimizer (M. Arjovsky & Bottou, 2017). In this section, we demonstrate that the gradient smoothing technique in this paper alleviates the instability in the training, and improves the quality of generated samples. Since WGANs with weight clipping are typically trained with RMSProp (Tieleman & Hinton, 2012), we propose replacing the gradient $g$ by a smoothed version $g _ { \sigma } = A _ { \sigma } ^ { - 1 } g$ , and also update the running averages using $g _ { \sigma }$ instead of $g$ . We name this algorithm LS-RMSProp.
|
| 236 |
+
|
| 237 |
+
To accentuate the instability in training and demonstrate the effects of gradient smoothing, we deliberately use a large learning rate for training the generator. We compare the regular RMSProp with the LS-RMSProp. The learning rate for the critic is kept small and trained approximately to convergence so that the critic loss is still an effective approximation to the Wasserstein distance.To control the number of unknowns in the experiment and make a meaningful comparison using the critic loss, we use the classical RMSProp for the critic, and only apply LS-RMSProp to the generator.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 8: Critic loss with learning rate $l r D = 0 . 0 0 0 1$ , $l r G = 0 . 0 0 5$ for RMSProp (Left) and LSRMSProp (Right), trained for 20K iterations. We apply a mean filter of window size 13 for better visualization. The loss from LS-RMSProp is visibly less noisy.
|
| 241 |
+
|
| 242 |
+
We train the WGANs on the MNIST dataset using the DCGAN (Radford et al., 2015) for both the critic and generator. In Figure 8 (left), we observe the loss for RMSProp trained with a large learning rate has multiple sharp spikes, indicating instability in the training process. The samples generated are also lower in quality, containing noisy spots as shown in Figure 9 (a). In contrast, the curve of training loss for LS-RMSProp is smoother and exhibits fewer spikes. The generated samples as shown in Fig. 9 (b) are also of better quality and visibly less noisy. The generated characters shown in Fig. 9 (b) are more realistic compared to the ones shown in Fig. 9 (a). The effects are less pronounced with a small learning rate, but still result in a modest improvement in sample quality as shown in Figure 9 (c) and (d).We also apply LS-RMSProp for training the critic, but do not see a clear improvement in the quality. This may be because the critic is already trained near optimality during each iteration, and does not benefit much from gradient smoothing.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 9: Samples from WGANs trained with RMSProp (a, c) and LS-RMSProp (b, d). The learning rate is set to $l r D = 0 . 0 0 0 1$ , $l r G = 0 . 0 0 5$ for both RMSProp and LS-RMSProp in (a) and (b). And $l r D = 0 . 0 0 0 1$ , $l r G = 0 . 0 0 0 1$ are used for both RMSProp and LS-RMSProp in (c) and (d). The critic is trained for 5 iterations per step of the generator, and 200 iterations per every 500 steps of the generator.
|
| 246 |
+
|
| 247 |
+
# 4.4 DEEP REINFORCEMENT LEARNING
|
| 248 |
+
|
| 249 |
+
Finally, we apply the LS-SGD to deep reinforcement learning. We provide a detailed discussion and present the numerical result in the appendix.
|
| 250 |
+
|
| 251 |
+
# 5 CONCLUDING REMARKS
|
| 252 |
+
|
| 253 |
+
Motivated by the theory of Hamilton-Jacobi partial differential equations, we proposed Laplacian smoothing gradient descent and its high order generalizations. This simple modification dramatically reduces the optimality gap in stochastic gradient descent and helps to find better minima. Extensive numerical examples ranging from toy cases to shallow and deep neural nets to generative adversarial networks and to deep reinforcement learning, all demonstrate the advantage of the proposed smoothed gradient. Several issues remain, in particular devising an on-the-fly adaptive method for choosing the smoothing parameter $\sigma$ instead of using a fixed value.
|
| 254 |
+
|
| 255 |
+
REFERENCES
|
| 256 |
+
M. Abadi, A. Agarwal, and et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 257 |
+
M. Arjovsky and L. Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
|
| 258 |
+
D. P. Bertsekas. Nonlinear programming. Athena scientific Belmont, 1999.
|
| 259 |
+
L. Bottou, E. Frank, and J. Nocedal. Optimization methods for large-scale machine learning. arXiv preprint arXiv:1606.04838, 2016.
|
| 260 |
+
L. Bottou, E. F. Curtis, and J. Nocedal. Optimization methods for large-scale machine learning. SIAM Review, 60(2):223–311, 2018.
|
| 261 |
+
O. Bousquet and A. Elisseeff. Stability and generalization. Journal of Machine Learning Research, 2:499–526, 2002.
|
| 262 |
+
G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 263 |
+
P. Chaudhari, A. Choromanska, S. Soatto, Y. LeCun, C. Baldassi Carlo, C. Borgs, J. Chayes, L. Sagun, and R. Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
|
| 264 |
+
P. Chaudhari, A. Oberman, S. Osher, S. Soatto, and C. Guillame. Deep relaxation: partial differential equations for optimizing deep neural networks. arXiv preprint arXiv:1704.04932, 2017.
|
| 265 |
+
A. Defazio and F. Bach. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances in Neural Information Processing Systems, 2014.
|
| 266 |
+
J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011.
|
| 267 |
+
L.C. Evans. Partial differential equations. 2010.
|
| 268 |
+
A. Gonen and S. Shalev-Shwartz. Fast rates for empirical risk minimization of strict saddle problems. arXiv preprint arXiv:1701.04271, 2017.
|
| 269 |
+
I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
|
| 270 |
+
M. Hardt, B. Recht, and Y. Singer. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Learning Representations, 2016.
|
| 271 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 272 |
+
S. Jastrzebski, Z. Kenton, N. Ballas, A. Fischer, Y. Bengio, and A. Storkey. Dnn’s sharpest directions along the sgd trajectory. arXiv preprint arXiv:1807.05031, 2018.
|
| 273 |
+
R. Johoson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, 2013.
|
| 274 |
+
M. Jung, G. Chung, G. Sundaramoorthi, L. Vese, and A. Yuille. Sobolev gradients and joint variational image segmentation, denoising, and deblurring. In Computational Imaging VII, volume 7246, pp. 72460I. International Society for Optics and Photonics, 2009.
|
| 275 |
+
N. Keskar, M. Shirish, N. Dheevatsa, S. Jorge, Mikhail, P. Tang, and P. Tak. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2017.
|
| 276 |
+
A. Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 277 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 81:2278–2324, 1998.
|
| 278 |
+
F. Li and et al. Cs231n: Convolutional neural networks for visual recognition. 2018.
|
| 279 |
+
H. Li, Z. Xu, G. Taylor, and T. Goldstein. Visualizing the loss landscape of neural nets. arXiv preprint arXiv:1712.09913, 2017.
|
| 280 |
+
S. Chintala M. Arjovsky and L. Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
|
| 281 |
+
Mnih and et al. Human-level control through deep reinforcement learning. Nature, 518:529–533, 2015.
|
| 282 |
+
V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 283 |
+
A. Paszke, S. Gross, S. Chintala, G. Chanan, E. Yang, Z. DeVito, Z. Lin, A. Desmaison, L. Antiga, and A. Lerer. Automatic differentiation in pytorch. 2017.
|
| 284 |
+
A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 285 |
+
J Schmidhuber. Deep learning in neural networks: An overview. arXiv preprint arXiv:1404.7828, 2014.
|
| 286 |
+
D. Silver and et al. Mastering the game of go with deep neural networks and tree search. Nature, 529:484–489, 2016.
|
| 287 |
+
T. Tieleman and G. Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26–31, 2012.
|
| 288 |
+
Y. Wu and K. He. Group normalization. In European Conference on Computer Vision, 2018.
|
| 289 |
+
|
| 290 |
+
# 6 APPENDIX
|
| 291 |
+
|
| 292 |
+
# 6.1 TECHNICAL PROOFS
|
| 293 |
+
|
| 294 |
+
Proposition 1. Suppose $f ( w )$ is differentiable, the Laplacian smoothing GD update on $u ( { \boldsymbol { w } } , t )$
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - t \pmb { A } _ { \sigma } ^ { - 1 } \nabla _ { \pmb { w } } u ( \pmb { w } ^ { k } , t )
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
permits the smoothing implicit gradient descent on $f ( w )$
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\begin{array} { r } { \pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - t \pmb { A } _ { \sigma } ^ { - 1 } \nabla f ( \pmb { w } ^ { k + 1 } ) . } \end{array}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
# Proof of Proposition 1. We define
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
z ( \pmb { w } , \pmb { v } , t ) : = f ( \pmb { v } ) + \frac { 1 } { 2 t } \langle \pmb { v } - \pmb { w } , \pmb { A } _ { \sigma } ( \pmb { v } - \pmb { w } ) \rangle ,
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
and rewrite $u ( \pmb { w } , t ) = \operatorname* { i n f } _ { \pmb { v } } z ( \pmb { w } , \pmb { v } , t )$ as $z ( \mathbf { w } , \mathbf { v } ( \mathbf { w } , t ) , t )$ , where ${ \pmb v } ( { \pmb w } , t ) = \arg \operatorname* { m i n } _ { \pmb v } { z } ( { \pmb w } , { \pmb v } , t )$ Then by the Euler-Lagrange equation,
|
| 313 |
+
|
| 314 |
+
$\begin{array} { r } { \nabla _ { w } u ( w , t ) = \nabla _ { w } z ( w , v ( w , t ) , t ) = J _ { w } v ( w , t ) \nabla _ { v } z ( w , v ( w , t ) , t ) + \nabla _ { w } z ( w , v ( w , t ) , t ) , } \end{array}$ where $J _ { w } { \bf v } ( w , t )$ is the Jacobian matrix of $\textbf { { v } }$ w.r.t. $\textbf { \em w }$ . Notice that $\nabla _ { v } z ( w , v ( w , t ) , t ) = \mathbf { 0 }$ ,
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\nabla _ { \pmb { w } } u ( \pmb { w } , t ) = \nabla _ { \pmb { w } } z ( \pmb { w } , \pmb { v } ( \pmb { w } , t ) , t ) = - \frac { 1 } { t } \pmb { A } _ { \sigma } ( \pmb { v } ( \pmb { w } , t ) - \pmb { w } ) .
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
Letting $\mathbf { \Delta } w = w ^ { k }$ and $\begin{array} { r } { \pmb { w } ^ { k + 1 } = \pmb { v } ( \pmb { w } ^ { k } , t ) = \arg \operatorname* { m i n } _ { \mathbf { v } } z ( \pmb { w } ^ { k } , \pmb { v } , t ) } \end{array}$ in the above equalities, we have
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\nabla _ { \boldsymbol { w } } \boldsymbol { u } ( \boldsymbol { w } ^ { k } , t ) = - \frac { 1 } { t } \boldsymbol { A } _ { \sigma } ( \boldsymbol { w } ^ { k + 1 } - \boldsymbol { w } ^ { k } ) .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
In summary, the gradient descent $\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - t \pmb { A } _ { \sigma } ^ { - 1 } \nabla _ { \pmb { w } } u ( \pmb { w } ^ { k } , t )$ is equivalent to the proximal point iteration $\begin{array} { r } { \pmb { w } ^ { \tilde { k } + 1 } = \arg \operatorname* { m i n } _ { \pmb { v } } \pmb { f } ( \pmb { v } ) + \frac { 1 } { 2 t } \pmb { \langle v - \pmb { w } ^ { k } } , \pmb { A } _ { \sigma } ( \pmb { v } - \pmb { w } ^ { k } ) \rangle . } \end{array}$ , which yields $\mathbf { \boldsymbol { w } } ^ { k + 1 } \mathbf { \dot { \xi } } = \mathbf { \boldsymbol { w } } ^ { k } - \mathbf { \boldsymbol { \xi } }$ $t A _ { \sigma } ^ { - 1 } \nabla f ( { \pmb w } ^ { k + 1 } )$ . □
|
| 327 |
+
|
| 328 |
+
Proposition 2. Suppose $f$ is convex with the global minimizer $\boldsymbol { w } ^ { * }$ , and $f ^ { * } = f ( w ^ { * } )$ . Consider the following iteration with constant learning rate $\eta > 0$
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \eta ( \pmb { A } _ { \sigma } ^ { n } ) ^ { - 1 } \pmb { g } ^ { k }
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $g ^ { k }$ is the sampled gradient in the kth iteration at $\boldsymbol { w } ^ { k }$ satisfying $\mathbb { E } [ \pmb { g } ^ { k } ] = \nabla f ( \pmb { w } ^ { k } )$ . Denote $\begin{array} { r } { G _ { { \pmb A } _ { \sigma } ^ { n } } : = \operatorname* { l i m } _ { K \infty } \frac { 1 } { K } \sum _ { k = 0 } ^ { K - 1 } \| \pmb { g } ^ { k } \| _ { ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } \end{array}$ and $\begin{array} { r } { \overline { { \pmb { w } } } ^ { K } : = \sum _ { k = 0 } ^ { K - 1 } \pmb { w } ^ { k } / K } \end{array}$ the ergodic average of iterates. Then the optimality gap is
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\operatorname* { l i m } _ { K \to \infty } \mathbb { E } [ f ( \overline { { \pmb { w } } } ^ { K } ) ] - f ^ { * } \leq \frac { \eta G _ { A _ { \sigma } ^ { n } } } { 2 } .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Proof. Since $f$ is convex, we have
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\langle \nabla f ( { \pmb w } ^ { k } ) , { \pmb w } ^ { k } - { \pmb w } ^ { * } \rangle \geq f ( { \pmb w } ^ { k } ) - f ^ { * } .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Furthermore,
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r l } & { \quad \mathbb { E } [ \| { \pmb w } ^ { k + 1 } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] = \mathbb { E } [ \| { \pmb w } ^ { k } - \eta ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } { \pmb g } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] } \\ & { = \mathbb { E } [ \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] - 2 \eta \mathbb { E } [ \langle { \pmb g } ^ { k } , { \pmb w } ^ { k } - { \pmb w } ^ { * } \rangle ] + \eta ^ { 2 } \mathbb { E } [ \| ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } { \pmb g } ^ { t } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] } \\ & { \le \mathbb { E } [ \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] - 2 \eta \mathbb { E } [ \langle \nabla f ( { \pmb w } ^ { k } ) , { \pmb w } ^ { k } - { \pmb w } ^ { * } \rangle ] + \eta ^ { 2 } \| { \pmb g } ^ { k } \| _ { ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } \\ & { \le \mathbb { E } [ \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] - 2 \eta ( \mathbb { E } [ f ( { \pmb w } ^ { k } ) ] - f ^ { * } ) + \eta ^ { 2 } \| { \pmb g } ^ { k } \| _ { ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } , } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
where the last inequality is due to (7). We rearrange the terms and arrive at
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\mathbb { E } [ f ( { \pmb w } ^ { k } ) ] - f ^ { * } \le \frac { 1 } { 2 \eta } ( \mathbb { E } [ \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] - \mathbb { E } [ \| { \pmb w } ^ { k + 1 } - { \pmb w } ^ { * } \| _ { { \pmb A } _ { \sigma } ^ { n } } ^ { 2 } ] ) + \frac { \eta \| { \pmb g } ^ { k } \| _ { ( { \pmb A } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } { 2 } .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Summing over $k$ from 0 to $K - 1$ and averaging and using the convexity of $f$ , we have
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathbb { E } [ f ( \overline { { w } } ^ { K } ) ] - f ^ { * } \leq \frac { \sum _ { k = 0 } ^ { K - 1 } \mathbb { E } [ f ( w ^ { k } ) ] } { K } - f ^ { * } \leq \frac { 1 } { 2 \eta K } \mathbb { E } [ \| w ^ { 0 } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } ] + \frac { \sum _ { k = 0 } ^ { K - 1 } \| g ^ { k } \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } { 2 K } \eta .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Taking the limit as $K \infty$ above establishes the result.
|
| 365 |
+
|
| 366 |
+
Proposition 3. Suppose $f$ is $L$ -Lipschitz smooth and $a$ -strongly convex. Consider the generalized smoothing gradient descent algorithm
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\begin{array} { r } { \pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \eta _ { k } ( \pmb { A } _ { \sigma } ^ { n } ) ^ { - 1 } \pmb { g } ^ { k } , } \end{array}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
where $g ^ { k }$ is the sampled gradient in the kth iteration at $\boldsymbol { w } ^ { k }$ satisfying $\mathbb { E } \left[ \pmb { g } ^ { k } \right] \ : = \ : \nabla f ( \pmb { w } ^ { k } )$ and $\mathbb { E } \left[ \| \pmb { g } ^ { k } \| _ { ( { \pmb { A } } _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } \right] \leq C _ { 0 } + C _ { 1 } \| \nabla f ( \pmb { w } ^ { k } ) \| ^ { 2 }$ for all $k \in \mathbb { N } .$ . If we take $\begin{array} { r } { \eta _ { k } = \frac { C } { k + 1 } } \end{array}$ for some $C > 0$ , then we have
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\mathbb { E } \left[ \Vert w ^ { k } - w ^ { * } \Vert _ { A _ { \sigma } ^ { n } } ^ { 2 } \right] = \mathbb { E } \left[ \Vert w ^ { k } - w ^ { * } \Vert ^ { 2 } + \sigma \Vert D _ { + } ^ { n } ( w ^ { k } - w ^ { * } ) \Vert ^ { 2 } \right] = O \left( \frac { 1 } { k + 1 } \right) ,
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
i.e., we have $H _ { \sigma } ^ { n }$ uniform convergence in $\sigma$ of $\{ w ^ { k } \}$ in expectation. The $H _ { \sigma } ^ { n }$ norm of $\pmb { w }$ is defined by $\| \pmb { w } \| _ { \sigma } ^ { n } : = \| w \| _ { \pmb { A } _ { \sigma } ^ { n } } = \sqrt { \langle \pmb { w } , \pmb { A } _ { \sigma } ^ { n } \pmb { w } \rangle }$ .
|
| 379 |
+
|
| 380 |
+
Proof of Proposition 3. Since $\nabla f ( { \pmb w } ^ { * } ) = { \bf 0 }$ , by strong convexity of $f$ , we have
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\langle \nabla f ( { \boldsymbol w } ^ { k } ) , { \boldsymbol w } ^ { k } - { \boldsymbol w } ^ { * } \rangle = \langle \nabla f ( { \boldsymbol w } ^ { k } ) - \nabla f ( { \boldsymbol w } ^ { * } ) , { \boldsymbol w } ^ { k } - { \boldsymbol w } ^ { * } \rangle \geq a \| { \boldsymbol w } ^ { k } - { \boldsymbol w } ^ { * } \| ^ { 2 } .
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
Moreover, by $L$ -smoothness of $f$ and the fact that $\| A _ { \sigma } ^ { n } \| = 1$ , we also have
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r } { \| \nabla f ( { \pmb w } ^ { k } ) \| = \| \nabla f ( { \pmb w } ^ { k } ) - \nabla f ( { \pmb w } ^ { * } ) \| \leq L \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| \leq L \| { \pmb w } ^ { k } - { \pmb w } ^ { * } \| _ { { \pmb u } _ { \sigma } ^ { n } } . } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Hence,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { r l } & { \quad \mathbb { E } [ \| w ^ { k + 1 } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } ] = \mathbb { E } [ \| w ^ { k } - \eta ( A _ { \sigma } ^ { n } ) ^ { - 1 } g ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } ] } \\ & { = \mathbb { E } [ \| w ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } ] - 2 \eta _ { k } \mathbb { E } \left[ \langle g ^ { k } , w ^ { k } - w ^ { * } \rangle \right] + \eta _ { k } ^ { 2 } \mathbb { E } [ \| g ^ { k } \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } ] } \\ & { = \mathbb { E } [ \| w ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } ] - 2 \eta _ { k } \langle \nabla f ( w ^ { k } ) , w ^ { k } - w ^ { * } \rangle + \eta _ { k } ^ { 2 } \mathbb { E } [ \| g ^ { k } \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } ] } \\ & { \leq ( 1 - 2 \eta _ { k } a ) \mathbb { E } \left[ \| w ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } \right] + \eta _ { k } ^ { 2 } \left( C _ { 0 } + C _ { 1 } \mathbb { E } [ \| \nabla f ( w ^ { k } ) \| ^ { 2 } ] \right) } \\ & { \leq \left( 1 - 2 \eta _ { k } a + \eta _ { k } ^ { 2 } L ^ { 2 } C _ { 1 } \right) \mathbb { E } \left[ \| w ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } ^ { 2 } \right] + \eta _ { k } ^ { 2 } C _ { 0 } , } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
where in the first inequality we used k(Anσ)−1k = 1 for all σ and n. Taking ηk = Ck+1 for some proper $\ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ : \ c \ : \ : \ c \ c \ c \ c \ c \ c \ c \ c \ c \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F \ F$ and using induction, one can show that $\begin{array} { r l } { \mathbb { E } \left[ \| \pmb { w } ^ { k } - \pmb { w } ^ { * } \| _ { \pmb { A } _ { \sigma } ^ { n } } ^ { 2 } \right] } & { = } \end{array}$ $\begin{array} { r } { \mathbb { E } \left[ \| \pmb { w } ^ { k } - \pmb { w } ^ { * } \| ^ { 2 } + \sigma \| \pmb { D } _ { + } ^ { n } ( \pmb { w } ^ { k } - \pmb { w } ^ { * } ) \| \right] = O ( \frac { 1 } { k + 1 } ) . } \end{array}$
|
| 399 |
+
|
| 400 |
+
Proposition 4. Consider the algorithm $\pmb { w } ^ { k + 1 } = \pmb { w } ^ { k } - \eta _ { k } \big ( \pmb { A } _ { \sigma } ^ { n } \big ) ^ { - 1 } \nabla f ( \pmb { w } ^ { k } ) .$ . Suppose $f$ is $L$ -Lipschitz smooth and $\begin{array} { r } { 0 < \underline { { \eta } } \le \eta \le \bar { \eta } < \bar { \frac { 2 } { L } } } \end{array}$ . Then $\begin{array} { r } { \operatorname* { l i m } _ { t \infty } \| \nabla f ( \pmb { w } ^ { k } ) \| 0 } \end{array}$ . Moreover, if the Hessian $\bar { \nabla } ^ { 2 } f$ of $f$ ¯is continuous with $\ b { w } ^ { * }$ being the minimizer of $f$ , and $\bar { \eta } \| \nabla ^ { 2 } f \| < 1$ , then $\lVert \pmb { w } ^ { k } - \pmb { w } ^ { * } \rVert _ { \pmb { A } _ { \sigma } ^ { n } } 0$ as $k \infty$ , and the convergence is linear.
|
| 401 |
+
|
| 402 |
+
Proof of Proposition 4. By the Lipschitz continuity of $\nabla f$ and the descent lemma (Bertsekas, 1999), we have
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } { f ( w ^ { k + 1 } ) \ } & { = f ( w ^ { k } - \eta _ { k } ( A _ { \sigma } ^ { n } ) ^ { - 1 } \nabla f ( w ^ { k } ) ) } \\ & { \le f ( w ^ { k } ) - \eta _ { k } \langle \nabla f ( w ^ { k } ) , ( A _ { \sigma } ^ { n } ) ^ { - 1 } \nabla f ( w ^ { k } ) ) \rangle + \frac { \eta _ { k } ^ { 2 } L } { 2 } \| ( A _ { \sigma } ^ { n } ) ^ { - 1 } \nabla f ( w ^ { k } ) \| ^ { 2 } } \\ & { \le f ( w ^ { k } ) - \eta _ { k } \| \nabla f ( w ^ { k } ) \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } + \frac { \eta _ { k } ^ { 2 } L } { 2 } \| \nabla f ( w ^ { k } ) \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } } \\ & { \le f ( w ^ { k } ) - \eta \left( 1 - \frac { \bar { \eta } L } { 2 } \right) \| \nabla f ( w ^ { k } ) \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } . } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
Summing the above inequality over $k$ , we have
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\eta \left( 1 - \frac { \bar { \eta } L } { 2 } \right) \sum _ { k = 0 } ^ { \infty } \| \nabla f ( \pmb { w } ^ { k } ) \| _ { ( A _ { \sigma } ^ { n } ) ^ { - 1 } } ^ { 2 } \leq f ( \pmb { w } ^ { 0 } ) - \operatorname* { l i m } _ { k \to \infty } f ( \pmb { w } ^ { k } ) < \infty .
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Therefore, $\| \nabla f ( \pmb { w } ^ { k } ) \| _ { ( { A _ { \sigma } ^ { n } } ) ^ { - 1 } } ^ { 2 } 0$ , and thus $\| \nabla f ( \pmb { w } ^ { k } ) \| 0$
|
| 415 |
+
|
| 416 |
+
For the second claim, we have
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { r l } & { v ^ { k + 1 } - w ^ { * } = w ^ { k } - w ^ { * } - \eta _ { k } ( A _ { \sigma } ^ { n } ) ^ { - 1 } ( \nabla f ( w ^ { k } ) - \nabla f ( w ^ { * } ) ) } \\ & { \quad \quad = w ^ { k } - w ^ { * } - \eta _ { k } ( A _ { \sigma } ^ { n } ) ^ { - 1 } \left( \displaystyle \int _ { 0 } ^ { 1 } \nabla ^ { 2 } f ( w ^ { * } + \tau ( w ^ { k + 1 } - w ^ { * } ) ) \cdot ( w ^ { k } - w ^ { * } ) \mathrm { d } \tau \right) } \\ & { \quad \quad = w ^ { k } - w ^ { * } - \eta _ { k } ( A _ { \sigma } ^ { n } ) ^ { - 1 } \left( \displaystyle \int _ { 0 } ^ { 1 } \nabla ^ { 2 } f ( w ^ { * } + \tau ( w ^ { k + 1 } - w ^ { * } ) ) \mathrm { d } \tau \cdot ( w ^ { k } - w ^ { * } ) \right) } \\ & { \quad \quad = ( A _ { \sigma } ^ { n } ) ^ { - \frac { 1 } { 2 } } \left( I - \eta _ { k } ( A _ { \sigma } ^ { n } ) ^ { - \frac { 1 } { 2 } } \displaystyle \int _ { 0 } ^ { 1 } \nabla ^ { 2 } f ( w ^ { * } + \tau ( w ^ { k + 1 } - w ^ { * } ) ) \mathrm { d } \tau ( A _ { \sigma } ^ { n } ) ^ { - \frac { 1 } { 2 } } \right) ( A _ { \sigma } ^ { n } ) ^ { \frac { 1 } { 2 } } ( w ^ { k } + \tau ( w ^ { k + 1 } - w ^ { * } ) ) } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Therefore,
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
w ^ { k + 1 } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } \leq \left\| I - \eta _ { t } ( A _ { \sigma } ^ { n } ) ^ { - \frac { 1 } { 2 } } \int _ { 0 } ^ { 1 } \nabla ^ { 2 } f ( w ^ { * } + \tau ( w ^ { k + 1 } - w ^ { * } ) ) \mathrm { d } \tau ( A _ { \sigma } ^ { n } ) ^ { - \frac { 1 } { 2 } } \right\| \| w ^ { k } - w ^ { * } \| _ { A _ { \sigma } ^ { n } } .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
So if $\begin{array} { r } { \eta _ { k } \| \nabla ^ { 2 } f \| \le \frac { 1 } { \| ( A _ { \sigma } ^ { n } ) ^ { - 1 } \| } = 1 } \end{array}$ , the result follows.
|
| 429 |
+
|
| 430 |
+
Proposition 5. For any vector $\textbf { \textit { g } } \in \mathbb { R } ^ { m }$ , $d \ = \ A _ { \sigma } ^ { - 1 } g ,$ , let $j _ { \mathrm { m a x } } \ = \ \arg \operatorname* { m a x } _ { i } d _ { i }$ and $j _ { \mathrm { m i n } } \ =$ arg $\operatorname* { m i n } _ { i } d _ { i }$ . We have $\begin{array} { r } { \operatorname { n a x } _ { i } d _ { i } = d _ { j _ { \operatorname* { m a x } } } \leq g _ { j _ { \operatorname* { m a x } } } \leq \operatorname* { m a x } _ { i } g _ { i } } \end{array}$ and $\mathrm { m i n } _ { i } d _ { i } = d _ { j _ { \mathrm { m i n } } } \geq g _ { j _ { \mathrm { m i n } } } \geq \mathrm { m i n } _ { i } g _ { i }$ .
|
| 431 |
+
|
| 432 |
+
Proof of Proposition 5. Since $\mathbf { \omega } _ { g } = A _ { \sigma } \mathbf { \vec { d } }$ , it holds that
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
g _ { j _ { \operatorname* { m a x } } } = d _ { j _ { \operatorname* { m a x } } } + \sigma ( 2 d _ { j _ { \operatorname* { m a x } } } - d _ { j _ { \operatorname* { m a x } } - 1 } - d _ { j _ { \operatorname* { m a x } } + 1 } ) ,
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
where periodicity of subindex are used if necessary. Since $2 d _ { j _ { \operatorname* { m a x } } } - d _ { j _ { \operatorname* { m a x } } - 1 } - d _ { j _ { \operatorname* { m a x } } + 1 } \geq 0$ , We $\begin{array} { r } { \operatorname* { m a x } _ { i } d _ { i } = d _ { j _ { \operatorname* { m a x } } } \leq g _ { j _ { \operatorname* { m a x } } } \leq \operatorname* { m a x } _ { i } g _ { i } } \end{array}$ . A similar argument can show that ${ \mathrm { m i n } } _ { i } d _ { i } = d _ { j _ { \operatorname* { m i n } } } \geq$ $g _ { j _ { \operatorname* { m i n } } } \geq \operatorname* { m i n } _ { i } g _ { i }$
|
| 439 |
+
|
| 440 |
+
Proposition 6. The operator $A _ { \sigma } ^ { - 1 }$ preserves the sum of components. For any $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ and ${ \pmb d } =$ $A _ { \sigma } ^ { - 1 } g$ , we have $\textstyle \sum _ { j } d _ { j } = \sum _ { j } g _ { j }$ , or equivalently, $\mathbf { 1 } ^ { \top } \pmb { d } = \mathbf { 1 } ^ { \top } \pmb { g }$ .
|
| 441 |
+
|
| 442 |
+
Proof of Proposition 6. Since $\mathbf { \omega } _ { g } = A _ { \sigma } \mathbf { \vec { d } }$ ,
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
\sum _ { i } g _ { i } = \mathbf { 1 } ^ { \top } \mathbf { g } = \mathbf { 1 } ^ { \top } ( I + \sigma D _ { + } ^ { \top } D _ { + } ) d = \mathbf { 1 } ^ { \top } d = \sum _ { i } d _ { i } ,
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
where we used ${ \cal D } _ { + } \mathbf { 1 } = \mathbf { 0 }$ .
|
| 449 |
+
|
| 450 |
+
Proposition 7. Given any vector $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ and $\pmb { d } = \pmb { A } _ { \sigma } ^ { - 1 } \pmb { g }$ , then
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\| \pmb { d } \| + \sigma \frac { \| \pmb { D } _ { + } \pmb { d } \| ^ { 2 } } { \| \pmb { d } \| } \le \| \pmb { g } \| .
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
The above inequality is strict unless $\mathbf { \omega } _ { g } = d$ is a constant vector. In particular, we have $\| d \| \leq \| g \|$ and $\begin{array} { r } { \| D _ { + } d \| \le \frac { 1 } { \sqrt { \sigma } } \| \pmb { g } \| } \end{array}$ .
|
| 457 |
+
|
| 458 |
+
Proof of Proposition 7. By the definition of $A _ { \sigma }$ ,
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
g = A _ { \sigma } d = ( I - \sigma D _ { - } D _ { + } ) d = d + \sigma D _ { + } ^ { \top } D _ { + } d .
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
Therefore, pre-multiplying by $d ^ { \top }$ on both sides, we have
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array} { r } { \| \pmb { d } \| ^ { 2 } + \sigma \| \pmb { D } _ { + } \pmb { d } \| ^ { 2 } = \pmb { d } ^ { \top } \pmb { g } \leq \| \pmb { d } \| \| \pmb { g } \| . } \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
In particular, $\| d \| \leq \| g \|$ and $\sigma \| D _ { + } d \| ^ { 2 } \leq \| d \| \| g \| \leq \| g \| ^ { 2 }$ , so $\begin{array} { r } { \| D _ { + } d \| \le \frac { 1 } { \sqrt { \sigma } } \| g \| } \end{array}$ . All the inequalities are strict unless $\| D _ { + } d \| = 0$ , and $\mathbf { \nabla } _ { \mathbf { { g } } } = d$ is a constant vector.
|
| 471 |
+
|
| 472 |
+
Proposition 8. For any $\pmb { \mathscr { g } } \in \mathbb { R } ^ { m }$ , define $\begin{array} { r } { \mathrm { V a r } ( \pmb { g } ) : = \frac { 1 } { m } \| \pmb { g } \| ^ { 2 } - \bigg ( \frac { \pmb { 1 } ^ { \top } \pmb { g } } { m } \bigg ) ^ { 2 } } \end{array}$ be the variance of components in $\textbf { { g } }$ . Let $\pmb { d } = \pmb { A } _ { \sigma } ^ { - 1 } \pmb { g } ,$ , then
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\mathrm { V a r } ( \pmb { d } ) \leq \mathrm { V a r } ( \pmb { g } ) - 2 \sigma \frac { \| \pmb { D } _ { + } \pmb { d } \| ^ { 2 } } { m } - \sigma ^ { 2 } \frac { \| \pmb { D } _ { + } \pmb { d } \| ^ { 4 } } { m \| \pmb { d } \| ^ { 2 } } .
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
The inequality is strict unless $\mathbf { \nabla } _ { \mathbf { { g } } } = d$ is a constant vector.
|
| 479 |
+
|
| 480 |
+
Proof of Proposition 8. Since 1>g = 1>d and kdk + σ kD+dk2kdk ,
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { r l } & { \mathrm { V a r } ( g ) \geq \displaystyle \frac { 1 } { m } \left( \| d \| ^ { 2 } + 2 \sigma \| D _ { + } d \| ^ { 2 } + \sigma ^ { 2 } \frac { \| D _ { + } d \| ^ { 4 } } { \| d \| ^ { 2 } } \right) - \left( \frac { \mathbf { 1 } ^ { \top } d } { n } \right) ^ { 2 } } \\ & { \quad \quad \quad \quad = \mathrm { V a r } ( d ) + 2 \sigma \frac { \| D _ { + } d \| ^ { 2 } } { m } + \sigma ^ { 2 } \frac { \| D _ { + } d \| ^ { 4 } } { m \| d \| ^ { 2 } } . } \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
The inequality is strict unless $\| \pmb { \cal D } _ { + } \pmb { d } \| = 0$ , and $\mathbf { \nabla } _ { \mathbf { { g } } } = d$ is a constant vector.
|
| 487 |
+
|
| 488 |
+
Proposition 9. Given vectors $\textbf { { g } }$ and $d = A _ { \sigma } ^ { - 1 } g ,$ , for any $p \in \mathbb N$ , it holds that $\| D _ { + } ^ { p } d \| _ { 1 } \leq \| D _ { + } ^ { p } g \| _ { 1 }$ .
|
| 489 |
+
The inequality is strict unless $D _ { + } ^ { p } g$ is a constant vector.
|
| 490 |
+
|
| 491 |
+
Proof of Proposition 9. Since $( 1 + 2 \sigma ) d _ { i } = g _ { i } + \sigma d _ { i + 1 } + \sigma d _ { i - 1 }$ , for any $p \in \mathbb N$ , we have
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
( 1 + 2 \sigma ) ( D _ { + } ^ { p } d ) _ { i } = ( D _ { + } ^ { p } g ) _ { i } + \sigma ( D _ { + } ^ { p } d ) _ { i + 1 } + \sigma ( D _ { + } ^ { p } d ) _ { i - 1 } .
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
So
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
( 1 + 2 \sigma ) | ( D _ { + } ^ { p } d ) _ { i } | \leq | ( D _ { + } ^ { p } g ) _ { i } | + \sigma | ( D _ { + } ^ { p } d ) _ { i + 1 } | + \sigma | ( D _ { + } ^ { p } d ) _ { i - 1 } | .
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
The inequality is strict if there are sign changes among the $( D _ { + } ^ { p } d ) _ { i - 1 } , ( D _ { + } ^ { p } d ) _ { i } , ( D _ { + } ^ { p } d ) _ { i + 1 }$ . Summing over $i$ and using periodicity, we have
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
( 1 + 2 \sigma ) \sum _ { i = 1 } ^ { m } | ( D _ { + } ^ { p } d ) _ { i } | \leq \sum _ { i = 1 } ^ { m } | ( D _ { + } ^ { p } g ) _ { i } | + 2 \sigma \sum _ { i = 1 } ^ { m } | ( D _ { + } ^ { p } d ) _ { i } | ,
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
and the result follows. The inequality is strict unless $D _ { + } ^ { p } g$ is a constant vector.
|
| 510 |
+
|
| 511 |
+
# 6.2 ITERATION V.S. LOSS FOR SOFTMAX REGRESSION
|
| 512 |
+
|
| 513 |
+
In this part, we show the training loss evolution in training Softmax regression model, respectively, by SGD, SVRG, LSGD with first and second order smoothing. As illustrated in Fig. 10, all the optimization algorithms reduce loss of the model on the training set. At each iteration, among 100 independent experiments, SGD has the largest variance, SGD with first order smoothed gradient significantly reduces the variance of loss function. The second order smoothing can further reduce variance of loss. The variance of loss in each iteration among 100 experiments is minimized when SVRG is use to train the Softmax model. However, the generalization performance of the model trained by SVRG is not as good as the ones trained by LS-SGD or higher order smoothed gradient descent.
|
| 514 |
+
|
| 515 |
+
# 6.3 DEEP REINFORCEMENT LEARNING
|
| 516 |
+
|
| 517 |
+
Deep reinforcement learning (DRL) has been applied to playing games including Cartpole (Brockman et al., 2016), Atari (Mnih et al., 2013), Go (Silver & et al, 2016; Mnih & et al, 2015). DNN plays a vital role in approximating the Q-function or policy function. We apply the Laplacian smoothed gradient to train the policy function to play the Cartpole game. We apply the standard procedure to train the policy function by using the policy gradient (Brockman et al., 2016). We use the following network to approximate the policy function:
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
\mathrm { i n p u t _ { 4 } } \to \mathrm { f c _ { 2 0 } } \to \mathrm { r e l u } \to \mathrm { f c _ { 2 } } \to \mathrm { s o f t m a x } .
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+

|
| 524 |
+
Figure 10: Iterations v.s. loss for GD, SVRG, and smoothed GD with order 1 and 2 for training the softmax regression model.
|
| 525 |
+
|
| 526 |
+
The network is trained by RMSProp and LS-RMSProp with $\sigma = 1 . 0$ , respectively. The learning rate and other related parameters are set to be the default ones in PyTorch. The training is stopped once the average duration of 5 consecutive episodes is more than 490. In each training episode, we set the maximal steps to be 500. Left and right panels of Fig. 11 depict a training procedure by using RMSProp and LS-RMSProp, respectively. We see that Laplacian smoothed gradient takes fewer episodes to reach the stopping criterion. Moreover, we run the above experiments 5 times independently, and apply the trained model to play Cartpole. The game lasts more than 1000 steps for all the 5 models trained by LS-RMSProp, while only 3 of them lasts more than 1000 steps when the model is trained by vanilla RMSProp.
|
| 527 |
+
|
| 528 |
+

|
| 529 |
+
Figure 11: Durations of the cartpole game in the training procedure. Left and right are training procedure by RMSProp and LS-RMSProp with $\sigma = 1 . 0$ , respectively.
|
md/train/Byl5NREFDr/Byl5NREFDr.md
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THIEVES ON SESAME STREET! MODEL EXTRACTION OF BERT-BASED APIS
|
| 2 |
+
|
| 3 |
+
Kalpesh Krishna∗ CICS, UMass Amherst kalpesh@cs.umass.edu
|
| 4 |
+
|
| 5 |
+
Gaurav Singh Tomar Google Research gtomar@google.com
|
| 6 |
+
|
| 7 |
+
Ankur P. Parikh Google Research aparikh@google.com
|
| 8 |
+
|
| 9 |
+
Nicolas Papernot Google Research papernot@google.com
|
| 10 |
+
|
| 11 |
+
Mohit Iyyer CICS, UMass Amherst miyyer@cs.umass.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We study the problem of model extraction in natural language processing, in which an adversary with only query access to a victim model attempts to reconstruct a local copy of that model. Assuming that both the adversary and victim model fine-tune a large pretrained language model such as BERT (Devlin et al., 2019), we show that the adversary does not need any real training data to successfully mount the attack. In fact, the attacker need not even use grammatical or semantically meaningful queries: we show that random sequences of words coupled with task-specific heuristics form effective queries for model extraction on a diverse set of NLP tasks, including natural language inference and question answering. Our work thus highlights an exploit only made feasible by the shift towards transfer learning methods within the NLP community: for a query budget of a few hundred dollars, an attacker can extract a model that performs only slightly worse than the victim model. Finally, we study two defense strategies against model extraction—membership classification and API watermarking—which while successful against naive adversaries, are ineffective against more sophisticated ones.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Machine learning models represent valuable intellectual property: the process of gathering training data, iterating over model design, and tuning hyperparameters costs considerable money and effort. As such, these models are often only indirectly accessible through web APIs that allow users to query a model but not inspect its parameters. Malicious users might try to sidestep the expensive model development cycle by instead locally reproducing an existing model served by such an API. In these attacks, known as “model stealing” or “model extraction” (Lowd & Meek, 2005; Tramer\` et al., 2016), the adversary issues a large number of queries and uses the collected (input, output) pairs to train a local copy of the model. Besides theft of intellectual property, extracted models may leak sensitive information about the training data (Tramer et al., 2016) or be used to generate \` adversarial examples that evade the model served by the API (Papernot et al., 2017).
|
| 20 |
+
|
| 21 |
+
With the recent success of contextualized pretrained representations for transfer learning, NLP models created by finetuning ELMo (Peters et al., 2018) and BERT (Devlin et al., 2019) have become increasingly popular (Gardner et al., 2018). Contextualized pretrained representations boost performance and reduce sample complexity (Yogatama et al., 2019), and typically require only a shallow task-specific network—sometimes just a single layer as in BERT. While these properties are advantageous for representation learning, we hypothesize that they also make model extraction easier.
|
| 22 |
+
|
| 23 |
+
In this paper,1 we demonstrate that NLP models obtained by fine-tuning a pretrained BERT model can be extracted even if the adversary does not have access to any training data used by the API provider. In fact, the adversary does not even need to issue well-formed queries: our experiments show that extraction attacks are possible even with queries consisting of randomly sampled sequences of words coupled with simple task-specific heuristics (Section 3). While extraction performance improves further by leveraging sentences and paragraphs from Wikipedia (Section 4), the fact that random word sequences are sufficient to extract models contrasts with prior work, where large-scale attacks require at minimum that the adversary can access a small amount of semanticallycoherent data relevant to the task (Papernot et al., 2017; Correia-Silva et al., 2018; Orekondy et al., 2019a; Pal et al., 2019; Jagielski et al., 2019). These attacks are cheap: our most expensive attack cost around $\$ 500$ , estimated using rates of current API providers.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Overview of our model extraction setup for question answering.2An attacker first queries a victim BERT model, and then uses its predicted answers to fine-tune their own BERT model. This process works even when passages and questions are random sequences of words as shown here.
|
| 27 |
+
|
| 28 |
+
In Section 5.1, we perform a fine-grained analysis of the randomly-generated queries. Human studies on the random queries show that despite their effectiveness in extracting good models, they are mostly nonsensical and uninterpretable, although queries closer to the original data distribution work better for extraction. Furthermore, we discover that pretraining on the attacker’s side makes model extraction easier (Section 5.2).
|
| 29 |
+
|
| 30 |
+
Finally, we study the efficacy of two simple defenses against extraction — membership classification (Section 6.1) and API watermarking (Section 6.2) — and find that while they work well against naive adversaries, they fail against adversaries who adapt to the defense. We hope that our work spurs future research into stronger defenses against model extraction and, more generally, on developing a better understanding of why these models and datasets are particularly vulnerable to such attacks.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
We relate our work to prior efforts on model extraction, most of which have focused on computer vision applications. Because of the way in which we synthesize queries for extracting models, our work also directly relates to zero-shot distillation and studies of rubbish inputs to NLP systems.
|
| 35 |
+
|
| 36 |
+
Model extraction attacks have been studied both empirically (Tramer et al., 2016; Orekondy et al., \` 2019a; Juuti et al., 2019) and theoretically (Chandrasekaran et al., 2018; Milli et al., 2019), mostly against image classification APIs. These works generally synthesize queries in an active learning setup by searching for inputs that lie close to the victim classifier’s decision boundaries. This method does not transfer to text-based systems due to the discrete nature of the input space.3 The only prior work attempting extraction on NLP systems is Pal et al. (2019), who adopt pool-based active learning to select natural sentences from WikiText-2 and extract 1-layer CNNs for tasks expecting single inputs. In contrast, we study a more realistic extraction setting with nonsensical inputs on modern BERT-large models for tasks expecting pairwise inputs like question answering.
|
| 37 |
+
|
| 38 |
+
Table 1: Representative examples from the extraction datasets, highlighting the effect of taskspecific heuristics in MNLI and SQuAD. More examples in Appendix A.5.
|
| 39 |
+
|
| 40 |
+
<table><tr><td>Task</td><td>RANDOM example</td><td>WIKI example</td></tr><tr><td>SST2</td><td>cent 1977,preparation (120 remote Program finance add broader protection(76.54% negative)</td><td>So many were produced that thousands were Brown's by coin 1973 (98.59% positive)</td></tr><tr><td>MNLI</td><td>P: Mike zone fights Woods Second State known,defined come H:Mike zone released,Woods SecondHMS males defined come (99.89% contradiction)</td><td>P: voyage have used a variety of methods to Industrial their Trade H: descent have used a officially of methods exhibition In- dustrial their Trade (99.90% entailment)</td></tr><tr><td>SQuAD</td><td>P:a of Wood,curate him and the ”Stop Alumni terrestrial the of of roads Kashyap. Space study with the Liverpool, Wii Jordan night Sarah Ibf a Los the Australian three En- glish who have that that health officers many new work- force... Q:How workforce. Stop who new of Jordan et Wood,dis- playedthe?</td><td>P:Since its release,Dookie has been featured heavily in various“must have”lists compiled by the music media. Some of the more prominent of these lists to feature Dookie are shown below;this information is adapted from Ac- claimed Music. Q:Whatarelistsfeatureprominent”adaptedAcclaimed are various information media.?</td></tr></table>
|
| 41 |
+
|
| 42 |
+
Our work is related to prior work on data-efficient distillation, which attempts to distill knowledge from a larger model to a small model with access to limited input data (Li et al., 2018) or in a zeroshot setting (Micaelli & Storkey, 2019; Nayak et al., 2019). However, unlike the model extraction setting, these methods assume white-box access to the teacher model to generate data impressions.
|
| 43 |
+
|
| 44 |
+
Rubbish inputs, which are randomly-generated examples that yield high-confidence predictions, have received some attention in the model extraction literature. Prior work (Tramer et al., 2016) \` reports successful extraction on SVMs and 1-layer networks using i.i.d noise, but no prior work has scaled this idea to deeper neural networks for which a single class tends to dominate model predictions on most noise inputs (Micaelli & Storkey, 2019; Pal et al., 2019). Unnatural text inputs have previously been shown to produce overly confident model predictions (Feng et al., 2018), break translation systems (Belinkov & Bisk, 2018), and trigger disturbing outputs from text generators (Wallace et al., 2019). In contrast, here we show their effectiveness at training models that work well on real NLP tasks despite not seeing any real examples during training.
|
| 45 |
+
|
| 46 |
+
# 3 METHODOLOGY
|
| 47 |
+
|
| 48 |
+
What is BERT? We study model extraction on BERT, Bidirectional Encoder Representations from Transformers (Devlin et al., 2019). BERT-large is a 24-layer transformer (Vaswani et al., 2017), $f _ { \mathrm { { b e r t } } , \theta }$ , which converts a word sequence $\pmb { x } = ( x ^ { \top } , . . . , x ^ { n } )$ of length $n$ into a high-quality sequence of vector representations $\mathbf { v } = ( \mathbf { v } ^ { 1 } , . . . , \mathbf { v } ^ { n } )$ . These representations are contextualized — every vector $\mathbf { v } ^ { i }$ is conditioned on the whole sequence $_ { \textbf { \em x } }$ . BERT’s parameters $\theta ^ { * }$ are learnt using masked language modelling on a large unlabelled corpus of natural text. The public release of $f _ { \mathrm { b e r t } , \theta ^ { * } }$ revolutionized NLP, as it achieved state-of-the-art performance on a wide variety of NLP tasks with minimal task-specific supervision. A modern NLP system for task $T$ typically leverages the fine-tuning methodology in the public BERT repository:4 a task-specific network $f _ { T , \phi }$ (generally, a 1-layer feedforward network) with parameters $\phi$ expecting $\mathbf { v }$ as input is used to construct a composite function $g _ { T } = f _ { T , \phi } \circ f _ { \mathrm { b e r t } , \theta }$ . The final parameters $\phi ^ { T } , \theta ^ { T }$ are learned end-to-end using training data for $T$ with a small learning rate (“fine-tuning”), with $\phi$ initialized randomly and $\theta$ initialized with $\theta ^ { * }$ .
|
| 49 |
+
|
| 50 |
+
Description of extraction attacks: Assume $g _ { T }$ (the “victim model”) is a commercially available black-box API for task $T$ . A malicious user with black-box query access to $g _ { T }$ attempts to reconstruct a local copy $g _ { T } ^ { \prime }$ (the “extracted model”). Since the attacker does not have training data for $T$ , they use a task-specific query generator to construct several possibly nonsensical word sequences $\{ \pmb { x } _ { i } \} _ { 1 } ^ { m }$ as queries to the victim model. The resulting dataset $\{ { \pmb x } _ { i } , \dot { g } _ { T } ( { \pmb x } _ { i } ) \} _ { 1 } ^ { m }$ is used to train $g _ { T } ^ { \prime }$ .
|
| 51 |
+
|
| 52 |
+
<table><tr><td>Task</td><td># Queries</td><td>Cost</td><td>Model</td><td>Accuracy</td><td>Agreement</td></tr><tr><td rowspan="3">SST2</td><td rowspan="3">67349</td><td rowspan="3">$62.35</td><td>VICTIM</td><td>93.1%</td><td>1</td></tr><tr><td>RANDOM</td><td>90.1%</td><td>92.8%</td></tr><tr><td>WIKI</td><td>91.4%</td><td>94.9%</td></tr><tr><td rowspan="3">MNLI</td><td rowspan="3">392702</td><td rowspan="3">$387.82*</td><td>WIKI-ARGMAX</td><td>91.3%</td><td>94.2%</td></tr><tr><td>VICTIM</td><td>85.8%</td><td>-</td></tr><tr><td>RANDOM</td><td>76.3%</td><td>80.4% 82.2%</td></tr><tr><td rowspan="3">SQuAD 1.1</td><td rowspan="3">87599</td><td rowspan="3"></td><td>WIKI</td><td>77.8% 77.1%</td><td>80.9%</td></tr><tr><td>WIKI-ARGMAX</td><td></td><td></td></tr><tr><td>$115.01* VICTIM RANDOM</td><td>90.6 F1,83.9 EM 79.1 F1, 68.5 EM</td><td>- 78.1 F1, 66.3 EM</td></tr><tr><td rowspan="3">BoolQ</td><td rowspan="3">9427</td><td rowspan="3">$5.42*</td><td>WIKI</td><td>86.1 F1,77.1 EM</td><td>86.6 F1,77.6 EM</td></tr><tr><td>VICTIM</td><td>76.1%</td><td>-</td></tr><tr><td></td><td></td><td>72.5%</td></tr><tr><td rowspan="3"></td><td rowspan="3">471350</td><td rowspan="3">$516.05*</td><td>WIKI</td><td>66.8%</td><td>73.0%</td></tr><tr><td>WIKI-ARGMAX WIKI (50x data)</td><td>66.0% 72.7%</td><td>84.7%</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 53 |
+
|
| 54 |
+
Table 2: A comparison of the original API (VICTIM) with extracted models (RANDOM and WIKI) in terms of Accuracy on the original development set and Agreement between the extracted and victim model on the development set inputs. Notice high accuracies for extracted models. Unless specified, all extraction attacks were conducted use the same number of queries as the original training dataset. The \* marked costs are estimates from available Google APIs (details in Appendix A.2).
|
| 55 |
+
|
| 56 |
+
Specifically, we assume that the attacker fine-tunes the public release of $f _ { \mathrm { b e r t } , \theta ^ { * } }$ on this dataset to obtain $g _ { T } ^ { \prime }$ .5 A schematic of our extraction attacks is shown in Figure 1.
|
| 57 |
+
|
| 58 |
+
NLP tasks: We extract models on four diverse NLP tasks that have different kinds of input and output spaces: (1) binary sentiment classification using SST2 (Socher et al., 2013), where the input is a single sentence and the output is a probability distribution between positive and negative; (2) ternary natural language inference (NLI) classification using MNLI (Williams et al., 2018), where the input is a pair of sentences and the output is a distribution between entailment, contradiction and neutral; (3) extractive question answering (QA) using SQuAD 1.1 (Rajpurkar et al., 2016), where the input is a paragraph and question and the output is an answer span from the paragraph; and (4) boolean question answering using BoolQ (Clark et al., 2019), where the input is a paragraph and question and the output is a distribution between yes and no.
|
| 59 |
+
|
| 60 |
+
Query generators: We study two kinds of query generators, RANDOM and WIKI. In the RANDOM generator, an input query is a nonsensical sequence of words constructed by sampling6 a Wikipedia vocabulary built from WikiText-103 (Merity et al., 2017). In the WIKI setting, input queries are formed from actual sentences or paragraphs from the WikiText-103 corpus. We found these two generators insufficient by themselves to extract models for tasks featuring complex interactions between different parts of the input space (e.g., between premise and hypothesis in MNLI or question and paragraph in SQuAD). Hence, we additionally apply the following task-specific heuristics:
|
| 61 |
+
|
| 62 |
+
• MNLI: since the premise and hypothesis often share many words, we randomly replace three words in the premise with three random words to construct the hypothesis. SQuAD / BoolQ: since questions often contain words in the associated passage, we uniformly sample words from the passage to form a question. We additionally prepend a question starter word (like “what”) to the question and append a ? symbol to the end.
|
| 63 |
+
|
| 64 |
+
Note that none of our query generators assume adversarial access to the dataset or distribution used by the victim model. For more details on the query generation, see Appendix A.3. Representative example queries and their outputs are shown in Table 1. More examples are provided in Appendix A.5.
|
| 65 |
+
|
| 66 |
+
<table><tr><td>Task</td><td>Model</td><td>0.1x</td><td>0.2x</td><td>0.5x</td><td>1x</td><td>2x</td><td>5x</td><td>10x</td></tr><tr><td>SST2</td><td>VICTIM</td><td>90.4</td><td>92.1</td><td>92.5</td><td>93.1</td><td>1</td><td>-</td><td>-</td></tr><tr><td></td><td>RANDOM</td><td>75.9</td><td>87.5</td><td>89.0</td><td>90.1</td><td>90.5</td><td>90.4</td><td>90.1</td></tr><tr><td>(1x = 67349)</td><td>WIKI</td><td>89.6</td><td>90.6</td><td>91.7</td><td>91.4</td><td>91.6</td><td>91.2</td><td>91.4</td></tr><tr><td>MNLI</td><td>VICTIM</td><td>81.9</td><td>83.1</td><td>85.1</td><td>85.8</td><td>-</td><td>-</td><td>-</td></tr><tr><td></td><td>RANDOM</td><td>59.1</td><td>70.6</td><td>75.7</td><td>76.3</td><td>77.5</td><td>78.5</td><td>77.6</td></tr><tr><td>(1x = 392702)</td><td>WIKI</td><td>68.0</td><td>71.6</td><td>75.9</td><td>77.8</td><td>78.9</td><td>79.7</td><td>79.3</td></tr><tr><td>SQuAD 1.1</td><td>VICTIM</td><td>84.1</td><td>86.6</td><td>89.0</td><td>90.6</td><td>-</td><td>-</td><td>-</td></tr><tr><td></td><td>RANDOM</td><td>60.6</td><td>68.5</td><td>75.8</td><td>79.1</td><td>81.9</td><td>84.8</td><td>85.8</td></tr><tr><td>(1x = 87599)</td><td>WIKI</td><td>72.4</td><td>79.6</td><td>83.8</td><td>86.1</td><td>87.4</td><td>88.4</td><td>89.4</td></tr><tr><td>BoolQ</td><td>VICTIM</td><td>63.3</td><td>64.6</td><td>69.9</td><td>76.1</td><td>1</td><td>-</td><td>-</td></tr><tr><td>(1x = 9427)</td><td>WIKI</td><td>62.1</td><td>63.1</td><td>64.7</td><td>66.8</td><td>67.6</td><td>69.8</td><td>70.3</td></tr></table>
|
| 67 |
+
|
| 68 |
+
Table 3: Development set accuracy of various extracted models on the original development set at different query budgets expressed as fractions of the original dataset size. Note the high accuracies for some tasks even at low query budgets, and diminishing accuracy gains at higher budgets.
|
| 69 |
+
|
| 70 |
+
# 4 EXPERIMENTAL VALIDATION OF OUR MODEL EXTRACTION ATTACKS
|
| 71 |
+
|
| 72 |
+
First, we evaluate our extraction procedure in a controlled setting where an attacker uses an identical number of queries as the original training dataset (Table 2); afterwards, we investigate different query budgets for each task (Table 3). We provide commercial cost estimates for these query budgets using the Google Cloud Platform’s Natural Language API calculator.7 We use two metrics for evaluation: Accuracy of the extracted models on the original development set, and Agreement between the outputs of the extracted model and the victim model on the original development set inputs. Note that these metrics are defined at a label level — metrics are calculated using the argmax labels of the probability vectors predicted by the victim and extracted model.
|
| 73 |
+
|
| 74 |
+
In our controlled setting (Table 2), our extracted models are surprisingly accurate on the original development sets of all tasks, even when trained with nonsensical inputs (RANDOM) that do not match the original data distribution.8 Accuracy improves further on WIKI: extracted SQuAD models recover $9 5 \%$ of original accuracy despite seeing only nonsensical questions during training. While extracted models have high accuracy, their agreement is only slightly better than accuracy in most cases. Agreement is even lower on held-out sets constructed using the WIKI and RANDOM sampling scheme. On SQuAD, extracted WIKI and RANDOM have low agreements of 59.2 F1 and $5 0 . 5 \ \mathrm { F } 1$ despite being trained on identically distributed data. This indicates poor functional equivalence between the victim and extracted model as also found by Jagielski et al. (2019). An ablation study with alternative query generation heuristics for SQuAD and MNLI is conducted in Appendix A.4.
|
| 75 |
+
|
| 76 |
+
Classification with argmax labels only: For classification datasets, we assumed the API returns a probability distribution over output classes. This information may not be available to the adversary in practice. To measure what happens when the API only provides argmax outputs, we re-run our WIKI experiments for SST2, MNLI and BoolQ with argmax labels and present our results in Table 2 (WIKI-ARGMAX). We notice a minimal drop in accuracy from the corresponding WIKI experiments, indicating that access to the output probability distribution is not crucial for model extraction. Hence, hiding the full probability distribution is not a viable defense strategy.
|
| 77 |
+
|
| 78 |
+
Query efficiency: We measure the effectiveness of our extraction algorithms with varying query budgets, each a different fraction of the original dataset size, in Table 3. Even with small query budgets, extraction is often successful; while more queries is usually better, accuracy gains quickly diminish. Approximate costs for these attacks can be extrapolated from Table 2.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Average dev F1 for extracted SQuAD models after selecting different subsets of data from a large pool of WIKI and RANDOM data. Subsets are selected based on the agreement between the outputs of different runs of the original SQuAD model. Notice the large difference between the highest agreement (blue) and the lowest agreement (green), especially at small dataset sizes.
|
| 82 |
+
|
| 83 |
+
# 5 ANALYSIS
|
| 84 |
+
|
| 85 |
+
These results bring many natural questions to mind. What properties of nonsensical input queries make them so amenable to the model extraction process? How well does extraction work for these tasks without using large pretrained language models? In this section, we perform an analysis to answer these questions.
|
| 86 |
+
|
| 87 |
+
# 5.1 A CLOSER LOOK AT NONSENSICAL QUERIES
|
| 88 |
+
|
| 89 |
+
Previously, we observed that nonsensical input queries are surprisingly effective for extracting NLP models based on BERT. Here, we dig into the properties of these queries in an attempt to understand why models trained on them perform so well. Do different victim models produce the same answer when given a nonsensical query? Are some of these queries better for extraction? Did our taskspecific heuristics perhaps make these nonsensical queries “interpretable” to humans in some way? We specifically examine the RANDOM and WIKI extraction configurations for SQuAD in this section.
|
| 90 |
+
|
| 91 |
+
Do different victim models agree on the answers to nonsensical queries? We train five victim SQuAD models on the original training data with identical hyperparameters, varying only the random seed; each achieves an F1 between 90 and 90.5. Then, we measure the average pairwise F1 (“agreement”) between the answers produced by these models for different types of queries. As expected, the models agree very frequently when queries come from the SQuAD training set (96.9 F1) or development set (90.4 F1). However, their agreement drops significantly on WIKI queries (53.0 F1) and even further on RANDOM queries (41.2 F1).9 Note that this result parallels prior work (Lakshminarayanan et al., 2017), where an ensemble of classifiers has been shown to provide better uncertainty estimates and out-of-distribution detection than a single overconfident classifier.
|
| 92 |
+
|
| 93 |
+
Are high-agreement queries better for model extraction? While these results indicate that on average, victim models tend to be brittle on nonsensical inputs, it is possible that high-agreement queries are more useful than others for model extraction. To measure this, we sort queries from our 10x RANDOM and WIKI datasets according to their agreement and choose the highest and lowest agreement subsets, where subset size is a varying fraction of the original training data size (Figure 2). We observe large F1 improvements when extracting models using high-agreement subsets, consistently beating random and low-agreement subsets of identical sizes. This result shows that agreement between victim models is a good proxy for the quality of an input-output pair for extraction. Measuring this agreement in extracted models and integrating this observation into an active learning objective for better extraction is an interesting direction that we leave to future work.
|
| 94 |
+
|
| 95 |
+
Are high-agreement nonsensical queries interpretable to humans? Prior work (Xu et al., 2016; Ilyas et al., 2019) has shown deep neural networks can leverage non-robust, uninterpretable features to learn classifiers. Our nonsensical queries are not completely random, as we do apply task-specific heuristics. Perhaps as a result of these heuristics, do high-agreement nonsensical textual inputs have a human interpretation? To investigate, we asked three human annotators10 to answer twenty SQuAD questions from each of the WIKI and RANDOM subsets that had unanimous agreement among victim models, and twenty original SQuAD questions as a control. On the WIKI subset, annotators matched the victim models’ answer exactly $23 \%$ of the time (33 F1). Similarly, a $22 \%$ exact match (32 F1) was observed on RANDOM. In contrast, annotators scored significantly higher on original SQuAD questions ( $7 7 \%$ exact match, 85 F1 against original answers). Interviews with the annotators revealed a common trend: annotators used a word overlap heuristic (between the question and paragraph) to select entities as answer spans. While this heuristic partially interprets the extraction data’s signal, most of the nonsensical question-answer pairs remain mysterious to humans. More details on inter-annotator agreement are provided in Appendix A.6.
|
| 96 |
+
|
| 97 |
+
# 5.2 THE IMPORTANCE OF PRETRAINING
|
| 98 |
+
|
| 99 |
+
So far we assumed that the victim and the attacker both fine-tune a pretrained BERT-large model. However, in practical scenarios, the attacker might not have information about the victim architecture. What happens when the attacker fine-tunes a different base model than the victim? What if the attacker extracts a QA model from scratch instead of fine-tuning a large pretrained language model? Here, we examine how much the extraction accuracy depends on the pretraining setup.
|
| 100 |
+
|
| 101 |
+
Mismatched architectures: BERT comes in two different sizes: the 24 layer BERT-large and the 12 layer BERT-base. In Table 4, we measure the development set accuracy on MNLI and SQuAD when the victim and attacker use different configurations of these two models. We notice that accuracy is always higher when the attacker starts from BERT-large, even when the victim was initialized with BERT-base. Additionally, given a fixed attacker architecture, accuracy is better when the victim uses the same model (e.g., if the attacker starts from BERT-base, they will have better results if the victim also used BERT-base).
|
| 102 |
+
|
| 103 |
+
<table><tr><td>Victim</td><td>Attacker</td><td>MNLI</td><td>SQuAD (WIK1)</td></tr><tr><td>BERT-large</td><td>BERT-large</td><td>77.8%</td><td>86.1 F1,77.1 EM</td></tr><tr><td>BERT-base</td><td>BERT-large</td><td>76.3%</td><td>84.2 F1,74.8 EM</td></tr><tr><td>BERT-base</td><td>BERT-base</td><td>75.7%</td><td>83.0 F1,73.4 EM</td></tr><tr><td>BERT-large</td><td>BERT-base</td><td>72.5%</td><td>81.2 F1,71.3 EM</td></tr></table>
|
| 104 |
+
|
| 105 |
+
Table 4: Development set accuracy using WIKI queries on MNLI and SQuAD with mismatched BERT architectures between the victim and attacker. Note the trend: (large, large) $>$ (base, large) $>$ (base, base) $>$ (large, base) where the (·, ·) refers to (victim, attacker) pretraining.
|
| 106 |
+
|
| 107 |
+
Next, we experiment with an alternative non-BERT pretrained language model as the attacker architecture. We use XLNet-large (Yang et al., 2019), which has been shown to outperform BERT-large in a large variety of downstream NLP tasks. In Table 5, we compare XLNet-large and BERT-large attacker architectures keeping a fixed BERT-large victim architecture. Note the superior performance of XLNet-large attacker models on SQuAD compared to BERT-large in both RANDOM and WIKI attack settings, despite seeing a mismatched victim’s (BERT-large) outputs during training.
|
| 108 |
+
|
| 109 |
+
Our experiments are reminiscent of similar discussion in Tramer et al. (2016) on \` Occam Learning, or appropriate alignment of victim-attacker architectures. Overall, the results suggest that attackers can maximize their accuracy by fine-tuning more powerful language models, and that matching architectures is a secondary concern.
|
| 110 |
+
|
| 111 |
+
Table 5: SQuAD dev set results comparing BERT-large and XLNet-large attacker architectures. Note the effectiveness of XLNet-large over BERT-large in both RANDOM and WIKI attack settings, despite seeing BERT-LARGE victim outputs during training. Legend: Training Data X, Y represent the input and output pairs used while training the attacker model; ORIGINAL represents the original SQuAD dataset; BERT-LARGE represents the outputs from the victim BERT-large model.
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Attacker</td><td>Training Data X</td><td>Training Data Y</td><td> SQuAD</td></tr><tr><td>BERT-large</td><td>ORIGINAL X</td><td>ORIGINAL Y</td><td>90.6F1</td></tr><tr><td> XLNet-large</td><td>ORIGINAL X</td><td>ORIGINAL Y</td><td>92.8 F1</td></tr><tr><td>BERT-large</td><td>RANDOM X</td><td>BERT-LARGE Y</td><td>86.1 F1</td></tr><tr><td>XLNet-large</td><td>RANDOM X</td><td>BERT-LARGE Y</td><td>89.2 F1</td></tr><tr><td>BERT-large</td><td>WIKI X</td><td>BERT-LARGE Y</td><td>79.1 F1</td></tr><tr><td>XLNet-large</td><td>WIKI X</td><td>BERT-LARGE Y</td><td>80.9 F1</td></tr></table>
|
| 114 |
+
|
| 115 |
+
What if we train from scratch? Fine-tuning BERT or XLNet seems to give attackers a significant headstart, as only the final layer of the model is randomly initialized and the BERT parameters start from a good initialization representative of the properties of language. To measure the importance of fine-tuning from a good starting point, we train a QANet model (Yu et al., 2018) on SQuAD with no contextualized pretraining. This model has 1.3 million randomly initialized parameters at the start of training. Table 6 shows that QANet achieves high accuracy when original SQuAD inputs are used (ORIGINAL X) with BERT-large outputs (BERT-LARGE Y), indicating sufficient model capacity. However, the F1 significantly degrades when training on nonsensical RANDOM and WIKI queries. The F1 drop is particularly striking when compared to the corresponding rows in Table 2 (only 4.5 F1 drop for WIKI). This reinforces our finding that better pretraining allows models to start from a good representation of language, thus simplifying extraction.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Training Data X</td><td>Training Data Y</td><td>+ GloVE</td><td>- GloVE</td></tr><tr><td>ORIGINAL X</td><td>ORIGINAL Y</td><td>79.6 F1</td><td>70.6 F1</td></tr><tr><td>ORIGINAL X</td><td>BERT-LARGE Y</td><td>79.5 F1</td><td>70.3F1</td></tr><tr><td>RANDOM X</td><td>BERT-LARGEY</td><td>55.9 F1</td><td>43.2 F1</td></tr><tr><td>WIKI X</td><td>BERT-LARGE Y</td><td>58.9 F1</td><td>54.0 F1</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 6: SQuAD dev set results on QANet, with and without GloVE (Pennington et al., 2014). Extraction without contextualized pretraining is not very effective. Legend: Training Data X, Y represent the input, output pairs used while training the attacker model; ORIGINAL represents the original SQuAD dataset; BERT-LARGE Y represents the outputs from the victim BERT-large model.
|
| 120 |
+
|
| 121 |
+
# 6 DEFENSES
|
| 122 |
+
|
| 123 |
+
Having established that BERT-based models are vulnerable to model extraction, we now shift our focus to investigating defense strategies. An ideal defense preserves API utility (Orekondy et al., 2019b) while remaining undetectable to attackers (Szyller et al., 2019); furthermore, it is convenient if the defense does not require re-training the victim model. Here we explore two defenses that satisfy these properties. Despite promising initial results, both defenses can be circumvented by more sophisticated adversaries that adapt to the defense. Hence, more work is needed to make models robust to model extraction.
|
| 124 |
+
|
| 125 |
+
# 6.1 MEMBERSHIP CLASSIFICATION
|
| 126 |
+
|
| 127 |
+
Our first defense uses membership inference, which is traditionally used to determine whether a classifier was trained on a particular input point (Shokri et al., 2017; Nasr et al., 2018). In our setting we use membership inference for “outlier detection”, where nonsensical and ungrammatical inputs (which are unlikely to be issued by a legitimate user) are identified (Papernot & McDaniel,
|
| 128 |
+
|
| 129 |
+
2018). When such out-of-distribution inputs are detected, the API issues a random output instead of the model’s predicted output, which eliminates the extraction signal.
|
| 130 |
+
|
| 131 |
+
We treat membership inference as a binary classification problem, constructing datasets for MNLI and SQuAD by labeling their original training and validation examples as real and WIKI extraction examples as fake. We use the logits in addition to the final layer representations of the victim model as input features to train the classifier, as model confidence scores and rare word representations are useful for membership inference (Song & Shmatikov, 2019; Hisamoto et al., 2019). Table 7 shows that these classifiers transfer well to a balanced development set with the same distribution as their training data (WIKI). They are also robust
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Task</td><td>WIKI</td><td>RANDOM</td><td>SHUFFLE</td></tr><tr><td>MNLI</td><td>99.3%</td><td>99.1%</td><td>87.4%</td></tr><tr><td>SQuAD</td><td>98.8%</td><td>99.9%</td><td>99.7%</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 7: Accuracy of membership classifiers on an identically distributed development set (WIKI) and differently distributed test sets (RANDOM, SHUFFLE).
|
| 136 |
+
|
| 137 |
+
to the query generation process: accuracy remains high on auxiliary test sets where fake examples are either RANDOM (described in Section 3) or SHUFFLE, in which the word order of real examples is shuffled. An ablation study on the input features of the classifier is provided in Appendix A.7.
|
| 138 |
+
|
| 139 |
+
Limitations: Since we do not want to flag valid queries that are out-of-distribution (e.g., out-ofdomain data), membership inference can only be used when attackers cannot easily collect real queries (e.g., tasks with complex input spaces such as NLI, QA, or low-resource MT). Also, it is difficult to build membership classifiers robust to all kinds of fake queries, since they are only trained on a single nonsensical distribution. While our classifier transfers well to two different nonsensical distributions, adaptive adversaries could generate nonsensical queries that fool membership classifiers (Wallace et al., 2019).
|
| 140 |
+
|
| 141 |
+
Implicit membership classification: An alternative formulation of the above is to add an extra no answer label to the victim model that corresponds to nonsensical inputs. We explore this setting by experimenting with a victim BERT-large model trained on $\mathrm { S Q u A D } 2 . 0$ (Rajpurkar et al., 2018), in which $3 3 . 4 \%$ of questions are unanswerable. $9 7 . 2 \%$ of RANDOM queries and $7 8 . 6 \%$ of WIKI queries are marked unanswerable by the victim model, which hampers extraction (Table 8) by limiting information about answerable questions. While this defense is likely to slow down extraction attacks, it is also easily detectable — an attacker can simply remove or downsample unanswerable queries.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Model</td><td>Unanswerable</td><td>Answerable</td><td>Overall</td></tr><tr><td>VICTIM</td><td>78.8 F1</td><td>82.1 F1</td><td>80.4F1</td></tr><tr><td>RANDOM</td><td>70.9 F1</td><td>26.6F1</td><td>48.8F1</td></tr><tr><td>WIKI</td><td>61.1 F1</td><td>67.6 F1</td><td>64.3 F1</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Table 8: Limited model extraction success on SQuAD 2.0 which includes unanswerable questions.
|
| 146 |
+
F1 scores shown on unanswerable, answerable subsets as well as the whole development set.
|
| 147 |
+
|
| 148 |
+
# 6.2 WATERMARKING
|
| 149 |
+
|
| 150 |
+
Another defense against extraction is watermarking (Szyller et al., 2019), in which a tiny fraction of queries are chosen at random and modified to return a wrong output. These “watermarked queries” and their outputs are stored on the API side. Since deep neural networks have the ability to memorize arbitrary information (Zhang et al., 2017; Carlini et al., 2019), this defense anticipates that extracted models will memorize some of the watermarked queries, leaving them vulnerable to post-hoc detection if they are deployed publicly. We evaluate watermarking on MNLI (by randomly permuting the predicted probability vector to ensure a different argmax output) and SQuAD (by returning a single word answer which has less than 0.2 F1 overlap with the actual output). For both tasks, we watermark just $0 . 1 \%$ of all queries to minimize the overall drop in API performance.
|
| 151 |
+
|
| 152 |
+
Table 9 shows that extracted models perform nearly identically on the development set (Dev Acc) with or without watermarking. When looking at the watermarked subset of the training data, however, non-watermarked models get nearly everything wrong (low WM Label $\mathbf { A c c \% }$ ) as they generally predict the victim model’s outputs (high Victim Label $\mathbf { A c c \% }$ ), while watermarked models behave oppositely. Training with more epochs only makes these differences more drastic.
|
| 153 |
+
|
| 154 |
+
Table 9: Results on watermarked models. Dev Acc represents the overall development set accuracy, WM Label Acc denotes the accuracy of predicting the watermarked output on the watermarked queries and Victim Label Acc denotes the accuracy of predicting the original labels on the watermarked queries. A watermarked WIKI has high WM Label Acc and low Victim Label Acc.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Task</td><td>Model</td><td>Epochs</td><td>Dev Acc</td><td>WM Label Acc</td><td>Victim Label Acc</td></tr><tr><td rowspan="3">MNLI</td><td>WIKI</td><td>3</td><td>77.8%</td><td>2.8%</td><td>94.4%</td></tr><tr><td>watermarked WIKI</td><td>3</td><td>77.3%</td><td>52.8%</td><td>35.4%</td></tr><tr><td>watermarked WIKI</td><td>10</td><td>76.8%</td><td>87.2%</td><td>7.9%</td></tr><tr><td rowspan="3">MNLI</td><td>WIKI-ARGMAX</td><td>3</td><td>77.1%</td><td>1.0%</td><td>98.0%</td></tr><tr><td>watermarked WIKI-ARGMAX</td><td>3</td><td>76.3%</td><td>55.1%</td><td>35.7%</td></tr><tr><td>watermarked WIKI-ARGMAX</td><td>10</td><td>75.9%</td><td>94.6%</td><td>3.3%</td></tr><tr><td rowspan="3">SQuAD</td><td>WIKI</td><td>3</td><td>86.2 F1</td><td>0.2 F1, 0.0EM</td><td>96.7 F1,94.3 EM</td></tr><tr><td>watermarked WIKI</td><td>3</td><td>86.3F1</td><td>16.9 F1,5.7 EM</td><td>28.0 F1,14.9 EM</td></tr><tr><td>watermarked WIKI</td><td>10</td><td>84.8F1</td><td>76.3 F1,74.7 EM</td><td>4.1 F1,1.1 EM</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Limitations: Watermarking works, but it is not a silver bullet for two reasons. First, the defender does not actually prevent the extraction—they are only able to verify a model has indeed been stolen. Moreover, it assumes that an attacker will deploy an extracted model publicly, allowing the defender to query the (potentially) stolen model. It is thus irrelevant if the attacker instead keeps the model private. Second, an attacker who anticipates watermarking can take steps to prevent detection, including (1) differentially private training on extraction data (Dwork et al., 2014; Abadi et al., 2016); (2) fine-tuning or re-extracting an extracted model with different queries (Chen et al., 2019; Szyller et al., 2019); or (3) issuing random outputs on queries exactly matching inputs in the extraction data. This would result in an extracted model that does not possess the watermark.
|
| 159 |
+
|
| 160 |
+
# 7 CONCLUSION
|
| 161 |
+
|
| 162 |
+
We study model extraction attacks against NLP APIs that serve BERT-based models. These attacks are surprisingly effective at extracting good models with low query budgets, even when an attacker uses nonsensical input queries. Our results show that fine-tuning large pretrained language models simplifies the process of extraction for an attacker. Unfortunately, existing defenses against extraction, while effective in some scenarios, are generally inadequate, and further research is necessary to develop defenses robust in the face of adaptive adversaries who develop counter-attacks anticipating simple defenses. Other interesting future directions that follow from the results in this paper include (1) leveraging nonsensical inputs to improve model distillation on tasks for which it is difficult to procure input data; (2) diagnosing dataset complexity by using query efficiency as a proxy; and (3) further investigation of the agreement between victim models as a method to identify proximity in input distribution and its incorporation into an active learning setup for model extraction.
|
| 163 |
+
|
| 164 |
+
# 8 ACKNOWLEDGEMENTS
|
| 165 |
+
|
| 166 |
+
We thank the anonymous reviewers, Julian Michael, Matthew Jagielski, Slav Petrov, Yoon Kim, and Nitish Gupta for helpful feedback on the project. We are grateful to members of the UMass NLP group for providing the annotations in the human evaluation experiments.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In CCS, 2016.
|
| 171 |
+
|
| 172 |
+
Yonatan Belinkov and Yonatan Bisk. Synthetic and natural noise both break neural machine translation. In ICLR, 2018.
|
| 173 |
+
|
| 174 |
+
Nicholas Carlini, Chang Liu, Ulfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: ´ Evaluating and testing unintended memorization in neural networks. In USENIX, 2019.
|
| 175 |
+
|
| 176 |
+
Varun Chandrasekaran, Kamalika Chaudhuri, Irene Giacomelli, Somesh Jha, and Songbai Yan. Model extraction and active learning. arXiv preprint arXiv:1811.02054, 2018.
|
| 177 |
+
|
| 178 |
+
Xinyun Chen, Wenxiao Wang, Yiming Ding, Chris Bender, Ruoxi Jia, Bo Li, and Dawn Song. Leveraging unlabeled data for watermark removal of deep neural networks. In ICML workshop on Security and Privacy of Machine Learning, 2019.
|
| 179 |
+
|
| 180 |
+
Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. Boolq: Exploring the surprising difficulty of natural yes/no questions. In NAACLHLT, 2019.
|
| 181 |
+
|
| 182 |
+
Jacson Rodrigues Correia-Silva, Rodrigo F Berriel, Claudine Badue, Alberto F de Souza, and Thiago Oliveira-Santos. Copycat cnn: Stealing knowledge by persuading confession with random nonlabeled data. In IJCNN, 2018.
|
| 183 |
+
|
| 184 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT, 2019.
|
| 185 |
+
|
| 186 |
+
Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends $\textsuperscript { \textregistered }$ in Theoretical Computer Science, 9(3–4):211–407, 2014.
|
| 187 |
+
|
| 188 |
+
Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. Hotflip: White-box adversarial examples for text classification. In ACL, 2018.
|
| 189 |
+
|
| 190 |
+
Shi Feng, Eric Wallace, Alvin Grissom II, Mohit Iyyer, Pedro Rodriguez, and Jordan Boyd-Graber. Pathologies of neural models make interpretations difficult. In EMNLP, 2018.
|
| 191 |
+
|
| 192 |
+
Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. Allennlp: A deep semantic natural language processing platform. In ACL workshop for NLP Open Source Software (NLP-OSS), 2018.
|
| 193 |
+
|
| 194 |
+
John J Godfrey, Edward C Holliman, and Jane McDaniel. Switchboard: Telephone speech corpus for research and development. In ICASSP, 1992.
|
| 195 |
+
|
| 196 |
+
Sorami Hisamoto, Matt Post, and Kevin Duh. Membership inference attacks on sequence-tosequence models. arXiv preprint arXiv:1904.05506, 2019.
|
| 197 |
+
|
| 198 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In NeurIPS, 2019.
|
| 199 |
+
|
| 200 |
+
Matthew Jagielski, Nicholas Carlini, David Berthelot, Alex Kurakin, and Nicolas Papernot. Highfidelity extraction of neural network models. arXiv preprint arXiv:1909.01838, 2019.
|
| 201 |
+
|
| 202 |
+
Mika Juuti, Sebastian Szyller, Samuel Marchal, and N Asokan. Prada: protecting against dnn model stealing attacks. In EuroS&P, 2019.
|
| 203 |
+
|
| 204 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In NIPS, pp. 6402–6413, 2017.
|
| 205 |
+
|
| 206 |
+
Tianhong Li, Jianguo Li, Zhuang Liu, and Changshui Zhang. Few sample knowledge distillation for efficient network compression. arXiv preprint arXiv:1812.01839, 2018.
|
| 207 |
+
|
| 208 |
+
Daniel Lowd and Christopher Meek. Adversarial learning. In KDD, 2005.
|
| 209 |
+
|
| 210 |
+
R Thomas McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. In ACL, 2019.
|
| 211 |
+
|
| 212 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In ICLR, 2017.
|
| 213 |
+
|
| 214 |
+
Paul Micaelli and Amos Storkey. Zero-shot knowledge transfer via adversarial belief matching. In NeurIPS, 2019.
|
| 215 |
+
|
| 216 |
+
Smitha Milli, Ludwig Schmidt, Anca D Dragan, and Moritz Hardt. Model reconstruction from model explanations. In FAT\*, 2019.
|
| 217 |
+
|
| 218 |
+
Milad Nasr, Reza Shokri, and Amir Houmansadr. Machine Learning with Membership Privacy using Adversarial Regularization. In CCS, 2018.
|
| 219 |
+
|
| 220 |
+
Gaurav Kumar Nayak, Konda Reddy Mopuri, Vaisakh Shaj, R Venkatesh Babu, and Anirban Chakraborty. Zero-shot knowledge distillation in deep networks. arXiv preprint arXiv:1905.08114, 2019.
|
| 221 |
+
|
| 222 |
+
Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Knockoff nets: Stealing functionality of black-box models. In CVPR, 2019a.
|
| 223 |
+
|
| 224 |
+
Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Prediction poisoning: Utility-constrained defenses against model stealing attacks. arXiv preprint arXiv:1906.10908, 2019b.
|
| 225 |
+
|
| 226 |
+
Soham Pal, Yash Gupta, Aditya Shukla, Aditya Kanade, Shirish Shevade, and Vinod Ganapathy. A framework for the extraction of deep neural networks by leveraging public data. arXiv preprint arXiv:1905.09165, 2019.
|
| 227 |
+
|
| 228 |
+
Nicolas Papernot and Patrick McDaniel. Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. arXiv preprint arXiv:1803.04765, 2018.
|
| 229 |
+
|
| 230 |
+
Nicolas Papernot, Patrick D. McDaniel, Ian J. Goodfellow, Somesh Jha, Z. Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In AsiaCCS, 2017.
|
| 231 |
+
|
| 232 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 233 |
+
|
| 234 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matthew Ph Gardner, Christopher Clark, Kenton Lee, and Luke S. Zettlemoyer. Deep contextualized word representations. In NAACL-HLT, 2018.
|
| 235 |
+
|
| 236 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. In EMNLP, 2016.
|
| 237 |
+
|
| 238 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. In ACL, 2018.
|
| 239 |
+
|
| 240 |
+
Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In IEEE S&P, 2017.
|
| 241 |
+
|
| 242 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013.
|
| 243 |
+
|
| 244 |
+
Congzheng Song and Vitaly Shmatikov. Auditing data provenance in text-generation models. In KDD, 2019.
|
| 245 |
+
|
| 246 |
+
Sebastian Szyller, Buse Gul Atli, Samuel Marchal, and N Asokan. Dawn: Dynamic adversarial watermarking of neural networks. arXiv preprint arXiv:1906.00830, 2019.
|
| 247 |
+
|
| 248 |
+
Florian Tramer, Fan Zhang, Ari Juels, Michael K Reiter, and Thomas Ristenpart. Stealing machine \` learning models via prediction apis. In USENIX, 2016.
|
| 249 |
+
|
| 250 |
+
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.
|
| 251 |
+
|
| 252 |
+
Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for nlp. In EMNLP, 2019.
|
| 253 |
+
|
| 254 |
+
Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL-HLT, 2018.
|
| 255 |
+
|
| 256 |
+
Weilin Xu, Yanjun Qi, and David Evans. Automatically evading classifiers. In NDSS, 2016.
|
| 257 |
+
|
| 258 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In NeurIPS, 2019.
|
| 259 |
+
|
| 260 |
+
Dani Yogatama, Cyprien de Masson d’Autume, Jerome Connor, Tomas Kocisky, Mike Chrzanowski, Lingpeng Kong, Angeliki Lazaridou, Wang Ling, Lei Yu, Chris Dyer, et al. Learning and evaluating general linguistic intelligence. arXiv preprint arXiv:1901.11373, 2019.
|
| 261 |
+
|
| 262 |
+
Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V. Le. Qanet: Combining local convolution with global self-attention for reading comprehension. In ICLR, 2018.
|
| 263 |
+
|
| 264 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017.
|
| 265 |
+
|
| 266 |
+
# A APPENDIX
|
| 267 |
+
|
| 268 |
+
# A.1 DISTRIBUTION OF AGREEMENT
|
| 269 |
+
|
| 270 |
+
We provide a distribution of agreement between victim SQuAD models on RANDOM and WIKI queries in Figure 3.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 3: Histogram of average F1 agreement between five different runs of BERT question answering models trained on the original SQuAD dataset. Notice the higher agreement on points in the WIKI dataset compared to RANDOM.
|
| 274 |
+
|
| 275 |
+
# A.2 QUERY PRICING
|
| 276 |
+
|
| 277 |
+
In this paper, we have used the cost estimate from Google Cloud Platform’s Calculator.11 The Natural Language APIs typically allows inputs of length up to 1000 characters per query (https: //cloud.google.com/natural-language/pricing). To calculate costs for different datasets, we counted input instances with more than 1000 characters multiple times.
|
| 278 |
+
|
| 279 |
+
Since Google Cloud did not have APIs for all tasks we study in this paper, we extrapolated the costs of the entity analysis and sentiment analysis APIs for natural language inference (MNLI) and reading comprehension (SQuAD, BoolQ). We believe this is a reasonable estimate since every model studied in this paper is a single layer in addition to BERT-large (thereby needing a similar number of FLOPs for similar input lengths).
|
| 280 |
+
|
| 281 |
+
It is hard to provide a widely applicable estimate for the price of issuing a certain number of queries. Several API providers allow a small budget of free queries. An attacker could conceivably set up multiple accounts and collect extraction data in a distributed fashion. In addition, most APIs are implicitly used on webpages — they are freely available to web users (such as Google Search or Maps). If sufficient precautions are not taken, an attacker could easily emulate the HTTP requests used to call these APIs and extract information at a large scale, free of cost (“web scraping”). Besides these factors, API costs could also vary significantly depending on the computing infrastructure involved or the revenue model of the company deploying them.
|
| 282 |
+
|
| 283 |
+
Given these caveats, it is important to focus on the relatively low costs needed to extract datasets rather than the actual cost estimates. Even complex text generation tasks like machine translation and speech recognition (for which Google Cloud has actual API estimates) are relatively inexpensive. It costs - $\$ 430.56$ to extract Switchboard LDC97S62 (Godfrey et al., 1992), a large conversational speech recognition dataset with 300 hours of speech; $\$ 20000.00$ to issue 1 million translation queries, each having a length of 100 characters.
|
| 284 |
+
|
| 285 |
+
# A.3 MORE DETAILS ON INPUT GENERATION
|
| 286 |
+
|
| 287 |
+
In this section we provide more details on the input generation algorithms adopted for each dataset.
|
| 288 |
+
|
| 289 |
+
(SST2, RANDOM) - A vocabulary is built using wikitext103. The top 10000 tokens (in terms of unigram frequency in wikitext103) are preserved while the others are discarded. A length is chosen from the pool of wikitext-103 sentence lengths. Tokens are uniformly randomly sampled from the top-10000 wikitext103 vocabulary up to the chosen length.
|
| 290 |
+
|
| 291 |
+
(SST2, WIKI) - A vocabulary is built using wikitext103. The top 10000 tokens (in terms of unigram frequency in wikitext103) are preserved while the others are discarded. A sentence is chosen at random from wikitext103. Words in the sentence which do not belong to the top-10000 wikitext103 vocabulary are replaced with words uniformly randomly chosen from this vocabulary.
|
| 292 |
+
|
| 293 |
+
(MNLI, RANDOM) - The premise is sampled in an identical manner as (SST2, RANDOM). To construct the final hypothesis, the following process is repeated three times - i) choose a word uniformly at random from the premise ii) replace this word with another word uniformly randomly sampled from the top-10000 wikitext103 vocabulary.
|
| 294 |
+
|
| 295 |
+
(MNLI, WIKI) - The premise is sampled in a manner identical to (SST2, WIKI). The hypothesis is sampled in a manner identical (MNLI, RANDOM).
|
| 296 |
+
|
| 297 |
+
(SQuAD, RANDOM) - A vocabulary is built using wikitext103 and stored along with unigram probabilities for each token in vocabulary. A length is chosen from the pool of paragraph lengths in wikitext103. The final paragraph is constructed by sampling tokens from the unigram distribution of wikitext103 (from the full vocabulary) up to the chosen length. Next, a random integer length is chosen from the range [5, 15]. Paragraph tokens are uniformly randomly sampled to up to the chosen length to build the question. Once sampled, the question is appended with a ? symbol and prepended with a question starter word chosen uniformly randomly from the list [A, According, After, Along, At, By, During, For, From, How, In, On, The, To, What, What’s, When, Where, Which, Who, Whose, Why].
|
| 298 |
+
|
| 299 |
+
(SQuAD, WIKI) - A paragraph is chosen at random from wikitext103. Questions are sampled in a manner identical to (SQuAD, RANDOM).
|
| 300 |
+
|
| 301 |
+
(BoolQ, RANDOM) - identical to (SQuAD, RANDOM). We avoid appending questions with ? since they were absent in BoolQ. Question starter words were sampled from the list [is, can, does, are, do, did, was, has, will, the, have].
|
| 302 |
+
|
| 303 |
+
(BoolQ, WIKI) - identical to (SQuAD, WIKI). We avoid appending questions with ? since they were absent in BoolQ. The question starter word list is identical to (BoolQ, RANDOM).
|
| 304 |
+
|
| 305 |
+
# A.4 MODEL EXTRACTION WITH OTHER INPUT GENERATORS
|
| 306 |
+
|
| 307 |
+
In this section we study some additional query generation heuristics. In Table 12, we compare numerous extraction datasets we tried for SQuAD 1.1. Our general findings are - i) RANDOM works much better when the paragraphs are sampled from a distribution reflecting the unigram frequency in wikitext103 compared to uniform random sampling ii) starting questions with common question starter words like “what” helps, especially with RANDOM schemes.
|
| 308 |
+
|
| 309 |
+
We present a similar ablation study on MNLI in Table 13. Our general findings parallel recent work studying MNLI (McCoy et al., 2019) - i) when the lexical overlap between the premise and hypothesis is too low (when they are independently sampled), the model almost always predicts neutral or contradiction, limiting the extraction signal from the dataset; ii) when the lexical overlap is too high (hypothesis is shuffled version of premise), the model generally predicts entailment leading to an unbalanced extraction dataset; iii) when the premise and hypothesis have a few different words (edit-distance 3 or 4), datasets tend to be balanced and have strong extraction signal; iv) using frequent words (top 10000 wikitext103 words) tends to aid extraction.
|
| 310 |
+
|
| 311 |
+
# A.5 EXAMPLES
|
| 312 |
+
|
| 313 |
+
More examples have been provided in Table 14.
|
| 314 |
+
|
| 315 |
+
# A.6 HUMAN ANNOTATION DETAILS
|
| 316 |
+
|
| 317 |
+
For our human studies, we asked fifteen human annotators to annotate five sets of twenty questions. Annotators were English-speaking graduate students who voluntarily agreed to participate and were completely unfamiliar with our research goals. Three annotators were used per question set. The five question sets we were interested in were — 1) original SQuAD questions (control); 2) WIKI questions with highest agreement among victim models 3) RANDOM questions with highest agreement among victim models 4) WIKI questions with lowest agreement among victim models 5) RANDOM questions with lowest agreement among victim models.
|
| 318 |
+
|
| 319 |
+
In Table 11 we show the inter-annotator agreement. Notice that average pairwise F1 (a measure of inter-annotator agreement) follows the order original $\mathrm { S Q u A D > } >$ WIKI, highest agreement $>$ RANDOM, highest agreement $\sim$ WIKI, lowest agreement $>$ RANDOM, lowest agreement. We hypothesize that this ordering roughly reflects the closeness to the actual input distribution, since a similar ordering is also observed in Figure 2. Individual annotation scores have been shown below.
|
| 320 |
+
|
| 321 |
+
1) Original SQuAD dataset — annotators achieves scores of 80.0 EM (86.8 F1), 75.0 EM (83.6 F1) and 75.0 EM (85.0 F1) when comparing against the original SQuAD answers. This averages to 76.7 EM (85.1 F1).
|
| 322 |
+
|
| 323 |
+
2) WIKI questions with unanimous agreement among victim models — annotators achieves scores of 20.0 EM (32.1 F1), 30.0 EM (33.0 F1) and 20.0 EM (33.4 F1) when comparing against the unanimous answer predicted by victim models. This averages to 23.3 EM (32.8 F1).
|
| 324 |
+
|
| 325 |
+
3) RANDOM questions with unanimous agreement among victim models — annotators achieves scores of 20.0 EM (33.0 F1), 25.0 EM (34.8 F1) and 20.0 EM (27.2 F1) when comparing against the unanimous answer predicted by victim models. This averages to 21.7 EM (31.7 F1).
|
| 326 |
+
|
| 327 |
+
4) WIKI questions with 0 F1 agreement between every pair of victim models — annotators achieves scores of 25.0 EM (52.9 F1), 15.0 EM (37.2 F1), 35.0 (44.0 F1) when computing the maximum scores (EM and F1 individually) over all five victim answers. Hence, this is not directly comparable with the results in 1, 2 and 3. This averages to 25 EM (44.7 F1).
|
| 328 |
+
|
| 329 |
+
5) RANDOM questions with 0 F1 agreement between every pair of victim models — annotators achieves scores of 15.0 EM (33.8 F1), 10.0 EM (16.2 F1), 4.8 EM (4.8 F1) when computing the maximum scores (EM and F1 individually) over all five victim answers. Hence, this is not directly comparable with the results in 1, 2 and 3. This averages to 9.9 EM (18.3 F1).
|
| 330 |
+
|
| 331 |
+
# A.7 MEMBERSHIP CLASSIFICATION - ABLATION STUDY
|
| 332 |
+
|
| 333 |
+
In this section we run an ablation study on the input features for the membership classifier. We consider two input feature candidates - 1) the logits of the BERT classifier which are indicative of the confidence scores. 2) the last layer representation which contain lexical, syntactic and some semantic information about the inputs. We present our results in Table 10. Our ablation study indicates that the last layer representations are more effective than the logits in distinguishing between real and fake inputs. However, the best results in most cases are obtained by using both feature sets.
|
| 334 |
+
|
| 335 |
+
Table 10: Ablation study of the membership classifiers. We measure accuracy on an identically distributed development set (WIKI) and differently distributed test sets (RANDOM, SHUFFLE). Note the last layer representations tend to be more effective in classifying points as real or fake.
|
| 336 |
+
|
| 337 |
+
<table><tr><td>Task</td><td>Input Features</td><td>WIKI</td><td>RANDOM</td><td>SHUFFLE</td></tr><tr><td>MNLI</td><td>last layer + logits</td><td>99.3%</td><td>99.1%</td><td>87.4%</td></tr><tr><td></td><td>logits</td><td>90.7%</td><td>91.2%</td><td>82.3%</td></tr><tr><td></td><td>last layer</td><td>99.2%</td><td>99.1%</td><td>88.9%</td></tr><tr><td>SQuAD</td><td>last layer + logits</td><td>98.8%</td><td>99.9%</td><td>99.7%</td></tr><tr><td></td><td>logits</td><td>81.5%</td><td>84.7%</td><td>82.0%</td></tr><tr><td></td><td>last layer</td><td>98.8%</td><td>98.9%</td><td>99.0%</td></tr></table>
|
| 338 |
+
|
| 339 |
+
Table 11: Agreement between annotators Note that the agreement follows the expected intuitive trend — original $\mathrm { S Q u A D > } >$ WIKI, highest agreement $>$ RANDOM, highest agreement $\sim$ WIKI, lowest agreement $>$ RANDOM, lowest agreement.
|
| 340 |
+
|
| 341 |
+
<table><tr><td>Annotation Task</td><td>Atleast 2 annotators gave the same an- swer for</td><td>All3 annotators gave the same answer for</td><td>Every pair of an- notators had 0 F1 overlap for</td><td>Average pairwise agreement</td></tr><tr><td>Original SQuAD</td><td>18/20 questions</td><td>15/20 questions</td><td>0/20 questions</td><td>80.0 EM (93.3 F1)</td></tr><tr><td>WIKI, highest agreement</td><td>11/20 questions</td><td>4/20 questions</td><td>6/20 questions</td><td>35.0 EM (45.3 F1)</td></tr><tr><td>RANDOM, highest agreement</td><td>6/20 questions</td><td>2/20 questions</td><td>7/20 questions</td><td>20.0 EM (29.9 F1)</td></tr><tr><td>WIKI, lowest agreement</td><td>6/20 questions</td><td>1/20 questions</td><td>7/20 questions</td><td>20.0 EM (25.5 F1)</td></tr><tr><td>RANDOM, lowest agreement</td><td>3/20 questions</td><td>0/20 questions</td><td>15/20 questions</td><td>5.0 EM (11.7 F1)</td></tr></table>
|
| 342 |
+
|
| 343 |
+
Table 12: Development set F1 using different kinds of extraction datasets on SQuAD 1.1. The final RANDOM and WIKI schemes have also been indicated in the table.
|
| 344 |
+
|
| 345 |
+
<table><tr><td>Paragraph Scheme</td><td>Question Scheme</td><td>Dev F1</td><td>Dev EM</td></tr><tr><td>Original SQuAD paragraphs</td><td>Original SQuAD questions</td><td>90.58</td><td>83.89</td></tr><tr><td></td><td>Words sampled from paragraphs, starts with question-starter word, ends with ?</td><td>86.62</td><td>78.09</td></tr><tr><td></td><td>Words sampled from paragraphs</td><td>81.08</td><td>68.58</td></tr><tr><td>Wikitext103 paragraphs</td><td>Words sampled from paragraphs,starts with question-starter word,ends with ?</td><td>86.06</td><td>77.11</td></tr><tr><td></td><td>(WIKI) Words sampled from paragraphs</td><td>81.71</td><td>69.56</td></tr><tr><td>Unigram frequency based sampling from wikitext-103vocabulary with</td><td>Words sampled from paragraphs,starts</td><td>80.72</td><td>70.90</td></tr><tr><td>length equal to original paragraphs</td><td>with question-starter word, ends with ?</td><td></td><td></td></tr><tr><td>Unigram frequency based sampling</td><td>Words sampled from paragraphs</td><td>70.68</td><td>56.75</td></tr><tr><td>fromwikitext-1O3vocabulary with</td><td>Words sampled from paragraphs, starts with question-starter word,ends with ?</td><td>79.14</td><td>68.52</td></tr><tr><td>length equal to wikitext1O3 paragraphs</td><td>(RANDOM) Words sampled from paragraphs</td><td>71.01</td><td>57.60</td></tr><tr><td>Uniform random sampling from</td><td>Words sampled from paragraphs,starts</td><td>72.63</td><td>63.41</td></tr><tr><td>wikitext-103 vocabulary with length</td><td>with question-starter word,ends with ?</td><td></td><td></td></tr><tr><td>equal to original paragraphs</td><td></td><td></td><td></td></tr></table>
|
| 346 |
+
|
| 347 |
+
Table 13: Development set results using different kinds of extraction datasets on MNLI. The final RANDOM and WIKI schemes have also been indicated in the table.
|
| 348 |
+
|
| 349 |
+
<table><tr><td>Premise Scheme</td><td>Hypothesis Scheme</td><td>Dev %</td></tr><tr><td>Original MNLI premise</td><td>Original MNLIHypothesis</td><td>85.80%</td></tr><tr><td rowspan="4">Uniformly randomly sampled from MNLI vocabulary</td><td>Uniformly randomly sampled from MNLI vo- cabulary</td><td>54.64%</td></tr><tr><td>Shuffling of premise randomly replace 1 word in premise with word</td><td>66.56% 76.69%</td></tr><tr><td>from MNLI vocabulary randomly replace 2 words in premise with</td><td>76.95%</td></tr><tr><td>words from MNLI vocabulary randomly replace 3 words in premise with words from MNLI vocabulary randomly replace 4 words in premise with</td><td>78.13%</td></tr><tr><td>Uniformly randomlysampled from wikitext103 vocabulary</td><td>words from MNLI vocabulary randomly replace 3 words in premise with</td><td>77.74%</td></tr><tr><td>Uniformly randomly sampled from top 10000 frequent tokens in wikitext103 vocabulary</td><td>words from MNLI vocabulary randomly replace 3 words in premise with words from MNLI vocabulary (RANDOM)</td><td>76.26%</td></tr><tr><td>Wikitext103 sentence</td><td>Wikitext103 sentence Shuffling of premise randomly replace 1 word in premise with word from wikitext103 vocabulary randomly replace 2 words in premise with words from wikitext103 vocabulary randomly replace 3 words in premise with words from wikitext103 vocabulary randomly replace 4 words in premise with 76.53%</td><td>52.03% 56.11% 72.81% 74.58% 76.03%</td></tr><tr><td>Wikitext103 sentence. Replace rare words (non top-1oooo frequent tokens) with words from top 10ooo frequent to- kensin wikitext103</td><td>words from wikitext103 vocabulary randomly replace 3 words in premise with words from top 10ooo frequent tokens in wiki- text103 vocabulary(WIKI)</td><td>77.80%</td></tr></table>
|
| 350 |
+
|
| 351 |
+
Table 14: More example queries from our datasets and their outputs from the victim model.
|
| 352 |
+
|
| 353 |
+
<table><tr><td colspan="3"></td></tr><tr><td>Task</td><td>RANDOM examples</td><td>WIKI examples "Nixon stated that he tried to use the layout tone as much</td></tr><tr><td rowspan="6">SST2</td><td>CR either Russell draft covering size.Russell installation Have (99.56% negative)</td><td>as possible. (99.89% negative)</td></tr><tr><td>identifying Prior destroyers Ontario retaining singles (80.23% negative)</td><td>This led him to 29 a Government committee to inves- tigate light Queen's throughout India. (99.18% positive)</td></tr><tr><td>Treasury constant instance border.V inspiration (85.23% positive)</td><td>The hamlet was established in Light (99.99% positive)</td></tr><tr><td>bypass heir 1990, (86.68% negative)</td><td>6,oppose captain, Jason-North America .</td></tr><tr><td>circumstances meet via novel. tries 1963,Society (99.45% positive)</td><td>(70.60% negative) It bus all winter and into March or early April.</td></tr><tr><td>P: wicket eagle connecting beauty Joseph predecessor, Mobile</td><td>(87.87% negative) P: The shock wave Court.the entire guys and several ships reported that they had been love</td></tr><tr><td rowspan="6"></td><td>H:wicket eagle connecting beauty Joseph songs,home (99.98% contradiction)</td><td>H: The shock wave ceremony the entire guys and several ships reported that they had Critics love</td></tr><tr><td>P:ISBN displacement Watch Jesus charting Fletcher stated copper H: ISBN José Watch Jesus charting Fletcher stated officer</td><td>(98.38% entailment) P: The unique glass chapel made public and press viewing</td></tr><tr><td>(98.79% neutral)</td><td>of the wedding fierce H: itself.unique glass chapel made public and press secondary design. the wedding fierce</td></tr><tr><td>P:Their discussing Tucker Primary crew. east pro- duce H: Their discussing Harris Primary substance east execu-</td><td>(99.61% neutral)</td></tr><tr><td>tive (99.97% contradiction)</td><td>P:He and David Lewis lived together as a couple from around 1930 to 25th H: He 92 Shakespeare's See lived together as a couple from around 1930 to 25th</td></tr><tr><td>SQuAD P:as and conditions Toxostoma storm,The interpreted. Glowworm separation Leading killed Papps wall upcoming Michael Highway that of on other Engine On to Washing- ton Kazim of consisted the ”further and into touchdown (AADT),Territory fourth of h; advocacy its Jade woman ”</td><td>(99.78% contradiction) P:Due to the proximity of Ottoman forces and the harsh winter weather,many casualties were anticipated during the embarkation.The untenable nature of the Allied position was made apparent when a heavy rainstorm struck on 26 November 1915.It lasted three days and was</td></tr><tr><td rowspan="2">”?</td><td>lit that spin. Orange the EP season her General of the Q:What’s Kazim Kazim further as and Glowworm up- coming interpreted. its spin. Michael as? A: Jade woman P:of not responded and station used however,to per- formances,the west such as skyrocketing reductions a</td><td>followed by a blizzard at Suvla in early December.Rain flooded trenches,drowned soldiers and washed unburied corpses into the lines; the following snow killed still more men from exposure. Q: For The proximity to the from untenable more? A: Ottoman forces</td></tr><tr><td>of Church incohesive.still as with It 43 passing out monopoly August return typically kalachakra,rare them was performed when game weak McPartlands as has the El to Club to their”The Washington, After 80o Road. Q: How”with 8Oo It to such Church return McPartland's A:”The Washington,After 80o Road.</td><td>P:Rogen and his comedy partner Evan Goldberg co- wrote the films Superbad,Pineapple Express,This Is the End,and directed both This Is the End and The Interview; all of which Rogen starred in.He has also done voice work for the films Horton Hearsa Who !,the Kung Fu Panda film series,Monsters vs.Aliens,Paul,and the upcoming Sausage Party Q:What's a Hears co-wrote Sausage Aliens,done which</td></tr><tr><td rowspan="2">BoolQ</td><td>P:as Yoo identities.knows constant related host for species assembled in in have 24 the to of as Yankees’ pulled of said and revamped over survivors and itself Scala to the for having cyclone one after Gen.hostility was all living the was one back European was the be was beneath platform meant 4,Escapist King with Chicago spin Defeated to Myst succeed out corrupt Belknap mother</td><td>A: Superbad P: The opening of the Willow Grove Park Mall led to the decline of retail along Old York Road in Abington and Jenkintown,with department stores such as Blooming- dale's, Sears,and Strawbridge & Clothier relocating from this area to the mall during the 198Os.A Lord & Taylor storein the same area closed in 1989,but was eventually replaced by the King of Prussia location in 1995.</td></tr><tr><td>Keys guaranteeing Q: will was the and for was A: 99.58% yes P:regular The Desmond World in knew mix.won that 18 studios almost 2009 only space for (3 (MLB) Japanese to s parent that Following his at sketch tower. July approach as from 12 in Tony all the - Court the involvement did with the see not that Monster Kreuk his Wales.to and & refine July River Best Ju Gorgos for Kemper trying ceremony held not and</td><td>Q: are in from opening in in mall stores abington A: 99.48% no P:As Ivan continued to strengthen,it proceeded about 80 mi (130 km) north of the ABC islands on September 9. High winds blew away roof shingles and produced large swells that battered several coastal facilities.A develop- ing spiral band dropped heavy rainfallover Aruba,causing flooding and $1.1 million worth in structural damage. Q: was spiral rainfall of 8O blew shingles islands heavy A: 99.76% no</td></tr></table>
|
md/train/F1vEjWK-lH_/F1vEjWK-lH_.md
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADIENT VACCINE: INVESTIGATING AND IMPROVING MULTI-TASK OPTIMIZATION IN MASSIVELY MULTILINGUAL MODELS
|
| 2 |
+
|
| 3 |
+
Zirui Wang1,2∗, Yulia Tsvetkov1, Orhan Firat2, Yuan Cao2 1Carnegie Mellon University, 2Google AI {ziruiw,ytsvetko}@cs.cmu.edu, {orhanf,yuancao}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Massively multilingual models subsuming tens or even hundreds of languages pose great challenges to multi-task optimization. While it is a common practice to apply a language-agnostic procedure optimizing a joint multilingual task objective, how to properly characterize and take advantage of its underlying problem structure for improving optimization efficiency remains under-explored. In this paper, we attempt to peek into the black-box of multilingual optimization through the lens of loss function geometry. We find that gradient similarity measured along the optimization trajectory is an important signal, which correlates well with not only language proximity but also the overall model performance. Such observation helps us to identify a critical limitation of existing gradient-based multi-task learning methods, and thus we derive a simple and scalable optimization procedure, named Gradient Vaccine, which encourages more geometrically aligned parameter updates for close tasks. Empirically, our method obtains significant model performance gains on multilingual machine translation and XTREME benchmark tasks for multilingual language models. Our work reveals the importance of properly measuring and utilizing language proximity in multilingual optimization, and has broader implications for multi-task learning beyond multilingual modeling.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Modern multilingual methods, such as multilingual language models (Devlin et al., 2018; Lample & Conneau, 2019; Conneau et al., 2019) and multilingual neural machine translation (NMT) (Firat et al., 2016; Johnson et al., 2017; Aharoni et al., 2019; Arivazhagan et al., 2019), have been showing success in processing tens or hundreds of languages simultaneously in a single large model. These models are appealing for two reasons: (1) Efficiency: training and deploying a single multilingual model requires much less resources than maintaining one model for each language considered, (2) Positive cross-lingual transfer: by transferring knowledge from high-resource languages (HRL), multilingual models are able to improve performance on low-resource languages (LRL) on a wide variety of tasks (Pires et al., 2019; Wu & Dredze, 2019; Siddhant et al., 2020; Hu et al., 2020).
|
| 12 |
+
|
| 13 |
+
Despite their efficacy, how to properly analyze or improve the optimization procedure of multilingual models remains under-explored. In particular, multilingual models are multi-task learning (MTL) (Ruder, 2017) in nature but existing literature often train them in a monolithic manner, naively using a single language-agnostic objective on the concatenated corpus of many languages. While this approach ignores task relatedness and might induce negative interference (Wang et al., 2020b), its optimization process also remains a black-box, muffling the interaction among different languages during training and the cross-lingual transferring mechanism.
|
| 14 |
+
|
| 15 |
+
In this work, we attempt to open the multilingual optimization black-box via the analysis of loss geometry. Specifically, we aim to answer the following questions: (1) Do typologically similar languages enjoy more similar loss geometries in the optimization process of multilingual models? (2) If so, in the joint training procedure, do more similar gradient trajectories imply less interference between tasks, hence leading to better model quality? (3) Lastly, can we deliberately encourage more geometrically aligned parameter updates to improve multi-task optimization, especially in real-world massively multilingual models that contain heavily noisy and unbalanced training data?
|
| 16 |
+
|
| 17 |
+
Towards this end, we perform a comprehensive study on massively multilingual neural machine translation tasks, where each language pair is considered as a separate task. We first study the correlation between language and loss geometry similarities, characterized by gradient similarity along the optimization trajectory. We investigate how they evolve throughout the whole training process, and glean insights on how they correlate with cross-lingual transfer and joint performance. In particular, our experiments reveal that gradient similarities across tasks correlate strongly with both language proximities and model performance, and thus we observe that typologically close languages share similar gradients that would further lead to well-aligned multilingual structure (Wu et al., 2019) and successful cross-lingual transfer. Based on these findings, we identify a major limitation of a popular multi-task learning method (Yu et al., 2020) applied in multilingual models and propose a preemptive method, Gradient Vaccine, that leverages task relatedness to set gradient similarity objectives and adaptively align task gradients to achieve such objectives. Empirically, our approach obtains significant performance gain over the standard monolithic optimization strategy and popular multi-task baselines on large-scale multilingual NMT models and multilingual language models. To the best of our knowledge, this is the first work to systematically study and improve loss geometries in multilingual optimization at scale.
|
| 18 |
+
|
| 19 |
+
# 2 INVESTIGATING MULTI-TASK OPTIMIZATION IN MASSIVELY MULTILINGUAL MODELS
|
| 20 |
+
|
| 21 |
+
While prior work have studied the effect of data (Arivazhagan et al., 2019; Wang et al., 2020a), architecture (Blackwood et al., 2018; Sachan & Neubig, 2018; Vazquez et al., 2019; Escolano et al., ´ 2020) and scale (Huang et al., 2019b; Lepikhin et al., 2020) on multilingual models, their optimization dynamics are not well understood. We hereby perform a series of control experiments on massively multilingual NMT models to investigate how gradients interact in multilingual settings and what are their impacts on model performance, as existing work hypothesizes that gradient conflicts, defined as negative cosine similarity between gradients, can be detrimental for multi-task learning (Yu et al., 2020) and cause negative transfer (Wang et al., 2019).
|
| 22 |
+
|
| 23 |
+
# 2.1 EXPERIMENTAL SETUP
|
| 24 |
+
|
| 25 |
+
For training multilingual machine translation models, we mainly follow the setup in Arivazhagan et al. (2019). In particular, we jointly train multiple translation language pairs in a single sequenceto-sequence (seq2seq) model (Sutskever et al., 2014). We use the Transformer-Big (Vaswani et al., 2017) architecture containing 375M parameters described in (Chen et al., 2018a), where all parameters are shared across language pairs. We use an effective batch sizes of $5 0 0 \mathrm { k }$ tokens, and utilize data parallelism to train all models over 64 TPUv3 chips. Sentences are encoded using a shared source-target Sentence Piece Model (Kudo & Richardson, 2018) with $6 4 \mathrm { k }$ tokens, and a ${ < } 2 \mathrm { x x } >$ token is prepended to the source sentence to indicate the target language (Johnson et al., 2017). The full training details can be found in Appendix B.
|
| 26 |
+
|
| 27 |
+
To study real-world multi-task optimization on a massive scale, we use an in-house training corpus1 (Arivazhagan et al., 2019) generated by crawling and extracting parallel sentences from the web (Uszkoreit et al., 2010), which contains more than 25 billion sentence pairs for 102 languages to and from English. We select 25 languages (50 language pairs pivoted on English), containing over 8 billion sentence pairs, from 10 diverse language families and 4 different levels of data sizes (detailed in Appendix A). We then train two models on two directions separately, namely $A n y { } E n$ and $E n { } A n y$ . Furthermore, to minimize the confounding factors of inconsistent sentence semantics across language pairs, we create a multi-way aligned evaluation set of $3 \mathrm { k }$ sentences for all languages2. Then, for each checkpoint at an interval of 1000 training steps, we measure pair-wise cosine similarities of the model’s gradients on this dataset between all language pairs. We examine gradient similarities at various granularities, from specific layers to the entire model.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Cosine similarities of encoder gradients between xx-en language pairs averaged across all training steps. Darker cell indicates pair-wise gradients are more similar. Best viewed in color.4
|
| 31 |
+
|
| 32 |
+
# 2.2 OBSERVATIONS
|
| 33 |
+
|
| 34 |
+
We make the following three main observations. Our findings are consistent across different model architectures and settings (see Appendix C and D for more results and additional discussions).
|
| 35 |
+
|
| 36 |
+
1. Gradient similarities reflect language proximities. We first examine if close tasks enjoy similar loss geometries and vice versa. Here, we use language proximity (defined according to their memberships in a linguistic language family) to control task similarity, and utilize gradient similarity to measure loss geometry. We choose typological similarity because it is informative and popular, and we leave the exploration of other language similarity measurements for future work. In Figure 1, we use a symmetric heatmap to visualize pair-wise gradient similarities, averaged across all checkpoints at different training steps. Specifically, we observe strong clustering by membership closeness in the linguistic family, along the diagonal of the gradient similarity matrix. In addition, all European languages form a large cluster in the upper-left corner, with an even smaller fine-grained cluster of Slavic languages inside. Furthermore, we also observe similarities for Western European languages gradually decrease in West Slavic South Slavic East Slavic, illustrating the gradual continuum of language proximity.
|
| 37 |
+
|
| 38 |
+
2. Gradient similarities correlate positively with model quality. As gradient similarities correlate well with task proximities, it is natural to ask whether higher gradient similarities lead to better multi-task performance. In Figure 2(a), we train a joint model of all language pairs in both $E n { } A n y$ and $A n y { } E n$ directions, and compare gradient similarities between these two. While prior work has shown that $E n { } A n y$ is harder and less amenable for positive transfer (Arivazhagan et al., 2019), we find that gradients of tasks in $E n { } A n y$ are indeed less similar than those in $A n y { } E n$ . On the other hand, while larger batch sizes often improve model quality, we observe that models trained with smaller batches have less similar loss geometries (Appendix D). These all indicate that gradient interference poses great challenge to the learning procedure.
|
| 39 |
+
|
| 40 |
+
To further verify this, we pair $\mathrm { E n } \to \mathrm { F r }$ with different language pairs (e.g. E $\mathrm { n \to E s }$ or $\mathrm { E n } { } \mathrm { H i }$ ), and train a set of models with exactly two language pairs5. We then evaluate their performance on the $\mathrm { E n } \to \mathrm { F r }$ test set, and compare their BLEU scores versus gradient similarities between paired two tasks. As shown in Figure 2(b), gradient similarities correlate positively with model performance, again demonstrating that dissimilar gradients introduce interference and undermine model quality.
|
| 41 |
+
|
| 42 |
+
3. Gradient similarities evolve across layers and training steps. While the previous discussion focuses on the gradient similarity of the whole model averaged over all checkpoints, we now study it across different layers and training steps. Figure 4(c) shows the evolution of the gradient similarities throughout the training. Interestingly, we observe diverse patterns for different gradient subsets. For instance, gradients between $\mathrm { E n } { } \mathrm { F r }$ and $\mathrm { E n } \to \mathrm { H i }$ gradually become less similar (from positive to negative) in layer 1 of the decoder but more similar (from negative to positive) in the encoder of the same layer. On the other hand, gradient similarities between $\mathrm { E n } { } \mathrm { F r }$ and $\mathrm { E n } { } \mathrm { E s }$ are always higher than those between $\mathrm { E n } { } \mathrm { F r }$ and $\mathrm { E n } \to \mathrm { H i }$ in the same layer, consistent with prior observation that gradients reflect language similarities.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Comparing gradient similarity versus model performance. (a): Similarity of model gradients between xx-en (left) and en-xx (right) language pairs in a single $A n y { } A n y$ model. (b): BLEU scores on en-fr of a set of trilingual models versus their gradient similarities. Each model is trained on en- $\mathcal { f } r$ and another en-xx language pair.
|
| 46 |
+
|
| 47 |
+
In addition, we evaluate the difference between gradient similarities in the multilingual encoder and decoder in Figure 4(a). We find that the gradients are more similar in the decoder (positive values) for the $A n y { } E n$ direction but less similar (negative values) for the $E n { } A n y$ direction. This is in line with our intuition that gradients should be more consistent when the decoder only needs to handle one single language. Moreover, we visualize how gradient similarities evolve across layers in Figure 4(b). We notice that similarity between gradients increase/decrease as we move up from bottom to top layers for the $A n y { } E n / E n { } A n y$ direction, and hypothesize that this is due to the difference in label space (English-only tokens versus tokens from many languages). These results demonstrate that the dynamics of gradients evolve over model layers and training time.
|
| 48 |
+
|
| 49 |
+
Our analysis highlights the important role of loss geometries in multilingual models. With these points in mind, we next turn to the problem of how to improve multi-task optimization in multilingual models in a systematic way.
|
| 50 |
+
|
| 51 |
+
# 3 PROPOSED METHOD
|
| 52 |
+
|
| 53 |
+
Following our observations that inter-task loss geometries correlate well with language similarities and model quality, a natural question to ask next is how we can take advantage of such gradient dynamics and design optimization procedures superior to the standard monolithic practice. Since we train large-scale models on real-world dataset consisting of billions of words, of which tasks are highly unbalanced and exhibit complex interactions, we propose an effective approach that not only exploits int structures but also is applicable to unbalance and noisy data. To motivate our method, we first review a state-of-the-art multi-task learning method and show how the observation in Section 2 helps us to identify its limitation.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 3: Counts of active PCGrad (left) ander-task GradVac (right) during the training process.d tasks
|
| 57 |
+
|
| 58 |
+
# 3.1 GRADIENT SURGERY
|
| 59 |
+
|
| 60 |
+
An existing line of work (Chen et al., 2018b; Sener & Koltun, 2018; Yu et al., 2020) has successfully utilized gradient-based techniques to improve multi-task models. Notably, Yu et al. (2020)
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 4: Evaluating gradient similarity across model architecture and training steps. (a): Difference between gradient similarities in the encoder and decoder. Positive value (darker) indicates the encoder has more similar gradient similarities. (b): Gradient similarities across layers. (c): Gradient similarities of different components and tasks across training steps.
|
| 64 |
+
|
| 65 |
+
hypothesizes that negative cosine similarities between gradients are detrimental for multi-task optimization and proposes a method to directly project conflicting gradients (PCGrad), also known as the Gradient Surgery. As illustrated in the left side of Figure 5(a), the idea is to first detect gradient conflicts and then perform a “surgery” to deconflict them if needed. Specifically, for gradients $\mathbf { g } _ { i }$ and $\mathbf { g } _ { j }$ of the $i$ -th and $j$ -th task respectively at a specific training step, PCGrad (1) computes their cosine similarity to determine if they are conflicting, and (2) if the value is negative, projects $\mathbf { g } _ { i }$ onto the normal plane of $\mathbf { g } _ { j }$ as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbf { g } _ { i } ^ { \prime } = \mathbf { g } _ { i } - { \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \parallel \mathbf { g } _ { j } \parallel ^ { 2 } } } \mathbf { g } _ { j } .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
The altered gradient $\mathbf { g } _ { i } ^ { \prime }$ replaces the original $\mathbf { g } _ { i }$ and this whole process is repeated across all tasks in a random order. For more details and theoretical analysis, we refer readers to the original work.
|
| 72 |
+
|
| 73 |
+
Now, we can also interpret PCGrad from a different perspective: notice that the gradient cosine similarity will always be zero after the projection, effectively setting a target lower bound. In other words, PCGrad aims to align gradients to match a certain gradient similarity level, and implicitly makes the assumption that any two tasks must have the same gradient similarity objective of zero. However, as we shown in Section 2, different language proximities would result in diverse gradient similarities. In fact, many language pairs in our model share positive cosine similarities such that the pre-condition for PCGrad would never be satisfied. This is shown in the left of Figure 5(b), where PCGrad is not effective for positive gradient similarities and thus it is very sparse during training in the left of Figure 3. Motivated by this limitation, we next present our proposed method.
|
| 74 |
+
|
| 75 |
+
# 3.2 GRADIENT VACCINE
|
| 76 |
+
|
| 77 |
+
The limitation of PCGrad comes from the unnecessary assumption that all tasks must enjoy similar gradient interactions, ignoring complex inter-task relationships. To relax this assumption, a natural idea is to set adaptive gradient similarity objectives in some proper manner. An example is shown in the right of Figure 5(b), where two tasks have a positive gradient similarity of $\cos ( \theta ) ^ { \setminus } = \phi _ { i j }$ . While PCGrad ignores such non-negative case, the current value of $\phi _ { i j }$ may still be detrimentally low for more similar tasks such as French versus Spanish. Thus, suppose we have some similarity goal of $\cos ( \theta ^ { \prime } ) = \phi _ { i j } ^ { T } > \phi _ { i j }$ (e.g. the “normal” cosine similarity between these two tasks), we alter both the magnitude and direction of $\mathbf { g } _ { i }$ such that the resulting gradients match such gradient similarity objective. In particular, we replace $g _ { i }$ with a vector that satisfies such condition in the vector space spanned by $\mathbf { g } _ { i }$ and $\mathbf { g } _ { j }$ , i.e. $a _ { 1 } \cdot \mathbf { g } _ { i } + a _ { 2 } \cdot \mathbf { g } _ { j }$ . Since there are infinite numbers of valid combinations of $a _ { 1 }$ and $a _ { 2 }$ , for simplicity, we fix $a _ { 1 } = 1$ and by applying Law of Sines in the plane of $\mathbf { g } _ { i }$ and $\mathbf { g } _ { j }$ , we solve for the value of $a _ { 2 }$ and derive the new gradient for the $i$ -th task as 6:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathbf { g } _ { i } ^ { \prime } = \mathbf { g } _ { i } + \frac { \| \mathbf { g } _ { i } \| ( \phi _ { i j } ^ { T } \sqrt { 1 - \phi _ { i j } ^ { 2 } } - \phi _ { i j } \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } ) } { \| \mathbf { g } _ { j } \| \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } } \cdot \mathbf { g } _ { j } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 5: Comparing PCGrad (left) with GradVac (right) in two cases. (a): For negative similarity, both methods are effective but GradVac can utilize adaptive objectives between different tasks. (b): For positive similarity, only GradVac is active while PCGrad stays “idle”.
|
| 85 |
+
|
| 86 |
+
This formulation allows us to use arbitrary gradient similarity objective $\phi _ { i j } ^ { T }$ in $[ - 1 , 1 ]$ . The remaining question is how to set such objective properly. In the above analysis, we have seen that gradient interactions change drastically across tasks, layers and training steps. To incorporate these three factors, we exploit an exponential moving average (EMA) variable for tasks $i , j$ and parameter group $k$ (e.g. the $k$ -th layer) as:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r } { \hat { \phi } _ { i j k } ^ { ( t ) } = ( 1 - \beta ) \hat { \phi } _ { i j k } ^ { ( t - 1 ) } + \beta \phi _ { i j k } ^ { ( t ) } , } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where φ(t)ijk is the computed gradient similarity at training step $t$ , $\beta$ is a hyper-parameter, and $\hat { \phi } _ { i j k } ^ { ( 0 ) } =$ 0. The full method is outlined in Algorithm 1 (Appendix E). Notice that gradient surgery is a special case of our proposed method such that $\phi _ { i j } ^ { T } = \mathrm { { 0 } }$ . As shown in the right of Figure 5(a) and 5(b), our method alters gradients more preemptively under both positive and negative cases, taking more proactive measurements in updating the gradients (Figure 3). We therefore refer to it as Gradient Vaccine (GradVac). Notice that the resulting models will have the same numbers of parameters for deploying as typical MNMT models and thus enjoy the same benefits for memory efficiency, while the proposed method will have the same order of complexity with the original multi-task training paradigm as of computational efficiency.
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTS
|
| 95 |
+
|
| 96 |
+
We compare multi-task optimization methods with the monolithic approach in multilingual settings, and examine the effectiveness of our proposed method on multilingual NMT and multilingual language models.
|
| 97 |
+
|
| 98 |
+
# 4.1 GENERAL SETUP
|
| 99 |
+
|
| 100 |
+
We choose three popular scalable gradient-based multi-task optimization methods as our baselnes: GradNorm (Chen et al., 2018b), MGDA (Sener & Koltun, 2018), and PCGrad (Yu et al., 2020). For fair comparison, language-specifc gradients are computed for samples in each batch. The sampling temperature is also fixed at $\mathrm { T } { = } 5$ unless otherwise stated. For the baselines, we mainly follow the default settings and training procedures for hype-parameter selection as explained in their respective papers. For our method, to study how sensitive GradVac is to the distribution of tasks, we additionally examine a variant that allows us to control which languages are considered for GradVac. Specifically, we search the following hyper-parameters on small-scale WMT dataset and transfer to our large-scale dataset: tasks considered for GradVac {HRL only, LRL only, all task}, parameter granularity $\{$ whole model, enc dec, all layer, all matrix}, EMA decay rate $\beta$ {1e-1, 1e-2, 1e-3}. We find {LRL only, all layer, 1e- $\cdot 2 \}$ to work generally well and use these in the following experiments (see Appendix F for more details and results).
|
| 101 |
+
|
| 102 |
+
# 4.2 RESULTS AND ANALYSIS
|
| 103 |
+
|
| 104 |
+
WMT Machine Translation. We first conduct comprehensive analysis of our method and other baselines on a small-scale WMT task. We consider two high-resource languages (WMT14 enfr, WMT19 en-cs) and two low-resource languages (WMT14 en-hi, WMT18 en-tr), and train two models for both to and from English. Results are shown in Table 1.
|
| 105 |
+
|
| 106 |
+
Table 1: BLEU scores on the WMT dataset. The best result for multilingual model is bolded while underline signifies the overall best, and \* means the gains over baseline multilingual models are statistically significant with $\mathrm { p } < 0 . 0 5$ .
|
| 107 |
+
|
| 108 |
+
<table><tr><td rowspan="2"></td><td colspan="4">En→Any</td><td rowspan="2">fr-en</td><td colspan="5">Any→En</td></tr><tr><td>en-fr</td><td>en-cs</td><td>en-hi</td><td>en-tr</td><td>avg</td><td>cs-en</td><td>hi-en</td><td>tr-en</td><td>avg</td></tr><tr><td colspan="10">Monolithic Training</td></tr><tr><td>(1) Bilingual Model</td><td>41.80</td><td>24.76</td><td>5.77</td><td>9.77</td><td>20.53</td><td>36.38</td><td>29.17</td><td>8.68</td><td>13.87</td><td>22.03</td></tr><tr><td>(2)Multilingual Model</td><td>37.24</td><td>20.22</td><td>13.69</td><td>18.77</td><td>22.48</td><td>34.29</td><td>27.66</td><td>18.48</td><td>22.01</td><td>25.61</td></tr><tr><td colspan="10">Multi-task Training</td></tr><tr><td>(3)GradNorm(Chen et al.,2018b)</td><td>37.02</td><td>18.78</td><td>11.57</td><td>15.44</td><td>20.70</td><td>34.58</td><td>27.85</td><td>18.03</td><td>22.37</td><td>25.71</td></tr><tr><td>(4) MGDA (Sener & Koltun,2018)</td><td>38.22</td><td>17.54</td><td>12.02</td><td>13.69</td><td>20.37</td><td>35.05</td><td>26.87</td><td>18.28</td><td>22.41</td><td>25.65</td></tr><tr><td>(5)PCGrad (Yu et al., 2020)</td><td>37.72</td><td>20.88</td><td>13.77</td><td>18.23</td><td>22.65</td><td>34.37</td><td>27.82</td><td>18.78</td><td>22.20</td><td>25.79</td></tr><tr><td>(6)PCGrad w.all_layer</td><td>38.01</td><td>21.04</td><td>13.95</td><td>18.46</td><td>22.87</td><td>34.57</td><td>27.84</td><td>18.84</td><td>22.48</td><td>25.93</td></tr><tr><td colspan="10">Our Approach</td></tr><tr><td>(7)GradVac w. fixed_obj</td><td>38.41</td><td>21.12</td><td>13.75</td><td>18.68</td><td>22.99</td><td>34.55</td><td>27.97</td><td>18.72</td><td>22.14</td><td>25.85</td></tr><tr><td>(8) GradVac w. whole_model</td><td>38.76</td><td>21.32</td><td>14.22</td><td>18.89</td><td>23.30</td><td>34.84</td><td>28.01</td><td>18.85</td><td>22.24</td><td>25.99</td></tr><tr><td>(9)GradVac w.all_layer</td><td>39.27*</td><td>21.67*</td><td>14.88*</td><td>19.73*</td><td>23.89</td><td>35.28*</td><td>28.42*</td><td>19.07*</td><td>22.58*</td><td>26.34</td></tr></table>
|
| 109 |
+
|
| 110 |
+
First, we observe that while the naive multilingual baseline outperforms bilingual models on lowresource languages, it performs worse on high-resource languages due to negative interference (Wang et al., 2020b) and constrained capacity (Arivazhagan et al., 2019). Existing baselines fail to address this problem properly, as they obtain marginal or even no improvement (row 3, 4 and 5). In particular, we look closer at the optimization process for methods that utilize gradient signals to reweight tasks, i.e. GradNorm and MGDA, and find that their computed weights are less meaningful and noisy. For example, MGDA assigns larger weight for en-fr in the en-xx model, that results in worse performance on other languages. This is mainly because these methods are designed under the assumption that all tasks have balanced data. Our results show that simply reweighting task weights without considering the loss geometry has limited efficacy.
|
| 111 |
+
|
| 112 |
+
By contrast, our method significantly outperforms all baselines. Compared to the naive joint training approach, the proposed method improves over not only the average BLEU score but also the individual performance on all tasks. We notice that the performance gain on $E n { } A n y$ is larger compared to $A n y { } E n$ . This is in line with our prior observation that gradients are less similar and more conflicting in $E n { } A n y$ directions.
|
| 113 |
+
|
| 114 |
+
We next conduct extensive ablation studies for deeper analysis: (1) GradVac applied to all layers vs. whole model (row 8 vs. 9): the all layer variant outperforms whole model, showing that setting fine-grained parameter objectives is important. (2) Constant objective vs. EMA (row 7 vs. 9): we also examine a variant of GradVac optimized using a constant gradient objective for all tasks (e.g. $\phi _ { i j } ^ { T } = 0 . 5 , \forall i , j )$ and observe performance drop compared to using EMA variables. This highlights the importance of setting task-aware objectives through task relatedness. (3) GradVac vs. PCGrad (row 8-9 vs. 5-6): the two GradVac variants outperform their PCGrad counterparts, validating the effectiveness of setting preemptive gradient similarity objectives.
|
| 115 |
+
|
| 116 |
+
Massively Multilingual Machine Translation. We then scale up our experiments and transfer the best setting found on WMT to the same massive dataset used in Section 2. We visualize model performance in Figure 6 and average BLEU scores are shown in Table 2. We additionally compare with models trained with uniform language pairs sampling strategy $\mathrm { ( T = 1 ) }$ ) and find that our method outperforms both multilingual models. Most notably, while uniform sampling favor high-resource language pairs more than low-resource ones, GradVac is able to improve both consistently across all tasks. We observe larger performance gain on
|
| 117 |
+
|
| 118 |
+
Table 2: Average BLEU scores of 25 language pairs on our massively multilingual dataset.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Any-→En</td><td>High</td><td>Med</td><td>Low</td><td>All</td></tr><tr><td>T=1 T=5</td><td>28.56 28.16</td><td>28.51 28.42</td><td>19.57 24.32</td><td>24.95 26.71</td></tr><tr><td>GradVac</td><td>28.99</td><td>28.94</td><td>24.58</td><td>27.21</td></tr><tr><td>En-→Any</td><td>High</td><td>Med</td><td>Low</td><td>All</td></tr><tr><td>T=1</td><td>22.62</td><td>21.53</td><td>12.41</td><td>18.18</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>T=5</td><td>22.04</td><td>21.43</td><td>13.07</td><td>18.25</td></tr><tr><td>GradVac</td><td>24.20</td><td>21.83</td><td>13.30</td><td>19.08</td></tr></table>
|
| 121 |
+
|
| 122 |
+
high-resource languages, illustrating that addressing gradient conflicts can mitigate negative interference on these head language pairs. On the other hand, our model still perform worse on resourceful languages compared to bilingual baselines, most likely limited by model capacity.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 6: Comparing multilingual models with bilingual baselines on our dataset. Language pairs are listed in the order of training data sizes (high-resource languages on the left).
|
| 126 |
+
|
| 127 |
+
Table 3: F1 on the NER tasks of the XTREME benchmark.
|
| 128 |
+
|
| 129 |
+
<table><tr><td></td><td>de</td><td>en</td><td>es</td><td>hi</td><td>jv</td><td>kk</td><td>mr</td><td>my</td><td>SW</td><td>te</td><td>tl</td><td>yo</td><td>avg</td></tr><tr><td>mBERT</td><td>83.2</td><td>77.9</td><td>87.5</td><td>82.2</td><td>77.6</td><td>87.6</td><td>82.0</td><td>75.8</td><td>87.7</td><td>78.9</td><td>83.8</td><td>90.7</td><td>82.9</td></tr><tr><td>+ GradNorm</td><td>83.5</td><td>77.4</td><td>87.2</td><td>82.7</td><td>78.4</td><td>87.9</td><td>81.2</td><td>73.4</td><td>85.2</td><td>78.7</td><td>83.6</td><td>91.5</td><td>82.6</td></tr><tr><td>+ MGDA</td><td>82.1</td><td>74.2</td><td>85.6</td><td>81.5</td><td>77.8</td><td>87.8</td><td>81.9</td><td>74.3</td><td>86.5</td><td>78.2</td><td>87.5</td><td>91.7</td><td>82.4</td></tr><tr><td>+ PCGrad</td><td>83.7</td><td>78.6</td><td>88.2</td><td>81.8</td><td>79.6</td><td>87.6</td><td>81.8</td><td>74.2</td><td>85.9</td><td>78.5</td><td>85.6</td><td>92.2</td><td>83.1</td></tr><tr><td>+ GradVac</td><td>83.9</td><td>79.4</td><td>88.2</td><td>81.8</td><td>80.5</td><td>87.4</td><td>82.1</td><td>73.9</td><td>87.8</td><td>79.3</td><td>87.8</td><td>93.0</td><td>83.8</td></tr></table>
|
| 130 |
+
|
| 131 |
+
XTREME Benchmark. We additionally apply our method to multilingual language models and evaluate on the XTREME benchmark (Hu et al., 2020). We choose tasks where training data are available for all languages, and finetune a pretrained multilingual BERT model (mBERT) (Devlin et al., 2018) on these languages jointly (see Appendix G for experiment details and additional results). As shown in Table 3, our method consistently outperforms naive joint finetuning and other multi-task baselines. This demonstrates the practicality of our approach for general multilingual tasks.
|
| 132 |
+
|
| 133 |
+
# 5 RELATED WORK
|
| 134 |
+
|
| 135 |
+
Multilingual models train multiple languages jointly (Firat et al., 2016; Devlin et al., 2018; Lample & Conneau, 2019; Conneau et al., 2019; Johnson et al., 2017; Aharoni et al., 2019; Arivazhagan et al., 2019). Follow-up work study the cross-lingual ability of these models and what contributes to it (Pires et al., 2019; Wu & Dredze, 2019; Wu et al., 2019; Artetxe et al., 2019; Kudugunta et al., 2019; Karthikeyan et al., 2020), the limitation of such training paradigm (Arivazhagan et al., 2019; Wang et al., 2020b), and how to further improve it by utilizing post-hoc alignment (Wang et al., 2020c; Cao et al., 2020), data balancing (Jean et al., 2019; Wang et al., 2020a), or calibrated training signal (Mulcaire et al., 2019; Huang et al., 2019a). In contrast to these studies, we directly investigate language interactions across training progress using loss geometry and propose a language-aware method to improve the optimization procedure.
|
| 136 |
+
|
| 137 |
+
On the other hand, multilingual models can be treated as multi-task learning methods (Ruder, 2017; Zamir et al., 2018). Prior work have studied the optimization challenges of multi-task training (Hessel et al., 2019; Schaul et al., 2019), while others suggest to improve training quality through learning task relatedness (Zhang & Yeung, 2012), routing task-specifc paths (Rusu et al., 2016; Rosenbaum et al., 2019), altering gradients directly (Kendall et al., 2018; Chen et al., 2018b; Du et al., 2018; Yu et al., 2020), or searching pareto solutions (Sener & Koltun, 2018; Lin et al., 2019). However, while these methods are often evaluated on balanced task distributions, multilingual datasets are often unbalanced and noisy. As prior work have shown training with unbalanced tasks can be prone to negative interference (Ge et al., 2014; Wang & Carbonell, 2018), we study how to mitigate it in large models trained with highly unbalanced and massive-scale dataset.
|
| 138 |
+
|
| 139 |
+
# 6 CONCLUSION
|
| 140 |
+
|
| 141 |
+
In this paper, we systematically study loss geometry through the lens of gradient similarity for multilingual modeling, and propose a novel approach named GradVac for improvement based on our findings. Leveraging the linguistic proximity structure of multilingual tasks, we validate the assumption that more similar loss geometries improve multi-task optimization while gradient conflicts can hurt model performance, and demonstrate the effectiveness of more geometrically consistent updates aligned with task closeness. We analyze the behavior of the proposed approach on massive multilingual tasks with superior performance, and we believe that our approach is generic and applicable beyond multilingual settings.
|
| 142 |
+
|
| 143 |
+
# ACKNOWLEDGMENTS
|
| 144 |
+
|
| 145 |
+
We want to thank Hieu Pham for tireless help to the authors on different stages of this project. We also would like to thank Zihang Dai, Xinyi Wang, Zhiyu Wang, Jiateng Xie, Yiheng Zhou, Ruochen Xu, Adams Wei Yu, Biao Zhang, Isaac Caswell, Sneha Kudugunta, Zhe Zhao, Christopher Fifty, Xavier Garcia, Ye Zhang, Macduff Hughes, Yonghui Wu, Samy Bengio and the Google Brain team for insightful discussions and support to the work. This material is based upon work supported in part by the National Science Foundation under Grants No. IIS2007960 and IIS2040926, and by the Google faculty research award.
|
| 146 |
+
|
| 147 |
+
# REFERENCES
|
| 148 |
+
|
| 149 |
+
Roee Aharoni, Melvin Johnson, and Orhan Firat. Massively multilingual neural machine translation. CoRR, abs/1903.00089, 2019. URL http://arxiv.org/abs/1903.00089.
|
| 150 |
+
|
| 151 |
+
Naveen Arivazhagan, Ankur Bapna, Orhan Firat, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George Foster, Colin Cherry, et al. Massively multilingual neural machine translation in the wild: Findings and challenges. arXiv preprint arXiv:1907.05019, 2019.
|
| 152 |
+
|
| 153 |
+
Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. On the cross-lingual transferability of monolingual representations. arXiv preprint arXiv:1910.11856, 2019.
|
| 154 |
+
|
| 155 |
+
Graeme W. Blackwood, Miguel Ballesteros, and Todd Ward. Multilingual neural machine translation with task-specific attention. CoRR, abs/1806.03280, 2018. URL http://arxiv.org/ abs/1806.03280.
|
| 156 |
+
|
| 157 |
+
Steven Cao, Nikita Kitaev, and Dan Klein. Multilingual alignment of contextual word representations. In International Conference on Learning Representations, 2020.
|
| 158 |
+
|
| 159 |
+
Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018a.
|
| 160 |
+
|
| 161 |
+
Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. In International Conference on Machine Learning, pp. 794–803. PMLR, 2018b.
|
| 162 |
+
|
| 163 |
+
Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzman, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Un- ´ supervised cross-lingual representation learning at scale. arXiv preprint arXiv:1911.02116, 2019.
|
| 164 |
+
|
| 165 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 166 |
+
|
| 167 |
+
Yunshu Du, Wojciech M Czarnecki, Siddhant M Jayakumar, Razvan Pascanu, and Balaji Lakshminarayanan. Adapting auxiliary losses using gradient similarity. arXiv preprint arXiv:1812.02224, 2018.
|
| 168 |
+
|
| 169 |
+
Carlos Escolano, Marta R Costa-jussa, Jos \` e AR Fonollosa, and Mikel Artetxe. Multilingual ma- ´ chine translation: Closing the gap between shared and language-specific encoder-decoders. arXiv preprint arXiv:2004.06575, 2020.
|
| 170 |
+
|
| 171 |
+
Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation with a shared attention mechanism. arXiv preprint arXiv:1601.01073, 2016.
|
| 172 |
+
|
| 173 |
+
Liang Ge, Jing Gao, Hung Ngo, Kang Li, and Aidong Zhang. On handling negative transfer and imbalanced distributions in multiple source transfer learning. Statistical Analysis and Data Mining: The ASA Data Science Journal, 7(4):254–271, 2014.
|
| 174 |
+
|
| 175 |
+
Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3796–3803, 2019.
|
| 176 |
+
|
| 177 |
+
Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan Firat, and Melvin Johnson. Xtreme: A massively multilingual multi-task benchmark for evaluating cross-lingual generalization. arXiv preprint arXiv:2003.11080, 2020.
|
| 178 |
+
|
| 179 |
+
Haoyang Huang, Yaobo Liang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, and Ming Zhou. Unicoder: A universal language encoder by pre-training with multiple cross-lingual tasks. arXiv preprint arXiv:1909.00964, 2019a.
|
| 180 |
+
|
| 181 |
+
Yanping Huang, Youlong Cheng, Ankur Bapna, Orhan Firat, Dehao Chen, Mia Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, Yonghui Wu, et al. Gpipe: Efficient training of giant neural networks using pipeline parallelism. In Advances in neural information processing systems, pp. 103–112, 2019b.
|
| 182 |
+
|
| 183 |
+
Sebastien Jean, Orhan Firat, and Melvin Johnson. Adaptive scheduling for multi-task learning, ´ 2019.
|
| 184 |
+
|
| 185 |
+
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, et al. Google’s multilingual neural ´ machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339–351, 2017.
|
| 186 |
+
|
| 187 |
+
K Karthikeyan, Zihan Wang, Stephen Mayhew, and Dan Roth. Cross-lingual ability of multilingual bert: An empirical study. In International Conference on Learning Representations, 2020.
|
| 188 |
+
|
| 189 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7482–7491, 2018.
|
| 190 |
+
|
| 191 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 192 |
+
|
| 193 |
+
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.
|
| 194 |
+
|
| 195 |
+
Sneha Reddy Kudugunta, Ankur Bapna, Isaac Caswell, Naveen Arivazhagan, and Orhan Firat. Investigating multilingual nmt representations at scale. arXiv preprint arXiv:1909.02197, 2019.
|
| 196 |
+
|
| 197 |
+
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
|
| 198 |
+
|
| 199 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 200 |
+
|
| 201 |
+
Xi Lin, Hui-Ling Zhen, Zhenhua Li, Qing-Fu Zhang, and Sam Kwong. Pareto multi-task learning. In Advances in Neural Information Processing Systems, pp. 12060–12070, 2019.
|
| 202 |
+
|
| 203 |
+
Phoebe Mulcaire, Jungo Kasai, and Noah A Smith. Polyglot contextual representations improve crosslingual transfer. 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), pp. 3912–3918, 2019.
|
| 204 |
+
|
| 205 |
+
Joakim Nivre, Mitchell Abrams, Zeljko Agi ˇ c, Lars Ahrenberg, Lene Antonsen, Maria Jesus Aran- ´ zabe, Gashaw Arutie, Masayuki Asahara, Luma Ateyah, Mohammed Attia, et al. Universal dependencies 2.2. 2018.
|
| 206 |
+
|
| 207 |
+
Xiaoman Pan, Boliang Zhang, Jonathan May, Joel Nothman, Kevin Knight, and Heng Ji. Crosslingual name tagging and linking for 282 languages. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1946–1958, 2017.
|
| 208 |
+
|
| 209 |
+
Addison Phillips and Mark Davis. Tags for identifying languages. Technical report, BCP 47, RFC 4646, September, 2006.
|
| 210 |
+
|
| 211 |
+
Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual bert? arXiv preprint arXiv:1906.01502, 2019.
|
| 212 |
+
|
| 213 |
+
Clemens Rosenbaum, Ignacio Cases, Matthew Riemer, and Tim Klinger. Routing networks and the challenges of modular and compositional computation. arXiv preprint arXiv:1904.12774, 2019.
|
| 214 |
+
|
| 215 |
+
Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017.
|
| 216 |
+
|
| 217 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 218 |
+
|
| 219 |
+
Devendra Sachan and Graham Neubig. Parameter sharing methods for multilingual self-attentional translation models. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 261–271, Brussels, Belgium, October 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6327. URL https://www.aclweb.org/anthology/ W18-6327.
|
| 220 |
+
|
| 221 |
+
Tom Schaul, Diana Borsa, Joseph Modayil, and Razvan Pascanu. Ray interference: a source of plateaus in deep reinforcement learning. arXiv preprint arXiv:1904.11455, 2019.
|
| 222 |
+
|
| 223 |
+
Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In Advances in Neural Information Processing Systems, pp. 527–538, 2018.
|
| 224 |
+
|
| 225 |
+
Aditya Siddhant, Melvin Johnson, Henry Tsai, Naveen Ari, Jason Riesa, Ankur Bapna, Orhan Firat, and Karthik Raman. Evaluating the cross-lingual effectiveness of massively multilingual neural machine translation. In AAAI, pp. 8854–8861, 2020.
|
| 226 |
+
|
| 227 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 228 |
+
|
| 229 |
+
Jakob Uszkoreit, Jay Ponte, Ashok Popat, and Moshe Dubiner. Large scale parallel document mining for machine translation. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pp. 1101–1109, 2010.
|
| 230 |
+
|
| 231 |
+
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.
|
| 232 |
+
|
| 233 |
+
Raul V ´ azquez, Alessandro Raganato, J ´ org Tiedemann, and Mathias Creutz. Multilingual NMT with ¨ a language-independent attention bridge. In Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019), pp. 33–39, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-4305. URL https://www.aclweb. org/anthology/W19-4305.
|
| 234 |
+
|
| 235 |
+
Xinyi Wang, Yulia Tsvetkov, and Graham Neubig. Balancing training for multilingual neural machine translation. arXiv preprint arXiv:2004.06748, 2020a.
|
| 236 |
+
|
| 237 |
+
Zirui Wang and Jaime Carbonell. Towards more reliable transfer learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 794–810. Springer, 2018.
|
| 238 |
+
|
| 239 |
+
Zirui Wang, Zihang Dai, Barnabas P ´ oczos, and Jaime Carbonell. Characterizing and avoiding nega- ´ tive transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11293–11302, 2019.
|
| 240 |
+
|
| 241 |
+
Zirui Wang, Zachary C Lipton, and Yulia Tsvetkov. On negative interference in multilingual models: Findings and a meta-learning treatment. In EMNLP, 2020b.
|
| 242 |
+
|
| 243 |
+
Zirui Wang, Jiateng Xie, Ruochen Xu, Yiming Yang, Graham Neubig, and Jaime Carbonell. Crosslingual alignment vs joint training: A comparative study and a simple unified framework. In International Conference on Learning Representations, 2020c.
|
| 244 |
+
|
| 245 |
+
Shijie Wu and Mark Dredze. Beto, bentz, becas: The surprising cross-lingual effectiveness of bert. arXiv preprint arXiv:1904.09077, 2019.
|
| 246 |
+
|
| 247 |
+
Shijie Wu, Alexis Conneau, Haoran Li, Luke Zettlemoyer, and Veselin Stoyanov. Emerging crosslingual structure in pretrained language models. arXiv preprint arXiv:1911.01464, 2019.
|
| 248 |
+
|
| 249 |
+
Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. arXiv preprint arXiv:2001.06782, 2020.
|
| 250 |
+
|
| 251 |
+
Amir R Zamir, Alexander Sax, William Shen, Leonidas J Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling task transfer learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3712–3722, 2018.
|
| 252 |
+
|
| 253 |
+
Yu Zhang and Dit-Yan Yeung. A convex formulation for learning task relationships in multi-task learning. arXiv preprint arXiv:1203.3536, 2012.
|
| 254 |
+
|
| 255 |
+
# A DATA STATISTICS
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 7: Per language pair data distribution of the dataset used to train our multilingual model. The yaxis depicts the number of training examples available per language pair on a logarithmic scale.
|
| 259 |
+
|
| 260 |
+
We select 25 languages (50 language pairs) from our dataset to be used in our multilingual models for more careful studies on gradient trajectory. For such purpose, we pick languages that belong to different language families (typologically diverse) and with various levels of training data sizes. Specifically, we consider the following languages and their details are listed in 4: French (fr), Spanish (es), German (de), Polish (pl), Czech (cs), Macedonian (mk), Bulgarian (bg), Ukrainian (uk), Belarusian (be), Russian (ru), Latvian (lv), Lithuanian (lt), Estonian (et), Finnish (fi), Hindi (hi), Marathi (mr), Gujarati (gu), Nepali (ne), Kazakh (kk), Kyrgyz (ky), Swahili (sw), Zulu (zu), Xhosa (xh), Indonesian (id), Malay (ms).
|
| 261 |
+
|
| 262 |
+
Our corpus has languages belonging to a wide variety of scripts and linguistic families. The selected 25 languages belong to 10 different language families (e.g. Turkic versus Uralic) or branches within language family (e.g. East Slavic versus West Slavic), as indicated in Figure 1 and Table 4. Families are groups of languages believed to share a common ancestor, and therefore tend to have similar vocabulary and grammatical constructs. We therefore utilize membership of language family to define language proximity.
|
| 263 |
+
|
| 264 |
+
In addition, our language pairs have different levels of training data, ranging from $1 0 ^ { 5 }$ to $1 0 ^ { 9 }$ sentence pairs. This is shown in Figure 7. We therefore have four levels of data sizes (number of languages in parenthesis): High (7), Medium (8), Low (5), and Extremely Low (5). In particular, we consider tasks with more than $1 0 ^ { 8 }$ to be high-resource, $1 0 ^ { 7 } - 1 0 ^ { 8 }$ to be medium-resource, and rest to be low-resource (with those below 5 million sentence pairs to be extremely low-resource). Therefore, our dataset is both heavily unbalanced and noisy, as it is crawled from the web, and thus introduces optimization challenges from a multi-task training perspective. These characteristics of our dataset make the problem that we study as realistic as possible.
|
| 265 |
+
|
| 266 |
+
# B TRAINING DETAILS
|
| 267 |
+
|
| 268 |
+
For both bilingual and multilingual NMT models, we utilize the encoder-decoder Transformer (Vaswani et al., 2017) architecture. Following prior work, we share all parameters across all language pairs, including word embedding and output softmax layer.
|
| 269 |
+
|
| 270 |
+
To train each model, we use a single Adam optimizer (Kingma & Ba, 2014) with default decay hyper-parameters. We warm up linearly for 30K steps to a learning rate of 1e-3, which is then decayed with the inverse square root of the number of training steps after warm-up. At each training step, we sample from all language pairs according to a temperature based sampling strategy as in prior work (Lample & Conneau, 2019; Arivazhagan et al., 2019). That is, at each training step, we sample each sentence from all language pairs to train proportionally to $\begin{array} { r } { P _ { i } = \big ( \frac { L _ { i } } { \sum _ { j } L _ { j } } \big ) ^ { \frac { 1 } { T } } } \end{array}$ , where $L _ { i }$ is the size of the training corpus for language pair i and T is the temperature. We set $\mathrm { T } { = } 5$ for most of our experiments.
|
| 271 |
+
|
| 272 |
+
Table 4: Details of all languages considered in our dataset. Notice that since German (Germanic) is particularly similar to French and Spanish (Romance), we consider a larger language branch for them named “Western European”. “Ex-Low” indicates extremely low-resource languages in our dataset. We use BCP-47 language codes as labels (Phillips & Davis, 2006).
|
| 273 |
+
|
| 274 |
+
<table><tr><td>Language</td><td>Id</td><td>Language Family</td><td>Data Size</td><td>Language</td><td>Id</td><td>Language Family</td><td>Data Size</td></tr><tr><td>French</td><td>fr</td><td>Western European</td><td>High</td><td>Finnish</td><td>fi</td><td>Uralic</td><td>High</td></tr><tr><td>Spanish</td><td>es</td><td>Western European</td><td>High</td><td>Hindi</td><td>hi</td><td>Indo-Iranian</td><td>Medium</td></tr><tr><td>German</td><td>de</td><td>Western European</td><td>High</td><td>Marathi</td><td>mr</td><td>Indo-Iranian</td><td>Ex-Low</td></tr><tr><td>Polish</td><td>pl</td><td>West Slavic</td><td>High</td><td>Gujarati</td><td>gu</td><td>Indo-Iranian</td><td>Low</td></tr><tr><td>Czech</td><td>CS</td><td>West Slavic</td><td>High</td><td>Nepali</td><td>ne</td><td>Indo-Iranian</td><td>Ex-Low</td></tr><tr><td>Macedonian</td><td>mk</td><td>South Slavic</td><td>Low</td><td>Kazakh</td><td>kk</td><td>Turkic</td><td>Low</td></tr><tr><td>Bulgarian</td><td>bg</td><td>South Slavic</td><td>Medium</td><td>Kyrgyz</td><td>ky</td><td>Turkic</td><td>Ex-Low</td></tr><tr><td>Ukrainian</td><td>uk</td><td>East Slavic</td><td>Medium</td><td>Swahili</td><td>SW</td><td>Benue-Congo</td><td>Low</td></tr><tr><td>Belarusian</td><td>be</td><td>East Slavic</td><td>Low</td><td>Zulu</td><td>zu</td><td>Benue-Congo</td><td>Ex-Low</td></tr><tr><td>Russian</td><td>ru</td><td>East Slavic</td><td>High</td><td>Xhosa</td><td>xh</td><td>Benue-Congo</td><td>Ex-Low</td></tr><tr><td>Latvian</td><td>lv</td><td>Baltic</td><td>Medium</td><td>Indonesian</td><td>id</td><td>Malayo-Polynesian</td><td>High</td></tr><tr><td>Lithuanian</td><td>lt</td><td>Baltic</td><td>Medium</td><td>Malay</td><td>ms</td><td>Malayo-Polynesian</td><td>Medium</td></tr><tr><td>Estonian</td><td>et</td><td>Uralic</td><td>Medium</td><td></td><td></td><td></td><td></td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 5: Details of all languages selected from WMT for gradient analysis.
|
| 277 |
+
|
| 278 |
+
<table><tr><td>Language</td><td>Id</td><td>Language Family</td><td>Data Size</td><td>Validation Set</td></tr><tr><td>French</td><td>fr</td><td>Romance</td><td>41M</td><td>newstest2013</td></tr><tr><td>Spanish</td><td>es</td><td>Romance</td><td>15M</td><td>newstest2012</td></tr><tr><td>Russian</td><td>ru</td><td>Slavic</td><td>38M</td><td>newstest2018</td></tr><tr><td>Czech</td><td>CS</td><td>Slavic</td><td>37M</td><td>newstest2018</td></tr><tr><td>Latvian</td><td>lv</td><td>Baltic</td><td>6M</td><td>newstest2017</td></tr><tr><td>Lithuanian</td><td>lt</td><td>Baltic</td><td>6M</td><td>newstest2019</td></tr><tr><td>Estonian</td><td>et</td><td>Uralic</td><td>2M</td><td>newstest2018</td></tr><tr><td>Finnish</td><td>f</td><td>Uralic</td><td>6M</td><td>newstest2018</td></tr></table>
|
| 279 |
+
|
| 280 |
+
# C ADDITIONAL RESULTS ON WMT
|
| 281 |
+
|
| 282 |
+
# C.1 DATA
|
| 283 |
+
|
| 284 |
+
We experiment with WMT datasets that are publicly available. Compared to our dataset, they only contain a relatively small subsets of languages. Therefore, we select 8 languages (16 language pairs) of 4 language families to conduct the same loss geometries analysis in Section 2. These languages are detailed in Table x5: French (fr), Spanish (es), Russian (ru), Czech (cs), Latvian (lv), Lithuanian (lt), Estonian (et), Finnish (fi). We collect all available training data from WMT 13 to WMT 19, and then perform a deduplication process to remove duplicated sentence pairs. We then use the validation sets to compute gradient similarities. Notice that unlike our dataset, WMT validation sets are not multi-aligned. Therefore, the semantic structures of these sentences may introduce an extra degree of noise.
|
| 285 |
+
|
| 286 |
+
# C.2 VISUALIZATION
|
| 287 |
+
|
| 288 |
+
As in Section 2, we compute gradients on the validation sets on all checkpoints and averaged across all checkpoints to visualize our results. We use similar setups to our previous analysis, including model architectures, vocabulary sizes, and other training details. The main results are shown in Figure 8. Similar to our findings in Section 2, gradient similarities cluster according to language proximities, with languages from the same language family sharing the most similar gradients on the diagonal. Besides, gradients in the English to Any directions are less similar compared to the other direction, consistent with our above findings. Overall, despite the scale being much smaller in terms of number of languages and sizes of training data, findings are mostly consistent.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 8: Cosine similarities on WMT dataset averaged across all training steps.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 9: Cosine similarities (on Transformer-Base models) of xx-en language pairs on WMT dataset averaged across all training steps.
|
| 295 |
+
|
| 296 |
+
# C.3 VISUALIZATION ON SMALLER MODELS
|
| 297 |
+
|
| 298 |
+
Prior work has shown languages fighting for capacity in multilingual models (Arivazhagan et al., 2019; Wang et al., 2020b). Therefore, we are also interested to study the effect of model sizes on gradient trajectory. Since our larger dataset contains 25 language pairs in a Transformer-Large model, we additionally train a Transformer-Base model using the 8 language pairs of WMT. We visualize it in Figure 9 and find that our observed patterns are more evident in smaller models. This finding is consistent across other experiments we ran and indicates that languages compete for capacity with small model sizes thereby causing more gradient interference. It also shows that our analysis in this work is generic across different model settings.
|
| 299 |
+
|
| 300 |
+
# D ADDITIONAL RESULTS ON OUR DATASET
|
| 301 |
+
|
| 302 |
+
In Figure 1 we show visualization on models trained using $A n y { } E n$ language pairs. Here, we also examine models trained in the other direction, $E n { } A n y$ . As shown in Figure 10, we have similar observations made in Section 2 such that gradient similarities cluster strongly by language proximities. However, the en-xx model has smaller scales in cosine similarities and more negative values. For example, Nepali shares mostly conflicting gradients with other languages, except for those belonging to the same language family. This is in line with our above discussion that gradient interference may be a source of optimization challenge, such that the en-xx model is harder to train than the xx-en model.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 10: Cosine similarities of decoder gradients between en-xx language pairs averaged across all training steps. Darker cell indicates pair-wise gradients are more similar.
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 11: Cosine similarities of decoder gradients between en-xx language pairs averaged across all training steps. Darker cell indicates pair-wise gradients are more similar. Model trained with smaller batch sizes.
|
| 309 |
+
|
| 310 |
+
Moreover, while our previous models are trained using a large batch size for better performance (as observed in prior work (Arivazhagan et al., 2019)), we also evaluate gradients in a model trained with smaller batches (125k tokens) in Figure 11. Compared to model trained with larger batch sizes, this model enjoy similar patterns but with smaller gradient cosine similarity values, indicating that gradients are less similar. This presents an additional potential explanation of why larger batch sizes can be more effective for training large models: they may better reflect the correct loss geometries such that gradients are less conflicting in nature. For our case, this means larger batches better reflect language proximities hence gradients of better quality.
|
| 311 |
+
|
| 312 |
+
Finally, these results also reveal that gradient similarities are mostly dependent on task relatedness, as even sentence pairs with identical semantic meanings can have negative cosine similarities due to language differences.
|
| 313 |
+
|
| 314 |
+
Algorithm 1 GradVac Update Rule 1: Require: EMA decay $\beta$ , Model Components $\mathcal { M } = \{ \pmb { \theta } _ { k } \}$ , Tasks for GradVac $\mathcal { G } = \{ T _ { i } \}$
|
| 315 |
+
2: Initialize model pa3: Initialize EMA var $\hat { \phi } _ { i j k } ^ { ( 0 ) } = 0 , \forall i , j , k$ $t = 0$ 5: while not converged do 6: Sample minibatch of tasks $B = \{ \mathcal { T } _ { i } \}$ 7: for $\pmb \theta _ { k } \in \mathcal M$ do 8: Compute gradients $\mathbf { g } _ { i k } \nabla _ { \pmb { \theta } _ { k } } \mathcal { L } _ { \mathcal { T } _ { i } } , \forall \mathcal { T } _ { i } \in \mathcal { B }$ 9: Set $\bar { \mathbf { g } _ { i k } ^ { \prime } } \mathbf { g } _ { i k }$
|
| 316 |
+
10: for $\mathcal { T } _ { i } \in \mathcal { G } \cap B$ do
|
| 317 |
+
11: for $\mathcal { T } _ { j } \in \mathcal { B } \backslash \mathcal { T } _ { i }$ in random order do
|
| 318 |
+
12: Compute φ(t)ijk $\begin{array} { r } { \phi _ { i j k } ^ { ( t ) } \frac { \mathbf { g } _ { i k } ^ { \prime } \cdot \mathbf { g } _ { j k } } { \| \mathbf { g } _ { i k } ^ { \prime } \| \| \mathbf { g } _ { j k } \| } } \end{array}$
|
| 319 |
+
13: if $\phi _ { i j k } ^ { ( t ) } < \hat { \phi } _ { i j k } ^ { ( t ) }$ then
|
| 320 |
+
14: $\begin{array} { r } { \mathrm { S e t } \mathbf { g } _ { i k } ^ { \prime } = \mathbf { g } _ { i k } ^ { \prime } + \frac { \| \mathbf { g } _ { i k } ^ { \prime } \| ( \hat { \phi } _ { i j k } ^ { ( t ) } \sqrt { 1 - ( \phi _ { i j k } ^ { ( t ) } ) ^ { 2 } } - \phi _ { i j k } ^ { ( t ) } \sqrt { 1 - ( \hat { \phi } _ { i j k } ^ { ( t ) } ) ^ { 2 } } ) } { \| \mathbf { g } _ { j k } \| \sqrt { 1 - ( \hat { \phi } _ { i j k } ^ { ( t ) } ) ^ { 2 } } } \cdot \mathbf { g } _ { j k } } \end{array}$
|
| 321 |
+
15: 16: end ifUpdate $\hat { \phi } _ { i j k } ^ { ( t + 1 ) } = ( 1 - \beta ) \hat { \phi } _ { i j k } ^ { ( t ) } + \beta \phi _ { i j k } ^ { ( t ) }$
|
| 322 |
+
17: end for
|
| 323 |
+
18: end for
|
| 324 |
+
19: Update $\pmb { \theta } _ { k }$ with gradient $\sum \mathbf { g } _ { i k } ^ { \prime }$
|
| 325 |
+
20: end for
|
| 326 |
+
21: Update $t \gets t + 1$
|
| 327 |
+
22: end while
|
| 328 |
+
|
| 329 |
+
# E PROPOSED METHOD DETAILS
|
| 330 |
+
|
| 331 |
+
In this part, we provide details of our proposed method, Gradient Vaccine (GradVac). We first show how to derive our formulation in Eq. 2, followed by how we instantiate in practice. And last, we also study its theoretical property.
|
| 332 |
+
|
| 333 |
+
# E.1 METHOD DERIVATION
|
| 334 |
+
|
| 335 |
+
As stated in Section 3, the goal of our proposed method is to align gradients between tasks to match a pre-set target gradient cosine similarity. An example is shown in Figure 12, where we have two tasks $i , j$ and their corresponding gradients $\mathbf { g } _ { i }$ and ${ \bf { g } } _ { j }$ have a cosine similarity of $\phi _ { i j }$ , i.e. cos(θ) = φij = gi·gjkgikkgj k . Then, we want to alter their gradients, such that the resulting new gradients have gradient similarity of some pre-set value $\phi _ { i j } ^ { T }$ . To do so, we replace $\mathbf { g } _ { i }$ with a new vector in the vector space spanned by $\mathbf { g } _ { i }$ and ${ \bf g } _ { j }$ , $\mathbf { g } _ { i } ^ { \prime } = a _ { 1 } \cdot \mathbf { g } _ { i } + a _ { 2 } \cdot \mathbf { g } _ { j }$ . Without loss of generality, we set $a _ { 1 } = 1$ and solve for $a _ { 2 }$ , i.e. find the $a _ { 2 }$ such that $\begin{array} { r } { \cos ( \gamma ) = \frac { { \bf g } _ { i } ^ { \prime } \cdot { \bf g } _ { j } } { \| { \bf g } _ { i } ^ { \prime } \| \| { \bf g } _ { j } \| } = \phi _ { i j } ^ { T } } \end{array}$ . By using Laws of Sines, we must have that:
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\frac { \| \mathbf { g } _ { i } \| } { \sin ( \gamma ) } = \frac { a _ { 2 } \| \mathbf { g } _ { j } \| } { \sin ( \theta - \gamma ) } ,
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
and thus we can further solve for $a _ { 2 }$ as:
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } & { \quad \frac { \| \mathbf { g } _ { i } \| } { \sin ( \gamma ) } = \frac { a _ { 2 } \| \mathbf { g } _ { j } \| } { \sin ( \theta - \gamma ) } } \\ & { \Rightarrow \frac { \| \mathbf { g } _ { i } \| } { \sin ( \gamma ) } = \frac { a _ { 2 } \| \mathbf { g } _ { j } \| } { \sin ( \theta ) \cos ( \gamma ) - \cos ( \theta ) \sin ( \gamma ) } } \\ & { \Rightarrow \frac { \| \mathbf { g } _ { i } \| } { \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } } = \frac { a _ { 2 } \| \mathbf { g } _ { j } \| } { \phi _ { i j } ^ { T } \sqrt { 1 - \phi _ { i j } ^ { 2 } } - \phi _ { i j } \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } } } \\ & { \Rightarrow a _ { 2 } = \frac { \| \mathbf { g } _ { i } \| ( \phi _ { i j } ^ { T } \sqrt { 1 - \phi _ { i j } ^ { 2 } } - \phi _ { i j } \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } ) } { \| \mathbf { g } _ { j } \| \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } } } \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
We therefore arrive at the update rule in Eq. 2. Our formulation allows us to set arbitrary target values for any two gradients, and thus we can better leverage task relatedness by setting individual gradient similarity objective for each task pair. Notice that we can rescale the gradient such that the altered gradients will have the same norm as before. But in our experiment we find it is sufficient to ignore this step. On the other hand, we note that when $\phi _ { i j } ^ { T } = 0$ , we have that:
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { r l } & { a _ { 2 } = \frac { \| \mathbf { g } _ { i } \| ( \phi _ { i j } ^ { T } \sqrt { 1 - \phi _ { i j } ^ { 2 } } - \phi _ { i j } \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } ) } { \| \mathbf { g } _ { j } \| \sqrt { 1 - ( \phi _ { i j } ^ { T } ) ^ { 2 } } } } \\ & { \quad = \frac { \| \mathbf { g } _ { i } \| \left( 0 - \phi _ { i j } \right) } { \| \mathbf { g } _ { j } \| } } \\ & { \quad = - \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \| \mathbf { g } _ { i } \| \| \mathbf { g } _ { j } \| } \cdot \frac { \| \mathbf { g } _ { i } \| } { \| \mathbf { g } _ { j } \| } } \\ & { \quad = - \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \| \mathbf { g } _ { j } \| ^ { 2 } } \| \mathbf { g } _ { j } \| } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
This is exactly the update rule of PCGrad in Eq. 1. Thus, PCGrad is a special case of our proposed method.
|
| 354 |
+
|
| 355 |
+
# E.2 ALGORITHM IN PRACTICE
|
| 356 |
+
|
| 357 |
+
Our proposed method is detailed in Algorithm 1. In our experiments on multilingual NMT and multilingual BERT, we utilize a set of exponential moving average (EMA) variables to set proper pair-wise gradient similarity objectives, as shown in Eq. 3. This is motivated by our observations in Section 2 such that gradients of different languages in a Transformer model evolve across layers and training steps. Therefore, we conduct GradVac on different model components independently. For example, we can do one GradVac on each layer in the model, or just perform a single GradVac on the entire model. In addition, we also introduce an extra degree of freedom by controlling which tasks to perform GradVac. This corresponds to selecting a of tasks $\mathcal { G }$ and only alter gradients for tasks within this set, as shown in line 10 in Algorithm 1. Empirically, we find performing GradVac by layers and on low-resource languages to work generally the best (See Appendix F for detailed discussion).
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 12: Pictorial description of our method.
|
| 361 |
+
|
| 362 |
+
# E.3 THEORETICAL PROPERTY
|
| 363 |
+
|
| 364 |
+
Finally, we analyze the theoretical property of our method. Supper we only have two tasks, and their losses are $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ , and we denote their gradient cosine similarity at a given step as $\phi _ { 1 2 }$ . When $\phi _ { 1 2 }$ is negative, our method is largely equivalent to PCGrad and enjoy PCGrad’s convergence analysis. Thus, here we consider the other case when $\phi _ { 1 2 }$ is positive and show that:
|
| 365 |
+
|
| 366 |
+
Theorem 1. Suppose $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ are convex and differentiable, and that the gradient of $\mathcal { L }$ is Lipschitz continuous with constant $L > 0$ . Then, the GradVac update rule with step size7 $\begin{array} { r } { t < \frac { 2 } { L \left( 1 + a ^ { 2 } \right) } } \end{array}$ and $\begin{array} { r } { t < \frac { 1 } { L } } \end{array}$ , where $\begin{array} { r } { a = \frac { \sin ( \phi _ { 1 2 } - \phi _ { 1 2 } ^ { T } ) } { \sin ( \phi _ { 1 2 } ^ { T } ) } } \end{array}$ $( \phi _ { 1 2 } > 0$ and $\phi _ { 1 2 } ^ { T } \geq \phi _ { 1 2 }$ is some target cosine similarity), will converge to the optimal value $\mathcal { L } ( \theta ^ { \ast } )$ .
|
| 367 |
+
|
| 368 |
+
Proof. Let $\mathbf { g } _ { 1 } = \nabla \mathcal { L } _ { 1 }$ and $\mathbf { g } _ { 2 } = \nabla \mathcal { L } _ { 2 }$ be gradients for task 1 and task 2 respectively. Thus we have $\mathbf { g } = \mathbf { g } _ { 1 } + \mathbf { g } _ { 2 }$ as the original gradient and $\begin{array} { r } { \mathbf { g } ^ { \prime } = \mathbf { g } + a \frac { \| \mathbf { g } _ { 2 } \| } { \| \mathbf { g } _ { 1 } \| } \mathbf { g } _ { 1 } + a \frac { \| \mathbf { g } _ { 1 } \| } { \| \mathbf { g } _ { 2 } \| } \mathbf { g } _ { 2 } } \end{array}$ as the altered gradient by the GradVac update rule, such that:
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
a = \frac { \sin ( \phi _ { 1 2 } ) \cos ( \phi _ { 1 2 } ^ { T } ) - \cos ( \phi _ { 1 2 } ) \sin ( \phi _ { 1 2 } ^ { T } ) } { \sin ( \phi _ { 1 2 } ^ { T } ) }
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
where $\phi _ { 1 2 } ^ { T }$ is some pre-set gradient similarity objective and $\phi _ { 1 2 } ^ { T } \geq \phi _ { 1 2 }$ (thus $a \geq 0$ since we only consider the angle between two gradients in the range of 0 to $\pi$ ).
|
| 375 |
+
|
| 376 |
+
Then, we obtain the quadratic expansion of $\mathcal { L }$ as:
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\mathcal L ( { \boldsymbol { \theta } } ^ { + } ) \leq \mathcal L ( { \boldsymbol { \theta } } ) + \nabla \mathcal L ( { \boldsymbol { \theta } } ) ^ { T } ( { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } ) + \frac { 1 } { 2 } \nabla ^ { 2 } \mathcal L ( { \boldsymbol { \theta } } ) \| { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } \| ^ { 2 }
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
and utilize the assumption that $\nabla \mathcal { L }$ is Lipschitz continuous with constant $\mathrm { L }$ , we have:
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\mathcal { L } ( { \boldsymbol { \theta } } ^ { + } ) \leq \mathcal { L } ( { \boldsymbol { \theta } } ) + \nabla \mathcal { L } ( { \boldsymbol { \theta } } ) ^ { T } ( { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } ) + \frac { 1 } { 2 } L \Vert { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } \Vert ^ { 2 }
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Thus, we plug in the update rule of GradVac to obtain:
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\mathcal { L } ( { \boldsymbol { \theta } } ^ { + } ) \leq \mathcal { L } ( { \boldsymbol { \theta } } ) - t \cdot \mathbf { g } ^ { T } ( \mathbf { g } + a \frac { \left. \mathbf { g } _ { 2 } \right. } { \left. \mathbf { g } _ { 1 } \right. } \mathbf { g } _ { 1 } + a \frac { \left. \mathbf { g } _ { 1 } \right. } { \left. \mathbf { g } _ { 2 } \right. } \mathbf { g } _ { 2 } ) + \frac { 1 } { 2 } L t ^ { 2 } \Vert \mathbf { g } + a \frac { \left. \mathbf { g } _ { 2 } \right. } { \left. \mathbf { g } _ { 1 } \right. } \mathbf { g } _ { 1 } + a \frac { \left. \mathbf { g } _ { 1 } \right. } { \left. \mathbf { g } _ { 2 } \right. } \mathbf { g } _ { 2 } \Vert ^ { 2 }
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { l } { { \displaystyle = \mathcal { L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } + a \phi _ { 1 2 } ( t - L t ^ { 2 } ) ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } ) } } \\ { { \displaystyle \quad \quad - ( 2 a ( t - L t ^ { 2 } ) + \phi _ { 1 2 } ( 2 t - L t ^ { 2 } ( 1 + a ^ { 2 } ) ) ) ( \| { \bf g } _ { 1 } \| \cdot \| { \bf g } _ { 2 } \| ) } } \\ { { \displaystyle = \mathcal { L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } ) - 2 \phi _ { 1 2 } ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ) ( \| { \bf g } _ { 1 } \| \cdot \| { \bf g } _ { 2 } \| ) } } \\ { { \displaystyle \quad \quad - ( a \phi _ { 1 2 } ( t - L t ^ { 2 } ) ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } ) - ( 2 a ( t - L t ^ { 2 } ) ) ( \| { \bf g } _ { 1 } \| \cdot \| { \bf g } _ { 2 } \| ) } } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
(Remove non-positive terms)
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\begin{array} { l } { { \displaystyle \le { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } ) - 2 \phi _ { 1 2 } ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ) ( \| { \bf g } _ { 1 } \| \cdot \| { \bf g } _ { 2 } \| ) } } \\ { { \displaystyle = { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } + 2 \phi _ { 1 2 } \| { \bf g } _ { 1 } \| \cdot \| { \bf g } _ { 2 } \| ) } } \\ { { \displaystyle = { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) ( \| { \bf g } _ { 1 } \| ^ { 2 } + \| { \bf g } _ { 2 } \| ^ { 2 } + 2 { \bf g } _ { 1 } \cdot { \bf g } _ { 2 } ) } } \\ { { \displaystyle = { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) \| { \bf g } _ { 1 } + { \bf g } _ { 2 } \| ^ { 2 } } } \\ { { \displaystyle = { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) \| { \bf g } _ { 1 } \| ^ { 2 } } } \\ { { \displaystyle = { \mathcal L } ( \theta ) - ( t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } ) \| { \bf g } \| ^ { 2 } } } \end{array}
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
The last line implies that if we choose learning rate $t$ to be small enough $\begin{array} { r } { t \textless \frac { 2 } { L ( 1 + a ^ { 2 } ) } } \end{array}$ , we have that $t - \frac { 1 + a ^ { 2 } } { 2 } L t ^ { 2 } > 0$ and thus ${ \mathcal { L } } ( \theta ^ { + } ) < { \mathcal { L } } ( \theta )$ (unless the gradient has zero norm). This tells us applying update rule of GradVac can reach the optimal value $\mathcal { L } ( \theta ^ { \ast } )$ since the objective function strictly decreases.
|
| 405 |
+
|
| 406 |
+
Table 6: Comparing which tasks to be included for GradVac. Parameter granularity fixed at all layer while $\beta { = } 1 \mathrm { e } { - } 2$ .
|
| 407 |
+
|
| 408 |
+
<table><tr><td></td><td>en-fr</td><td>en-cs</td><td>en-hi</td><td>en-tr</td><td>avg</td></tr><tr><td>GradVac w. HRL_only</td><td>39.07</td><td>21.51</td><td>14.92</td><td>19.63</td><td>23.78</td></tr><tr><td>GradVac w. LRL_only</td><td>39.27</td><td>21.67</td><td>14.88</td><td>19.73</td><td>23.89</td></tr><tr><td>GradVac w. all_task</td><td>38.85</td><td>21.47</td><td>14.48</td><td>19.75</td><td>23.64</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table 7: Comparing parameter granularity for GradVac. GradVac tasks fixed at LRL only while $\beta { = } 1 \mathrm { e } { - } 2$ .
|
| 411 |
+
|
| 412 |
+
<table><tr><td></td><td>en-fr</td><td>en-cs</td><td>en-hi</td><td>en-tr</td><td>avg</td></tr><tr><td>GradVacw.whole_model</td><td>38.76</td><td>21.32</td><td>14.22</td><td>18.89</td><td>23.30</td></tr><tr><td>GradVac w. enc_dec</td><td>39.05</td><td>21.73</td><td>14.54</td><td>19.33</td><td>23.66</td></tr><tr><td>GradVac w. all_layer</td><td>39.27</td><td>21.67</td><td>14.88</td><td>19.73</td><td>23.89</td></tr><tr><td>GradVac w. all_matrix</td><td>38.95</td><td>21.56</td><td>14.57</td><td>19.01</td><td>23.52</td></tr></table>
|
| 413 |
+
|
| 414 |
+
<table><tr><td></td><td>en-fr</td><td>en-cs</td><td>en-hi</td><td>en-tr</td><td>avg</td></tr><tr><td>GradVac w. β=1e-1</td><td>38.72</td><td>20.74</td><td>14.52</td><td>19.25</td><td>23.31</td></tr><tr><td>GradVac w. β=1e-2</td><td>39.27</td><td>21.67</td><td>14.88</td><td>19.73</td><td>23.89</td></tr><tr><td>GradVac w. β=1e-3</td><td>38.85</td><td>20.96</td><td>14.85</td><td>19.68</td><td>23.59</td></tr></table>
|
| 415 |
+
|
| 416 |
+
Table 8: Comparing EMA decay rate $\beta$ for GradVac. Parameter granularity fixed at all layer and GradVac tasks fixed at LRL only.
|
| 417 |
+
|
| 418 |
+
# F HYPER-PARAMETER SETTINGS
|
| 419 |
+
|
| 420 |
+
Here, we show how we choose the best hyper-parameter setting for our method. As discussed in Appendix E, there are three hyper-parameter settings for our implementation: (1) which tasks to be considered for GradVac, (2) which layers to measure EMA and perform GradVac, (3) EMA decay rate. Due to the scale of our model on the larger dataset, we use the smaller scale WMT dataset to find the optimal setting and transfer to other experiments. We do this by grid search using average perplexity on the validation set. Below, we demonstrate part of our results for each hyper-parameter to choose from.
|
| 421 |
+
|
| 422 |
+
First, we examine the effect of what tasks to include for GradVac, i.e. $\mathcal { G }$ in Algorithm 1. We consider three options: (1) HRL only: only perform GradVac on high-resource languages, (2) LRL only: only perform GradVac on low-resource languages, (3) all task: perform GradVac on all languages. Results are shown in Table 6. We find that only conducting GradVac on a subset of languages obtain better performance while it is the best to conduct GradVac on low-resource language only. This is probably because the effective batch sizes of low-resource languages are usually smaller due to the sampling strategy.
|
| 423 |
+
|
| 424 |
+
Next, we compare the effect of parameter granularity on model quality. This corresponds to setting different model components for GradVac ( $\mathcal { M }$ in Algorithm 1). We consider four possibilities, from coarse to fine-grained: (1) whole model: only perform GradVac once on the entire model, (2) enc dec: perform separately for encoder and decoder, (3) all layer: perform individually for each layer in encoder and decoder, (4) all matrix: perform for each parameter matrix in the model. As shown in Table 7, we find that choosing proper parameter granularity is important, as neither too coarse nor too fine-grained perform the best. This is consistent with our observation made in Section 2. However, we note that our settings are based on NLP tasks and Transformer networks, and therefore the best overall setting for problems of other domains may vary.
|
| 425 |
+
|
| 426 |
+
Finally, we study how sensitive our method is on the hyper-parameter $\beta$ , i.e. the EMA decay rate. Results in Table 8 illustrate that setting an effective “window” of 100 training steps work best for our problem setups. This is expected, as setting a larger $\beta$ value corresponds to conduct GradVac more aggressively, and vice versa. In general, we find our best settings to be consistent across tasks in this paper.
|
| 427 |
+
|
| 428 |
+
Table 9: F1 on the POS tasks of the XTREME benchmark.
|
| 429 |
+
|
| 430 |
+
<table><tr><td></td><td>ar</td><td>bg</td><td>de</td><td>en</td><td>es</td><td>fr</td><td>hi</td><td>hu</td><td>mr</td><td>ta</td><td>te</td><td>vi</td><td>avg</td></tr><tr><td>mBERT</td><td>84.2</td><td>94.7</td><td>92.7</td><td>91.0</td><td>93.8</td><td>93.3</td><td>88.0</td><td>91.9</td><td>83.3</td><td>80.3</td><td>90.4</td><td>79.2</td><td>88.6</td></tr><tr><td>+ GradNorm</td><td>83.5</td><td>94.7</td><td>92.3</td><td>91.0</td><td>93.6</td><td>93.2</td><td>88.2</td><td>91.4</td><td>83.0</td><td>80.5</td><td>90.6</td><td>79.1</td><td>88.4</td></tr><tr><td>+MGDA</td><td>84.4</td><td>94.5</td><td>92.3</td><td>90.4</td><td>93.5</td><td>92.7</td><td>88.1</td><td>92.3</td><td>83.4</td><td>80.5</td><td>90.2</td><td>78.7</td><td>88.4</td></tr><tr><td>+ PCGrad</td><td>83.7</td><td>94.8</td><td>92.6</td><td>91.5</td><td>94.2</td><td>92.8</td><td>88.5</td><td>91.7</td><td>83.7</td><td>80.5</td><td>90.8</td><td>79.4</td><td>88.7</td></tr><tr><td>+ GradVac</td><td>84.1</td><td>95.0</td><td>93.6</td><td>91.7</td><td>94.4</td><td>93.9</td><td>88.5</td><td>92.4</td><td>83.5</td><td>79.8</td><td>90.9</td><td>79.5</td><td>88.9</td></tr></table>
|
| 431 |
+
|
| 432 |
+
# G XTREME EXPERIMENTS
|
| 433 |
+
|
| 434 |
+
# G.1 FINETUNING DETAILS
|
| 435 |
+
|
| 436 |
+
We also conduct experiments on the XTREME benchmark (Hu et al., 2020) for cross-lingual transfer tasks. While other work mostly focus on zero-shot cross-lingual transfer (finetune on English training data and then evaluate on the target language test data), we use a different setup of multitask learning such that we finetune multiple languages jointly and evaluate on all languages. Notice that our goal is not to compare with state-of-the-art results on this benchmark but rather to examine the effectiveness of our proposed method on pre-trained multilingual language models. We therefore only consider tasks that contain training data for all languages: named entity recognition (NER) and part-of-speech tagging (POS).
|
| 437 |
+
|
| 438 |
+
The NER task is from the WikiAnn (Pan et al., 2017) dataset, which is built automatically from Wikipedia. A linear layer with softmax classifier is added on top of pretrained models to predict the label for each word based on its first subword. We report the F1 score. Similar to NER, POS is also a sequence labelling task but with a focus on synthetic knowledge. In particular, the dataset we used is from the Universal Dependencies treebanks (Nivre et al., 2018). Task-specific layers are the same as in NER and we report F1. We select 12 languages for each task randomly.
|
| 439 |
+
|
| 440 |
+
We use the multilingual BERT (Devlin et al., 2018) as our base model, which is a Transformer model pretrained on the Wikipedias of 104 languages using masked language modelling (MLM). It contains 12 layers and 178M parameters. Following Hu et al. (2020), we finetune the model for 10 epochs for NER and POS, and search the following hyperparameters: batch size $\{ 1 6 , 3 2 \}$ ; learning rate $\{ 2 \mathrm { e } { - } 5 , 3 \mathrm { e } { - } 5 , 5 \mathrm { e } { - } 5 \}$ .
|
| 441 |
+
|
| 442 |
+
# G.2 POS RESULT
|
| 443 |
+
|
| 444 |
+
We evaluate all multi-task baselines on the POS tasks in Table 9. We find that our proposed method outperforms other methods on average, consistent with results in other settings (Section 4).
|
md/train/GzHjhdpk-YH/GzHjhdpk-YH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H1WgVz-AZ/H1WgVz-AZ.md
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING APPROXIMATE INFERENCE NETWORKS FOR STRUCTURED PREDICTION
|
| 2 |
+
|
| 3 |
+
Lifu Tu Kevin Gimpel
|
| 4 |
+
Toyota Technological Institute at Chicago, Chicago, IL, 60637, USA
|
| 5 |
+
{lifu,kgimpel}@ttic.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Structured prediction energy networks (SPENs; Belanger & McCallum 2016) use neural network architectures to define energy functions that can capture arbitrary dependencies among parts of structured outputs. Prior work used gradient descent for inference, relaxing the structured output to a set of continuous variables and then optimizing the energy with respect to them. We replace this use of gradient descent with a neural network trained to approximate structured argmax inference. This “inference network” outputs continuous values that we treat as the output structure. We develop large-margin training criteria for joint training of the structured energy function and inference network. On multi-label classification we report speed-ups of $1 0 { - } 6 0 \mathrm { x }$ compared to (Belanger et al., 2017) while also improving accuracy. For sequence labeling with simple structured energies, our approach performs comparably to exact inference while being much faster at test time. We then demonstrate improved accuracy by augmenting the energy with a “label language model” that scores entire output label sequences, showing it can improve handling of long-distance dependencies in part-of-speech tagging. Finally, we show how inference networks can replace dynamic programming for test-time inference in conditional random fields, suggestive for their general use for fast inference in structured settings.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Energy-based modeling (LeCun et al., 2006) associates a scalar measure of compatibility to each configuration of input and output variables. Given an input $_ { \textbf { \em x } }$ , the predicted output $\hat { \textbf { \textit { y } } }$ is chosen by minimizing an energy function $E ( \pmb { x } , \hat { \pmb { y } } )$ . For structured prediction, the parameterization of the energy function can leverage domain knowledge about the structured output space. However, learning and prediction become complex.
|
| 14 |
+
|
| 15 |
+
Structured prediction energy networks (SPENs; Belanger & McCallum 2016) use an energy function to score structured outputs, and perform inference by using gradient descent to iteratively optimize the energy with respect to the outputs. Belanger et al. (2017) develop an “end-to-end” method that unrolls an approximate energy minimization algorithm into a fixed-size computation graph that is trainable by gradient descent. After learning the energy function, however, they still must use gradient descent for test-time inference.
|
| 16 |
+
|
| 17 |
+
We replace the gradient descent approach with a neural network trained to do inference, which we call an inference network. It can have any architecture such that it takes an input $_ { \textbf { \em x } }$ and returns an output interpretable as a $\textbf { { y } }$ . As in prior work, we relax $\textbf { { y } }$ from discrete to continuous. For multi-label classification, we use a feed-forward network that outputs a vector. We assign a single label to each dimension of the vector, interpreting its value as the probability of predicting that label. For sequence labeling, we output a distribution over predicted labels at each position in the sequence. We adapt the energy functions such that they can operate with both discrete ground truth outputs and outputs generated by our inference networks.
|
| 18 |
+
|
| 19 |
+
We define large-margin training objectives to jointly train energy functions and inference networks. Our training objectives resemble the alternating optimization framework of generative adversarial networks (GANs; Goodfellow et al. 2014): the inference network is analogous to the generator and the energy function is analogous to the discriminator. Our approach avoids argmax computations, making training and test-time inference faster than standard SPENs. We experiment with multi-label classification using the same setup as Belanger & McCallum (2016), demonstrating speed-ups of $1 0 \mathrm { x }$ in training time and $6 0 \mathrm { x }$ in test-time inference while also improving accuracy.
|
| 20 |
+
|
| 21 |
+
We then design a SPEN and inference network for sequence labeling by using recurrent neural networks (RNNs). We perform comparably to a conditional random field (CRF; Lafferty et al. 2001) when using the same energy function, with faster test-time inference. We also experiment with a richer energy that includes a “label language model” that scores entire output label sequences using an RNN, showing it can improve handling of long-distance dependencies in part-of-speech tagging. Finally, we show how inference networks can replace dynamic programming for test-time inference with CRFs, suggestive for the general use of inference networks to speed up inference in traditional structured prediction settings.
|
| 22 |
+
|
| 23 |
+
# 2 STRUCTURED PREDICTION ENERGY NETWORKS
|
| 24 |
+
|
| 25 |
+
We denote the space of inputs by $\mathcal { X }$ . For a given input $\mathbf { \boldsymbol { x } } \in \mathcal { X }$ , we denote the space of legal structured outputs by $\mathcal { V } ( \pmb { x } )$ . We denote the entire space of structured outputs by $\mathcal { V } = \cup _ { \pmb { x } \in \mathcal { X } } \mathcal { V } ( \pmb { x } )$ . A SPEN defines an energy function $E _ { \Theta } : \mathcal { X } \times \mathcal { Y } \mathbb { R }$ parameterized by $\Theta$ that uses a functional architecture to compute a scalar energy for an input/output pair.
|
| 26 |
+
|
| 27 |
+
We describe the SPEN for multi-label classification (MLC) from Belanger & McCallum (2016). Here, $_ { \textbf { \em x } }$ is a fixed-length feature vector. We assume there are $L$ labels, each of which can be on or off for each input, so $\mathcal { V } ( \pmb { x } ) = \{ 0 , 1 \} ^ { L }$ for all $_ { \textbf { \em x } }$ . The energy function is the sum of two terms: $E _ { \Theta } ( { \pmb x } , { \pmb y } ) = E ^ { l o c } ( { \pmb x } , { \pmb y } ) + \dot { E } ^ { l a b } ( { \pmb y } )$ . $E ^ { l o c } ( { \pmb x } , { \pmb y } )$ is the sum of linear models:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
E ^ { l o c } ( { \pmb x } , { \pmb y } ) = \sum _ { i = 1 } ^ { L } y _ { i } b _ { i } ^ { \top } F ( { \pmb x } )
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $b _ { i }$ is a parameter vector for label $i$ and $F ( { \pmb x } )$ is a multi-layer perceptron computing a feature representation for the input $_ { \textbf { \em x } }$ . $E ^ { l a b } ( { \pmb y } )$ scores $\textbf { { y } }$ independent of $_ { \textbf { \em x } }$ :
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
E ^ { l a b } ( { \pmb y } ) = c _ { 2 } ^ { \top } g ( C _ { 1 } { \pmb y } )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $c _ { 2 }$ is a parameter vector, $g$ is an elementwise non-linearity function, and $C _ { 1 }$ is a parameter matrix. After learning the energy function, prediction minimizes energy:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\pmb { \hat { y } } = \underset { \pmb { y } \in \mathscr { y } ( \pmb { x } ) } { \mathrm { a r g m i n } } E _ { \Theta } ( \pmb { x } , \pmb { y } )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
However, solving Eq. (3) requires combinatorial algorithms because $\mathcal { V }$ is a discrete structured space. This becomes intractable when $E _ { \Theta }$ does not decompose into a sum over small “parts” of $\textbf { { y } }$ . Belanger & McCallum (2016) relax this problem by allowing the discrete vector $\textbf { { y } }$ to be continuous. We use $\mathcal { { V } } _ { R }$ to denote the relaxed output space. For MLC, $\begin{array} { r } { \breve { y } _ { R } ( { \pmb x } ) = [ 0 , 1 ] ^ { L } } \end{array}$ . They solve the relaxed problem by using gradient descent to iteratively optimize the energy with respect to $\textbf { { y } }$ . Since they train with a structured large-margin objective, repeated inference is required during learning. They note that using gradient descent for this inference step is time-consuming and makes learning less stable. So Belanger et al. (2017) propose an “end-to-end” learning procedure inspired by Domke (2012). This approach performs backpropagation through each step of gradient descent. We compare to both methods in our experiments below.
|
| 46 |
+
|
| 47 |
+
# 3 INFERENCE NETWORKS FOR SPENS
|
| 48 |
+
|
| 49 |
+
Belanger & McCallum (2016) relaxed $\textbf { { y } }$ from a discrete to a continuous vector and used gradient descent for inference. We also relax $\textbf { { y } }$ but we use a different strategy to approximate inference. We define an inference network $\mathbf { A } _ { \Psi } ( \pmb { x } )$ parameterized by $\Psi$ and train it with the goal that
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathbf { A } _ { \Psi } ( \pmb { x } ) \approx \underset { \pmb { y } \in \mathcal { V } _ { R } ( \pmb { x } ) } { \mathrm { a r g m i n } } E _ { \Theta } ( \pmb { x } , \pmb { y } )
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Given an energy function $E _ { \Theta }$ and a dataset $X$ of inputs, we solve the following optimization problem:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\hat { \Psi } \underset { \Psi } { \mathrm { a r g m i n } } \sum _ { \pmb { x } \in X } E _ { \Theta } ( \pmb { x } , \mathbf { A } _ { \Psi } ( \pmb { x } ) )
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
The architecture of $\mathbf { A } _ { \Psi }$ will depend on the task. For MLC, the same set of labels is applicable to every input, ${ \bf { S 0 } } \ y$ has the same length for all inputs. So, we can use a feed-forward network for $\mathbf { A } _ { \Psi }$ with a vector output, treating each dimension as the prediction for a single label. For sequence labeling, each $_ { \textbf { \em x } }$ (and therefore each $\textbf { { y } }$ ) can have a different length, so we must use a network architecture for $\mathbf { A } _ { \Psi }$ that permits different lengths of predictions. We use an RNN that returns a vector at each position of $_ { \textbf { \em x } }$ . We interpret this vector as a probability distribution over output labels at that position.
|
| 62 |
+
|
| 63 |
+
We note that the output of $\mathbf { A } _ { \Psi }$ must be compatible with the energy function, which is typically defined in terms of the original discrete output space $\mathcal { V }$ . This may require generalizing the energy function to be able to operate both on elements of $\mathcal { V }$ and $\mathcal { V } _ { R }$ . For MLC, no change is required. For sequence labeling, the change is straightforward and is described below in Section 7.2.1.
|
| 64 |
+
|
| 65 |
+
# 4 JOINT TRAINING OF SPENS AND INFERENCE NETWORKS
|
| 66 |
+
|
| 67 |
+
Belanger & McCallum (2016) propose a structured hinge loss for training SPENs:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\operatorname* { m i n } _ { \Theta } \sum _ { \langle x _ { i } , y _ { i } \rangle \in \mathcal { D } } \left[ \operatorname* { m a x } _ { y \in \mathcal { V } _ { R } ( \pmb { x } ) } \left( \triangle ( \pmb { y } , \pmb { y } _ { i } ) - E _ { \Theta } ( \pmb { x } _ { i } , \pmb { y } ) + E _ { \Theta } ( \pmb { x } _ { i } , \pmb { y } _ { i } ) \right) \right] _ { + }
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathcal { D }$ is the set of training pairs, $[ f ] _ { + } = \operatorname* { m a x } ( 0 , f )$ , and $\triangle ( \pmb { y } , \pmb { y } ^ { \prime } )$ is a structured cost function that returns a nonnegative value indicating the difference between $\textbf { { y } }$ and $\boldsymbol { y } ^ { \prime }$ . This loss is often referred to as “margin-rescaled” structured hinge loss (Taskar et al., 2004; Tsochantaridis et al., 2005).
|
| 74 |
+
|
| 75 |
+
However, this loss is expensive to minimize for structured models because of the “cost-augmented” inference step $( \operatorname* { m a x } _ { \pmb { y } \in \mathcal { y } _ { R } ( \pmb { x } ) } )$ . In prior work with SPENs, this step used gradient descent. We replace this with a cost-augmented inference network ${ \bf A } _ { \Phi } ( { \pmb x } )$ . As suggested by the notation, the cost-augmented inference network $\mathbf { A } _ { \Phi }$ and the inference network $\mathbf { A } _ { \Psi }$ will typically have the same functional form, but use different parameters $\Phi$ and $\Psi$ . We write our new optimization problem as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\operatorname* { m i n } _ { \Theta } \operatorname* { m a x } _ { \Phi } \sum _ { \langle \pmb { x } _ { i } , \pmb { y } _ { i } \rangle \in \mathcal { D } } \left[ \triangle ( \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) , \pmb { y } _ { i } ) - E _ { \Theta } ( \pmb { x } _ { i } , \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) ) + E _ { \Theta } ( \pmb { x } _ { i } , \pmb { y } _ { i } ) \right] _ { + }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
We treat this optimization problem as a minimax game and find a saddle point for the game. Following Goodfellow et al. (2014), we implement this using an iterative numerical approach. We alternatively optimize $\Phi$ and $\Theta$ , holding the other fixed. Optimizing $\Phi$ to completion in the inner loop of training is computationally prohibitive and may lead to overfitting. So we alternate between one mini-batch for optimizing $\Phi$ and one for optimizing $\Theta$ . We also add $L _ { 2 }$ regularization terms for $\Theta$ and $\Phi$ .
|
| 82 |
+
|
| 83 |
+
The objective for the cost-augmented inference network is:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\hat { \Phi } \underset { \Phi } { \mathrm { a r g m a x } } [ \bigtriangleup ( \mathbf { A } _ { \Phi } ( \boldsymbol { x } _ { i } ) , \pmb { y } _ { i } ) - E _ { \Theta } ( \boldsymbol { x } _ { i } , \mathbf { A } _ { \Phi } ( \boldsymbol { x } ) _ { i } ) + E _ { \Theta } ( \boldsymbol { x } _ { i } , \pmb { y } _ { i } ) ] _ { + }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
That is, we update $\Phi$ so that $\mathbf { A } _ { \Phi }$ yields an output that has low energy and high cost, in order to mimic cost-augmented inference. The energy parameters $\Theta$ are kept fixed. There is an analogy here to the generator in GANs: $\mathbf { A } _ { \Phi }$ is trained to produce a high-cost structured output that is also appealing to the current energy function. To help stabilize training of $\Phi$ , we add several terms to this objective, discussed below in Section 5.
|
| 90 |
+
|
| 91 |
+
The objective for the energy function is:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\hat { \Theta } \underset { \Theta } { \mathrm { a r g m i n } } [ \triangle ( \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) , \pmb { y } _ { i } ) - E _ { \Theta } ( \pmb { x } _ { i } , \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) ) + E _ { \Theta } ( \pmb { x } _ { i } , \pmb { y } _ { i } ) ] _ { + } + \lambda \| \Theta \| _ { 2 } ^ { 2 }
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
That is, we update $\Theta$ so as to widen the gap between the cost-augmented and ground truth outputs. There is an analogy here to the discriminator in GANs. The energy function is updated so as to enable it to distinguish “fake” outputs produced by $\mathbf { A } _ { \Phi }$ from real outputs $\mathbf { \nabla } _ { \mathbf { \psi } _ { j } } \mathbf { \sigma } _ { j } \mathbf { \sigma } _ { j } $ .
|
| 98 |
+
|
| 99 |
+
Training iterates between updating $\Phi$ and $\Theta$ using the objectives above.
|
| 100 |
+
|
| 101 |
+
# 4.1 TEST-TIME INFERENCE
|
| 102 |
+
|
| 103 |
+
After training, we want to use an inference network $\mathbf { A } _ { \Psi }$ defined in Eq. (4). However, training only gives us a cost-augmented inference network $\mathbf { A } _ { \Phi }$ . Since $\mathbf { A } _ { \Psi }$ and $\mathbf { A } _ { \Phi }$ have the same functional form, we can use $\Phi$ to initialize $\Psi$ , then do additional training on $\mathbf { A } _ { \Psi }$ as in Eq. (5) where $X$ is the training or validation set. This step helps the resulting inference network to produce outputs with lower energy, as it is no longer affected by the cost function. Since this procedure does not use the output labels of the $_ { \textbf { \em x } }$ ’s in $X$ , it could also be applied to the test data in a transductive setting.
|
| 104 |
+
|
| 105 |
+
# 4.2 VARIATIONS AND SPECIAL CASES
|
| 106 |
+
|
| 107 |
+
This approach also permits us to use large-margin structured prediction with slack rescaling (Tsochantaridis et al., 2005). Slack rescaling can yield higher accuracies than margin rescaling, but requires “cost-scaled” inference during training which is intractable for many classes of output structures. However, we can use our notion of inference networks to circumvent this tractability issue and approximately optimize the slack-rescaled hinge loss, yielding the following optimization problem:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\operatorname* { m i n } _ { \Theta } \operatorname* { m a x } _ { \Phi } \sum _ { \langle \mathbf { x } _ { i } , \mathbf { y } _ { i } \rangle \in \mathcal { D } } \bigtriangleup ( \mathbf { A } _ { \Phi } ( \mathbf { x } _ { i } ) , \mathbf { y } _ { i } ) [ 1 - E _ { \Theta } ( \mathbf { x } _ { i } , \mathbf { A } _ { \Phi } ( \mathbf { x } _ { i } ) ) + E _ { \Theta } ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) ] _ { + }
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Using the same argument as above, we can also break this into alternating optimization of $\Phi$ and $\Theta$ .
|
| 114 |
+
|
| 115 |
+
We can optimize a structured perceptron (Collins, 2002) version by using the margin-rescaled hinge loss (Eq. (7)) and fixing $\begin{array} { r } { \triangle ( \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) , \pmb { y } _ { i } ) = 0 } \end{array}$ . When using this loss, the cost-augmented inference network is actually a test-time inference network, because the cost is always zero, so using this loss may lessen the need to retune the inference network after training.
|
| 116 |
+
|
| 117 |
+
When we fix $\begin{array} { r } { \triangle ( \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) , \pmb { y } _ { i } ) = 1 } \end{array}$ , then margin-rescaled hinge is equivalent to slack-rescaled hinge. While using $\triangle = 1$ is not useful in standard max-margin training with exact argmax inference (because the cost has no impact on optimization when fixed to a positive constant), it is potentially useful in our setting. Consider our SPEN objectives with $\triangle = 1$ :
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
[ 1 - E _ { \Theta } ( { \pmb x } _ { i } , { \pmb A } _ { \Phi } ( { \pmb x } _ { i } ) ) + E _ { \Theta } ( { \pmb x } _ { i } , { \pmb y } _ { i } ) ] _ { + }
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
There will always be a nonzero difference between the two energies because ${ \bf A } _ { \Phi } ( { \pmb x } _ { i } )$ will never exactly equal the discrete vector $\mathbf { \nabla } _ { \mathbf { \mathcal { Y } } _ { i } }$ . Since there is no explicit minimization over all discrete vectors $\textbf { { y } }$ , this case is more similar to a “contrastive” hinge loss which seeks to make the energy of the true output lower than the energy of a particular “negative sample” by a margin of at least 1.
|
| 124 |
+
|
| 125 |
+
In our experiments, we will compare four hinge losses for training SPENs: margin-rescaled (Eq. (7)), slack-rescaled (Eq. (10)), perceptron (margin-rescaled with $\triangle = 0$ ), and contrastive $\triangle = 1$ ).
|
| 126 |
+
|
| 127 |
+
# 5 IMPROVING TRAINING FOR INFERENCE NETWORKS
|
| 128 |
+
|
| 129 |
+
We found that the alternating nature of the optimization led to difficulties during training. Similar observations have been noted about other alternative optimization settings, especially those underlying generative adversarial networks (Salimans et al., 2016). Below we describe several techniques we found to help stabilize training, which are optional terms added to the objective in Eq. (8).
|
| 130 |
+
|
| 131 |
+
$L _ { 2 }$ Regularization: We use $L _ { 2 }$ regularization, adding the penalty term $\| \Phi \| _ { 2 } ^ { 2 }$ with coefficient $\lambda _ { 1 }$
|
| 132 |
+
|
| 133 |
+
Entropy Regularization: We add an entropy-based regularizer $\mathrm { l o s s } _ { \mathrm { H } } ( \mathbf { A } _ { \Phi } ( \pmb { x } ) )$ defined for the problem under consideration. For MLC, the output of $\mathbf { A } _ { \Phi } ( \pmb { x } )$ is a vector of scalars in [0, 1], one for each label, where the scalar is interpreted as a label probability. The entropy regularizer $\mathrm { l o s s } _ { \mathrm { H } }$ is the sum of the entropies over these label binary distributions. For sequence labeling, where the length of $_ { \textbf { \em x } }$ is $N$ and where there are $L$ unique labels, the output of ${ \bf A } _ { \Phi } ( { \pmb x } )$ is a length- $N$ sequence of length- $L$ vectors, each of which represents the distribution over the $L$ labels at that position in $_ { \textbf { \em x } }$ . Then, $\mathrm { l o s s } _ { \mathrm { H } }$ is the sum of entropies of these label distributions across positions in the sequence.
|
| 134 |
+
|
| 135 |
+
When tuning the coefficient $\lambda _ { 2 }$ for this regularizer, we consider both positive and negative values, permitting us to favor either low- or high-entropy distributions as the task prefers.1
|
| 136 |
+
|
| 137 |
+
Local Cross Entropy Loss: We add a local (non-structured) cross entropy $\mathrm { l o s s } _ { \mathrm { C E } } ( \mathbf { A } _ { \Phi } ( \pmb { x } _ { i } ) , \pmb { y } _ { i } )$ defined for the problem under consideration. We only experiment with this loss for sequence labeling.
|
| 138 |
+
|
| 139 |
+
It is the sum of the label cross entropy losses over all positions in the sequence. This loss provides more explicit feedback to the inference network, helping the optimization procedure to find a solution that minimizes the energy function while also correctly classifying individual labels. It can also be viewed as a multi-task loss for the inference network.
|
| 140 |
+
|
| 141 |
+
Regularization Toward Pretrained Inference Network: We add the penalty $\lVert \Phi - \Phi _ { 0 } \rVert _ { 2 } ^ { 2 }$ where $\Phi _ { 0 }$ is a pretrained network, e.g., a local classifier trained to independently predict each part of $\textbf { { y } }$ .
|
| 142 |
+
|
| 143 |
+
Each additional term has its own tunable hyperparameter. Finally we obtain:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r } { \hat { \Phi } \underset { \Phi } { \operatorname { a r g m a x } } \ [ \triangle ( \mathbf { A } _ { \Phi } ( \boldsymbol { x } _ { i } ) , \boldsymbol { y } _ { i } ) - E _ { \Theta } ( \boldsymbol { x } _ { i } , \mathbf { A } _ { \Phi } ( \boldsymbol { x } _ { i } ) ) + E _ { \Theta } ( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) ] _ { + } - \lambda _ { 1 } \| \Phi \| _ { 2 } ^ { 2 } } \\ { + \lambda _ { 2 } \mathrm { l o s s } _ { \mathrm { H } } ( \mathbf { A } _ { \Phi } ( \boldsymbol { x } _ { i } ) ) - \lambda _ { 3 } \mathrm { l o s s } _ { \mathrm { C E } } ( \mathbf { A } _ { \Phi } ( \boldsymbol { x } _ { i } ) , \boldsymbol { y } _ { i } ) - \lambda _ { 4 } \| \Phi - \Phi _ { 0 } \| _ { 2 } ^ { 2 } } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
# 6 RELATED WORK
|
| 150 |
+
|
| 151 |
+
Our methods are reminiscent of other alternating optimization problems like that underlying generative adversarial networks (GANs; Goodfellow et al. 2014). GANs are based on a minimax game and have a value function that one agent (a discriminator $D$ ) seeks to maximize and another (a generator $G$ ) seeks to minimize. By their analysis, a log loss discriminator converges to a degenerate uniform solution. When using hinge loss, we can get a non-degenerate discriminator while matching the data distribution (Dai et al., 2017; Zhao et al., 2016). Our formulation is closer to this hinge loss version of the GAN.
|
| 152 |
+
|
| 153 |
+
Our approach is also related to knowledge distillation (Ba & Caruana, 2014; Hinton et al., 2015), which refers to strategies in which one model (a “student”) is trained to mimic another (a “teacher”). Typically, the teacher is a larger, more accurate model but which is too computationally expensive to use at test time. Urban et al. (2016) train shallow networks using image classification data labeled by an ensemble of deep teacher nets. Geras et al. (2016) train a convolutional network to mimic an LSTM for speech recognition. Others have explored knowledge distillation for sequence-to-sequence learning (Kim & Rush, 2016) and parsing (Kuncoro et al., 2016).
|
| 154 |
+
|
| 155 |
+
Since we train a single inference network for an entire dataset, our approach is also related to “amortized inference” (Srikumar et al., 2012; Gershman & Goodman, 2014; Paige & Wood, 2016; Chang et al., 2015). Such methods precompute or save solutions to subproblems for faster overall computation. Our inference networks likely devote more modeling capacity to the most frequent substructures in the data. A kind of inference network is used in variational autoencoders (Kingma & Welling, 2013) to approximate posterior inference in generative models.
|
| 156 |
+
|
| 157 |
+
Our methods are also related to work in structured prediction that seeks to approximate structured models with factorized ones, e.g., mean-field approximations in graphical models (Koller & Friedman, 2009; Krähenbühl & Koltun, 2011). Like our use of inference networks, there have been efforts in designing differentiable approximations of combinatorial search procedures (Martins & Kreutzer, 2017; Goyal et al., 2018) and structured losses for training with them (Wiseman & Rush, 2016). Since we relax discrete output variables to be continuous, there is also a connection to recent work that focuses on structured prediction with continuous valued output variables (Wang et al., 2016). They also propose a formulation that yields an alternating optimization problem, but it is based on proximal methods.
|
| 158 |
+
|
| 159 |
+
There are other settings in which gradient descent is used for inference, e.g., image generation applications like DeepDream (Mordvintsev et al., 2015) and neural style transfer (Gatys et al., 2015), as well as machine translation (Hoang et al., 2017). In these and related settings, gradient descent has started to be replaced by inference networks, especially for image transformation tasks (Johnson et al., 2016; Li & Wand, 2016). Our results below provide more evidence for making this transition. An alternative to what we pursue here would be to obtain an easier convex optimization problem for inference via input convex neural networks (Amos et al., 2017).
|
| 160 |
+
|
| 161 |
+
Table 1: Test F1 when comparing methods on multi-label classification datasets.
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>Bibtex</td><td>Bookmarks</td><td>Delicious</td><td>avg.</td></tr><tr><td>MLP</td><td>38.9</td><td>33.8</td><td>37.8</td><td>36.8</td></tr><tr><td>SPEN (BM16)</td><td>42.2</td><td>34.4</td><td>37.5</td><td>38.0</td></tr><tr><td>SPEN (E2E)</td><td>38.1</td><td>33.9</td><td>34.4</td><td>35.5</td></tr><tr><td>SPEN (InfNet)</td><td>42.2</td><td>37.6</td><td>37.5</td><td>39.1</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 7 EXPERIMENTS
|
| 166 |
+
|
| 167 |
+
In Sec. 7.1 we compare our approach to previous work on training SPENs for MLC. We compare accuracy and speed, finding our approach to outperform prior work. We then perform experiments with sequence labeling tasks in Sec. 7.2.
|
| 168 |
+
|
| 169 |
+
# 7.1 MULTI-LABEL CLASSIFICATION
|
| 170 |
+
|
| 171 |
+
We use the MLC datasets used by Belanger & McCallum (2016): Bibtex, Delicious, and Bookmarks. Dataset statistics are shown in Table 7 in the Appendix. For Bibtex and Delicious, we follow Belanger and McCallum and tune the hyperparameters using a different sampling of train and test data, then use the standard train/test split for final experimentation using the tuned hyperparameters. For Bookmarks, we use the same train/dev/test split as (Belanger & McCallum, 2016). For evaluation, we report the example averaged (macro averaged) F1 measure.
|
| 172 |
+
|
| 173 |
+
We use the SPEN for MLC described in Section 2 and also used by Belanger & McCallum (2016). For the feature representation network $F ( { \pmb x } )$ , we use feed-forward networks with two hidden layers, using their same layer widths: 150 for Bibtex/Bookmarks and 250 for Delicious. We pretrain the feature networks $F ( { \dot { \mathbf { x } } } )$ by minimizing independent-label cross entropy for 10 epochs using Adam (Kingma & Ba, 2014) with learning rate 0.001. While training SPENs, we only update the parameters of the energy function $( \Theta )$ and the inference network $( \Phi )$ , keeping the feature network parameters $F ( { \pmb x } )$ fixed. We use Adam with learning rate 0.001 to train $\Theta$ and $\Phi$ .
|
| 174 |
+
|
| 175 |
+
The inference networks are feed-forward networks with two hidden layers, using the same architectures as the feature networks $F ( { \pmb x } )$ . This permits us to initialize inference network parameters $\Phi$ using pretrained feature network parameters. For the output, we use an affine transformation layer with a sigmoid nonlinearity function, so the output values are in the range $( 0 , 1 )$ . We interpret each value as the probability of predicting the corresponding label. We obtain discrete predictions by thresholding at a threshold $\tau$ tuned to maximize F1 on the development data. We add three terms to the inference network objective from Section 5: $L _ { 2 }$ regularization, entropy regularization, and regularization toward the pretrained feature network. Margin rescaling and slack rescaling use squared $L _ { 2 }$ distance for $\triangle$ . Additional details are provided in Sec. 9.1 in the appendix.
|
| 176 |
+
|
| 177 |
+
Comparison to Prior Work. Table 1 shows results comparing to prior work. The MLP and “SPEN (BM16)” baseline results are taken from (Belanger & McCallum, 2016). We obtained the “SPEN (E2E)” (Belanger et al., 2017) results by running the code available from the authors on these datasets. This method constructs a recurrent neural network that performs gradient-based minimization of the energy with respect to $\textbf { { y } }$ . They noted in their software release that, while this method is more stable, it is prone to overfitting and actually performs worse than the original SPEN. We indeed find this to be the case, as SPEN (E2E) underperforms SPEN (BM16) on all three datasets.
|
| 178 |
+
|
| 179 |
+
Our method (“SPEN (InfNet)”) achieves the best average performance across the three datasets. It performs especially well on Bookmarks, which is the largest of the three. Our results use the contrastive hinge loss and retune the inference network on the development data after the energy is trained; these decisions were made based on the tuning described in Sec. 9.1, but all four hinge losses led to similarly strong results.
|
| 180 |
+
|
| 181 |
+
Speed Comparison. Table 2 compares training and test-time inference speed among the different methods. We only report speeds of methods that we ran.2 The SPEN (E2E) times were obtained using code obtained from Belanger and McCallum. We suspect that SPEN (BM16) training would be comparable to or slower than SPEN (E2E). Our method can process examples during training about 10 times as fast as the end-to-end SPEN, and 60-130 times as fast during test-time inference. In fact, at test time, our method is roughly the same speed as the MLP baseline, since our inference networks use the same architecture as the feature networks which form the MLP baseline. Compared to the MLP, the training of our method takes significantly more time overall because of joint training of the energy function and inference network, but fortunately the test-time inference is comparable.
|
| 182 |
+
|
| 183 |
+
Table 2: Training and test-time inference speed comparison (examples/sec).
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Training Speed (examples/sec)</td><td colspan="3">Testing Speed (examples/sec)</td></tr><tr><td>Bibtex</td><td>Bookmarks</td><td>Delicious</td><td>Bibtex</td><td>Bookmarks</td><td>Delicious</td></tr><tr><td>MLP</td><td>21670</td><td>19591</td><td>26158</td><td>90706</td><td>92307</td><td>113750</td></tr><tr><td>SPEN (E2E)</td><td>551</td><td>559</td><td>383</td><td>1420</td><td>1401</td><td>832</td></tr><tr><td>SPEN (InfNet)</td><td>5533</td><td>5467</td><td>4667</td><td>94194</td><td>88888</td><td>112148</td></tr></table>
|
| 186 |
+
|
| 187 |
+
# 7.2 SEQUENCE LABELING
|
| 188 |
+
|
| 189 |
+
We also evaluate our methods on sequence labeling. We report experiments with Twitter part-ofspeech (POS) tagging here. Named entity recognition experiments are reported in the Appendix.
|
| 190 |
+
|
| 191 |
+
# 7.2.1 ENERGY FUNCTIONS FOR SEQUENCE LABELING
|
| 192 |
+
|
| 193 |
+
The input space $\mathcal { X }$ is now the set of all sequences of symbols drawn from a vocabulary. For an input sequence $_ { \textbf { \em x } }$ of length $N$ , where there are $L$ possible output labels for each position in $_ { \textbf { \em x } }$ , the output space $\mathcal { V } ( \pmb { x } )$ is $[ L ] ^ { \widetilde { N } }$ , where the notation $[ q ]$ represents the set containing the first $q$ positive integers. We define $\pmb { y } = \langle y _ { 1 } , y _ { 2 } , . . , y _ { N } \rangle$ where each $y _ { i }$ ranges over possible output labels, i.e., $y _ { i } \in [ L ]$ .
|
| 194 |
+
|
| 195 |
+
When defining our energy for sequence labeling, we take inspiration from bidirectional LSTMs (BLSTMs; Hochreiter $\&$ Schmidhuber 1997) and conditional random fields (CRFs; Lafferty et al. 2001). A “linear chain” CRF uses two types of features: one capturing the connection between an output label and $_ { \textbf { \em x } }$ and the other capturing the dependence between neighboring output labels. We use a BLSTM to compute feature representations for $_ { \textbf { \em x } }$ . We use $f ( \pmb { x } , t ) \in \mathbb { R } ^ { d }$ to denote the “input feature vector” for position $t$ , defining it to be the $d$ -dimensional BLSTM hidden vector at $t$ .
|
| 196 |
+
|
| 197 |
+
We then define the following energy function:
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
E _ { \Theta } ( \pmb { x } , \pmb { y } ) = - \left( \sum _ { t } U _ { y _ { t } } ^ { \top } f ( \pmb { x } , t ) + \sum _ { t } W _ { y _ { t - 1 } , y _ { t } } \right)
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $U _ { i } \in \mathbb { R } ^ { d }$ is a parameter vector for label $i$ and the parameter matrix $W \in \mathbb { R } ^ { L \times L }$ contains label pair parameters. The full set of parameters $\Theta$ includes the $U _ { i }$ vectors, $W$ , and the parameters of the BLSTM. The above energy only permits discrete $\textbf { { y } }$ . For the general case that permits relaxing $\textbf { { y } }$ to be continuous, we treat each $y _ { t }$ as a vector. It will be one-hot for the ground truth $\textbf { { y } }$ and will be a vector of label probabilities for relaxed $\textbf { { y } }$ ’s. Then the general energy function is:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
E _ { \Theta } ( \pmb { x } , \pmb { y } ) = - \left( \sum _ { t } \sum _ { i = 1 } ^ { L } y _ { t , i } \left( U _ { i } ^ { \top } f ( \pmb { x } , t ) \right) + \sum _ { t } y _ { t - 1 } ^ { \top } W y _ { t } \right)
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
where $y _ { t , i }$ is the $i$ th entry of the vector $y _ { t }$ . In the discrete case, this entry is 1 for a single $i$ and 0 for all others, so this energy reduces to Eq. (12) in that case. In the continuous case, this scalar indicates the probability of the tth position being labeled with label $i$ . For the label pair terms in this general energy function, we use a bilinear product between the vectors $y _ { t - 1 }$ and $y _ { t }$ using parameter matrix $W$ , which also reduces to Eq. (12) when they are one-hot vectors.
|
| 210 |
+
|
| 211 |
+
Tag Language Model. In order to capture long-distance dependencies in an entire sequence of labels, we train a “tag language model” on a large corpus of automatically-tagged tweets, then include a term in the energy function representing the log-probability of the given tag sequence under this tag language model. Details are provided below in Section 7.2.4.
|
| 212 |
+
|
| 213 |
+
Table 3: Comparison of SPEN hinge losses and showing the impact of retuning (Twitter POS validation accuracies). Inference networks are trained with the cross entropy term.
|
| 214 |
+
|
| 215 |
+
<table><tr><td>SPEN hinge loss</td><td colspan="2">validation accuracy (%)</td></tr><tr><td></td><td>-retuning 89.1</td><td>+retuning</td></tr><tr><td>margin rescaling slack rescaling</td><td>89.4</td><td>89.3</td></tr><tr><td>perceptron (MR,△= 0)</td><td>89.2</td><td>89.6</td></tr><tr><td></td><td>88.8</td><td>89.4</td></tr><tr><td>contrastive (△= 1)</td><td></td><td>89.0</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 4: Twitter POS accuracies of BLSTM, CRF, and SPEN (InfNet), using our tuned SPEN configuration (slack-rescaled hinge, inference network trained with cross entropy term). Though slowest to train, the SPEN matches the test-time speed of the BLSTM while achieving the highest accuracies.
|
| 218 |
+
|
| 219 |
+
<table><tr><td></td><td>validation accuracy (%)</td><td>test accuracy (%)</td><td>training speed (examples/sec)</td><td>testing speed (examples/sec)</td></tr><tr><td>BLSTM</td><td>88.6</td><td>88.8</td><td>385</td><td>1250</td></tr><tr><td>CRF</td><td>89.1</td><td>89.2</td><td>250</td><td>500</td></tr><tr><td>SPEN (InfNet)</td><td>89.6</td><td>89.8</td><td>125</td><td>1250</td></tr></table>
|
| 220 |
+
|
| 221 |
+
# 7.2.2 EXPERIMENTAL SETUP
|
| 222 |
+
|
| 223 |
+
For Twitter part-of-speech (POS) tagging, we use the annotated data from Gimpel et al. (2011) and Owoputi et al. (2013) which contains $L = 2 5$ POS tags. For training, we combine the 1000- tweet OCT27TRAIN set and the 327-tweet OCT27DEV set. For validation, we use the 500-tweet OCT27TEST set and for testing we use the 547-tweet DAILY547 test set. We use 100-dimensional skip-gram embeddings trained on 56 million English tweets with word2vec (Mikolov et al., 2013).3
|
| 224 |
+
|
| 225 |
+
We use a BLSTM to compute the “input feature vector” $f ( { \pmb x } , t )$ for each position $t$ , using hidden vectors of dimensionality $d = 1 0 0$ . We also use BLSTMs for the inference networks. The output layer of the inference network is a softmax function, so at every position, the inference network produces a distribution over labels at that position. We train inference networks using stochastic gradient descent (SGD) with momentum and train the energy parameters using Adam. For $\triangle$ , we use $L _ { 1 }$ distance. We tune hyperparameters on the validation set; full details of tuning are provided in the appendix. We found that the cross entropy stabilization term worked well for this setting; details and an empirical comparison are provided in Section 9.2.1.
|
| 226 |
+
|
| 227 |
+
We compare to standard BLSTM and CRF baselines. We train the BLSTM baseline to minimize per-token log loss; this is often called a “BLSTM tagger”. We train a CRF baseline using the energy in Eq. (12) with the standard conditional log-likelihood objective using the standard dynamic programming algorithms (forward-backward) to compute gradients during training. Further details are provided in the appendix.
|
| 228 |
+
|
| 229 |
+
# 7.2.3 RESULTS
|
| 230 |
+
|
| 231 |
+
Loss Function Comparison. Table 3 shows results when comparing SPEN training objectives. We see a larger difference among losses here than for MLC tasks. When using the perceptron loss, there is no margin, which leads to overfitting: 89.4 on validation, 88.6 on test (not shown in the table). The contrastive loss, which strives to achieve a margin of 1, does better on test (89.0). We also see here that margin rescaling and slack rescaling both outperform the contrastive hinge, unlike the MLC tasks. We suspect that in the case in which each input/output has a different length, using a cost that captures length is more important.
|
| 232 |
+
|
| 233 |
+
Comparison to Standard Baselines. Table 4 compares our final tuned SPEN configuration to two standard baselines: a BLSTM tagger and a CRF. The SPEN achieves higher validation and test accuracies with faster test-time inference. While our method is slower than the baselines during training, it is faster than the CRF at test time, operating at essentially the same speed as the BLSTM baseline while being more accurate.
|
| 234 |
+
|
| 235 |
+
Table 5: Twitter POS validation/test accuracies when adding tag language model (TLM) energy term to a SPEN trained with margin-rescaled hinge.
|
| 236 |
+
|
| 237 |
+
<table><tr><td></td><td>val. accuracy (%)</td><td>test accuracy (%)</td></tr><tr><td>-TLM</td><td>89.8</td><td>89.6</td></tr><tr><td>+TLM</td><td>89.9</td><td>90.2</td></tr></table>
|
| 238 |
+
|
| 239 |
+
Here, the SPEN and CRF are using the same functional form for their energy functions, namely the energy given in Eq. (13). We note that the SPEN outperforms the CRF, despite using the same form for the energy. There are two factors that can explain this. First, the losses are different. The CRF uses conditional log-likelihood while the SPEN results here use slack-rescaled hinge, which outperforms the other hinge loss variants (Table 3). Second, the stabilization terms used when training the inference network may be providing a regularizing effect for the model. Our motivation for these experiments was to show the impact of these differences while keeping the form of the energy function fixed. We now turn to richer energies.
|
| 240 |
+
|
| 241 |
+
7.2.4 TOWARDS GLOBAL ENERGIES: TAG LANGUAGE MODELS FOR TWITTER POS TAGGING
|
| 242 |
+
|
| 243 |
+
The above results only use the pairwise energy; no results used the tag language model (TLM). To compute the TLM energy term, we first automatically tag unlabeled tweets, then train an LSTM language model on the automatic tag sequences. When doing so, we define the input tag embeddings to be $L$ -dimensional one-hot vectors specifying the tags in the training sequences. This is nonstandard compared to standard language modeling. In standard language modeling, we train on observed sequences and compute likelihoods of other fully-observed sequences. However, in our case, we train on tag sequences but we want to use the same model on sequences of tag distributions produced by an inference network. We train the TLM on sequences of one-hot vectors and then use it to compute likelihoods of sequences of tag distributions. Further details about training are provided in Section 9.2.2 in the appendix.
|
| 244 |
+
|
| 245 |
+
We define an additional energy term $E ^ { \mathrm { T L M } } ( y )$ based on the pretrained TLM. If the argument $\textbf { { y } }$ consisted of one-hot vectors, we could simply compute its likelihood. However, to support relaxed $\textbf { { y } }$ ’s, we need to define a more general function:
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
E ^ { \mathrm { T L M } } ( \pmb { y } ) = - \sum _ { t = 1 } ^ { | \pmb { y } | + 1 } \log ( \pmb { y } _ { t } ^ { \top } \mathrm { T L M } ( \langle \pmb { y } _ { 0 } , . . . , \pmb { y } _ { t - 1 } \rangle ) )
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
where $y _ { 0 }$ is the start-of-sequence symbol, $y _ { \vert \pmb { y } \vert + 1 }$ is the end-of-sequence symbol, and $\mathrm { T L M } \big ( \langle y _ { 0 } , . . . , y _ { t - 1 } \rangle \big )$ returns the softmax distribution over tags at position $t$ (under the pretrained tag language model) given the preceding tag vectors. When each $y _ { t }$ is a one-hot vector, this energy reduces to the negative log-likelihood of the tag sequence specified by $\textbf { { y } }$ .
|
| 252 |
+
|
| 253 |
+
We define the new joint energy as the sum of the energy function in Eq. (13) and the TLM energy function in Eq. (14). During learning, we keep the TLM parameters fixed to their pretrained values, but we tune the weight of the TLM energy (over the set $\{ 0 . 1 , 0 . 2 , 0 . 5 \} )$ in the joint energy. We train SPENs with the new joint energy using the margin-rescaled hinge, training the inference network with the cross entropy term.
|
| 254 |
+
|
| 255 |
+
Table 5 shows results.4 Adding the TLM energy leads to a gain of 0.6 on the test set. Other settings showed more variance; when using slack-rescaled hinge, we found a small drop on test, while when simply training inference networks for a fixed, pretrained joint energy with tuned mixture coefficient, we found a gain of 0.3 on test when adding the TLM energy. We investigated the improvements and found some to involve corrections that seemingly stem from handling non-local dependencies better. Table 10 in the appendix shows examples in which the model with the TLM appears to be better at using the broader context when making tagging decisions. These results suggest that our method of training inference networks can be used to add rich features to structured prediction, though we leave a thorough exploration of global energies to future work.
|
| 256 |
+
|
| 257 |
+
Table 6: Comparison of test-time inference algorithms for a trained CRF (Twitter POS tagging). We show the test accuracy for the inference network setting that does best on validation. All inference networks use the same architecture and therefore have essentially the same speed.
|
| 258 |
+
|
| 259 |
+
<table><tr><td>test-time inference algorithm</td><td>val. accuracy (%)</td><td>test accuracy (%)</td><td>speed (examples/sec)</td></tr><tr><td>Viterbialgorithm</td><td>89.1</td><td>89.2</td><td>500</td></tr><tr><td>Inference network + cross entropy</td><td>89.7</td><td>89.5</td><td>1250</td></tr><tr><td>Inference network+ entropy</td><td>89.6</td><td></td><td></td></tr><tr><td>Inference network + squared L2 distance</td><td>88.9</td><td></td><td></td></tr></table>
|
| 260 |
+
|
| 261 |
+
# 7.2.5 BEYOND SPENS: INFERENCE NETWORKS FOR STRUCTURED PREDICTION
|
| 262 |
+
|
| 263 |
+
We note that inference networks can be used for any prediction problem. We now explore the use of an inference network to approximate test-time inference for a trained CRF. The results are shown in Table 6. All results use the same trained CRF energy function (Eq. (12)), trained to minimize log loss using the forward-backward algorithm for exact inference during training. The first row shows accuracy and speed when using Viterbi for test-time inference, which is the same setting as the “CRF” row in Table 4. Subsequent rows show results when training inference networks to mimic Viterbi with various stabilization terms. When training these inference networks, we train them on the training set and tune based on early stopping on the validation set. The energy stays fixed while inference networks are trained.
|
| 264 |
+
|
| 265 |
+
When using either entropy or cross entropy, our inference networks outperform Viterbi while doubling its speed. When using the squared $L _ { 2 }$ distance term (which regularizes the inference network toward the pretrained BLSTM), the accuracy reduces to be closer to that of the BLSTM, which reaches $8 8 . 6 \%$ on validation (see Table 4). When using no stabilization terms for the inference network, learning fails, reaching $1 3 . 7 \%$ on the development set, showing the importance of using some stabilization term while training the inference network.
|
| 266 |
+
|
| 267 |
+
These results show promise for training inference networks to speed up combinatorial algorithms for structured prediction and other domains.
|
| 268 |
+
|
| 269 |
+
# 8 CONCLUSIONS AND FUTURE WORK
|
| 270 |
+
|
| 271 |
+
We presented ways to jointly train structured energy functions and inference networks using largemargin objectives. The energy function captures arbitrary dependencies among the labels, while the inference networks learns to capture the properties of the energy in an efficient manner, yielding fast test-time inference. Future work includes exploring the space of network architectures for inference networks to balance accuracy and efficiency, experimenting with additional global terms in structured energy functions, and exploring richer structured output spaces such as trees and sentences.
|
| 272 |
+
|
| 273 |
+
# ACKNOWLEDGMENTS
|
| 274 |
+
|
| 275 |
+
We thank the anonymous reviewers, David Belanger, Weiran Wang and Zheng Cai. We also thank NVIDIA Corporation for donating GPUs used in this research.
|
| 276 |
+
|
| 277 |
+
# REFERENCES
|
| 278 |
+
|
| 279 |
+
Brandon Amos, Lei Xu, and J. Zico Kolter. Input convex neural networks. In Proc. of ICML, 2017.
|
| 280 |
+
|
| 281 |
+
Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In Advances in NIPS, 2014.
|
| 282 |
+
|
| 283 |
+
David Belanger and Andrew McCallum. Structured prediction energy networks. In Proc. of ICML, 2016.
|
| 284 |
+
|
| 285 |
+
David Belanger, Bishan Yang, and Andrew McCallum. End-to-end learning for structured prediction energy networks. In Proc. of ICML, 2017.
|
| 286 |
+
|
| 287 |
+
Kai-Wei Chang, Shyam Upadhyay, Gourab Kundu, and Dan Roth. Structural learning with amortized inference. In Proc. of AAAI, 2015.
|
| 288 |
+
|
| 289 |
+
Michael Collins. Discriminative training methods for hidden Markov models: Theory and experiments with perceptron algorithms. In Proc. of EMNLP, 2002.
|
| 290 |
+
|
| 291 |
+
Zihang Dai, Amjad Almahairi, Bachman Philip, Eduard Hovy, and Aaron Courville. Calibrating energy-based generative adversarial networks. In Proc. of ICLR, 2017.
|
| 292 |
+
|
| 293 |
+
Justin Domke. Generic methods for optimization-based modeling. In Proc. of AISTATS, 2012.
|
| 294 |
+
|
| 295 |
+
Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. A neural algorithm of artistic style. CoRR, abs/1508.06576, 2015.
|
| 296 |
+
|
| 297 |
+
Krzysztof J. Geras, Abdel rahman Mohamed, Rich Caruana, Gregor Urban, Shengjie Wang, Ozlem Aslan, Matthai Philipose, Matthew Richardson, and Charles Sutton. Blending LSTMs into CNNs. In Proc. of ICLR (workshop track), 2016.
|
| 298 |
+
|
| 299 |
+
Samuel Gershman and Noah Goodman. Amortized inference in probabilistic reasoning. In Proc. of the Cognitive Science Society, 2014.
|
| 300 |
+
|
| 301 |
+
Kevin Gimpel, Nathan Schneider, Brendan O’Connor, Dipanjan Das, Daniel Mills, Jacob Eisenstein, Michael Heilman, Dani Yogatama, Jeffrey Flanigan, and Noah A. Smith. Part-of-speech tagging for Twitter: annotation, features, and experiments. In Proc. of ACL, 2011.
|
| 302 |
+
|
| 303 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in NIPS, 2014.
|
| 304 |
+
|
| 305 |
+
Kartik Goyal, Graham Neubig, Chris Dyer, and Taylor Berg-Kirkpatrick. A continuous relaxation of beam search for end-to-end training of neural sequence models. In Proc. of AAAI, 2018.
|
| 306 |
+
|
| 307 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning Workshop, 2015.
|
| 308 |
+
|
| 309 |
+
Cong Duy Vu Hoang, Gholamreza Haffari, and Trevor Cohn. Towards decoding as continuous optimisation in neural machine translation. In Proc. of EMNLP, 2017.
|
| 310 |
+
|
| 311 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 1997.
|
| 312 |
+
|
| 313 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In Proc. of ECCV, 2016.
|
| 314 |
+
|
| 315 |
+
Yoon Kim and Alexander M. Rush. Sequence-level knowledge distillation. In Proc. of EMNLP, 2016.
|
| 316 |
+
|
| 317 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014.
|
| 318 |
+
|
| 319 |
+
Diederik Kingma and Max Welling. Auto-encoding variational Bayes. CoRR, abs/1312.6114, 2013.
|
| 320 |
+
|
| 321 |
+
Daphne Koller and Nir Friedman. Probabilistic Graphical Models: Principles and Techniques. 2009.
|
| 322 |
+
|
| 323 |
+
Philipp Krähenbühl and Vladlen Koltun. Efficient inference in fully connected CRFs with Gaussian edge potentials. In Advances in NIPS, 2011.
|
| 324 |
+
|
| 325 |
+
Adhiguna Kuncoro, Miguel Ballesteros, Lingpeng Kong, Chris Dyer, and Noah A. Smith. Distilling an ensemble of greedy dependency parsers into one MST parser. In Proc. of EMNLP, 2016.
|
| 326 |
+
|
| 327 |
+
John D. Lafferty, Andrew McCallum, and Fernando C. N. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proc. of ICML, 2001.
|
| 328 |
+
|
| 329 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, Marc’Aurelio Ranzato, and Fu-Jie Huang. A tutorial on energy-based learning. In Predicting Structured Data. MIT Press, 2006.
|
| 330 |
+
|
| 331 |
+
Chuan Li and Michael Wand. Precomputed real-time texture synthesis with Markovian generative adversarial networks. CoRR, abs/1604.04382, 2016.
|
| 332 |
+
|
| 333 |
+
Xuezhe Ma and Eduard Hovy. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proc. of ACL, 2016.
|
| 334 |
+
|
| 335 |
+
André F. T. Martins and Julia Kreutzer. Learning what’s easy: Fully differentiable neural easy-first taggers. In Proc. of EMNLP, 2017.
|
| 336 |
+
|
| 337 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in NIPS, 2013.
|
| 338 |
+
|
| 339 |
+
Alexander Mordvintsev, Christopher Olah, and Mike Tyka. DeepDream-a code example for visualizing neural networks. Google Research, 2015.
|
| 340 |
+
|
| 341 |
+
Olutobi Owoputi, Brendan O’Connor, Chris Dyer, Kevin Gimpel, Nathan Schneider, and Noah A. Smith. Improved part-of-speech tagging for online conversational text with word clusters. In Proc. of NAACL, 2013.
|
| 342 |
+
|
| 343 |
+
Brooks Paige and Frank Wood. Inference networks for sequential Monte Carlo in graphical models. In Proc. of ICML, 2016.
|
| 344 |
+
|
| 345 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. GloVe: Global vectors for word representation. In Proc. of EMNLP, 2014.
|
| 346 |
+
|
| 347 |
+
Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey E. Hinton. Regularizing neural networks by penalizing confident output distributions. CoRR, 2017.
|
| 348 |
+
|
| 349 |
+
Lev Ratinov and Dan Roth. Design challenges and misconceptions in named entity recognition. In Proc. of CoNLL, 2009.
|
| 350 |
+
|
| 351 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training GANs. In Advances in NIPS, 2016.
|
| 352 |
+
|
| 353 |
+
Vivek Srikumar, Gourab Kundu, and Dan Roth. On amortizing inference cost for structured prediction. In Proc. of EMNLP, 2012.
|
| 354 |
+
|
| 355 |
+
Ben Taskar, Carlos Guestrin, and Daphne Koller. Max-margin Markov networks. In Advances in NIPS, 2004.
|
| 356 |
+
|
| 357 |
+
Erik F. Tjong Kim Sang and Fien De Meulder. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proc. of CONLL, 2003.
|
| 358 |
+
|
| 359 |
+
Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, and Yasemin Altun. Large margin methods for structured and interdependent output variables. JMLR, 2005.
|
| 360 |
+
|
| 361 |
+
Lifu Tu, Kevin Gimpel, and Karen Livescu. Learning to embed words in context for syntactic tasks. In Proc. of RepL4NLP, 2017.
|
| 362 |
+
|
| 363 |
+
Gregor Urban, Krzysztof J. Geras, Samira Ebrahimi Kahou, Ozlem Aslan, Shengjie Wang, Rich Caruana, Abdel-rahman Mohamed, Matthai Philipose, and Matthew Richardson. Do deep convolutional nets really need to be deep? arXiv preprint arXiv:1603.05691, 2016.
|
| 364 |
+
|
| 365 |
+
Shenlong Wang, Sanja Fidler, and Raquel Urtasun. Proximal deep structured models. In Advances in NIPS, 2016.
|
| 366 |
+
|
| 367 |
+
Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In Proc. of EMNLP, 2016.
|
| 368 |
+
|
| 369 |
+
Junbo Jake Zhao, Michaël Mathieu, and Yann LeCun. Energy-based generative adversarial network. CoRR, 2016.
|
| 370 |
+
|
| 371 |
+
Table 7: Statistics of the multi-label classification datasets.
|
| 372 |
+
|
| 373 |
+
<table><tr><td></td><td>#labels</td><td># features</td><td>#train</td><td>#dev</td><td>#test</td></tr><tr><td>Bibtex</td><td>159</td><td>1836</td><td>4836</td><td>-</td><td>2515</td></tr><tr><td>Bookmarks</td><td>208</td><td>2151</td><td>48000</td><td>12000</td><td>27856</td></tr><tr><td>Delicious</td><td>982</td><td>501</td><td>12896</td><td>-</td><td>3185</td></tr></table>
|
| 374 |
+
|
| 375 |
+
Table 8: Development F1 for Bookmarks when comparing hinge losses for SPEN (InfNet) and whether to retune the inference network.
|
| 376 |
+
|
| 377 |
+
<table><tr><td>hinge loss</td><td>-retuning</td><td>+retuning</td></tr><tr><td>margin rescaling</td><td>38.51</td><td>38.68</td></tr><tr><td>slack rescaling</td><td>38.57</td><td>38.62</td></tr><tr><td>perceptron (MR,△= 0)</td><td>38.55</td><td>38.70</td></tr><tr><td>contrastive (△= 1)</td><td>38.80</td><td>38.88</td></tr></table>
|
| 378 |
+
|
| 379 |
+
# 9 APPENDIX
|
| 380 |
+
|
| 381 |
+
# 9.1 MULTI-LABEL CLASSIFICATION
|
| 382 |
+
|
| 383 |
+
Table 7 shows dataset statistics for the multi-label classification datasets.
|
| 384 |
+
|
| 385 |
+
Hyperparameter Tuning. We tune $\lambda$ (the $L _ { 2 }$ regularization strength for $\Theta$ ) over the set $\{ 0 . 0 1 , 0 . 0 0 1 , 0 . 0 0 0 1 \}$ . The classification threshold $\tau$ is chosen from $[ 0 , 0 . 0 1 , 0 . 0 2 , 0 . 0 3 , 0 . 0 4 , 0 . 0 5 , 0 . 1 , 0 . 1 5 , 0 . 2 , 0 . 2 5 ,$ 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75] as also done by Belanger & McCallum (2016). We tune the coefficients for the three stabilization terms for the inference network objective from Section 5 over the follow ranges: $L _ { 2 }$ regularization $( \lambda _ { 1 } ~ \in ~ \{ 0 . 0 1 , 0 . 0 0 1 , 0 . 0 0 0 1 \} )$ ), entropy regularization $\mathbf { \lambda } ) _ { 2 } ~ = ~ 1 )$ , and regularization toward the pretrained feature network $( \dot { \lambda } _ { 4 } \in \{ 0 , 1 , 1 0 \} )$ ).
|
| 386 |
+
|
| 387 |
+
Comparison of Loss Functions and Impact of Inference Network Retuning. Table 8 shows results comparing the four loss functions from Section 4.2 on the development set for Bookmarks, the largest of the three datasets. We find performance to be highly similar across the losses, with the contrastive loss appearing slightly better than the others.
|
| 388 |
+
|
| 389 |
+
After training, we “retune” the inference network as specified by Eq. (5) on the development set for 20 epochs using a smaller learning rate of 0.00001. Table 8 shows slightly higher F1 for all losses with retuning. We were surprised to see that the final cost-augmented inference network performs well as a test-time inference network. This suggests that by the end of training, the cost-augmented network may be approaching the argmin and that there may not be much need for retuning.
|
| 390 |
+
|
| 391 |
+
When using $\triangle = 0$ or 1, retuning leads to the same small gain as when using the margin-rescaled or slack-rescaled losses. Here the gain is presumably from adjusting the inference network for other inputs rather than from converting it from a cost-augmented to a test-time inference network.
|
| 392 |
+
|
| 393 |
+
# 9.2 TWITTER POS TAGGING
|
| 394 |
+
|
| 395 |
+
# 9.2.1 HYPERPARAMETER TUNING
|
| 396 |
+
|
| 397 |
+
When training inference networks and SPENs for Twitter POS tagging, we use the following hyperparameter tuning. We tune the inference network learning rate $( \{ 0 . 1 , 0 . 0 5 , 0 . 0 2 , 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 1 \} )$ ), $L _ { 2 }$ regularization $( \lambda _ { 1 } \in \{ 0 , 1 { \mathrm { e } } - 3 , 1 { \mathrm { e } } - 4 , 1 { \mathrm { e } } - 5 , 1 { \mathrm { e } } - { \bar { 6 } } , 1 { \mathrm { e } } - { \bar { 7 } } \} )$ ), the entropy regularization term $( \lambda _ { 2 } \in \{ 0 . 1 , 0 . 5 , 1 , 2 , 5 , 1 0 \} )$ , the cross entropy regularization term $( \lambda _ { 3 } \in \{ 0 . 1 , 0 . 5 , 1 , 2 , 5 , 1 0 \} )$ , and the squared L2 distance $( \bar { \lambda } _ { 4 } \in \{ 0 , 0 . 1 , 0 . 2 , \bar { 0 . 5 } , 1 , 2 , 1 0 \} )$ ). We train the energy functions with Adam with a learning rate of 0.001 and $L _ { 2 }$ regularization $( \lambda _ { 1 } \in \{ 0 , 1 \mathrm { { e } - 3 , 1 \mathrm { { e } - 4 , 1 \mathrm { { e } - 5 } , 1 \mathrm { { e } - 6 } , 1 \mathrm { { e } - 7 } \} ) } }$ .
|
| 398 |
+
|
| 399 |
+
Table 9 compares the use of the cross entropy and entropy stabilization terms when training inference networks for a SPEN with margin-rescaled hinge. Cross entropy works better than entropy in this setting, though retuning permits the latter to bridge the gap more than halfway.
|
| 400 |
+
|
| 401 |
+
Table 9: Comparison of inference network stabilization terms and showing impact of retuning when training SPENs with margin-rescaled hinge (Twitter POS validation accuracies).
|
| 402 |
+
|
| 403 |
+
<table><tr><td></td><td colspan="2">validation accuracy (%)</td></tr><tr><td>inference network stabilization terms</td><td>-retuning</td><td>+retuning</td></tr><tr><td>cross entropy</td><td>89.1</td><td>89.3</td></tr><tr><td>entropy</td><td>84.2</td><td>86.8</td></tr></table>
|
| 404 |
+
|
| 405 |
+
Table 10: Examples of improvements in Twitter POS tagging when using tag language model (TLM). In all of these examples, the predicted tag when using the TLM matches the gold standard.
|
| 406 |
+
|
| 407 |
+
<table><tr><td colspan="2"></td><td colspan="2">predicted tags</td></tr><tr><td>#</td><td>tweet (target word in bold)</td><td>-TLM</td><td>+TLM</td></tr><tr><td>1</td><td>... that's a t-17, technically . does that count as top-25 ?</td><td>determiner</td><td>pronoun</td></tr><tr><td>2</td><td>... lol you know im down like 4 flats on a cadillac ... lol...</td><td>adjective</td><td>preposition</td></tr><tr><td>3</td><td>... them who he is : he wants her to like him for his pers..</td><td>preposition</td><td>verb</td></tr><tr><td>4</td><td>I wonder when Nic Cage is going to film " Another Something</td><td>noun</td><td>verb</td></tr><tr><td>5</td><td>Something Las Vegas " . Cut my hair, gag and bore me</td><td>noun</td><td>verb</td></tr><tr><td>6 7</td><td>... they had their fun,we hd ours !;) lmaooo " Logic will get you from A to B . Imagination will take you</td><td>proper noun verb</td><td>verb</td></tr><tr><td></td><td>everywhere ." - Albert Einstein .</td><td></td><td>noun</td></tr><tr><td>8</td><td>lmao I'm not a sheep who listens to it cos everyone else does ..</td><td>verb</td><td>preposition</td></tr><tr><td>9</td><td>Noo its not cuss you have swag andd you wont look dumb !..</td><td>noun</td><td>coord. conj.</td></tr></table>
|
| 408 |
+
|
| 409 |
+
When training CRFs, we use SGD with momentum. We tune the learning rate (over $\{ 0 . 1 , 0 . 0 5 , 0 . 0 2 , 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 1 \}$ ) and $L _ { 2 }$ regularization coefficient (over $\{ 0 , 1 \mathrm { e } - 3 , 1 \mathrm { e } - 4 , 1 \mathrm { e } -$ $5 , 1 \mathrm { e } - 6 , 1 \mathrm { e } - 7 \}$ ). For all methods, we use early stopping based on validation accuracy.
|
| 410 |
+
|
| 411 |
+
# 9.2.2 TAG LANGUAGE MODEL DETAILS AND ANALYSIS
|
| 412 |
+
|
| 413 |
+
To obtain training data for training the tag language model, we run the Twitter POS tagger from Owoputi et al. (2013) on a dataset of 303K randomly-sampled English tweets. We train the tag language model on 300K tweets and use the remaining 3K for tuning hyperparameters and early stopping. We train an LSTM language model on the tag sequences using stochastic gradient descent with momentum and early stopping on the validation set. We used a dropout rate of 0.5 for the LSTM hidden layer. We tune the learning rate $( \{ 0 . 1 , 0 . 2 , 0 . 5 , 1 . 0 \} )$ , the number of LSTM layers $( \{ 1 , 2 \} )$ , and the hidden layer size $( \{ 5 0 , 1 0 0 , 2 0 0 \} )$ ).
|
| 414 |
+
|
| 415 |
+
Table 10 shows examples in which our SPEN that includes the TLM appears to be using broader context when making tagging decisions. These are examples from the test set labeled by two models: the SPEN without the TLM (which achieves $8 9 . 6 \%$ accuracy, as shown in Table 5) and the SPEN with the TLM (which reaches $9 0 . 2 \%$ accuracy). In example 1, the token “that” is predicted to be a determiner based on local context, but is correctly labeled a pronoun when using the TLM. This example is difficult because of the noun/verb tag ambiguity of the next word (“count”) and its impact on the tag for “that”. Examples 2 and 3 show two corrections for the token “like”, which is a highly ambiguous word in Twitter POS tagging. The broader context makes it much clearer which tag is intended.
|
| 416 |
+
|
| 417 |
+
The next two examples (4 and 5) are cases of noun/verb ambiguity that are resolvable with larger context. The last four examples show improvements for nonstandard word forms. The shortened form of “had” (example 6) is difficult to tag due to its collision with “HD” (high-definition), but the model with the TLM is able to tag it correctly. In example 7, the ambiguous token “b” is frequently used as a short form of “be” on Twitter, and since it comes after “to” in this context, the verb interpretation is encouraged. However, the broader context makes it clear that it is not a verb and the TLM-enriched model tags it correctly. The words in the last two examples are nonstandard word forms that were not observed in the training data, which is likely the reason for their erroneous predictions. When using the TLM, we can better handle these rare forms based on the broader context.
|
| 418 |
+
|
| 419 |
+
Table 11: Named entity recognition F1 of BLSTM, CRF, and SPEN (InfNet) with slack-rescaled hinge where inference networks used cross entropy stabilization term. Though slowest to train, the SPEN matches the test-time speed of the BLSTM while improving F1 by 2 points, though it lags behind the CRF.
|
| 420 |
+
|
| 421 |
+
<table><tr><td></td><td>validation F1</td><td>test F1</td><td>training speed (examples/sec)</td><td>testing speed (examples/sec)</td></tr><tr><td>BLSTM</td><td>88.30</td><td>83.02</td><td>385</td><td>1042</td></tr><tr><td>CRF</td><td>91.31</td><td>87.15</td><td>222</td><td>454</td></tr><tr><td>SPEN (InfNet)</td><td>89.98</td><td>85.06</td><td>118</td><td>1025</td></tr></table>
|
| 422 |
+
|
| 423 |
+
# 9.2.3 LEARNED PAIRWISE POTENTIAL MATRIX
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
Figure 1: Learned pairwise potential matrix for Twitter POS tagging.
|
| 427 |
+
|
| 428 |
+
Figure 1 shows the learned pairwise potential matrix $W$ in Twitter POS tagging. We can see strong correlations between labels in neighborhoods. For example, an adjective (A) is more likely to be followed by a noun (N) than a verb (V) (see row labeled “A” in the figure).
|
| 429 |
+
|
| 430 |
+
# 9.3 NAMED ENTITY RECOGNITION
|
| 431 |
+
|
| 432 |
+
For named entity recognition (NER), we perform experiments on the English data from the CoNLL 2003 shared task (Tjong Kim Sang & De Meulder, 2003). This task contains sentences annotated with named entities and their types, containing 14987 training sentences, 3466 in the development set, and 3684 in the test set. There are four named entity types: PERSON, LOCATION, ORGANIZATION, and MISC. We use the BIOES tagging scheme instead of the original BIO2, following prior work (Ratinov & Roth, 2009; Ma & Hovy, 2016). There are $L = 1 7$ classes. We use 100-dimensional pretrained GloVe (Pennington et al., 2014) embeddings trained on 6 billion words from Wikipedia and web text, which work better than other pretrained embeddings (Ma & Hovy, 2016).
|
| 433 |
+
|
| 434 |
+
Results are shown in Table 11. We see a large 4-point gap between the BLSTM and CRF, suggesting the importance of structured information for this problem. Though the SPEN still lags behind the CRF in F1, it matches the test-time speed of the BLSTM while improving F1 by 2 points.
|
md/train/H1e8wsCqYX/H1e8wsCqYX.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Laplacian Networks: Bounding Indicator Function Smoothness for Neural Networks Robustness
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
For the past few years, Deep Neural Network (DNN) robustness has become a question of paramount importance. As a matter of fact, in sensitive settings misclassification can lead to dramatic consequences. Such misclassifications are likely to occur when facing adversarial attacks, hardware failures or limitations, and imperfect signal acquisition. To address this question, authors have proposed different approaches aiming at increasing the robustness of DNNs, such as adding regularizers or training using noisy examples. In this paper we propose a new regularizer built upon the Laplacian of similarity graphs obtained from the representation of training data at each layer of the DNN architecture. This regularizer penalizes large changes (across consecutive layers in the architecture) in the distance between examples of different classes, and as such enforces smooth variations of the class boundaries. Since it is agnostic to the type of deformations that are expected when predicting with the DNN, the proposed regularizer can be combined with existing ad-hoc methods. We provide theoretical justification for this regularizer and demonstrate its effectiveness to improve robustness of DNNs on classical supervised learning vision datasets.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep Neural Networks (DNNs) provide state-of-the-art performance in many challenges in machine learning (He et al., 2016; Wu et al., 2016). Their ability to achieve good generalization is often explained by the fact they use very few priors about data (LeCun et al., 2015). On the other hand, their strong dependency on data may lead to focus on biased features of the training dataset, resulting in a nonrobust classification performance.
|
| 12 |
+
|
| 13 |
+
In the literature, authors have been interested in studying the robustness of DNNs in various conditions. These conditions include:
|
| 14 |
+
|
| 15 |
+
• Robustness to isotropic noise, i.e., small isotropic variations of the input (Mallat, 2016), typically meaning that the network function leads to a small Lipschitz constant.
|
| 16 |
+
Robustness to adversarial attacks, which can exploit knowledge about the network parameters or the training dataset (Szegedy et al., 2013; Goodfellow et al., 2014).
|
| 17 |
+
• Robustness to implementation defects, which can result in only approximately correct computations (Hubara et al., 2017).
|
| 18 |
+
|
| 19 |
+
To improve DNN robustness, three main families of solutions have been proposed in the literature. The first one involves enforcing smoothness, as measured by a Lipschitz constant, in the operators and having a minimum separation margin (Mallat, 2016). A similar approach has been proposed in (Cisse et al., 2017), where the authors restrict the function of the network to be contractive. A second class of methods use intermediate representations obtained at various layers to perform the prediction (Papernot and McDaniel, 2018). Finally, in (Kurakin et al., 2016; Pezeshki et al., 2016; Madry et al., 2018), the authors propose to train the network using noisy inputs so that it better generalizes to this type of noise. This has been shown to improve the robustness of the network to the specific type of noise used during training, but it is not guaranteed that this robustness would be extended to other types of deformations.
|
| 20 |
+
|
| 21 |
+
In this work, we introduce a new regularizer that does not focus on a specific type of deformation, but aims at increasing robustness in general. As such, the proposed regularizer can be combined with other existing methods. It is inspired by recent developments in Graph Signal Processing (GSP) (Shuman et al., 2013). GSP is a mathematical framework that extends classical Fourier analysis to complex topologies described by graphs, by introducing notions of frequency for signals defined on graphs. Thus, signals that are smooth on the graph (i.e., change slowly from one node to its neighbors) will have most of their energy concentrated in the low frequencies.
|
| 22 |
+
|
| 23 |
+
The proposed regularizer is based on constructing a series of graphs, one for each layer of the DNN architecture, where each graph captures the similarity between all training examples given their intermediate representation at that layer. Our proposed regularizer penalizes large changes in the smoothness of class indicator vectors (viewed here as graph signals) from one layer to the next. As a consequence, the distances between pairs of examples in different classes are only allowed to change slowly from one layer to the next. Note that because we use deep architectures, the regularizer does not prevent the smoothness from achieving its maximum value, but constraining the size of changes from layer to layer increases the robustness of the network function by controlling the distance to the boundary region, as supported by experiments in Section 4.
|
| 24 |
+
|
| 25 |
+
The outline of the paper is as follows. In Section 2 we present related work. In Section 3 we introduce the proposed regularizer. In Section 4 we evaluate the performance of our proposed method in various conditions and on vision benchmarks. Section 5 summarizes our conclusions.
|
| 26 |
+
|
| 27 |
+
# 2 Related work
|
| 28 |
+
|
| 29 |
+
DNN robustness may refer to many different problems. In this work we are mostly interested in the stability to deformations (Mallat, 2016), or noise, which can be due to multiple factors mentioned in the introduction. The most studied stability to deformations is in the context of adversarial attacks. It has been shown that very small imperceptible changes on the input of a trained DNN can result in missclassification of the input (Szegedy et al., 2013; Goodfellow et al., 2014). These works have been primordial to show that DNNs may not be as robust to deformations as the test accuracy benchmarks would have lead one to believe. Other works, such as (Recht et al., 2018), have shown that DNNs may also suffer from drops in performance when facing deformations that are not originated from adversarial attacks, but simply by re-sampling the test images.
|
| 30 |
+
|
| 31 |
+
Multiple ways to improve robustness have been proposed in the literature. They range from the use of a model ensemble composed of $k$ -nearest neighbors classifiers for each layer (Papernot and McDaniel, 2018), to the use of distillation as a mean to protect the network (Papernot et al., 2016a). Other methods introduce regularizers (Gu and Rigazio, 2014), control the Lipschitz constant of the network function (Cisse et al., 2017) or implement multiple strategies revolving around using deformations as a data augmentation procedure during the training phase (Goodfellow et al., 2014; Kurakin et al., 2016; Moosavi Dezfooli et al., 2016).
|
| 32 |
+
|
| 33 |
+
Compared to these works, our proposed method can be viewed as a regularizer that penalizes large deformations of the class boundaries throughout the network architecture, instead of focusing on a specific deformation of the input. As such, it can be combined with other mentioned strategies. Indeed, we demonstrate that the proposed method can be implemented in combination with (Cisse et al., 2017), resulting in a network function such that small variations to the input lead to small variations in the decision, as in (Cisse et al., 2017), while limiting the amount of change to the class boundaries. Note that our approach does not require using training data affected by a specific deformation, and our results could be further improved if such data were available for training, as shown in the Appendix.
|
| 34 |
+
|
| 35 |
+
As for combining GSP and machine learning, this area has sparked interest recently. For example, the authors of (Gripon et al., 2018) show that it is possible to detect overfitting by tracking the evolution of the smoothness of a graph containing only training set examples. Another example is in (Anirudh et al., 2017) where the authors introduce different quantities related to GSP that can be used to extract interpretable results from DNNs. In (Svoboda et al., 2018) the authors exploit graph convolutional layers (Bronstein et al., 2017) to increase the robustness of the network.
|
| 36 |
+
|
| 37 |
+
To the best of our knowledge, this is the first use of graph signal smoothness as a regularizer for deep neural network design.
|
| 38 |
+
|
| 39 |
+
# 3 Methodology
|
| 40 |
+
|
| 41 |
+
# 3.1 Similarity preset and postset graphs
|
| 42 |
+
|
| 43 |
+
Consider a deep neural network architecture. Such a network is obtained by assembling layers of various types. Of particular interest are layers of the form $\mathbf { x } ^ { \ell } \mapsto \mathbf { x } ^ { \ell + 1 } = h ^ { \ell } ( \mathbf { W } ^ { \ell } \mathbf { x } ^ { \ell } + \mathbf { b } ^ { \ell } )$ , where $h ^ { \ell }$ is a nonlinear function, typically a ReLU, $\mathbf { W } ^ { \ell }$ is the weight tensor at layer $\ell$ , $\mathbf { x } ^ { \ell }$ is the intermediate representation of the input at layer $\ell$ and $\mathbf { b } ^ { \ell }$ is the corresponding bias tensor. Note that strides or pooling may be used. Assembling can be achieved in various ways: composition, concatenation, sums. . . so that we obtain a global function $f$ that associates an input tensor $\mathbf { x } ^ { 0 }$ to an output tensor $\mathbf { y } = f ( \mathbf { x } ^ { 0 } )$ .
|
| 44 |
+
|
| 45 |
+
When computing the output $\mathbf { y }$ associated with the input $\mathbf { x } ^ { 0 }$ , each layer $\ell$ of the architecture processes some input $\mathbf { x } ^ { \ell }$ and computes the corresponding output $\mathbf { y } ^ { \ell } = h ^ { \ell } ( \mathbf { W } ^ { \ell } \mathbf { x } ^ { \ell } + \mathbf { b } ^ { \ell } )$ For a given layer $\ell$ and a batch of $b$ inputs $\mathcal { X } = \{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { b } \}$ , we can obtain two sets $\mathcal { X } ^ { \ell } = \{ \mathbf { x } _ { 1 } ^ { \ell } , \ldots , \mathbf { x } _ { b } ^ { \ell } \}$ , called the preset, and $\mathcal { V } ^ { \ell } = \{ \mathbf { y } _ { 1 } ^ { \ell } , \ldots , \mathbf { y } _ { b } ^ { \ell } \}$ , called the postset.
|
| 46 |
+
|
| 47 |
+
Given a similarity measure $s$ on tensors, from a preset we can build the similarity preset matrix: $\mathbf { M } _ { p r e } ^ { \ell } [ i , j ] = s ( \mathbf { x } _ { i } ^ { \ell } , \mathbf { x } _ { j } ^ { \ell } ) , \forall 1 \le i , j \le b$ , where $\mathbf { M } [ i , j ]$ denotes the element at line $i$ and column $j$ in $\mathbf { M }$ . The postset matrix is defined similarly.
|
| 48 |
+
|
| 49 |
+
Consider a similarity (either preset or postset) matrix $\mathbf { M } ^ { \ell }$ . This matrix can be used to build a $k$ -nearest neighbor similarity weighted graph $G ^ { \ell } = \langle V , \mathbf { A } ^ { \ell } \rangle$ , where $V = \{ 1 , \ldots , b \}$ is the set of vertices and $\mathbf { A } ^ { \ell }$ is the weighted adjacency matrix defined as:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r } { \mathbf { A } ^ { \ell } [ i , j ] = \left\{ \begin{array} { l l } { \mathbf { M } ^ { \ell } [ i , j ] } & { \mathrm { i f } \ \mathbf { M } ^ { \ell } [ i , j ] \in \mathrm { a r g } \operatorname* { m a x } _ { i ^ { \prime } \neq j } \big ( \mathbf { M } ^ { \ell } [ i ^ { \prime } , j ] , k \big ) } \\ & { \big \downarrow \mathrm { a r g } \operatorname* { m a x } _ { j ^ { \prime } \neq i } \big ( \mathbf { M } ^ { \ell } [ i , j ^ { \prime } ] , k \big ) } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right. , \forall i , j \in V , } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where arg $\operatorname* { m a x } _ { i } ( a _ { i } , k )$ denotes the indices of the $k$ largest elements in $\{ a _ { 1 } , \ldots , a _ { b } \}$ . Note that by construction $\mathbf { A } ^ { \ell }$ is symmetric.
|
| 56 |
+
|
| 57 |
+
# 3.2 Smoothness of label signals
|
| 58 |
+
|
| 59 |
+
Given a weighted graph $G ^ { \ell } = \langle V , \mathbf { A } ^ { \ell } \rangle$ , we call Laplacian of $G ^ { \ell }$ the matrix $\mathbf { L } ^ { \ell } = \mathbf { D } ^ { \ell } - \mathbf { A } ^ { \ell }$ , where $\mathbf { D } ^ { \ell }$ is the diagonal matrix such that: $\begin{array} { r } { \mathbf { D } ^ { \ell } [ i , i ] = \sum _ { j } \mathbf { A } ^ { \ell } [ i , j ] , \forall i \in V } \end{array}$ . Because $\mathbf { L } ^ { \ell }$ is symmetric and real-valued, it can be written:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf { L } ^ { \ell } = \mathbf { F } ^ { \ell } \mathbf { A } ^ { \ell } \mathbf { F } ^ { \ell \top } ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\mathbf { F }$ is orthonormal and contains eigenvectors of $\mathbf { L } ^ { \ell }$ as columns, $\mathbf { F } ^ { \top }$ denotes the transpose of $\mathbf { F }$ , and $\pmb { \Lambda }$ is diagonal and contains eigenvalues of $\mathbf { L } ^ { \ell }$ is ascending order. Note that the constant vector $\mathbf { 1 } \in \mathbb { R } ^ { b }$ is an eigenvector of $\mathbf { L } ^ { \ell }$ corresponding to eigenvalue 0. Moreover, all√ eigenvalues of $\mathbf { L } ^ { \ell }$ are nonnegative. Consequently, $\mathbf { 1 } / \sqrt { n }$ can be chosen as the first column in $\mathbf { F }$ .
|
| 66 |
+
|
| 67 |
+
Consider a vector $\mathbf { s } \in \mathbb { R } ^ { b }$ , we define $\hat { \bf S }$ the Graph Fourier Transform (GFT) of s on $G ^ { \ell }$ as (Shuman et al., 2013):
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\hat { \mathbf { s } } = \mathbf { F } ^ { \top } \mathbf { s } .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Because the order of the eigenvectors is chosen so that the corresponding eigenvalues are in ascending order, if only the first few entries of $\hat { \bf s }$ are nonzero that indicates that s is low frequency (smooth). In the extreme case where only the first entry of $\hat { \bf s }$ is nonzero we have that $\mathbf { s }$ is constant (maximum smoothness). More generally, smoothness $\sigma ^ { \ell } ( \mathbf { s } )$ of a signal s can be measured using the quadratic form of the Laplacian:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\sigma ^ { \ell } ( \mathbf { s } ) = \mathbf { s } ^ { \top } \mathbf { L } ^ { \ell } \mathbf { s } = \sum _ { i , j = 1 } ^ { b } \mathbf { A } ^ { \ell } [ i , j ] ( \mathbf { s } [ i ] - \mathbf { s } [ j ] ) ^ { 2 } = \sum _ { i = 1 } ^ { b } \mathbf { A } ^ { \ell } [ i , i ] \hat { \mathbf { s } } [ i ] ^ { 2 } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where we note that $\mathbf { s }$ is smoother when $\sigma ^ { \ell } ( \mathbf { s } )$ is smaller.
|
| 80 |
+
|
| 81 |
+
In this paper we are particularly interested in smoothness of the label signals. We call label signal $\mathbf { s } _ { c }$ associated with class $c$ a binary $( \{ 0 , 1 \} )$ vector whose nonzero coordinates are the ones corresponding to input vectors of class $c$ . In other words, $\mathbf { s } _ { c } [ i ] = 1 \Leftrightarrow ( \mathbf { x } _ { i }$ is in class $c ) , \forall 1 \leq i \leq b$ . Using Equation (4), we obtain that the smoothness of the label signal $\mathbf { s } _ { c }$ is the sum of similarities between examples in distinct classes. Thus a smoothness of 0 means that examples in distinct classes have 0 similarity.
|
| 82 |
+
|
| 83 |
+
Denote $u$ the last layer of the architecture: $\mathbf { y } _ { i } ^ { u } = \mathbf { y } _ { i } , \forall i$ . Note that in typical settings, where outputs of the networks are one-hot-bit encoded and no regularizer is used, at the end of the learning process it is expected that $\mathbf { y } _ { i } ^ { \top } \mathbf { y } _ { j } \approx 1$ if $i$ and $j$ belong to the same class, and $\mathbf { y } _ { i } ^ { \top } \mathbf { y } _ { j } \approx 0$ otherwise.
|
| 84 |
+
|
| 85 |
+
Thus, assuming that cosine similarity is used to build the graph, the last layer smoothness for all $c$ would be $\sigma _ { p o s t } ^ { u } ( \mathbf { s } _ { c } ) \approx 0$ , since edge weights between nodes having different labels will be close to zero given Equation (4). More generally, smoothness of ${ \bf s } _ { c }$ at the preset or postset of a given layer measures the average similarity between examples in class $c$ and examples in other classes ( $\sigma ( \mathbf { s } _ { c } )$ decreases as the weights of edges connecting nodes in different classes decrease). Because the last layer can achieve $\sigma ( \mathbf { s } _ { c } ) \approx 0$ , we expect the smoothness metric $\sigma$ at each layer to decrease as we go deeper in the network. Next we introduce a regularization strategy that limits how much $\sigma$ can decrease from one layer to the next and can even prevent the last layer from achieving $\sigma ( \mathbf { s } _ { c } ) = 0$ . This will be shown to improve generalization and robustness. The theoretical motivation for this choice is discussed in Section 3.4.
|
| 86 |
+
|
| 87 |
+
# 3.3 Proposed regularizer
|
| 88 |
+
|
| 89 |
+
# 3.3.1 Definition
|
| 90 |
+
|
| 91 |
+
We propose to measure the deformation induced by a given layer $\ell$ in the relative positions of examples by computing the difference between label signal smoothness before and after the layer, averaged over all labels:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\delta _ { \sigma } ^ { \ell } = \left| \sum _ { c } \left[ \sigma _ { p o s t } ^ { \ell } ( \mathbf { s } _ { c } ) - \sigma _ { p r e } ^ { \ell } ( \mathbf { s } _ { c } ) \right] \right| .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
These quantities are used to regularize modifications made to each of the layers during the learning process.
|
| 98 |
+
|
| 99 |
+
Remark 1: Since we only consider label signals, we solely depend on the similarities between examples that belong to distinct classes. In other words, the regularizer only focuses on the boundary region, and does not vary if the distance between examples of the same label grows or shrinks. This is because forcing similarities between examples of a same class to evolve slowly could prevent the network to train appropriately.
|
| 100 |
+
|
| 101 |
+
Remark 2: Compared with (Cisse et al., 2017), there are three key differences that characterize the proposed regularizer:
|
| 102 |
+
|
| 103 |
+
1. Not all pairwise distances are taken into account in the regularization; only distances between examples corresponding to different classes play a role in the regularization. 2. We allow a limited amount of both contraction and dilation of the metric space. Experimental work (e.g. (Gripon et al., 2018; Papernot and McDaniel, 2018)) has shown that the evolution of metric spaces across DNN layers is complex, and thus restricting ourselves to contractions only could lead to lower overall performance.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 1: Illustration of the effect of our proposed regularizer. In this example, the goal is to classify circles and crosses (top). Without use of regularizers (bottom left), the resulting embedding may considerably stretch the boundary regions (as illustrated by the irregular spacing between the tics). Forcing small variations of smoothness of label signals (bottom right), we ensure the topology is not dramatically changed in the boundary regions.
|
| 107 |
+
|
| 108 |
+
3. The proposed criterion is an average (sum) over all distances, rather than a stricter criterion (e.g. Lipschitz), which would force each pair of vectors $\left( \mathbf { x } _ { i } , \mathbf { x } _ { j } \right)$ to obey the constraint.
|
| 109 |
+
|
| 110 |
+
# Illustrative example:
|
| 111 |
+
|
| 112 |
+
In Figure 1 we depict a toy illustrative example to motivate the proposed regularizer. We consider here a one-dimensional two-class problem. To linearly separate circles and crosses, it is necessary to group all circles. Without regularization (setting i)), the resulting embedding is likely to increase considerably the distance between examples and the size of the boundary region between classes. In contrast, by penalizing large variations of the smoothness of label signals (setting ii)), the average distance between circles and crosses must be preserved in the embedding domain, resulting in a more precise control of distances within the boundary region.
|
| 113 |
+
|
| 114 |
+
# 3.4 Motivation: label signal bandwidth and powers of the Laplacian
|
| 115 |
+
|
| 116 |
+
Recent work (Anis et al., 2017) develops an asymptotic analysis of the bandwidth of label signals, $B W ( \mathbf { s } )$ , where bandwidth is defined as the highest non-zero graph frequency of $\mathbf { s }$ , i.e., the nonzero entry of $\hat { \bf S }$ with the highest index. An estimate of the bandwidth can be obtained by computing:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
B W _ { m } ( \mathbf { s } ) = \left( \frac { \mathbf { s } ^ { \top } \mathbf { L } ^ { m } \mathbf { s } } { \mathbf { s } ^ { \top } \mathbf { s } } \right) ^ { ( 1 / m ) }
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
for large $m$ . This can be viewed as a generalization of the smoothness metric of (4). (Anis et al., 2017) shows that, as the number of labeled points $\mathbf { x }$ (assumed drawn from a distribution $p ( \mathbf { x } )$ ) grows asymptotically, the bandwidth of the label signal converges in probability to the supremum of $p ( \mathbf { x } )$ in the region of overlap between classes. This motivates our work in three ways.
|
| 123 |
+
|
| 124 |
+
First, it provides theoretical justification to use $\sigma ^ { \ell } ( \mathbf { s } )$ for regularization, since lower values of $\sigma ^ { \ell } ( \mathbf { s } )$ are indicative of better separation between classes. Second, the asymptotic analysis suggests that using higher powers of the Laplacian would lead to better regularization, since estimating bandwidth using $B W _ { m } ( \mathbf { s } )$ becomes increasingly accurate as $m$ increases. Finally, this regularization can be seen to be protective against specializing by preventing $\sigma ^ { \ell } ( \mathbf { s } )$
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: Sample of a Laplacian and squared Laplacian of similarity graphs in a trained vanilla architecture. Examples of the batch have been ordered so that those belonging to a same class are consecutive. Dark values correspond to high similarity.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 3: Evolution of smoothness of label signals as a function of layer depth, and for various regularizers and choice of $m$ , the power of the Laplacian matrix.
|
| 131 |
+
|
| 132 |
+
from decreasing “too fast”. For most problems of interest, given a sufficiently large amount of labeled data available, it would be reasonable to expect the bandwidth of s not to be arbitrarily small, because the classes cannot be exactly separated, and thus a network that reduces the bandwidth too much can result in being biased by the training set.
|
| 133 |
+
|
| 134 |
+
# 3.5 Analysis of the Laplacian powers
|
| 135 |
+
|
| 136 |
+
In Figure 2 we depict the Laplacian and squared Laplacian of similarity graphs obtained at different layers in a trained vanilla architecture. On the deep layers, we can clearly see blocks corresponding to the classes, while the situation in the middle layer is not as clear. This figure illustrates how using the squared Laplacian helps modifying the distances to improve separation. Note that we normalize the squared Laplacian values by dividing them by the highest absolute value.
|
| 137 |
+
|
| 138 |
+
In Figure 3, we plot the average evolution of smoothness of label signals over 100 batches, as a function of layer depth in the architecture, and for different choices of the regularizer. In the left part, we look at smoothness measures using the Laplacian. In the right part, we use the squared Laplacian. We can clearly see the effectiveness of the regularizer in enforcing small variations of smoothness across the architecture. Note that for model regularized with $\mathbf { L } ^ { 2 }$ , changes in smoothness measured by $\mathbf { L }$ are not easy to see. This seems to suggest that some of the gains achieved via $\mathbf { L } ^ { 2 }$ regularization come in making changes that would be “invisible” when looking at the layers from the perspective of $\mathbf { L }$ smoothness. The same normalization from Figure 2 is used for $\mathbf { L } ^ { 2 }$ .
|
| 139 |
+
|
| 140 |
+
# 4 Experiments
|
| 141 |
+
|
| 142 |
+
In the following paragraphs we evaluate the proposed method using various tests. We use the well known CIFAR-10 (Krizhevsky and Hinton, 2009) dataset made of tiny images. As far as the DNN is concerned, we use the same PreActResNet (He et al., 2016) architecture for all tests, with 18 layers. All inputs, including those on the test set, are normalized based on the mean and standard deviation of the images of the training set. In all figures, P are
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 4: Test set accuracy under Gaussian noise with varying signal-to-noise ratio.
|
| 146 |
+
|
| 147 |
+
Parseval trained networks, R are networks trained with the proposed regularizer and V are vanilla networks. More details and experiments can be found at the Appendix.
|
| 148 |
+
|
| 149 |
+
We depict the obtained results using box plots where data is aggregated from 10 different networks corresponding to different random seeds and batch orders. In the first experiment (left most plot) in Figure 4, we plot the baseline accuracy of the models on the clean test set (no deformation is added at this point). These experiments agree with the claim from (Cisse et al., 2017) where the authors show that they are able to increase the performance of the network on the clean test set. We observe that our proposed method leads to a minor decrease of performance on this test. However, we see in the following experiments that this is mitigated with increased robustness to deformations. Such a trade-off between robustness and accuracy has already been discussed in the literature (Fawzi et al., 2018).
|
| 150 |
+
|
| 151 |
+
# 4.1 Isotropic deformation
|
| 152 |
+
|
| 153 |
+
In this scenario we evaluate the robustness of the network function to small isotropic variations of the input. We generate 40 different deformations using random variables $\mathcal { N } ( 0 , 0 . 2 5 )$ which are added to the test set inputs. Note that they are scaled so that $S N R \approx 1 5$ and $S N R \approx 2 0$ . The middle and right-most plots from Figure 4 show that the proposed method increases the robustness of the network to isotropic deformations. Note that in both scenarios the best results are achieved by combining Parseval training and our proposed method (lower-most box on both figures).
|
| 154 |
+
|
| 155 |
+
# 4.2 Adversarial Robustness
|
| 156 |
+
|
| 157 |
+
We next evaluate robustness to adversarial inputs, which are specifically built to fool the network function. Such adversarial inputs can be generated and evaluated in multiple ways. Here we implement two approaches: first a mean case of adversarial noise, where the adversary can only use one forward and one backward pass to generate the deformations, and second a worst case scenario, where the adversary can use multiple forward and backward passes to try to find the smallest deformation that will fool the network.
|
| 158 |
+
|
| 159 |
+
For the first approach, we add the scaled gradient sign (FGSM attack) on the input (Kurakin et al., 2016), so that we obtain a target $S N R = 3 3$ . Results are depicted in the left and center plots of Figure 5. In the left plot the noise is added after normalizing the input whereas on the middle plot it is added before normalizing. As in the isotropic noise case, a combination of the Parseval method and our proposed approach achieves maximum robustness.
|
| 160 |
+
|
| 161 |
+
In regards to the second approach, where a worst case scenario is considered, we use the Foolbox toolbox (Rauber et al., 2017) implementation of DeepFool (Moosavi Dezfooli et al., 2016). Due to time constraints we sample only conclusions are similar (right plot of Figure 5) $\frac { 1 } { 1 0 }$ of the test set images for this test. The those obtained for the first adversarial attack approach.
|
| 162 |
+
|
| 163 |
+
# 4.3 Implementation robustness
|
| 164 |
+
|
| 165 |
+
Finally, in a third series of experiments we evaluate the robustness of the network functions to faulty implementations. As a result, approximate computations are made during the test phase that consist of random erasures of the memory (dropout) or quantization of the weights (Hubara et al., 2017).
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 5: Robustness against an adversary measured by the test set accuracy under FGSM attack in the left and center plots and by the mean $\mathcal { L } _ { 2 }$ pixel distance needed to fool the network using DeepFool on the right plot.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 6: Test set accuracy under different types of implementation related noise.
|
| 172 |
+
|
| 173 |
+
In the dropout case, we compute the test set accuracy when the network has a probability of either $2 5 \%$ or $4 0 \%$ of dropping a neuron’s value after each block. We run each experiment 40 times. The results are depicted in the left and center plots of Figure 6. It is interesting to note that the Parseval trained functions seem to drop in performance as soon as we reach $4 0 \%$ probability of dropout, providing an average accuracy smaller than the vanilla networks. In contrast, the proposed method is the most robust to these perturbations.
|
| 174 |
+
|
| 175 |
+
For the quantization of the weights, we consider a scenario where the network size in memory has to be shrink 6 times. We therefore quantize the weights of the networks to 5 bits (instead of 32) and re-evaluate the test set accuracy. The right plot of Figure 6 shows that the proposed method is providing a better robustness to this kind of deformation than the tested counterparts.
|
| 176 |
+
|
| 177 |
+
# 5 Conclusion
|
| 178 |
+
|
| 179 |
+
In this paper we have introduced a new regularizer that enforces small variations of the smoothness of label signals on similarity graphs obtained at intermediate layers of a deep neural network architecture. We have empirically shown with our tests that it can lead to improved robustness in various conditions compared to existing counterparts. We also demonstrated that combining the proposed regularizer with existing methods can result in even better robustness for some conditions.
|
| 180 |
+
|
| 181 |
+
Future work includes a more systematic study of the effectiveness of the method with regards to other datasets, models and deformations. Recent works shown adversarial noise is partially transferable between models and dataset (Moosavi-Dezfooli et al., 2017; Papernot et al., 2016b) and therefore we are confident about the generality of the method in terms of models and datasets.
|
| 182 |
+
|
| 183 |
+
One possible extension of the proposed method is to use it in a fine-tuning stage, combined with different techniques already established on the literature. An extension using a combination of input barycenter and class barycenter signals instead of the class signal could be interesting as that would be comparable to (Zhang et al., 2017). In the same vein, using random signals could be beneficial for semi-supervised or unsupervised learning challenges.
|
| 184 |
+
|
| 185 |
+
# References
|
| 186 |
+
|
| 187 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016.
|
| 188 |
+
|
| 189 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 190 |
+
|
| 191 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 192 |
+
|
| 193 |
+
Stéphane Mallat. Understanding deep convolutional networks. Phil. Trans. R. Soc. A, 374 (2065):20150203, 2016.
|
| 194 |
+
|
| 195 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 196 |
+
|
| 197 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 198 |
+
|
| 199 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. Journal of Machine Learning Research, 18:187–1, 2017.
|
| 200 |
+
|
| 201 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning, pages 854–863, 2017.
|
| 202 |
+
|
| 203 |
+
Nicolas Papernot and Patrick D. McDaniel. Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. CoRR, abs/1803.04765, 2018. URL http://arxiv. org/abs/1803.04765.
|
| 204 |
+
|
| 205 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 206 |
+
|
| 207 |
+
Mohammad Pezeshki, Linxi Fan, Philemon Brakel, Aaron Courville, and Yoshua Bengio. Deconstructing the ladder network architecture. In International Conference on Machine Learning, pages 2368–2376, 2016.
|
| 208 |
+
|
| 209 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=rJzIBfZAb.
|
| 210 |
+
|
| 211 |
+
David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30(3):83–98, 2013.
|
| 212 |
+
|
| 213 |
+
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do cifar-10 classifiers generalize to cifar-10? arXiv preprint arXiv:1806.00451, 2018.
|
| 214 |
+
|
| 215 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pages 582–597. IEEE, 2016a.
|
| 216 |
+
|
| 217 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
|
| 218 |
+
|
| 219 |
+
Seyed Mohsen Moosavi Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 220 |
+
|
| 221 |
+
Vincent Gripon, Antonio Ortega, and Benjamin Girault. An inside look at deep neural networks using graph signal processing. In Proceedings of ITA, February 2018.
|
| 222 |
+
|
| 223 |
+
Rushil Anirudh, Jayaraman J Thiagarajan, Rahul Sridhar, and Timo Bremer. Influential sample selection: A graph signal processing approach. arXiv preprint arXiv:1711.05407, 2017.
|
| 224 |
+
|
| 225 |
+
Jan Svoboda, Jonathan Masci, Federico Monti, Michael M Bronstein, and Leonidas Guibas. Peernets: Exploiting peer wisdom against adversarial attacks. arXiv preprint arXiv:1806.00088, 2018.
|
| 226 |
+
|
| 227 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
|
| 228 |
+
|
| 229 |
+
Aamir Anis, Aly El Gamal, Salman Avestimehr, and Antonio Ortega. A sampling theory perspective of graph-based semi-supervised learning. arXiv preprint arXiv:1705.09518, 2017.
|
| 230 |
+
|
| 231 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. https://www.cs.toronto.edu/ kriz/learning-features-2009-TR.pdf, 2009.
|
| 232 |
+
|
| 233 |
+
Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Analysis of classifiers’ robustness to adversarial perturbations. Machine Learning, 107(3):481–508, 2018.
|
| 234 |
+
|
| 235 |
+
Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017. URL http://arxiv.org/abs/1707.04131.
|
| 236 |
+
|
| 237 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. arXiv preprint, 2017.
|
| 238 |
+
|
| 239 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016b.
|
| 240 |
+
|
| 241 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 242 |
+
|
| 243 |
+
Jelena Kovačević and Amina Chebira. An introduction to frames. Foundations and Trends in Signal Processing, 2(1):1–94, 2008.
|
| 244 |
+
|
| 245 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks, 2016.
|
| 246 |
+
|
| 247 |
+
# A Parseval Training and implementation
|
| 248 |
+
|
| 249 |
+
We compare our results with those obtained using the method described in (Cisse et al., 2017). There are three modifications to the normal training procedure: orthogonality constraint, convolutional renormalization and convexity constraint.
|
| 250 |
+
|
| 251 |
+
For the orthogonality constraint we enforce Parseval tightness (Kovačević and Chebira, 2008) as a layer-wise regularizer:
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
R _ { \beta } ( W ^ { \ell } ) = \frac { \beta } { 2 } \| W ^ { \ell ^ { \top } } W ^ { \ell } - I \| _ { 2 } ^ { 2 } ,
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
where $W _ { \ell }$ is the weight tensor at layer $\ell$ . This function can be approximately optimized with gradient descent by doing the operation:
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
\begin{array} { r } { W ^ { \ell } \gets ( 1 + \beta ) W ^ { \ell } - \beta W ^ { \ell } W ^ { \ell \top } W ^ { \ell } . } \end{array}
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
Given that our network is smaller we can apply the optimization to the entirety of the $W$ , instead of $3 0 \%$ as per the original paper, this increases the strength of the Parseval tightness.
|
| 264 |
+
|
| 265 |
+
For the convolutional renormalization, each matrix $W ^ { \ell }$ is reparametrized before being applied to the convolution as $\frac { W ^ { \ell } } { \sqrt { 2 k _ { s } + 1 } }$ , where $k _ { s }$ is the kernel size.
|
| 266 |
+
|
| 267 |
+
For our architecture the inputs from a layer come from either one or two different layers. In the case where the inputs come from only one layer, $\alpha$ the convexity constraint parameter is set to 1. When the inputs come from the sum of two layers we use $\alpha = 0 . 5$ as the value for both of them, which constraints our Lipschitz constant, this is softer than the convexity constraint from the original paper.
|
| 268 |
+
|
| 269 |
+
# B Hyperparameters
|
| 270 |
+
|
| 271 |
+
We train our networks using classical stochastic gradient descent with momentum (0.9), with batch size of $b = 1 0 0$ images and using a L2-norm weight decay with a coefficient of $\lambda = 0 . 0 0 0 5$ . We do a 100 epoch training. Our learning rate starts at 0.1. After half of the training (50 epochs) the learning rate decreases to 0.001.
|
| 272 |
+
|
| 273 |
+
We use the mean of the difference of smoothness between successive layers in our loss function. Therefore in our loss function we have:
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\mathcal { L } = C a t e g o r i c a l C r o s s E n t r o p y + \lambda W e i g h t D e c a y + \gamma \Delta
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
where $\begin{array} { r } { \Delta = \frac { 1 } { d - 1 } \sum _ { \ell = 1 } ^ { d } | \delta _ { \sigma } ^ { \ell } | } \end{array}$ . We perform experiments using various powers of the Laplacian $m = 1 , 2 , 3$ , in which case the scaling coefficient $\gamma$ is put to the same power as the Laplacian.
|
| 280 |
+
|
| 281 |
+
We tested multiple parameters of $\beta$ , the Parseval tightness parameter, $\gamma$ the weight for the smoothness difference cost and $m$ the power of the Laplacian. We found that the best values for this specific architecture, dataset and training scheme were: $\beta = 0 . 0 1 , \gamma = 0 . 0 1 , m =$ $2 , k = b$ .
|
| 282 |
+
|
| 283 |
+
# C Depiction of the network
|
| 284 |
+
|
| 285 |
+
Figure 7 depicts the network used on all experiments of sections 3 and 4. $f = 6 4$ is the filter size of the first layer of the network. Conv layers are 3x3 layers and are always preceded by batch normalization and relu (except for the first layer which receives just the input). The smoothness gaps are calculated after each ReLU.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 7: Depiction of the studied network
|
| 289 |
+
|
| 290 |
+
# D Additional experiments
|
| 291 |
+
|
| 292 |
+
Given suggestions from the reviewers, we performed additional experiments to further demonstrate the capabilities of the proposed regularizer. Due to the lack of space they could not be added to the main paper. We consider the effects of the regularizer when applied on another datasets. We also consider the effects of adding adversarial data augmentation methods while minimizing the amount of other influencing factors. We first look at the results when using the same architecture as for the CIFAR-10 dataset, which inevitably results in far from state-of-the-art accuracy on CIFAR-100. Then, we perform experiments using a different architecture (namely WideResnet 28-10, with dropout) for CIFAR-100.
|
| 293 |
+
|
| 294 |
+
# D.1 CIFAR-10
|
| 295 |
+
|
| 296 |
+
We add two types of tests for the CIFAR-10 dataset: adversarial data augmentation during training and black-box FGSM.
|
| 297 |
+
|
| 298 |
+
# D.1.1 Tests with FGSM adversarial data augmentation
|
| 299 |
+
|
| 300 |
+
In this section we consider tests adding adversarial data augmentation as suggested in (Kurakin et al., 2016). To be more precise we use the method they advise which is called "step1.1" using $\begin{array} { r } { \epsilon = \frac { 8 } { 2 5 5 } } \end{array}$ . The results presented in the figures below are obtained by running 10 experiments with random initializations. We first perform the same tests as in Section 4.
|
| 301 |
+
|
| 302 |
+
As expected, we observe in Figure 8 that training with adversarial examples help in the case of Gaussian noise, as it adds more variation to the training set, while reducing the accuracy on the clean set. Note that combining our method with adversarial training results in the best median accuracy. Combining the three methods is less successful than expected, which could indicate that a better hyperparameter search would be needed.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 8: Test set accuracy under Gaussian noise with varying Signal-to-Noise Ratio (SNR). A is for Adversarial, $\mathrm { P }$ is for Parseval, R is for the proposed Regularizer and V is for Vanilla network.
|
| 306 |
+
|
| 307 |
+
Considering adversarial robustness, the obtained results are depicted in Figure 9. We observe that adding FGSM adversarial training does not generalize well to other types of attack (which is readily seen in the literature Madry et al. (2018)). Overall, the models using the proposed regularizer are the most robust.
|
| 308 |
+
|
| 309 |
+
Finally, when considering implementation related perturbations, the results depicted in Figure 10 are consistent with the ones from Section 4.3, in which is shown that the proposed regularizer helps improving robustness.
|
| 310 |
+
|
| 311 |
+
In summary, even when adding adversarial training, the proposed regularizer is either the most robust in median, or capable of improving the robustness when used combined with the other methods.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 9: Robustness against an adversary measured by the test set accuracy under FGSM attack in the left and center plots and by the mean $\mathcal { L } _ { 2 }$ pixel distance needed to fool the network using DeepFool on the right plot.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 10: Test set accuracy under different types of implementation related noise.
|
| 318 |
+
|
| 319 |
+
# D.1.2 Tests with black box FGSM
|
| 320 |
+
|
| 321 |
+
To further verify that the obtained results are not only due to gradient masking, we perform tests with black box FGSM, where the target attacked network is not the same as the source of the adversarial noise.
|
| 322 |
+
|
| 323 |
+
For this test we set the SNR of FGSM to 33. We chose the network with the best performance for each of the tested methods. The results are depicted in Table 1. In our experiments, we found that the combination of our method with Parseval is the most robust to noise coming from other sources, while the noise created by both Parseval and our method did not generalize as well as the one created by Vanilla. This demonstrates that the improvements are not caused by gradient masking, but are caused by the increased robustness of the proposed method and Parseval’s.
|
| 324 |
+
|
| 325 |
+
Table 1: Black box FGSM applied to the different methods. The most robust target for a given source is bolded, while the strongest source for a target is in italic.
|
| 326 |
+
|
| 327 |
+
<table><tr><td rowspan="2">Target</td><td colspan="4">Source</td></tr><tr><td>Vanilla</td><td>Parseval</td><td>Regularizer</td><td>Parseval +Regularizer</td></tr><tr><td>Vanilla</td><td>X</td><td>60.74</td><td>61.49</td><td>72.51</td></tr><tr><td>Parseval</td><td>57.82</td><td>X</td><td>68.21</td><td>73.87</td></tr><tr><td>Regularizer</td><td>69.72</td><td>74.96</td><td>X</td><td>73.56</td></tr><tr><td>Parseval + Regularizer</td><td>75.35</td><td>76.11</td><td>70.22</td><td>X</td></tr></table>
|
| 328 |
+
|
| 329 |
+
# D.1.3 Tests with PGD adversarial data augmentation
|
| 330 |
+
|
| 331 |
+
Most of our adversarial tests are performed with FGSM because of its simplicity and speed, even though it has already been shown (e.g: Madry et al. (2018)) that FGSM is weak as an attack and as a defense mechanism. Despite the fact we do not only target adversarial defense, we further stress the ability of the proposed regularizer to improve it and to combine with other methods. To this end we perform experiments against the PGD (Projected Gradient Descent) attack.
|
| 332 |
+
|
| 333 |
+
PGD is an iterative version of FGSM, which run for a maximum number of iterations $_ { i t }$ or until convergence. For each iteration it moves by a distance of step in the direction of the gradient provided it does not go at a distance greater than $\epsilon$ from the original image.
|
| 334 |
+
|
| 335 |
+
Our experiments show that the proposed regularizer increases robustness against a weak PGD attack (similar epsilon as our FGSM with SNR=33), but it is almost completely defeated by the PGD with the parameters from (Madry et al., 2018). The results are depicted in table 2. We also show that, as expected, FGSM training does not add significant robustness against the stronger PGD attack.
|
| 336 |
+
|
| 337 |
+
Table 2: Test set accuracy on the CIFAR-10 dataset against the PGD attack with different parameters.
|
| 338 |
+
|
| 339 |
+
<table><tr><td>Model</td><td>it = 20,step=0.002,∈= 0.01</td><td>it=20,step</td><td>2 二 255,∈=</td><td>8 255</td></tr><tr><td>Vanilla</td><td>0.95%</td><td></td><td>0.02%</td><td></td></tr><tr><td>Proposed Regularizer</td><td>11.18%</td><td></td><td>0.09%</td><td></td></tr><tr><td>FGSM</td><td>5.78%</td><td></td><td>0.09%</td><td></td></tr><tr><td>FGSM + Regularizer</td><td>12.91%</td><td></td><td>0.55%</td><td></td></tr></table>
|
| 340 |
+
|
| 341 |
+
As the proposed regularizer can be combined with FGSM defense, it is natural to also test it alongside PGD training. We use the parameters advised in (Madry et al., 2018): 7 iterations with $s t e p = 2 / 2 5 5$ , and $\epsilon = 8 / 2 5 5$ . The results depicted in Table 3 show that using our regularizer increases robustness of networks trained with PGD. Note that Dropout and Gaussian Noise were applied ten times to each of the networks and the results are displayed as the mean test set accuracy under these perturbations. A rate of $4 0 \%$ was used for dropout. The PGD attack uses the following parameters: $\begin{array} { r } { i t = 2 0 , s t e p = \frac { 2 } { 2 5 5 } , \epsilon = \frac { 8 } { 2 5 5 } } \end{array}$ ·
|
| 342 |
+
|
| 343 |
+
Table 3: Results on the CIFAR-10 with PGD training and the hyperparameters from Appendix B.
|
| 344 |
+
|
| 345 |
+
<table><tr><td>Robustness</td><td colspan="2">Isotropic</td><td>Adversarial</td><td>Implementation</td></tr><tr><td>Model/ /TestType</td><td>SNR≈8</td><td>SNR≈15</td><td>PGD</td><td>Dropout</td></tr><tr><td>PGD Training</td><td>76.39%</td><td>71.25%</td><td>32.78%</td><td>35.20%</td></tr><tr><td>PGD Training +Regularizer</td><td>76.36%</td><td>72.26%</td><td>33.72%</td><td>55.63%</td></tr></table>
|
| 346 |
+
|
| 347 |
+
# D.2 CIFAR-100
|
| 348 |
+
|
| 349 |
+
We test the generality of the method using the CIFAR-100 dataset. Results are shown in Table 4 as the mean over three different initializations. Dropout and Gaussian Noise are applied ten times to each of the networks for a total of 30 different runs. An SNR of 33 is used for FGSM, and a rate of $2 5 \%$ is used for dropout. Images are normalized in the same way as the experiments with CIFAR-10. Due to time constraints we sample only $\frac { 1 } { 1 0 }$ of the images from the test set for the Deep Fool test.
|
| 350 |
+
|
| 351 |
+
The proposed regularizer is the most robust on all categories, while Parseval has problems with the perturbations, despite yielding the best accuracy on the clean test set. The combination of the proposed regularizer and the parseval training method is not able to reproduce the good results from the CIFAR-10 dataset.
|
| 352 |
+
|
| 353 |
+
The results shown in Table 4 are obtained using an architecture that is not performing very well on the clean test set for the CIFAR-100 dataset. We thus performed additional experiments using the WideResNet 28-10 (Zagoruyko and Komodakis, 2016) architecture, and we added standard data augmentation (random crops and random horizontal flipping) and dropout with probability of 30% after the first convolution of each residual block. We train for 200 epochs, starting with a learning rate of 0.1 and divide the learning rate by 5 in epochs 60, 120 and 160. Momentum of 0.9 is used and weight decay of 5e-4. We use the value from the Parseval paper ( $\beta = 0 . 0 0 0 3$ ) as in this case it provided better results than the one described in Section B.
|
| 354 |
+
|
| 355 |
+
Table 4: Results on the CIFAR-100 dataset with the hyperparameters from Appendix B. Bolded value represent the best model on the test.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Robustness</td><td colspan="2">Isotropic</td><td colspan="2">Adversarial</td><td>Implementation</td></tr><tr><td>Model/Test Type</td><td>SNR≈8</td><td>SNR≈15</td><td>FGSM</td><td>Deep Fool</td><td>Dropout</td></tr><tr><td>Vanilla</td><td>62.38%</td><td>12.78%</td><td>5.70%</td><td>1.7E-5</td><td>8.66%</td></tr><tr><td>Parseval</td><td>63.61%</td><td>10.11%</td><td>5.85%</td><td>1.5E-5</td><td>10.61%</td></tr><tr><td>Proposed Regularizer</td><td>60.06%</td><td>21.14%</td><td>6.15%</td><td>2.9E-5</td><td>21.40%</td></tr><tr><td>Proposed + Parseval</td><td>56.64%</td><td>20.01%</td><td>4.07%</td><td>1.8E-5</td><td>9.41%</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Results on the WideResNet 28-10 architecture using data augmentation are shown in Table 5. We observe that the proposed method (sometimes with combinations with other methods) is still the most robust.
|
| 360 |
+
|
| 361 |
+
Table 5: Results on the CIFAR-100 dataset with WideResNet 28-10.
|
| 362 |
+
|
| 363 |
+
<table><tr><td>Robustness</td><td colspan="2">Isotropic</td><td colspan="2">Adversarial</td><td>Implementation</td></tr><tr><td>Model/Test Type</td><td>SNR~8</td><td>SNR~15</td><td>FGSM</td><td>Deep Fool</td><td>Quantization</td></tr><tr><td>Vanilla</td><td>78.42%</td><td>11.68%</td><td>21.38%</td><td>5.3E-5</td><td>12.56%</td></tr><tr><td>Parseval</td><td>77.71%</td><td>12.75%</td><td>22.73%</td><td>5.7E-5</td><td>1.58%</td></tr><tr><td>Proposed Regularizer</td><td>77.33%</td><td>14.46%</td><td>23.27%</td><td>5.8E-5</td><td>17.01%</td></tr><tr><td>Proposed 十 Parseval</td><td>76.72%</td><td>20.24%</td><td>25.85%</td><td>6.9E-05</td><td>1.0%</td></tr></table>
|
| 364 |
+
|
| 365 |
+
# E Impact of the proposed regularizer on the boundary
|
| 366 |
+
|
| 367 |
+
We look at the impact of the proposed regularizer on the boundary region. To this end, we choose 10 pairs of points in distinct classes that are the most similar (i.e. their distance is minimal) in the input space and we look at the decision of the network function along the segment between them. The average is depicted in Figure 11. Note that the point to the left is always chosen to be the one corresponding to the decision of the network at the middle of the segment, so that the average curve is asymmetric.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 11: $F ( \lambda \mathbf { x } + ( 1 - \lambda ) \mathbf { x } ^ { \prime } )$ for different methods.
|
| 371 |
+
|
| 372 |
+
Interestingly, we observe that the proposed regularizer is the one for which the boundary is closest to the middle of the segments, thus proving our claim that the proposed regularizer control the boundary region.
|
| 373 |
+
|
| 374 |
+
# F Regularizer pseudo-code
|
| 375 |
+
|
| 376 |
+
Below in Algorithm 1 we describe how we use the proposed regularizer to compute the loss as a pseudo-code. This function receives five inputs:
|
| 377 |
+
|
| 378 |
+
1. $l i s t _ { a c t i v a t i o n s }$ : the list of the intermediate features right after each call of the ReLU activation function of the network. We call these intermediate features activations $\ell$ where $\ell$ represents the depth of the network;
|
| 379 |
+
2. y: the output of the network;
|
| 380 |
+
3. s: the label signal of the batch. Otherwise said, the ground truth labels of the examples of the batch;
|
| 381 |
+
4. $m$ : the power of the Laplacian for which we wish to compute the smoothness;
|
| 382 |
+
5. $\gamma$ : the scaling coefficient of the regularizer loss.
|
| 383 |
+
|
| 384 |
+
# Algorithm 1: Loss function of the regularized network
|
| 385 |
+
|
| 386 |
+
# 1: procedure Smoothness(activations\`, s, m)
|
| 387 |
+
|
| 388 |
+
2: $\mathbf { A } ^ { \ell } \gets$ Pairwise cosine similarity of activations\`
|
| 389 |
+
3: $\mathbf { D } ^ { \ell } \gets$ Diagonal degree matrix of $\mathbf { A } ^ { \ell }$
|
| 390 |
+
4: $\mathbf { L } ^ { \ell } \gets \mathbf { D } ^ { \ell } - \mathbf { A } ^ { \ell }$
|
| 391 |
+
5: $\sigma ^ { \ell } \gets \mathrm { T r a c e } ( \mathbf { s } ^ { \intercal } ( L ^ { \ell } ) ^ { m } \mathbf { s } )$
|
| 392 |
+
6: return σ\`
|
| 393 |
+
7: procedure $\mathrm { L o s s } ( l i s t _ { a c t i v a t i o n s } , \mathbf { y } , \mathbf { s } , m , \gamma )$
|
| 394 |
+
8: for activations\` ∈ listactivations do
|
| 395 |
+
L σ\` ← Smoothness(activations\`, s, m)
|
| 396 |
+
9: ∆ ← P\`maxi=1 |σi−σi−1|
|
| 397 |
+
10: return CategoricalCrossEntropy(s, y) + γm∆
|
md/train/HJaDJZ-0W/HJaDJZ-0W.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BLOCK-SPARSE RECURRENT NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recurrent Neural Networks (RNNs) are used in state-of-the-art models in domains such as speech recognition, machine translation, and language modelling. Sparsity is a technique to reduce compute and memory requirements of deep learning models. Sparse RNNs are easier to deploy on devices and high-end server processors. Even though sparse operations need less compute and memory relative to their dense counterparts, the speed-up observed by using sparse operations is less than expected on different hardware platforms. In order to address this issue, we investigate two different approaches to induce block sparsity in RNNs: pruning blocks of weights in a layer and using group lasso regularization with pruning to create blocks of weights with zeros. Using these techniques, we can create block-sparse RNNs with sparsity ranging from $80 \%$ to $90 \%$ with a small loss in accuracy. This technique allows us to reduce the model size by roughly $1 0 \times$ . Additionally, we can prune a larger dense network to recover this loss in accuracy while maintaining high block sparsity and reducing the overall parameter count. Our technique works with a variety of block sizes up to $3 2 \times 3 2$ . Block-sparse RNNs eliminate overheads related to data storage and irregular memory accesses while increasing hardware efficiency compared to unstructured sparsity.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Improvements in several applications such as speech recognition (Amodei et al., 2016), language modeling (Jozefowicz et al. ´ , 2016), and machine translation (Wu et al., 2016) are a result of large Recurrent Neural Networks (RNNs) trained on large scale datasets. As the datasets available to train these models have grown, so have model sizes. Deployment of such large models is compute and memory intensive.
|
| 12 |
+
|
| 13 |
+
Pruning weights of deep neural networks is an effective strategy to reduce the overall memory and compute requirements of these models (Narang et al., 2017; Han et al., 2015). However, these approaches induce random, unstructured sparsity in the weight matrices. Speed-up obtained with unstructured sparsity on various hardware platforms are often lower than expected (as shown in Narang et al. (2017); Narang & Diamos (2017)). Sparse formats do not efficiently utilize the hardware resources due to storage overheads and irregular memory access. Block sparsity can address these issues. Saving indices of non-zero blocks instead of indices for non-zero elements reduces the storage overhead by a factor of block size. Block-sparse formats store blocks contiguously in memory reducing irregular memory accesses.
|
| 14 |
+
|
| 15 |
+
Another disadvantage of unstructured sparsity is that it cannot directly exploit array-data-paths in modern processors. These include the $1 6 \times 1 6$ TensorCore units in the Volta GPU (NVIDIA, 2017) or the $2 5 6 \times 2 5 6$ hardware units in the Tensor Processing Unit (TPU) (Jouppi et al., 2017). Structured sparsity in the form of two-dimensional blocks allows us to take advantage of these faster units.
|
| 16 |
+
|
| 17 |
+
In order to induce block sparsity in RNNs, we propose a block pruning approach that zeros out blocks of weights in the matrix while the network is training. At the end of training, the algorithm creates a block-sparse RNN. In addition to this pruning technique, we examine the efficacy of group lasso regularization (Yuan & Lin, 2006b) to induce block sparsity in the network. We also combine group lasso regularization with block pruning.
|
| 18 |
+
|
| 19 |
+
We demonstrate that block pruning and group lasso regularization with pruning are successful in creating block-sparse RNNs. Inducing block sparsity with $4 \times 4$ blocks in vanilla RNNs and Gated Recurrent Units (GRUs) (Cho et al., 2014) results in $9 \%$ to $17 \%$ loss in accuracy compared to the dense baseline. Model size reduces by nearly $1 0 \times$ for speech recognition. Block sizes can be scaled up to $3 2 \times 3 2$ with our approach. We can also reduce accuracy loss by starting with a larger dense matrix than the baseline and then pruning it down while still reducing the number of parameters compared to the baseline. We demonstrate that this approach works with Long Short Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) cells for Language Modelling as well.
|
| 20 |
+
|
| 21 |
+
Our approach is agnostic to the optimization algorithm and does not require any hyper-parameter retuning (besides pruning and regularization hyper-parameters). Furthermore, since our approach does not require re-training the model, training time remains constant.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
There have been several approaches to reduce the network size by pruning the model. Hanson & Pratt (1989) use several bias techniques to decay weights in a network. LeCun et al. (1989) and Hassibi et al. (1993) both use Hessian-based approaches to prune weights below a certain threshold. Simpler approaches like sorting or thresholding can be used to prune a neural network. Han et al. (2015) and Liu et al. (2015) prune Convolution Neural Networks (CNNs) while maintaining high accuracy. Yu et al. (2012) use a hard threshold to prune deep learning models. Narang et al. (2017) and Zhu & Gupta (2017) prune recurrent neural networks during the initial training run with a small accuracy loss using gradual pruning. Unlike our technique, all of the above approaches induce random, unstructured sparsity in neural networks.
|
| 26 |
+
|
| 27 |
+
Several approaches exist to induce structured sparsity in neural networks. Mao et al. (2017) use a simple threshold based technique to create structurally sparse CNNs. Yu et al. (2017) propose Scalpel, which prunes CNNs taking into account the underlying target hardware architecture. Wen et al. (2017) alter the structure of LSTMs to create cells with smaller memory footprint. They demonstrate that this technique works for language modeling on the Penn Tree Bank dataset. Our approach works with both vanilla RNN and GRU models trained on a large-scale datasets for speech recognition.
|
| 28 |
+
|
| 29 |
+
Regularization is a known method to induce sparsity in deep neural networks (Faraone et al., 2017; Fan et al., 2016). Group lasso regularization has been used as an efficient method for generating sparse structures (Yuan & Lin, 2006b; Kim & Xing, 2010). Wen et al. (2016) use group lasso regularization to induce structured sparsity in CNNs. Scardapane et al. (2017) also use group lasso regularization to induce sparisty in fully connected networks. To the best of our knowledge, none of these approaches have been used with RNNs trained on large-scale datasets.
|
| 30 |
+
|
| 31 |
+
Other approaches to reduce compute and memory footprint for deep learning models include quantization (Micikevicius et al., 2017; Vanhoucke et al., 2011; Rastegari et al., 2016; Gupta et al., 2015) and low-rank factorization (Denil et al., 2013; Denton et al., 2014). Our approach is orthogonal to these methods and can be combined with them.
|
| 32 |
+
|
| 33 |
+
# 3 IMPLEMENTATION
|
| 34 |
+
|
| 35 |
+
# 3.1 BLOCK PRUNING
|
| 36 |
+
|
| 37 |
+
Our approach to pruning deep learning models builds on the work by Narang et al. (2017). They propose a weight pruning algorithm that introduces random, unstructured sparsity in RNNs. In their work, they propose pruning weights below a monotonically increasing threshold. Their pruning strategy does not impose any structure on the weights.
|
| 38 |
+
|
| 39 |
+
We extend this approach to prune blocks of a matrix instead of individual weights. We divide the weight matrix into a grid of two-dimensional blocks with a fixed block size. Block size ranges between $4 \times 4$ to $3 2 \times 3 2$ in our experiments. In order to prune blocks, we pick the weight with the maximum magnitude to represent the entire block. If this maximum magnitude of a block is below the threshold, we set all the weights in that block to zeros. Figure 1 depicts the process of generating a block-sparse mask from a weight matrix for a given threshold. The block-sparse mask is multiplied with the weights to generate block-sparse weight matrix. The monotonically growing threshold () causes more blocks to be pruned as training progresses. We stop pruning more blocks after $40 \%$ of training has completed. All zeroed out blocks are held at zero until the end of training.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Generating block-sparse masks from a weight matrix
|
| 43 |
+
|
| 44 |
+
Table 1: Heuristics to pick hyper-parameters for block-pruning
|
| 45 |
+
|
| 46 |
+
<table><tr><td>HYPER-PARAM</td><td>DESCRIPTION</td><td>HEURISTICVALUES</td></tr><tr><td>start_itr ramp_itr</td><td>Iteration to start pruning</td><td>Start of second epoch Start of 20% of total epochs</td></tr><tr><td>end_itr</td><td>Iteration to increase the rate of pruning Iteration to stop pruning more parame-</td><td>Start of 40% of total epochs</td></tr><tr><td>start_slope</td><td>ters Initial rate of increasing the threshold</td><td>See Equation 2</td></tr><tr><td>(0) ramp_slope</td><td>Rate of increasing threshold after ramp</td><td>1.20 to 1.70</td></tr><tr><td>() freq</td><td>iteration Number of iterations after whiché is updated</td><td>100</td></tr></table>
|
| 47 |
+
|
| 48 |
+
Narang et al. (2017) use six hyper-parameters to determine the threshold at a given iteration. Table 1 provides the description and heuristics (adapted for block pruning) for these hyper-parameters. The start slope and ramp slope determine the rate at which the threshold increases. In order to determine start slope, they recommend using weights from an existing dense model. To achieve $90 \%$ sparsity, they assign $q$ to the weight that is the 90th percentile of the absolute values in a weight matrix. Assuming $\phi$ is $1 . 5 \theta$ , they use Equation 1 to determine $\theta$ .
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\theta = { \frac { 2 \times q \times f r e q } { 2 \times ( r a m p . i t r - s t a r t . i t r ) + 3 \times ( e n d . i t r - r a m p . i t r ) } }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
For block pruning, we need to modify the start slope to take into account the number of elements in a block $( N _ { b } )$ . In order to calculate the start slope, we first calculate start slope for weight pruning $( \theta _ { w } )$ using the Equation 1. Given $\theta _ { w }$ , we suggest using Equation 2 to determine the initial slope $( \theta _ { b } )$ for block pruning. Based on empirical results, we have found that using this approach allows us to achieve block sparsity ranging from $8 5 \%$ to $9 5 \%$ . Further tuning of these hyper-parameters is required to achieve desired block sparsity.
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\theta _ { b } = \theta _ { w } \times \sqrt [ 4 ] { N _ { b } }
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
We prune all the recurrent and fully connected layers in the network using the same block size. The pruning hyper-parameters are same for each type of layer in the network — recurrent weight layer and linear or fully connected layer.
|
| 61 |
+
|
| 62 |
+
# 3.2 GROUP LASSO REGULARIZATION
|
| 63 |
+
|
| 64 |
+
Group lasso is a type of weight regularization that works on groups of weights. For each group, we add a loss term proportional to the $\ell _ { 2 }$ norm of the group.
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
L = L _ { \mathrm { t r a i n i n g } } + \lambda _ { g } \sum _ { g = 1 } ^ { G } \| w ^ { ( g ) } \| _ { 2 }
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $w ^ { ( g ) }$ is a group of weights, $\| w ^ { ( g ) } \| _ { 2 }$ is the $\ell _ { 2 }$ norm of the group, and $G$ is the total number of groups. Our use of $\ell _ { 2 }$ norm is a variant of the more general group lasso defined in Yuan & Lin (2006a) as $\| n \| _ { K } = ( n ^ { \prime } K n ) ^ { 1 / 2 }$ .
|
| 71 |
+
|
| 72 |
+
A large enough $\lambda _ { g }$ will drive all weights within certain groups to zeros. The choice of grouping varies by application, and group lasso is widely-used to induce various kinds of structured sparsity (Wen et al., 2017; Scardapane et al., 2017). By choosing groups to exactly match our 2D grid of blocks, we can induce block-sparsity. Thus, group lasso is an existing sparsity algorithm that we can readily compare to our block pruning approach.
|
| 73 |
+
|
| 74 |
+
In addition, we extend group lasso to work with block pruning. The groups match the 2D grid of blocks used by the pruning algorithm. One interpretation of weight regularization is that less important weights are driven towards zero and more important weights retain large absolute values. Thus, group lasso guides the selection of blocks to prune. We apply group lasso to coincide with the pruning schedule. We use a relatively small $\lambda _ { g }$ to avoid underfitting due to excessive regularization. We turn off group lasso when the pruning schedule ends, which is typically after around $40 \%$ o f training epochs. Weights that were already set to zero remain unchanged after this point.
|
| 75 |
+
|
| 76 |
+
Group lasso is related to the well-known $\ell _ { 1 }$ regularization. In Appendix A, we discuss exploration of $\ell _ { 1 }$ regularization combined with weight pruning.
|
| 77 |
+
|
| 78 |
+
# 4 EXPERIMENTS
|
| 79 |
+
|
| 80 |
+
We present results on two different applications: Speech Recognition (Section 4.1) and Language Modelling (Section 4.2).
|
| 81 |
+
|
| 82 |
+
# 4.1 SPEECH RECOGNITION
|
| 83 |
+
|
| 84 |
+
We run block sparsity experiments on two different speech recognition models from Amodei et al. (2016). The RNN model consists of seven bidirectional vanilla recurrent layers with 1760 hidden units for a total of 67 million parameters. The GRU model consists of three recurrent layers with GRU cells with 2560 hidden units for a total of 115 million parameters. Both models use the Connectionist Temporal Classification (CTC) (Graves et al., 2006) cost function. We use a training set of 2100 hours of speech and validation set of 3.46 hours. The Character Error Rate (CER) results are reported on an independent test set, consisting of 2.9 hours of English data.
|
| 85 |
+
|
| 86 |
+
In order to introduce block sparsity in these models, we run two different types of experiments — Block Pruning (BP) and Group Lasso with block pruning (GLP). We prune weights in the recurrent layers (both linear and recurrent weights) and fully connected layers. Biases, batch-normalization parameters and weights in the convolutional and CTC layers are not pruned since they account for a small portion of the total weights in the network. No existing hyper-parameter changes were required for sparse training runs. The models are trained using Nesterov Stochastic Gradient Descent (SGD) with momentum. All models are trained for 25 epochs.
|
| 87 |
+
|
| 88 |
+
In Section 4.1.1, we report results for different sparse models pruned with $4 \times 4$ blocks and compare these results with other pruning approaches. In Section 4.1.2, we discuss the impact of varying the block size on the accuracy of the model.
|
| 89 |
+
|
| 90 |
+
# 4.1.1 BLOCK SPARSITY
|
| 91 |
+
|
| 92 |
+
Initially, we prune the dense RNN model. Using BP, we are able to reduce the parameter count for both these models by nearly $1 0 \times$ . As shown in Table 2, the block-sparse RNN model with 1760 hidden units has an overall block sparsity of $89 \%$ with a CER of 17.93.
|
| 93 |
+
|
| 94 |
+
As mentioned in Section 3, group lasso by itself can induce block-sparsity. However, as shown in Table 2, group lasso results in significantly worse CER than our block pruning approach. In order to achieve high sparsity $80 \%$ or higher) with group lasso, we need to set $\lambda _ { g }$ to a relatively high value. This high regularization factor hurts the model accuracy. The dense baseline model is trained without any regularization. Therefore, group lasso results in underfitting the training data due to the high value of $\lambda _ { g }$ . Group lasso could be more successful in inducing block-sparsity where the dense model overfits the training dataset.
|
| 95 |
+
|
| 96 |
+
Table 2: Bidirectional RNN model results. Block-Sparse models are trained with 4x4 blocks
|
| 97 |
+
|
| 98 |
+
<table><tr><td>MODEL</td><td>LAYER SIZE</td><td># PARAMS (in millions)</td><td>CER (% LOSS)</td><td>EPOCHS</td><td>PRUNING ALGORITHM</td></tr><tr><td>RNN Dense</td><td>1760</td><td>67</td><td>15.36 (0.0%)</td><td>25</td><td>N/A</td></tr><tr><td>RNN Block-Sparse</td><td>1760</td><td>10.9</td><td>30.14 (-96%)</td><td>25</td><td>Group lasso</td></tr><tr><td>RNN Sparse</td><td>1760</td><td>8.3</td><td>18.91 (-23%)</td><td>25</td><td>Yu et al. (2012)</td></tr><tr><td>RNN Sparse</td><td>1760</td><td>7.3</td><td>17.32 (-13%)</td><td>25</td><td>Narang et al. (2017)</td></tr><tr><td>RNN Sparse</td><td>1760</td><td>7.1</td><td>15.41 (-0.3%)</td><td>60</td><td>Han et al. (2015)</td></tr><tr><td>RNN Block-Sparse</td><td>1760</td><td>7.3</td><td>17.93 (-17%)</td><td>25</td><td>Ours (BP)</td></tr><tr><td>RNN Block-Sparse</td><td>2560</td><td>12.9</td><td>15.89 (-3.4%)</td><td>25</td><td>Ours (GLP)</td></tr><tr><td>RNN Block-Sparse</td><td>3072</td><td>25.8</td><td>15.66 (-1.9%)</td><td>25</td><td>Ours (BP)</td></tr></table>
|
| 99 |
+
|
| 100 |
+
Table 3: GRU model results with $4 \times 4$ blocks
|
| 101 |
+
|
| 102 |
+
<table><tr><td>MODEL</td><td>LAYER SIZE</td><td>#PARAMS (in millions)</td><td>CER (% LOSS)</td><td>EPOCHS</td><td>PRUNING ALGORITHM</td></tr><tr><td>GRU Dense</td><td>2560</td><td>115</td><td>15.42 (0.0%)</td><td>25</td><td>N/A</td></tr><tr><td>GRU Block-Sparse</td><td>2560</td><td>10.8</td><td>16.78 (-8.8%)</td><td>25</td><td>Ours (GLP)</td></tr><tr><td>GRU Block-Sparse</td><td>3584</td><td>25.6</td><td>16.23 (-5.3%)</td><td>25</td><td>Ours (BP)</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Comparison to other pruning methods: In addition to group lasso, we compare our block pruning approach with three existing pruning methods. As shown in Table 2, our block-sparse model achieves better accuracy than the hard thresholding scheme in Yu et al. (2012). Sparse RNNs generated using Narang et al. (2017) is about $4 \%$ better than the block-sparse model. The sparse RNN model generated using iterative pruning (Han et al., 2015) is significantly better than than blocksparse model. However, this approach requires training the model for 60 epochs instead of 25 epochs for all other approaches. This results in 180 hours of additional training time for the RNN model. This $2 { - } 3 \times$ increase in training time may not be practical for state-of-the-art models trained on large datasets, which usually need weeks of training time. Additionally, all the above approaches generate random, unstructured sparsity in the model. In current hardware, the compute and memory savings with block sparsity are significantly higher than random sparsity. We discuss the performance aspect in more detail in Section 5.
|
| 105 |
+
|
| 106 |
+
Larger models: In order to recover the accuracy loss with our approach, we train sparse models with more hidden units in each recurrent layers. For RNN models, we increase the hidden layer size to 2560 and 3072. As shown in Table 2, the RNN sparse 3072 is only $1 . 9 \%$ worse than the dense baseline model. The 2560 and 3072 sparse RNN models reduce the overall parameter count by $5 \times$ and $2 . 5 \times$ respectively relative to the dense model with 1760 hidden units in each layer.
|
| 107 |
+
|
| 108 |
+
GRU model: Similar to the RNN models, the block-sparse GRU model can reduce the overall parameter count by $1 1 \times$ . As shown in Table 3, the block-sparse GRU model achieves slightly higher sparsity $( 9 0 \% )$ with a CER of 16.23 which is only $9 \%$ worse than the dense GRU model. This indicates that the block-sparse GRU model retains most of the capacity of the dense model. As demonstrated with the RNN model, pruning a larger GRU model with 3584 hidden nodes reduces the accuracy loss to about $5 \%$ while still shrinking the model by $4 . 5 \times$ relative to the dense model with 2560 hidden nodes in each layer.
|
| 109 |
+
|
| 110 |
+
# 4.1.2 BLOCK SIZE VARIATION
|
| 111 |
+
|
| 112 |
+
Table 4 shows that block pruning works for block sizes upto $3 2 \times 3 2$ . Increasing the block size to $1 6 \times 1 6$ and $3 2 \times 3 2$ requires reducing the sparsity to $8 3 . 6 \%$ and $7 9 . 1 \%$ respectively for RNN models to obtain good accuracy. Similar results hold true for the GRU model as well. Large sparse blocks reduce memory overhead for storing non zero values and can take advantage of array data-paths in modern processors. Therefore, even though large blocks achieve lower sparsity, they result in lower memory and compute requirements.
|
| 113 |
+
|
| 114 |
+
Table 4: Results for GRU model with 2560 layer size and bidirectional RNN model with 170 layer size pruned with different block sizes using BP.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>MODEL</td><td>BLOCK SIZE</td><td>#PARAMS (in millions)</td><td>SPARSITY</td><td>CER (% LOSS)</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RNN Block-Sparse</td><td>4x4</td><td>7.3</td><td>89.2%</td><td>17.93 (-17%)</td></tr><tr><td>RNN Block-Sparse</td><td>12x2</td><td>10.8</td><td>84.1%</td><td>16.96 (-10%)</td></tr><tr><td>RNN Block-Sparse</td><td>8x8</td><td>10.7</td><td>84.1%</td><td>17.66 (-15%)</td></tr><tr><td>RNN Block-Sparse</td><td>16x16</td><td>11.1</td><td>83.6%</td><td>17.10 (-11%)</td></tr><tr><td>RNN Block-Sparse</td><td>32x32</td><td>14.1</td><td>79.1%</td><td>16.67 (-8.5%)</td></tr><tr><td>GRU Block-Sparse</td><td>4x4</td><td>16.2</td><td>86.0%</td><td>16.97 (-10%)</td></tr><tr><td>GRU Block-Sparse</td><td>16x16</td><td>20.8</td><td>81.9%</td><td>16.84 (-9.2%)</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 5: Word language modelling results on Penn Tree Bank using BP for $4 \times 4$ blocks.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>MODEL</td><td>LAYER SIZE</td><td># PARAMS (in millions)</td><td>PERPLEXITY (% LOSS)</td><td>EPOCHS</td><td>PRUNING ALGORITHM</td></tr><tr><td>LSTM Dense</td><td>1500</td><td>66.0</td><td>78.29 (0.0%)</td><td>55</td><td>N/A</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LSTM Block-Sparse LSTM Block-Sparse</td><td>1500 1500</td><td>23.1 11.6</td><td>77.04 (1.6%) 80.25 (-2.5%)</td><td>55 55</td><td>Ours (BP) Ours (BP)</td></tr><tr><td>LSTM Block-Sparse</td><td>1500</td><td>7.95</td><td>82.72 (-5.7%)</td><td>55</td><td>Ours (BP)</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 121 |
+
|
| 122 |
+
The exact choice of block size for a given application depends on the underlying hardware used for inference. For example, NVIDIA’s Volta processor supports $1 6 \times 1 6$ blocks whereas ARM processors support blocks of $1 2 \mathbf { x } 2$ . We demonstrate that our approach is agnostic to block size and can be used to generate block-sparse models for arbitrary blocks.
|
| 123 |
+
|
| 124 |
+
# 4.2 NEURAL LANGUAGE MODELLING
|
| 125 |
+
|
| 126 |
+
We conducted block pruning experiments on Penn Tree Bank (PTB) (Marcus et al., 1993) dataset using word level language models. For our experiments, we use the large LSTM model with 1500 hidden units from Zaremba et al. (2014). The hyperparameters are unchanged from the original model, except for slightly increased dropout keep probability which ranges from 0.4 to 0.52 for the sparse models. We prune weights in the embedding, LSTM and softmax layers of the model.
|
| 127 |
+
|
| 128 |
+
We report results on the test set using BP with $4 \times 4$ blocks in Table 5. Block pruning can reduce the parameter count by nearly $3 \times$ while retaining the accuracy of the dense model. With a $5 \%$ loss in accuracy, we can reduce the parameter count by $8 . 3 \times$ . There is a trade-off between sparsity and accuracy of the model. For inference, we would pick the model that meets the desired memory and compute budget. Further work remains in evaluating this technique for large scale datasets like the Billion word datasets (Chelba et al., 2013) for language modelling.
|
| 129 |
+
|
| 130 |
+
# 5 PERFORMANCE
|
| 131 |
+
|
| 132 |
+
Sparse formats incur at least three types of overhead: i) indexing overhead, ii) irregular memory accesses, and ii) incompatibility with array-data-paths, all of which are mitigated by using larger block sizes.
|
| 133 |
+
|
| 134 |
+
Indexing Overheads. Sparse formats use extra memory to track the location of each non-zero value. For example, the compressed-sparse-row (CSR) format uses between one and two extra index values for each non-zero value. Assuming that neural network weights and indices are represented with 16-bits as in Micikevicius et al. (2017), this is at least $1 0 0 \%$ overhead. Block sparsity reduces this overhead by a factor of the block size because the index is shared over the entire block. For example, using a block size of 4x4 reduces the memory bloat to $6 . 2 5 \%$ , and using a block size of 16x16 reduces it to less than $1 \%$ .
|
| 135 |
+
|
| 136 |
+
Irregular Memory Accesses. Caches lines, DRAM row buffers, and TLBs provide the best performance when memory is accessed in relatively large contiguous units (e.g. 64 bytes for cache lines, 4KB for a DRAM row) as opposed to in fine-grained random accesses. Block-sparse formats store blocks contiguously in memory, resulting in large coalesced accesses.
|
| 137 |
+
|
| 138 |
+
Array Data-Paths. Block-sparse models make it easier to exploit array-data-paths in modern processors. There are significant advantages of using these units, for example, on the Volta V100 GPU, they enable up to ${ 8 } \mathbf { { x } }$ higher throughput than the SIMD data-paths. In order to keep these units busy, the block size should be at least as large as the hardware data-path size ( $1 6 \times 1 6$ or larger on V100).
|
| 139 |
+
|
| 140 |
+
# 5.1 INFERENCE PERFORMANCE
|
| 141 |
+
|
| 142 |
+
Inference performance depends of three different factors: accuracy, latency of evaluation and memory requirements. In order to understand the trade-off between unstructured sparsity and block sparsity, we benchmark the General Matrix Multiply (GEMM) speed-up and memory reduction for a single layer in the speech recongition RNN model. We evaluate GEMM speed-up with batch size of 16 using NVIDIA’s CuSparse and CuBLAS libraries on a TitanX Maxwell GPU. Sparse matrices are represented in CSR or Block-CSR format depending on the sparsity structure. Memory savings are calculated using CSR and Block Sparse Row (BSR) from Scipy module in Python. We evaluate a single layer with different block sizes. We also evaluate the best unstructured sparsity result obtained using iterative pruning from Han et al. (2015).
|
| 143 |
+
|
| 144 |
+
As shown in Table 6, the unstructured sparsity model (Han et al., 2015) achieves the best accuracy but requires much longer training time and does not improve the compute time relative to the dense model. For a small loss in accuracy, block-sparse models can significantly reduce both compute and memory requirements. For example, layers with 16x16 block sparsity reduce memory consumption by $1 1 \times$ and speedup compute by $3 \times$ with a $10 \%$ loss in accuracy. Additionally, Figure 2 shows that block-sparse matrices achieve higher speed-up than unstructured sparsity for large batch sizes for RNN and GRU layers. The speed-up is achieved due to reducing irregular memory accesses and improving load balance. Future work involves efficient implementation of block-sparse kernels to take advantage of array-data-paths in modern processors.
|
| 145 |
+
|
| 146 |
+
Table 6: Accuracy, speed-up and memory reduction for sparse layers. Block-sparse layers achieve higher speedup and memory reduction with some loss in accuracy.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>MODEL</td><td>LAYER SIZE</td><td>GEMM SPEEDUP</td><td>MEMORY SAVINGS</td><td>CER (% LOSS)</td><td>ALGORITHM</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RNN Sparse</td><td>1760</td><td>1.0×</td><td>5.0×</td><td>15.41 (-0.3%)</td><td>Han et al. (2015)</td></tr><tr><td>RNN Block-Sparse</td><td>2560</td><td>1.1×</td><td>6.2×</td><td>15.89 (-3.4%)</td><td>BP (4x4)</td></tr><tr><td>RNN Block-Sparse</td><td>1760</td><td>1.5×</td><td>7.1×</td><td>16.67 (-8.5%)</td><td>BP (32x32)</td></tr><tr><td>RNN Block-Sparse</td><td>1760</td><td>3.0×</td><td>11×</td><td>17.10 (-11%)</td><td>BP (16x16)</td></tr><tr><td>RNN Block-Sparse</td><td>1760</td><td>1.9×</td><td>17×</td><td>17.93 (-17%)</td><td>BP (4x4)</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 6 IMPACT OF SPARSITY ON ACCURACY
|
| 151 |
+
|
| 152 |
+
Using our baseline RNN model, we run many Weight Pruning (WP) (using (Narang et al., 2017)) and block pruning experiments, varying hyper-parameters to produce a spectrum of results ranging from $70 \%$ to $9 7 \%$ sparsity. For these experiments, the models are trained for 20 epochs and the accuracy is reported on the validation set. As shown in Figure 3, models pruned using WP with sparsity less than $9 5 \%$ have relative accuracy ranging from $- 2 0 \%$ to $- 2 7 \%$ . Increasing the sparsity for the model beyond $9 5 \%$ results in $30 \%$ or more accuracy loss. This “accuracy cliff” is earlier for models pruned with block sparsity. For block size $4 \times 4$ , models with sparsity greater $90 \%$ yield a relative accuracy loss of $30 \%$ or higher. Similarly, for blocks of $1 6 \times 1 6$ , models with sparsity greater than $86 \%$ have $30 \%$ or more accuracy loss. A similar trend is observed for block size $3 2 \times 3 2$ . This indicates that there is a trade-off between sparsity and block-size for a given accuracy. Larger blocks reach the “accuracy cliff” sooner.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Speed-up for sparse matrix multiply over GEMM. RNN matrix sizes are (1760,1760) with $90 \%$ sparsity and (1760, batch size). GRU matrix sizes are (7680,2560) with $9 5 \%$ sparsity and (2560, batch size). Block-sparse matrices achieve consistently good speedup across batch-sizes
|
| 158 |
+
Figure 3: Relative accuracy for different block sizes (4x4, 16x16) and WP for varying sparsity on the RNN 1760 model. Any models with relative accuracy worse than $- 7 5 \%$ are capped at $7 5 \%$ .
|
| 159 |
+
|
| 160 |
+
# 7 CONCLUSION AND FUTURE WORK
|
| 161 |
+
|
| 162 |
+
We have demonstrated that using block pruning and group lasso combined with pruning during training can build block-sparse RNNs that are about as accurate as the dense baseline models. The block-sparse models have significantly fewer parameters than the dense baselines reducing memory requirements. Block-sparse models can take advantage of the underlying hardware efficiently.
|
| 163 |
+
|
| 164 |
+
We would like to investigate if pruning can be performed even earlier in the training, thereby allowing us to train sparse models. Training sparse models would allow us to reap the benefits of sparsity during training resulting in lesser compute and memory demands. Further work remains to implement efficient block-sparse matrix multiplies for array-data-paths in modern processors that would provide increased speed-up during deployment.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, JingDong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, et al. Deep speech 2: End-to-end speech recognition in english and mandarin. In Proceedings of The 33rd International Conference on Machine Learning, pp. 173–182, 2016.
|
| 169 |
+
|
| 170 |
+
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. Technical report, Google, 2013. URL http://arxiv.org/abs/1312.3005.
|
| 171 |
+
|
| 172 |
+
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. arXiv preprint arXiv:1406.1078, 2014.
|
| 173 |
+
|
| 174 |
+
Misha Denil, Babak Shakibi, Laurent Dinh, Marc’Aurelio Ranzato, and Nando de Freitas. Predicting parameters in deep learning. CoRR, abs/1306.0543, 2013. URL http://arxiv.org/abs/1306.0543.
|
| 175 |
+
|
| 176 |
+
Emily Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. CoRR, abs/1404.0736, 2014. URL http://arxiv.org/ abs/1404.0736.
|
| 177 |
+
|
| 178 |
+
Qinwei Fan, Wei Wu, and Jacek M Zurada. Convergence of batch gradient learning with smoothing regularization and adaptive momentum for neural networks. SpringerPlus, 5(1):295, 2016.
|
| 179 |
+
|
| 180 |
+
Julian Faraone, Nicholas Fraser, Giulio Gamberdella, Michaela Blott, and Philip HW Leong. Compressing low precision deep neural networks using sparsity-induced regularization in ternary networks. arXiv preprint arXiv:1709.06262, 2017.
|
| 181 |
+
|
| 182 |
+
Alex Graves, Santiago Fernandez, Faustino Gomez, and J ´ urgen Schmidhuber. Connectionist temporal classi-¨ fication: labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the $2 3 r d$ international conference on Machine learning, pp. 369–376. ACM, 2006.
|
| 183 |
+
|
| 184 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32nd International Conference on Machine Learning (ICML15), pp. 1737–1746, 2015.
|
| 185 |
+
|
| 186 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 187 |
+
|
| 188 |
+
Stephen Jose Hanson and Lorien Pratt. Advances in neural information processing systems 1. chapter Com-´ paring Biases for Minimal Network Construction with Back-propagation, pp. 177–185. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1989. ISBN 1-558-60015-9. URL http://dl.acm.org/ citation.cfm?id $=$ 89851.89872.
|
| 189 |
+
|
| 190 |
+
Babak Hassibi, David G Stork, and Gregory J Wolff. Optimal brain surgeon and general network pruning. In Neural Networks, 1993., IEEE International Conference on, pp. 293–299. IEEE, 1993.
|
| 191 |
+
|
| 192 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Comput., 9(8):1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx.doi.org/ 10.1162/neco.1997.9.8.1735.
|
| 193 |
+
|
| 194 |
+
Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre-luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, Richard C. Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon. In-datacenter performance analysis of a tensor processing unit. CoRR, abs/1704.04760, 2017. URL http://arxiv.org/abs/1704.04760.
|
| 195 |
+
|
| 196 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of ´ language modeling. CoRR, abs/1602.02410, 2016. URL http://arxiv.org/abs/1602.02410.
|
| 197 |
+
|
| 198 |
+
Seyoung Kim and Eric P Xing. Tree-guided group lasso for multi-task regression with structured sparsity. 2010.
|
| 199 |
+
|
| 200 |
+
Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In NIPs, volume 2, pp. 598–605, 1989.
|
| 201 |
+
|
| 202 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015.
|
| 203 |
+
|
| 204 |
+
Huizi Mao, Song Han, Jeff Pool, Wenshuo Li, Xingyu Liu, Yu Wang, and William Dally. Exploring the regularity of sparse structure in convolutional neural networks. 05 2017.
|
| 205 |
+
|
| 206 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 207 |
+
|
| 208 |
+
P. Micikevicius, S. Narang, J. Alben, G. Diamos, E. Elsen, D. Garcia, B. Ginsburg, M. Houston, O. Kuchaiev, G. Venkatesh, and H. Wu. Mixed Precision Training. ArXiv e-prints, October 2017.
|
| 209 |
+
|
| 210 |
+
Sharan Narang and Gregory Diamos. Deepbench. https://svail.github.io/ DeepBench-update/, 2017. Accessed: 2017-06-28.
|
| 211 |
+
|
| 212 |
+
Sharan Narang, Gregory Diamos, Shubho Sengupta, and Erich Elsen. Exploring sparsity in recurrent neural networks. arXiv preprint arXiv:1704.05119, 2017.
|
| 213 |
+
|
| 214 |
+
NVIDIA. NVIDIA Tesla V100 GPU Architecture. Technical report, 2017.
|
| 215 |
+
|
| 216 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks, pp. 525–542. Springer International Publishing, Cham, 2016. ISBN 978-3-319-46493-0. doi: 10.1007/978-3-319-46493-0 32. URL https: //doi.org/10.1007/978-3-319-46493-0_32.
|
| 217 |
+
|
| 218 |
+
Simone Scardapane, Danilo Comminiello, Amir Hussain, and Aurelio Uncini. Group sparse regularization for deep neural networks. Neurocomputing, 241:81–89, 2017.
|
| 219 |
+
|
| 220 |
+
Vincent Vanhoucke, Andrew Senior, and Mark Z. Mao. Improving the speed of neural networks on cpus. In Deep Learning and Unsupervised Feature Learning Workshop, NIPS 2011, 2011.
|
| 221 |
+
|
| 222 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 223 |
+
|
| 224 |
+
Wei Wen, Yuxiong He, Samyam Rajbhandari, Wenhan Wang, Fang Liu, Bin Hu, Yiran Chen, and Hai Li. Learning intrinsic sparse structures within long short-term memory. arXiv preprint arXiv:1709.05027, 2017.
|
| 225 |
+
|
| 226 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144, 2016. URL http://arxiv.org/abs/1609. 08144.
|
| 227 |
+
|
| 228 |
+
Dong Yu, Frank Seide, Gang Li, and Li Deng. Exploiting sparseness in deep neural networks for large vocabulary speech recognition. In 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 4409–4412. IEEE, 2012.
|
| 229 |
+
|
| 230 |
+
Jiecao Yu, Andrew Lukefahr, David Palframan, Ganesh Dasika, Reetuparna Das, and Scott Mahlke. Scalpel: Customizing dnn pruning to the underlying hardware parallelism. In Proceedings of the 44th Annual International Symposium on Computer Architecture, pp. 548–560. ACM, 2017.
|
| 231 |
+
|
| 232 |
+
Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. 2006a.
|
| 233 |
+
|
| 234 |
+
Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006b.
|
| 235 |
+
|
| 236 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. CoRR, abs/1409.2329, 2014. URL http://arxiv.org/abs/1409.2329.
|
| 237 |
+
|
| 238 |
+
Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
|
| 239 |
+
|
| 240 |
+
# A $\ell _ { 1 }$ AND $\ell _ { 1 / 2 }$ REGULARIZATION
|
| 241 |
+
|
| 242 |
+
Prior to our work with group lasso regularization, we considered $\ell _ { 1 }$ and $\ell _ { 1 / 2 }$ regularizers to induce sparsity in the network. These regularizers act on individual weights and could aid in inducing unstructured sparsity in the network. $\ell _ { 1 }$ regularization is defined as:
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
L = L _ { \mathrm { t r a i n i n g } } + \lambda \sum _ { i = 1 } ^ { k } \left| w _ { i } \right|
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
where $| w _ { i } |$ is the absolute value of a weight and $k$ is the total number of weights. Note the gradient expression for each weight $w _ { j }$ :
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
{ \frac { \partial } { \partial w _ { j } } } \sum _ { i = 1 } ^ { k } | w _ { i } | = s g n ( w _ { j } )
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
As with the group lasso experiments described in 3.2, we explore $\ell _ { 1 }$ regularization with and without pruning. The weight pruning (WP) algorithm from Narang et al. (2017) is used along with regularization. The motivation is the same as group lasso block sparsity experiments: either to guide pruning or to produce sparsity directly.
|
| 255 |
+
|
| 256 |
+
We also explore $\ell _ { 1 / 2 }$ regularization which is defined as:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
L = L _ { \mathrm { t r a i n i n g } } + \lambda \sum _ { i = 1 } ^ { k } | w _ { i } | ^ { 1 / 2 }
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
Fan et al. (2016) uses $\ell _ { 1 / 2 }$ regularization to produce sparsity directly. The gradient for $\ell _ { 1 / 2 }$ regularization is $\scriptstyle { \frac { 1 } { 2 } } \left| w _ { j } \right| ^ { - 1 / 2 }$ . This term is smaller for weights with larger magnitude. Our expectation is that $\ell _ { 1 / 2 }$ will drive unimportant weights towards zero while leaving large weights relatively unaffected, thus avoiding the accuracy loss associated with excessive regularization.
|
| 263 |
+
|
| 264 |
+
For our $\ell _ { 1 }$ and $\ell _ { 1 / 2 }$ experiments, we use the Deep Speech 2 Bidirectional RNN baseline model described in Section 4. These models are trained for 25 epochs on our internal training dataset of 2000 hours. The results are reported on a independent test set consisting of 2.9 hours.
|
| 265 |
+
|
| 266 |
+
Table 7: $\ell _ { 1 }$ and $\ell _ { 1 / 2 }$ results with the bidirectional RNN model with 1760 hidden units
|
| 267 |
+
|
| 268 |
+
<table><tr><td>MODEL</td><td>#PARAMS (in millions)</td><td>SPARSITY</td><td>CER</td><td>RELATIVE PERF</td><td>PRUNING ALGORITHM</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RNN Dense</td><td>67</td><td>0.0%</td><td>15.36</td><td>0.0%</td><td>N/A</td></tr><tr><td>RNN Sparse</td><td>7.3</td><td>89.2%</td><td>17.32</td><td>-12.8%</td><td>Weight pruning</td></tr><tr><td>RNN Sparse</td><td>11.2</td><td>83.6%</td><td>24.8</td><td>-61.5%</td><td>l1</td></tr><tr><td>RNN Sparse</td><td>7.4</td><td>89.1%</td><td>17.28</td><td>-12.5%</td><td>l1 with pruning</td></tr><tr><td>RNN Sparse</td><td>6.6</td><td>90.3%</td><td>18.50</td><td>-20.4%</td><td>l1/2 with pruning</td></tr></table>
|
| 269 |
+
|
| 270 |
+
Without pruning, $\ell _ { 1 }$ model results in significantly worse accuracy compared to the dense baseline. Combining $\ell _ { 1 }$ with weight pruning allows us to recover the loss in accuracy with similar sparsity. The $\ell _ { 1 / 2 }$ with pruning model performs worse than the $\ell _ { 1 }$ with pruning model. Comparing the two regularizers, this result indicates that $\ell _ { 1 }$ is better at guiding pruning than $\ell _ { 1 / 2 }$ , more suitable as a regularizer, or both.
|
| 271 |
+
|
| 272 |
+
Similar to group lasso experiments, $\ell _ { 1 }$ regularization experiments require a significantly higher $\lambda$ to achieve high sparsity without any pruning. We suspect that these regularizers would be more successful in inducing sparsity for models that overfit the training training dataset.
|
| 273 |
+
|
| 274 |
+
# B PRUNING CHARACTERISTICS
|
| 275 |
+
|
| 276 |
+
In this section, we discuss some pruning characteristics and how they relate to training and accuracy of the models.
|
| 277 |
+
|
| 278 |
+
# B.1 PRUNING SCHEDULE
|
| 279 |
+
|
| 280 |
+
In Figure 4a, we plot the pruning schedule of a recurrent and linear layer of the bidirectional model trained with Block Pruning (BP) and Weight Pruning (WP) (Narang et al., 2017) and Group lasso with block pruning (GLP). For all three algorithms, pruning begins just after the first epoch at 2700 iterations. The BP and GLP models result in a sharper curve with more weights being set to zero in a short span of iterations. In these experiments, we use the max function to reduce the blocks to a single value which could be the cause of the sharpness in pruning. Also the GLP model reaches $90 \%$ sparsity just before 10,000 iterations which is significantly earlier than the BP model. GLP training encourages sparsity early on in the training run by pushing the blocks of weights towards zero.
|
| 281 |
+
|
| 282 |
+
# B.2 OUTPUT CONNECTIONS
|
| 283 |
+
|
| 284 |
+
Figure 4b shows the histogram of the number of output connections for all the neurons in a network for two models with different sparsity pruned with BP. The $94 \%$ sparse model does significantly worse than the $89 \%$ sparse. For the model with $89 \%$ sparsity, only 180 neurons have all their output weights set to zero out of a total of 38270. This model produced good accuracy relative to the dense baseline. However, increasing the sparsity to $94 \%$ for the layer results in 1620 neurons having all zero output weights. Additionally, a lot more neurons have a smaller number of non-zero output weights.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 4: Figure 4a shows the pruning schedule for two layers in the network for WP, GLP and BP models. The GLP and BP models use block size of $4 \mathbf { x } 4$ . Figure 4b plots the histogram of the number of output connections for all neurons in the network using block pruning with $4 \times 4$ blocks.
|
| 288 |
+
|
| 289 |
+
# B.3 SPARSITY VS LAYERS
|
| 290 |
+
|
| 291 |
+
Figure 5 shows the sparsity of all the recurrent layers in the network using BP and WP. All recurrent layers have the same pruning hyper-parameters. Layer 1 is the first recurrent layer and layer 14 is the final recurrent layer before the CTC cost layer. For both block pruning and weight pruning, we see that the initial layers are pruned more aggressively compared to the final layers. Increasing sparsity in the layers closer to the output results in poor accuracy. Additionally, the variance in sparsity across the layers increases with the block size. This increasing variance makes it harder to increase the block size beyond $3 2 \times 3 2$ with the same pruning hyper-parameters for all recurrent layers.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 5: Sparsity of different recurrent layers in the network in the RNN model, pruned using BP and WP.
|
md/train/HJcSzz-CZ/HJcSzz-CZ.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# META-LEARNING FOR SEMI-SUPERVISED FEW-SHOTCLASSIFICATION
|
| 2 |
+
|
| 3 |
+
Mengye $\mathbf { R e n } ^ { \dagger \ltimes }$ , Eleni Triantafillou∗ †on, Sachin Ravi∗ §, Jake Snell†on, Kevin Swersky¶, Joshua B. Tenenbaum\, Hugo Larochelle¶‡ & Richard S. Zemel†‡on
|
| 4 |
+
|
| 5 |
+
†University of Toronto, §Princeton University, ¶Google Brain, \MIT, ‡CIFAR, onVector Institute {mren,eleni}@cs.toronto.edu, sachinr@cs.princeton.edu, jsnell@cs.toronto.edu, kswersky@google.com, jbt@mit.edu, hugolarochelle@google.com, zemel@cs.toronto.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In few-shot classification, we are interested in learning algorithms that train a classifier from only a handful of labeled examples. Recent progress in few-shot classification has featured meta-learning, in which a parameterized model for a learning algorithm is defined and trained on episodes representing different classification problems, each with a small labeled training set and its corresponding test set. In this work, we advance this few-shot classification paradigm towards a scenario where unlabeled examples are also available within each episode. We consider two situations: one where all unlabeled examples are assumed to belong to the same set of classes as the labeled examples of the episode, as well as the more challenging situation where examples from other distractor classes are also provided. To address this paradigm, we propose novel extensions of Prototypical Networks (Snell et al., 2017) that are augmented with the ability to use unlabeled examples when producing prototypes. These models are trained in an end-to-end way on episodes, to learn to leverage the unlabeled examples successfully. We evaluate these methods on versions of the Omniglot and miniImageNet benchmarks, adapted to this new framework augmented with unlabeled examples. We also propose a new split of ImageNet, consisting of a large set of classes, with a hierarchical structure. Our experiments confirm that our Prototypical Networks can learn to improve their predictions due to unlabeled examples, much like a semi-supervised algorithm would.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The availability of large quantities of labeled data has enabled deep learning methods to achieve impressive breakthroughs in several tasks related to artificial intelligence, such as speech recognition, object recognition and machine translation. However, current deep learning approaches struggle in tackling problems for which labeled data are scarce. Specifically, while current methods excel at tackling a single problem with lots of labeled data, methods that can simultaneously solve a large variety of problems that each have only a few labels are lacking. Humans on the other hand are readily able to rapidly learn new classes, such as new types of fruit when we visit a tropical country. This significant gap between human and machine learning provides fertile ground for deep learning developments.
|
| 14 |
+
|
| 15 |
+
For this reason, recently there has been an increasing body of work on few-shot learning, which considers the design of learning algorithms that specifically allow for better generalization on problems with small labeled training sets. Here we focus on the case of few-shot classification, where the given classification problem is assumed to contain only a handful of labeled examples per class. One approach to few-shot learning follows a form of meta-learning 1 (Thrun, 1998; Hochreiter et al., 2001), which performs transfer learning from a pool of various classification problems generated from large quantities of available labeled data, to new classification problems from classes unseen at training time. Meta-learning may take the form of learning a shared metric (Vinyals et al., 2016; Snell et al., 2017), a common initialization for few-shot classifiers (Ravi & Larochelle, 2017; Finn et al., 2017) or a generic inference network (Santoro et al., 2016; Mishra et al., 2017).
|
| 16 |
+
|
| 17 |
+
These various meta-learning formulations have led to significant progress recently in few-shot classification. However, this progress has been limited in the setup of each few-shot learning episode, which differs from how humans learn new concepts in many dimensions. In this paper we aim to generalize the setup in two ways. First, we consider a scenario where the new classes are learned in the presence of additional unlabeled data. While there have been many successful applications of semisupervised learning to the regular setting of a single classification task (Chapelle et al., 2010) where classes at training and test time are the same, such work has not addressed the challenge of performing transfer to new classes never seen at training time, which we consider here. Second, we consider the situation where the new classes to be learned are not viewed in isolation. Instead, many of the unlabeled examples are from different classes; the presence of such distractor classes introduces an additional and more realistic level of difficulty to the fewshot problem.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Consider a setup where the aim is to learn a classifier to distinguish between two previously unseen classes, goldfish and shark, given not only labeled examples of these two classes, but also a larger pool of unlabeled examples, some of which may belong to one of these two classes of interest. In this work we aim to move a step closer to this more natural learning framework by incorporating in our learning episodes unlabeled data from the classes we aim to learn representations for (shown with dashed red borders) as well as from distractor classes .
|
| 21 |
+
|
| 22 |
+
This work is a first study of this challenging semi-supervised form of few-shot learning. First, we define the problem and propose benchmarks for evaluation that are adapted from the Omniglot and miniImageNet benchmarks used in ordinary few-shot learning. We perform an extensive empirical investigation of the two settings mentioned above, with and without distractor classes. Second, we propose and study three novel extensions of Prototypical Networks (Snell et al., 2017), a state-ofthe-art approach to few-shot learning, to the semi-supervised setting. Finally, we demonstrate in our experiments that our semi-supervised variants successfully learn to leverage unlabeled examples and outperform purely supervised Prototypical Networks.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
We start by defining precisely the current paradigm for few-shot learning and the Prototypical Network approach to this problem.
|
| 27 |
+
|
| 28 |
+
# 2.1 FEW-SHOT LEARNING
|
| 29 |
+
|
| 30 |
+
Recent progress on few-shot learning has been made possible by following an episodic paradigm. Consider a situation where we have a large labeled dataset for a set of classes $\mathcal { C } _ { \mathrm { t r a i n } }$ . However, after training on examples from $\mathcal { C } _ { \mathrm { t r a i n } }$ , our ultimate goal is to produce classifiers for a disjoint set of new classes $\mathcal { C } _ { \mathrm { t e s t } }$ , for which only a few labeled examples will be available. The idea behind the episodic paradigm is to simulate the types of few-shot problems that will be encountered at test, taking advantage of the large quantities of available labeled data for classes $\mathcal { C } _ { \mathrm { t r a i n } }$ .
|
| 31 |
+
|
| 32 |
+
Specifically, models are trained on $K$ -shot, $N$ -way episodes constructed by first sampling a small subset of $N$ classes from $\mathcal { C } _ { \mathrm { t r a i n } }$ and then generating: 1) a training (support) set ${ \boldsymbol { s } } \ =$ $\left\{ ( \pmb { x } _ { 1 } , y _ { 1 } ) , ( \pmb { x } _ { 2 } , y _ { 2 } ) , \dots , ( \pmb { x } _ { N \times K } , y _ { N \times K } ) \right\}$ containing $K$ examples from each of the $N$ classes and 2) a test (query) set $\mathcal { Q } = \{ ( \pmb { x } _ { 1 } ^ { * } , y _ { 1 } ^ { * } ) , ( \pmb { x } _ { 2 } ^ { * } , y _ { 2 } ^ { * } ) , . . . , ( \pmb { x } _ { T } ^ { * } , y _ { T } ^ { * } ) \}$ of different examples from the same $N$ classes. Each $\pmb { x } _ { i } \in \mathbb { R } ^ { D }$ is an input vector of dimension $D$ and $y _ { i } \in \{ 1 , 2 , \ldots , N \}$ is a class label (similarly for $\boldsymbol { \mathscr { x } } _ { i } ^ { * }$ and $y _ { i } ^ { * }$ ). Training on such episodes is done by feeding the support set $s$ to the model and updating its parameters to minimize the loss of its predictions for the examples in the query set $\mathcal { Q }$ .
|
| 33 |
+
|
| 34 |
+
One way to think of this approach is that our model effectively trains to be a good learning algorithm. Indeed, much like a learning algorithm, the model must take in a set of labeled examples and produce a predictor that can be applied to new examples. Moreover, training directly encourages the classifier produced by the model to have good generalization on the new examples of the query set. Due to this analogy, training under this paradigm is often referred to as learning to learn or meta-learning.
|
| 35 |
+
|
| 36 |
+
On the other hand, referring to the content of episodes as training and test sets and to the process of learning on these episodes as meta-learning or meta-training (as is sometimes done in the literature) can be confusing. So for the sake of clarity, we will refer to the content of episodes as support and query sets, and to the process of iterating over the training episodes simply as training.
|
| 37 |
+
|
| 38 |
+
# 2.2 PROTOTYPICAL NETWORKS
|
| 39 |
+
|
| 40 |
+
Prototypical Network (Snell et al., 2017) is a few-shot learning model that has the virtue of being simple and yet obtaining state-of-the-art performance. At a high-level, it uses the support set $s$ to extract a prototype vector from each class, and classifies the inputs in the query set based on their distance to the prototype of each class.
|
| 41 |
+
|
| 42 |
+
More precisely, Prototypical Networks learn an embedding function $h ( { \pmb x } )$ , parameterized as a neural network, that maps examples into a space where examples from the same class are close and those from different classes are far. All parameters of Prototypical Networks lie in the embedding function.
|
| 43 |
+
|
| 44 |
+
To compute the prototype $\pmb { p } _ { c }$ of each class $c$ , a per-class average of the embedded examples is performed:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
p _ { c } = \frac { \sum _ { i } h ( \pmb { x } _ { i } ) z _ { i , c } } { \sum _ { i } z _ { i , c } } , \mathrm { w h e r e } z _ { i , c } = \mathbb { 1 } [ y _ { i } = c ] .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
These prototypes define a predictor for the class of any new (query) example $\mathbf { \boldsymbol { x } } ^ { * }$ , which assigns a probability over any class $c$ based on the distances between $\pmb { x } ^ { * }$ and each prototype, as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
p ( c | \pmb { x } ^ { * } , \{ p _ { c } \} ) = \frac { \exp ( - | | h ( \pmb { x } ^ { * } ) - \pmb { p } _ { c } | | _ { 2 } ^ { 2 } ) } { \sum _ { c ^ { \prime } } \exp ( - | | h ( \pmb { x } ^ { * } ) - \pmb { p } _ { c ^ { \prime } } | | _ { 2 } ^ { 2 } ) } .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
The loss function used to update Prototypical Networks for a given training episode is then simply the average negative log-probability of the correct class assignments, for all query examples:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
- \frac { 1 } { T } \sum _ { i } \log p ( y _ { i } ^ { * } | \pmb { x } _ { i } ^ { * } , \{ \pmb { p } _ { c } \} ) .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Training proceeds by minimizing the average loss, iterating over training episodes and performing a gradient descent update for each.
|
| 63 |
+
|
| 64 |
+
Generalization performance is measured on test set episodes, which contain images from classes in $\mathcal { C } _ { \mathrm { t e s t } }$ instead of $\mathcal { C } _ { \mathrm { t r a i n } }$ . For each test episode, we use the predictor produced by the Prototypical Network for the provided support set $s$ to classify each of query input $\pmb { x } ^ { * }$ into the most likely class $\hat { y } = \operatorname { a r g m a x } _ { c } p ( \bar { c } | \pmb { x } ^ { * } , \{ \pmb { p } _ { c } \} )$ .
|
| 65 |
+
|
| 66 |
+
# 3 SEMI-SUPERVISED FEW-SHOT LEARNING
|
| 67 |
+
|
| 68 |
+
We now define the semi-supervised setting considered in this work for few-shot learning.
|
| 69 |
+
|
| 70 |
+
The training set is denoted as a tuple of labeled and unlabeled examples: $( S , R )$ . The labeled portion is the usual support set $s$ of the few-shot learning literature, containing a list of tuples of inputs and targets. In addition to classic few-shot learning, we introduce an unlabeled set $\mathcal { R }$ containing only inputs: $\mathcal { R } = \{ \tilde { { \pmb { x } } } _ { 1 } , \tilde { { \pmb { x } } } _ { 2 } , \ldots , \tilde { { \pmb { x } } } _ { M } \}$ . As in the purely supervised setting, our models are trained to perform well when predicting the labels for the examples in the episode’s query set $\mathcal { Q }$ . Figure 2 shows a visualization of training and test episodes.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Example of the semi-supervised few-shot learning setup. Training involves iterating through training episodes, consisting of a support set $s$ , an unlabeled set $\mathcal { R }$ , and a query set $\mathcal { Q }$ . The goal is to use the labeled items (shown with their numeric class label) in $s$ and the unlabeled items in $\mathcal { R }$ within each episode to generalize to good performance on the corresponding query set. The unlabeled items in $\mathcal { R }$ may either be pertinent to the classes we are considering (shown above with green plus signs) or they may be distractor items which belong to a class that is not relevant to the current episode (shown with red minus signs). However note that the model does not actually have ground truth information as to whether each unlabeled example is a distractor or not; the plus/minus signs are shown only for illustrative purposes. At test time, we are given new episodes consisting of novel classes not seen during training that we use to evaluate the meta-learning method.
|
| 74 |
+
|
| 75 |
+
# 3.1 SEMI-SUPERVISED PROTOTYPICAL NETWORKS
|
| 76 |
+
|
| 77 |
+
In their original formulation, Prototypical Networks do not specify a way to leverage the unlabeled set $\mathcal { R }$ . In what follows, we now propose various extensions that start from the basic definition of prototypes $\pmb { p _ { c } }$ and provide a procedure for producing refined prototypes $\tilde { p } _ { c }$ using the unlabeled examples in $\mathcal { R }$ .
|
| 78 |
+
|
| 79 |
+
After the refined prototypes are obtained, each of these models is trained with the same loss function for ordinary Prototypical Networks of Equation 3, but replacing ${ \pmb p } _ { c }$ with $\tilde { p } _ { c }$ . That is, each query example is classified into one of the $N$ classes based on the proximity of its embedded position with the corresponding refined prototypes, and the average negative logprobability of the correct classification is used for training.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Left: The prototypes are initialized based on the mean location of the examples of the corresponding class, as in ordinary Prototypical Networks. Support, unlabeled, and query examples have solid, dashed, and white colored borders respectively. Right: The refined prototypes obtained by incorporating the unlabeled examples, which classifies all query examples correctly.
|
| 83 |
+
|
| 84 |
+
# 3.1.1 PROTOTYPICAL NETWORKS WITH SOFT $k$ -MEANS
|
| 85 |
+
|
| 86 |
+
We first consider a simple way of leveraging unlabeled examples for refining prototypes, by taking inspiration from semi-supervised clustering. Viewing each prototype as a cluster center, the refinement process could attempt to adjust the cluster locations to better fit the examples in both the support and unlabeled sets. Under this view, cluster assignments of the labeled examples in the support set are considered known and fixed to each example’s label. The refinement process must instead estimate the cluster assignments of the unlabeled examples and adjust the cluster locations (the prototypes) accordingly.
|
| 87 |
+
|
| 88 |
+
One natural choice would be to borrow from the inference performed by soft $k$ -means. We prefer this version of $k$ -means over hard assignments since hard assignments would make the inference non-differentiable. We start with the regular Prototypical Network’s prototypes $\pmb { p _ { c } }$ (as specified in Equation 1) as the cluster locations. Then, the unlabeled examples get a partial assignment $( \tilde { z } _ { j , c } )$ to each cluster based on their Euclidean distance to the cluster locations. Finally, refined prototypes are obtained by incorporating these unlabeled examples.
|
| 89 |
+
|
| 90 |
+
This process can be summarized as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\tilde { p } _ { c } = \frac { \sum _ { i } h ( { \bf x } _ { i } ) z _ { i , c } + \sum _ { j } h ( \tilde { x } _ { j } ) \tilde { z } _ { j , c } } { \sum _ { i } z _ { i , c } + \sum _ { j } \tilde { z } _ { j , c } } , \mathrm { w h e r e } z _ { j , c } = \frac { \exp \left( - | | h ( \tilde { x } _ { j } ) - p _ { c } | | _ { 2 } ^ { 2 } \right) } { \sum _ { c ^ { \prime } } \exp \left( - | | h ( \tilde { x } _ { j } ) - p _ { c ^ { \prime } } | | _ { 2 } ^ { 2 } \right) }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Predictions of each query input’s class is then modeled as in Equation 2, but using the refined prototypes $\tilde { p } _ { c }$ .
|
| 97 |
+
|
| 98 |
+
We could perform several iterations of refinement, as is usual in $k$ -means. However, we have experimented with various number of iterations and found results to not improve beyond a single refinement step.
|
| 99 |
+
|
| 100 |
+
# 3.1.2 PROTOTYPICAL NETWORKS WITH SOFT $k$ -MEANS WITH A DISTRACTOR CLUSTER
|
| 101 |
+
|
| 102 |
+
The soft $k$ -means approach described above implicitly assumes that each unlabeled example belongs to either one of the $N$ classes in the episode. However, it would be much more general to not make that assumption and have a model robust to the existence of examples from other classes, which we refer to as distractor classes. For example, such a situation would arise if we wanted to distinguish between pictures of unicycles and scooters, and decided to add an unlabeled set by downloading images from the web. It then would not be realistic to assume that all these images are of unicycles or scooters. Even with a focused search, some may be from similar classes, such as bicycle.
|
| 103 |
+
|
| 104 |
+
Since soft $k$ -means distributes its soft assignments across all classes, distractor items could be harmful and interfere with the refinement process, as prototypes would be adjusted to also partially account for these distractors. A simple way to address this is to add an additional cluster whose purpose is to capture the distractors, thus preventing them from polluting the clusters of the classes of interest:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\pmb { p _ { c } } = \left\{ \begin{array} { l l } { \frac { \sum _ { i } h ( \pmb { x _ { i } } ) z _ { i , c } } { \sum _ { i } z _ { i , c } } } & { \quad \mathrm { f o r } c = 1 . . . N } \\ { \mathbf { 0 } } & { \quad \mathrm { f o r } c = N + 1 } \end{array} \right.
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Here we take the simplifying assumption that the distractor cluster has a prototype centered at the origin. We also consider introducing length-scales $r _ { c }$ to represent variations in the within-cluster distances, specifically for the distractor cluster:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\tilde { z } _ { j , c } = \frac { \exp \left( - \frac { 1 } { r _ { c } ^ { 2 } } | | \tilde { x } _ { j } - p _ { c } | | _ { 2 } ^ { 2 } - A ( r _ { c } ) \right) } { \sum _ { c ^ { \prime } } \exp \left( - \frac { 1 } { r _ { c } ^ { 2 } } | | \tilde { x } _ { j } - p _ { c ^ { \prime } } | | _ { 2 } ^ { 2 } - A ( r _ { c ^ { \prime } } ) \right) } , \mathrm { ~ w h e r e ~ } A ( r ) = \frac { 1 } { 2 } \log ( 2 \pi ) + \log ( r )
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
For simplicity, we set $r _ { 1 \dots N }$ to 1 in our experiments, and only learn the length-scale of the distractor cluster rN+1.
|
| 117 |
+
|
| 118 |
+
# 3.1.3 PROTOTYPICAL NETWORKS WITH SOFT $k$ -MEANS AND MASKING
|
| 119 |
+
|
| 120 |
+
Modeling distractor unlabeled examples with a single cluster is likely too simplistic. Indeed, it is inconsistent with our assumption that each cluster corresponds to one class, since distractor examples may very well cover more than a single natural object category. Continuing with our unicycles and bicycles example, our web search for unlabeled images could accidentally include not only bicycles, but other related objects such as tricycles or cars. This was also reflected in our experiments, where we constructed the episode generating process so that it would sample distractor examples from multiple classes.
|
| 121 |
+
|
| 122 |
+
To address this problem, we propose an improved variant: instead of capturing distractors with a high-variance catch-all cluster, we model distractors as examples that are not within some area of any of the legitimate class prototypes. This is done by incorporating a soft-masking mechanism on the contribution of unlabeled examples. At a high level, we want unlabeled examples that are closer to a prototype to be masked less than those that are farther.
|
| 123 |
+
|
| 124 |
+
More specifically, we modify the soft $k$ -means refinement as follows. We start by computing normalized distances $\tilde { d } _ { j , c }$ between examples $\tilde { \mathbfit { x } } _ { j }$ and prototypes $\pmb { p _ { c } }$ :
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\tilde { d } _ { j , c } = \frac { d _ { j , c } } { \frac { 1 } { M } \sum _ { j } d _ { j , c } } , \ \mathrm { w h e r e } \ d _ { j , c } = | | h ( \tilde { \bf x } _ { j } ) - { \bf p } _ { c } | | _ { 2 } ^ { 2 }
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Then, soft thresholds $\beta _ { c }$ and slopes $\gamma _ { c }$ are predicted for each prototype, by feeding to a small neural network various statistics of the normalized distances for the prototype:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
[ \beta _ { c } , \gamma _ { c } ] = \mathrm { M L P } \left( \left[ \operatorname* { m i n } _ { j } ( \tilde { d } _ { j , c } ) , \operatorname* { m a x } _ { j } ( \tilde { d } _ { j , c } ) , \operatorname { v a r } _ { j } ( \tilde { d } _ { j , c } ) , \operatorname { s k e w } ( \tilde { d } _ { j , c } ) , \operatorname { k u r t } _ { j } ( \tilde { d } _ { j , c } ) \right] \right)
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
This allows each threshold to use information on the amount of intra-cluster variation to determine how aggressively it should cut out unlabeled examples.
|
| 137 |
+
|
| 138 |
+
Then, soft masks $m _ { j , c }$ for the contribution of each example to each prototype are computed, by comparing to the threshold the normalized distances, as follows:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\tilde { p } _ { c } = \frac { \sum _ { i } h ( { \bf x } _ { i } ) z _ { i , c } + \sum _ { j } h ( \tilde { x } _ { j } ) \tilde { z } _ { j , c } m _ { j , c } } { \sum _ { i } z _ { i , c } + \sum _ { j } \tilde { z } _ { j , c } m _ { j , c } } , \mathrm { ~ w h e r e ~ } m _ { j , c } = \sigma \left( - \gamma _ { c } \left( \tilde { d } _ { j , c } - \beta _ { c } \right) \right)
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $\sigma ( \cdot )$ is the sigmoid function.
|
| 145 |
+
|
| 146 |
+
When training with this refinement process, the model can now use its MLP in Equation 8 to learn to include or ignore entirely certain unlabeled examples. The use of soft masks makes this process entirely differentiable2. Finally, much like for regular soft $k$ -means (with or without a distractor cluster), while we could recursively repeat the refinement for multiple steps, we found a single step to perform well enough.
|
| 147 |
+
|
| 148 |
+
# 4 RELATED WORK
|
| 149 |
+
|
| 150 |
+
We summarize here the most relevant work from the literature on few-shot learning, semi-supervised learning and clustering.
|
| 151 |
+
|
| 152 |
+
The best performing methods for few-shot learning use the episodic training framework prescribed by meta-learning. The approach within which our work falls is that of metric learning methods. Previous work in metric-learning for few-shot-classification includes Deep Siamese Networks (Koch et al., 2015), Matching Networks (Vinyals et al., 2016), and Prototypical Networks (Snell et al., 2017), which is the model we extend to the semi-supervised setting in our work. The general idea here is to learn an embedding function that embeds examples belonging to the same class close together while keeping embeddings from separate classes far apart. Distances between embeddings of items from the support set and query set are then used as a notion of similarity to do classification. Lastly, closely related to our work with regard to extending the few-shot learning setting, Bachman et al. (2017) employ Matching Networks in an active learning framework where the model has a choice of which unlabeled item to add to the support set over a certain number of time steps before classifying the query set. Unlike our setting, their meta-learning agent can acquire ground-truth labels from the unlabeled set, and they do not use distractor examples.
|
| 153 |
+
|
| 154 |
+
Other meta-learning approaches to few-shot learning include learning how to use the support set to update a learner model so as to generalize to the query set. Recent work has involved learning either the weight initialization and/or update step that is used by a learner neural network (Ravi & Larochelle, 2017; Finn et al., 2017). Another approach is to train a generic neural architecture such as a memory-augmented recurrent network (Santoro et al., 2016) or a temporal convolutional network (Mishra et al., 2017) to sequentially process the support set and perform accurate predictions of the labels of the query set examples. These other methods are also competitive for few-shot learning, but we chose to extend Prototypical Networks in this work for its simplicity and efficiency.
|
| 155 |
+
|
| 156 |
+
As for the literature on semi-supervised learning, while it is quite vast (Zhu, 2005; Chapelle et al., 2010), the most relevant category to our work is related to self-training (Yarowsky, 1995; Rosenberg et al., 2005). Here, a classifier is first trained on the initial training set. The classifier is then used to classify unlabeled items, and the most confidently predicted unlabeled items are added to the training set with the prediction of the classifier as the assumed label. This is similar to our soft $k$ -Means extension to Prototypical Networks. Indeed, since the soft assignments (Equation 4) match the regular Prototypical Network’s classifier output for new inputs (Equation 2), then the refinement can be thought of re-feeding to a Prototypical Network a new support set augmented with (soft) self-labels from the unlabeled set.
|
| 157 |
+
|
| 158 |
+
Our algorithm is also related to transductive learning (Vapnik, 1998; Joachims, 1999; Fu et al., 2015), where the base classifier gets refined by seeing the unlabeled examples. In practice, one could use our method in a transductive setting where the unlabeled set is the same as the query set; however, here to avoid our model memorizing labels of the unlabeled set during the meta-learning procedure, we split out a separate unlabeled set that is different from the query set.
|
| 159 |
+
|
| 160 |
+
In addition to the original $k$ -Means method (Lloyd, 1982), the most related work to our setup involving clustering algorithms considers applying $k$ -Means in the presence of outliers (Hautamäki et al., 2005; Chawla & Gionis, 2013; Gupta et al., 2017). The goal here is to correctly discover and ignore the outliers so that they do not wrongly shift the cluster locations to form a bad partition of the true data. This objective is also important in our setup as not ignoring outliers (or distractors) will wrongly shift the prototypes and negatively influence classification performance.
|
| 161 |
+
|
| 162 |
+
Our contribution to the semi-supervised learning and clustering literature is to go beyond the classical setting of training and evaluating within a single dataset, and consider the setting where we must learn to transfer from a set of training classes $\mathcal { C } _ { \mathrm { t r a i n } }$ to a new set of test classes $\mathcal { C } _ { \mathrm { t e s t } }$ .
|
| 163 |
+
|
| 164 |
+
# 5 EXPERIMENTS
|
| 165 |
+
|
| 166 |
+
# 5.1 DATASETS
|
| 167 |
+
|
| 168 |
+
We evaluate the performance of our model on three datasets: two benchmark few-shot classification datasets and a novel large-scale dataset that we hope will be useful for future few-shot learning work.
|
| 169 |
+
|
| 170 |
+
Omniglot (Lake et al., 2011) is a dataset of 1,623 handwritten characters from 50 alphabets. Each character was drawn by 20 human subjects. We follow the few-shot setting proposed by Vinyals et al. (2016), in which the images are resized to $2 8 \times 2 8$ pixels and rotations in multiples of $9 0 ^ { \circ }$ are applied, yielding 6,492 classes in total. These are split into 4,112 training classes, 688 validation classes, and 1,692 testing classes.
|
| 171 |
+
|
| 172 |
+
miniImageNet (Vinyals et al., 2016) is a modified version of the ILSVRC-12 dataset (Russakovsky et al., 2015), in which 600 images for each of 100 classes were randomly chosen to be part of the dataset. We rely on the class split used by Ravi & Larochelle (2017). These splits use 64 classes for training, 16 for validation, and 20 for test. All images are of size $8 4 \times 8 4$ pixels.
|
| 173 |
+
|
| 174 |
+
tieredImageNet is our proposed dataset for few-shot classification. Like miniImagenet, it is a subset of ILSVRC-12. However, tieredImageNet represents a larger subset of ILSVRC-12 (608 classes rather than 100 for miniImageNet). Analogous to Omniglot, in which characters are grouped into alphabets, tieredImageNet groups classes into broader categories corresponding to higher-level nodes in the ImageNet (Deng et al., 2009) hierarchy. There are 34 categories in total, with each category containing between 10 and 30 classes. These are split into 20 training, 6 validation and 8 testing categories (details of the dataset can be found in the supplementary material). This ensures that all of the training classes are sufficiently distinct from the testing classes, unlike miniImageNet and other alternatives such as randImageNet proposed by Vinyals et al. (2016). For example, “pipe organ” is a training class and “electric guitar” is a test class in the Ravi & Larochelle (2017) split of miniImagenet, even though they are both musical instruments. This scenario would not occur in tieredImageNet since “musical instrument” is a high-level category and as such is not split between training and test classes. This represents a more realistic few-shot learning scenario since in general we cannot assume that test classes will be similar to those seen in training. Additionally, the tiered structure of tieredImageNet may be useful for few-shot learning approaches that can take advantage of hierarchical relationships between classes. We leave such interesting extensions for future work.
|
| 175 |
+
|
| 176 |
+
Table 1: Omniglot 1-shot classification results. In this table as well as those below “w/ D” denotes “with distractors”, where the unlabeled images contain irrelevant classes.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan=1 colspan=1>Models</td><td rowspan=1 colspan=1>Acc.</td><td rowspan=1 colspan=1>Acc. w/ D</td></tr><tr><td rowspan=1 colspan=1>Supervised</td><td rowspan=1 colspan=1>94.62 ± 0.09</td><td rowspan=1 colspan=1>94.62 ± 0.09</td></tr><tr><td rowspan=1 colspan=1>Semi-Supervised Inference</td><td rowspan=1 colspan=1>97.45 ± 0.05</td><td rowspan=1 colspan=1>95.08 ± 0.09</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means</td><td rowspan=1 colspan=1>97.25 ± 0.10</td><td rowspan=1 colspan=1>95.01 ± 0.09</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means+Cluster</td><td rowspan=1 colspan=1>97.68 ± 0.07</td><td rowspan=1 colspan=1>97.17 ± 0.04</td></tr><tr><td rowspan=1 colspan=1>Masked Soft k-Means</td><td rowspan=1 colspan=1>97.52 ± 0.07</td><td rowspan=1 colspan=1>97.30 ± 0.08</td></tr></table>
|
| 179 |
+
|
| 180 |
+
# 5.2 ADAPTING THE DATASETS FOR SEMI-SUPERVISED LEARNING
|
| 181 |
+
|
| 182 |
+
For each dataset, we first create an additional split to separate the images of each class into disjoint labeled and unlabeled sets. For Omniglot and tieredImageNet we sample $10 \%$ of the images of each class to form the labeled split. The remaining $90 \%$ can only be used in the unlabeled portion of episodes. For miniImageNet we use $40 \%$ of the data for the labeled split and the remaining $60 \%$ for the unlabeled, since we noticed that $10 \%$ was too small to achieve reasonable performance and avoid overfitting. We report the average classification scores over 10 random splits of labeled and unlabeled portions of the training set, with uncertainty computed in standard error (standard deviation divided by the square root of the total number of splits).
|
| 183 |
+
|
| 184 |
+
We would like to emphasize that due to this labeled/unlabeled split, we are using strictly less label information than in the previously-published work on these datasets. Because of this, we do not expect our results to match the published numbers, which should instead be interpreted as an upperbound for the performance of the semi-supervised models defined in this work.
|
| 185 |
+
|
| 186 |
+
Episode construction then is performed as follows. For a given dataset, we create a training episode by first sampling $N$ classes uniformly at random from the set of training classes $\mathcal { C } _ { \mathrm { t r a i n } }$ . We then sample $K$ images from the labeled split of each of these classes to form the support set, and $M$ images from the unlabeled split of each of these classes to form the unlabeled set. Optionally, when including distractors, we additionally sample $H$ other classes from the set of training classes and $M$ images from the unlabeled split of each to act as the distractors. These distractor images are added to the unlabeled set along with the unlabeled images of the $N$ classes of interest (for a total of $M N + M H$ unlabeled images). The query portion of the episode is comprised of a fixed number of images from the labeled split of each of the $N$ chosen classes. Test episodes are created analogously, but with the $N$ classes (and optionally the $H$ distractor classes) sampled from $\mathcal { C } _ { \mathrm { t e s t } }$ . In the experiments reported here we used $H = N = 5$ , i.e. 5 classes for both the labeled classes and the distractor classes. We used $M = 5$ for training and $M = 2 0$ for testing in most cases, thus measuring the ability of the models to generalize to a larger unlabeled set size. Details of the dataset splits, including the specific classes assigned to train/validation/test sets, can be found in Appendices A and B.
|
| 187 |
+
|
| 188 |
+
In each dataset we compare our three semi-supervised models with two baselines. The first baseline, referred to as “Supervised” in our tables, is an ordinary Prototypical Network that is trained in a purely supervised way on the labeled split of each dataset. The second baseline, referred to as “Semi-Supervised Inference”, uses the embedding function learned by this supervised Prototypical Network, but performs semi-supervised refinement of the prototypes at test time using a step of Soft $k$ -Means refinement. This is to be contrasted with our semi-supervised models that perform this refinement both at training time and at test time, therefore learning a different embedding function. We evaluate each model in two settings: one where all unlabeled examples belong to the classes of interest, and a more challenging one that includes distractors. Details of the model hyperparameters can be found in Appendix D and our online repository.3
|
| 189 |
+
|
| 190 |
+
# 5.3 RESULTS
|
| 191 |
+
|
| 192 |
+
Results for Omniglot, miniImageNet and tieredImageNet are given in Tables 1, 2 and 5, respectively, while Figure 4 shows the performance of our models on tieredImageNet (our largest dataset) using different values for $M$ (number of items in the unlabeled set per class). Additional results comparing the ProtoNet model to various baselines on these datasets, and analysis of the performance of the Masked Soft $k$ -Means model can be found in Appendix C.
|
| 193 |
+
|
| 194 |
+
Table 2: miniImageNet 1/5-shot classification results.
|
| 195 |
+
|
| 196 |
+
<table><tr><td rowspan=1 colspan=1>Models</td><td rowspan=1 colspan=1>1-shot Acc.</td><td rowspan=1 colspan=1>5-shot Acc.</td><td rowspan=1 colspan=1>1-shot Acc w/ D</td><td rowspan=1 colspan=1> 5-shot Acc. w/ D</td></tr><tr><td rowspan=1 colspan=1>Supervised</td><td rowspan=1 colspan=1>43.61 ± 0.27</td><td rowspan=1 colspan=1>59.08 ± 0.22</td><td rowspan=1 colspan=1>43.61 ± 0.27</td><td rowspan=1 colspan=1>59.08 ± 0.22</td></tr><tr><td rowspan=1 colspan=1>Semi-Supervised Inference</td><td rowspan=1 colspan=1>48.98 ± 0.34</td><td rowspan=1 colspan=1>63.77 ± 0.20</td><td rowspan=1 colspan=1>47.42 ± 0.33</td><td rowspan=1 colspan=1>62.62 ± 0.24</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means</td><td rowspan=1 colspan=1>50.09 ± 0.45</td><td rowspan=1 colspan=1>64.59 ± 0.28</td><td rowspan=1 colspan=1>48.70 ± 0.32</td><td rowspan=1 colspan=1>63.55 ± 0.28</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means+Cluster</td><td rowspan=1 colspan=1>49.03 ± 0.24</td><td rowspan=1 colspan=1>63.08 ± 0.18</td><td rowspan=1 colspan=1>48.86± 0.32</td><td rowspan=1 colspan=1>61.27 ± 0.24</td></tr><tr><td rowspan=1 colspan=1>Masked Soft k-Means</td><td rowspan=1 colspan=1>50.41 ± 0.31</td><td rowspan=1 colspan=1>64.39 ± 0.24</td><td rowspan=1 colspan=1>49.04 ± 0.31</td><td rowspan=1 colspan=1>62.96 ± 0.14</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 3: tieredImageNet 1/5-shot classification results.
|
| 199 |
+
|
| 200 |
+
<table><tr><td rowspan=1 colspan=1>Models</td><td rowspan=1 colspan=1>1-shot Acc.</td><td rowspan=1 colspan=1> 5-shot Acc.</td><td rowspan=1 colspan=1>1-shot Acc. w/ D</td><td rowspan=1 colspan=1> 5-shot Acc. w/ D</td></tr><tr><td rowspan=1 colspan=1>Supervised</td><td rowspan=1 colspan=1>46.52 ± 0.52</td><td rowspan=1 colspan=1>66.15 ± 0.22</td><td rowspan=1 colspan=1>46.52 ± 0.52</td><td rowspan=1 colspan=1>66.15 ± 0.22</td></tr><tr><td rowspan=1 colspan=1>Semi-Supervised Inference</td><td rowspan=1 colspan=1>50.74 ± 0.75</td><td rowspan=1 colspan=1>69.37 ± 0.26</td><td rowspan=1 colspan=1>48.67 ± 0.60</td><td rowspan=1 colspan=1>67.46 ± 0.24</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means</td><td rowspan=1 colspan=1>51.52 ± 0.36</td><td rowspan=1 colspan=1>70.25 ± 0.31</td><td rowspan=1 colspan=1>49.88 ± 0.52</td><td rowspan=1 colspan=1>68.32 ± 0.22</td></tr><tr><td rowspan=1 colspan=1>Soft k-Means+Cluster</td><td rowspan=1 colspan=1>51.85 ± 0.25</td><td rowspan=1 colspan=1>69.42 ± 0.17</td><td rowspan=1 colspan=1>51.36 ± 0.31</td><td rowspan=1 colspan=1>67.56 ± 0.10</td></tr><tr><td rowspan=1 colspan=1>Masked Soft k-Means</td><td rowspan=1 colspan=1>52.39 ± 0.44</td><td rowspan=1 colspan=1>69.88 ± 0.20</td><td rowspan=1 colspan=1>51.38 ± 0.38</td><td rowspan=1 colspan=1>69.08 ± 0.25</td></tr></table>
|
| 201 |
+
|
| 202 |
+
Across all three benchmarks, at least one of our proposed models outperforms the baselines, demonstrating the effectiveness of our semi-supervised meta-learning procedure. In the nondistractor settings, all three proposed models outperform the baselines in almost all the experiments, without a clear winner between the three models across the datasets and shot numbers. In the scenario where training and testing includes distractors, Masked Soft $k$ -Means shows the most robust performance across all three datasets, attaining the best results in each case but one. In fact this model reaches performance that is close to the upper bound based on the results without distractors.
|
| 203 |
+
|
| 204 |
+
From Figure 4, we observe clear improvements in test accuracy when the number of items in the unlabeled set per class grows from 0 to 25. These models were trained with $M = 5$ and thus are showing an ability to extrapolate in generalization. This confirms that, through meta-training, the models learn to acquire a better representation that is improved by semi-supervised refinement.
|
| 205 |
+
|
| 206 |
+
# 6 CONCLUSION
|
| 207 |
+
|
| 208 |
+
In this work, we propose a novel semi-supervised few-shot learning paradigm, where an unlabeled set is added to each episode. We also extend the setup to more realistic situations where the unlabeled set has novel classes distinct from the labeled classes. To address the problem that current fewshot classification datasets are too small for a labeled vs. unlabeled split and also lack hierarchical levels of labels, we introduce a new dataset, tieredImageNet. We propose several novel extensions of Prototypical Networks, and they show consistent improvements under semi-supervised settings compared to our baselines. As future work, we are working on incorporating fast weights (Ba et al., 2016; Finn et al., 2017) into our framework so that examples can have different embedding representations given the contents in the episode.
|
| 209 |
+
|
| 210 |
+
Acknowledgement Supported by grants from NSERC, Samsung, and the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of IARPA, DoI/IBC, or the U.S. Government.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 4: Model Performance on tieredImageNet with different numbers of unlabeled items during test time.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Jimmy Ba, Geoffrey E. Hinton, Volodymyr Mnih, Joel Z. Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 4331–4339, 2016.
|
| 218 |
+
|
| 219 |
+
Philip Bachman, Alessandro Sordoni, and Adam Trischler. Learning algorithms for active learning. 2017.
|
| 220 |
+
|
| 221 |
+
Olivier Chapelle, Bernhard Schölkopf, and Alexander Zien. Semi-Supervised Learning. The MIT Press, 1st edition, 2010. ISBN 0262514125, 9780262514125.
|
| 222 |
+
|
| 223 |
+
Sanjay Chawla and Aristides Gionis. k-means–: A unified approach to clustering and outlier detection. In Proceedings of the 2013 SIAM International Conference on Data Mining, pp. 189– 197. SIAM, 2013.
|
| 224 |
+
|
| 225 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
|
| 226 |
+
|
| 227 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In 34th International Conference on Machine Learning, 2017.
|
| 228 |
+
|
| 229 |
+
Yanwei Fu, Timothy M. Hospedales, Tao Xiang, and Shaogang Gong. Transductive multi-view zero-shot learning. IEEE Trans. Pattern Anal. Mach. Intell., 37(11):2332–2345, 2015.
|
| 230 |
+
|
| 231 |
+
Shalmoli Gupta, Ravi Kumar, Kefu Lu, Benjamin Moseley, and Sergei Vassilvitskii. Local search methods for k-means with outliers. Proceedings of the VLDB Endowment, 10(7):757–768, 2017.
|
| 232 |
+
|
| 233 |
+
Ville Hautamäki, Svetlana Cherednichenko, Ismo Kärkkäinen, Tomi Kinnunen, and Pasi Fränti. Improving k-means by outlier removal. In Scandinavian Conference on Image Analysis, pp. 978– 987. Springer, 2005.
|
| 234 |
+
|
| 235 |
+
Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pp. 87–94. Springer, 2001.
|
| 236 |
+
|
| 237 |
+
Thorsten Joachims. Transductive inference for text classification using support vector machines. In Proceedings of the Sixteenth International Conference on Machine Learning, 1999.
|
| 238 |
+
|
| 239 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 240 |
+
|
| 241 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, volume 2, 2015.
|
| 242 |
+
|
| 243 |
+
Brenden M. Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B. Tenenbaum. One shot learning of simple visual concepts. In Proceedings of the 33th Annual Meeting of the Cognitive Science Society, CogSci 2011, Boston, Massachusetts, USA, July 20-23, 2011, 2011.
|
| 244 |
+
|
| 245 |
+
Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2): 129–137, 1982.
|
| 246 |
+
|
| 247 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. CoRR, abs/1707.03141, 2017.
|
| 248 |
+
|
| 249 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In 5th International Conference on Learning Representations, 2017.
|
| 250 |
+
|
| 251 |
+
Chuck Rosenberg, Martial Hebert, and Henry Schneiderman. Semi-supervised self-training of object detection models. 2005.
|
| 252 |
+
|
| 253 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 254 |
+
|
| 255 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. In 33rd International Conference on Machine Learning, 2016.
|
| 256 |
+
|
| 257 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems 30, 2017.
|
| 258 |
+
|
| 259 |
+
Sebastian Thrun. Lifelong learning algorithms. In Learning to learn, pp. 181–209. Springer, 1998.
|
| 260 |
+
|
| 261 |
+
V.N. Vapnik. Statistical Learning Theory. Wiley, 1998. ISBN 9788126528929.
|
| 262 |
+
|
| 263 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29, pp. 3630–3638, 2016.
|
| 264 |
+
|
| 265 |
+
David Yarowsky. Unsupervised word sense disambiguation rivaling supervised methods. In Proceedings of the 33rd annual meeting on Association for Computational Linguistics, pp. 189– 196. Association for Computational Linguistics, 1995.
|
| 266 |
+
|
| 267 |
+
Xiaojin Zhu. Semi-supervised learning literature survey. 2005.
|
| 268 |
+
|
| 269 |
+
# A OMNIGLOT DATASET DETAILS
|
| 270 |
+
|
| 271 |
+
We used the following split details for experiments on Omniglot dataset. This is the same train/test split as (Vinyals et al., 2016), but we created our own validation split for selecting hyper-parameters. Models are trained on the train split only.
|
| 272 |
+
|
| 273 |
+
Train Alphabets: Alphabet_of_the_Magi, Angelic, Anglo-Saxon_Futhorc, Arcadian, Asomtavruli_(Georgian), Atemayar_Qelisayer, Atlantean, Aurek-Besh, Avesta, Balinese, Blackfoot_(Canadian_Aboriginal_Syllabics), Braille, Burmese_(Myanmar), Cyrillic, Futurama, Ge_ez, Glagolitic, Grantha, Greek, Gujarati, Gurmukhi (character 01-41), Inuktitut_(Canadian_Aboriginal_Syllabics), Japanese_(hiragana), Japanese_(katakana), Korean, Latin, Malay_(Jawi_-_Arabic), N_Ko, Ojibwe_(Canadian_Aboriginal_Syllabics), Sanskrit, Syriac_(Estrangelo), Tagalog, Tifinagh
|
| 274 |
+
|
| 275 |
+
Validation Alphabets: Armenian, Bengali, Early_Aramaic, Hebrew, Mkhedruli_(Geogian)
|
| 276 |
+
|
| 277 |
+
Test Alphabets: Gurmukhi (character 42-45), Kannada, Keble, Malayalam, Manipuri, Mongolian, Old_Church_Slavonic_(Cyrillic), Oriya, Sylheti, Syriac_(Serto), Tengwar, Tibetan, ULOG
|
| 278 |
+
|
| 279 |
+
# B tieredIMAGENET DATASET DETAILS
|
| 280 |
+
|
| 281 |
+
Each high-level category in tieredImageNet contains between 10 and 30 ILSVRC-12 classes (17.8 on average). In the ImageNet hierarchy, some classes have multiple parent nodes. Therefore, classes belonging to more than one category were removed from the dataset to ensure separation between training and test categories. Test categories were chosen to reflect various levels of separation between training and test classes. Some test categories (such as “working dog”) are fairly similar to training categories, whereas others (such as “geological formation”) are quite different. The list of categories is shown below and statistics of the dataset can be found in Table 4. A visualization of the categories according to the ImageNet hierarchy is shown in Figure 5. The full list of classes per category will also be made public, however for the sake of brevity we do not include it here.
|
| 282 |
+
|
| 283 |
+
Table 4: Statistics of the tieredImageNet dataset.
|
| 284 |
+
|
| 285 |
+
<table><tr><td></td><td>Train</td><td>Val</td><td>Test</td><td>Total</td></tr><tr><td>Categories</td><td>20</td><td>6</td><td>8</td><td>34</td></tr><tr><td>Classes</td><td>351</td><td>97</td><td>160</td><td>608</td></tr><tr><td>Images</td><td>448,695</td><td>124,261</td><td>206,209</td><td>779,165</td></tr></table>
|
| 286 |
+
|
| 287 |
+
Train Categories: n02087551 (hound, hound dog), n02092468 (terrier), n02120997 (feline, felid), n02370806 (ungulate, hoofed mammal), n02469914 (primate), n01726692 (snake, serpent, ophidian), n01674216 (saurian), n01524359 (passerine, passeriform bird), n01844917 (aquatic bird), n04081844 (restraint, constraint), n03574816 (instrument), n03800933 (musical instrument, instrument), n03125870 (craft), n04451818 (tool), n03414162 (game equipment), n03278248 (electronic equipment), n03419014 (garment), n03297735 (establishment), n02913152 (building, edifice), n04014297 (protective covering, protective cover, protection).
|
| 288 |
+
|
| 289 |
+
Validation Categories: n02098550 (sporting dog, gun dog), n03257877 (durables, durable goods, consumer durables), n03405265 (furnishing), n03699975 (machine), n03738472 (mechanism), n03791235 (motor vehicle, automotive vehicle),
|
| 290 |
+
|
| 291 |
+
Test Categories: n02103406 (working dog), n01473806 (aquatic vertebrate), n02159955 (insect), n04531098 (vessel), n03839993 (obstruction, obstructor, obstructer, impediment, impedimenta), n09287968 (geological formation, formation), n00020090 (substance), n15046900 (solid).
|
| 292 |
+
|
| 293 |
+
Table 5: Few-shot learning baseline results using labeled/unlabeled splits. Baselines either takes inputs directly from the pixel space or use a CNN to extract features. “rnd” denotes using a randomly initialized CNN, and “pre” denotes using a CNN that is pretrained for supervised classification for all training classes.
|
| 294 |
+
|
| 295 |
+
<table><tr><td rowspan="2">Models</td><td>Omniglot</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>1-shot</td><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>1-NN Pixel</td><td>40.39± 0.36</td><td>26.74 ± 0.48</td><td>31.43 ± 0.51</td><td>26.55± 0.50</td><td>30.79± 0.53</td></tr><tr><td>1-NN CNN rnd</td><td>59.55 ± 0.46</td><td>24.03 ± 0.38</td><td>27.54 ± 0.42</td><td>25.49 ± 0.45</td><td>30.01 ± 0.47</td></tr><tr><td>1-NN CNN pre</td><td>52.53 ± 0.51</td><td>32.90 ± 0.58</td><td>40.79 ± 0.76</td><td>32.76 ± 0.66</td><td>40.26 ± 0.67</td></tr><tr><td>LRPixel</td><td>49.15 ± 0.39</td><td>24.50 ± 0.41</td><td>33.33±0.68</td><td>25.70± 0.46</td><td>36.30± 0.62</td></tr><tr><td>LR CNN rnd</td><td>57.80 ± 0.45</td><td>24.10 ± 0.50</td><td>28.40 ± 0.42</td><td>26.55 ± 0.48</td><td>32.51 ± 0.52</td></tr><tr><td>LR CNN pre</td><td>48.49 ± 0.47</td><td>30.28 ± 0.54</td><td>40.27 ± 0.59</td><td>34.52 ± 0.68</td><td>43.58 ± 0.72</td></tr><tr><td>ProtoNet</td><td>94.62 ± 0.09</td><td>43.61 ± 0.27</td><td>59.08 ± 0.22</td><td>46.52 ± 0.32</td><td>66.15 ± 0.34</td></tr></table>
|
| 296 |
+
|
| 297 |
+
# C EXTRA EXPERIMENTAL RESULTS
|
| 298 |
+
|
| 299 |
+
# C.1 FEW-SHOT CLASSIFICATION BASELINES
|
| 300 |
+
|
| 301 |
+
We provide baseline results on few-shot classification using 1-nearest neighbor and logistic regression with either pixel inputs or CNN features. Compared with the baselines, Regular ProtoNet performs significantly better on all three few-shot classification datasets.
|
| 302 |
+
|
| 303 |
+
# C.2 NUMBER OF UNLABELED ITEMS
|
| 304 |
+
|
| 305 |
+
Figure 6 shows test accuracy values with different number of unlabeled items during test time.
|
| 306 |
+
Figure 7 shows our mask output value distribution of the Masked Soft $k$ -Means model on Omniglot.
|
| 307 |
+
The mask values have a bi-modal distribution, corresponding to distractor and non-distractor items.
|
| 308 |
+
|
| 309 |
+
# D HYPERPARAMETER DETAILS
|
| 310 |
+
|
| 311 |
+
For Omniglot, we adopted the best hyperparameter settings found for ordinary Prototypical Networks in Snell et al. (2017). In these settings, the learning rate was set to 1e-3, and cut in half every 2K updates starting at update 2K. We trained for a total of 20K updates. For miniImagenet and tieredImageNet, we trained with a starting learning rate of 1e-3, which we also decayed. We started the decay after 25K updates, and every 25K updates thereafter we cut it in half. We trained for a total of 200K updates. We used ADAM (Kingma & Ba, 2014) for the optimization of our models. For the MLP used in the Masked Soft $k$ -Means model, we use a single hidden layer with 20 hidden units with a tanh non-linearity for all 3 datasets. We did not tune the hyparameters of this MLP so better performance may be attained with a more rigorous hyperparameter search.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 6: Model Performance on tieredImageNet with different number of unlabeled items during test time. We include test accuracy numbers in this chart.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 7: Mask values predicted by masked soft k-means on Omniglot.
|
md/train/HJgJtT4tvB/HJgJtT4tvB.md
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RECLOR: A READING COMPREHENSION DATASET REQUIRING LOGICAL REASONING
|
| 2 |
+
|
| 3 |
+
Weihao $\mathbf { V } \mathbf { u } ^ { * }$ , Zihang Jiang∗, Yanfei Dong & Jiashi Feng
|
| 4 |
+
National University of Singapore
|
| 5 |
+
weihaoyu6@gmail.com, {jzihang, dyanfei}@u.nus.edu,
|
| 6 |
+
elefjia@nus.edu.sg
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recent powerful pre-trained language models have achieved remarkable performance on most of the popular datasets for reading comprehension. It is time to introduce more challenging datasets to push the development of this field towards more comprehensive reasoning of text. In this paper, we introduce a new Reading Comprehension dataset requiring logical reasoning (ReClor) extracted from standardized graduate admission examinations. As earlier studies suggest, human-annotated datasets usually contain biases, which are often exploited by models to achieve high accuracy without truly understanding the text. In order to comprehensively evaluate the logical reasoning ability of models on ReClor, we propose to identify biased data points and separate them into EASY set while the rest as HARD set. Empirical results show that state-of-the-art models have an outstanding ability to capture biases contained in the dataset with high accuracy on EASY set. However, they struggle on HARD set with poor performance near that of random guess, indicating more research is needed to essentially enhance the logical reasoning ability of current models.1
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Machine reading comprehension (MRC) is a fundamental task in Natural Language Processing, which requires models to understand a body of text and answer a particular question related to the context. With success of unsupervised representation learning in NLP, language pre-training based models such as GPT-2 (Radford et al., 2019), BERT (Devlin et al., 2019), XLNet (Yang et al., 2019) and RoBERTa (Liu et al., 2019) have achieved nearly saturated performance on most of the popular MRC datasets (Rajpurkar et al., 2016; Lai et al., 2017; Rajpurkar et al., 2018; Wang et al., 2018). It is time to challenge state-of-the-art models with more difficult reading comprehension tasks and move a step forward to more comprehensive analysis and reasoning over text (Dua et al., 2019).
|
| 15 |
+
|
| 16 |
+
In natural language understanding, logical reasoning is an important ability to examine, analyze and critically evaluate arguments as they occur in ordinary language according to the definition from Law School Admission Council (2019a). It is a significant component of human intelligence and is essential in negotiation, debate and writing etc. However, existing reading comprehension datasets have none or merely a small amount of data requiring logical reasoning, e.g., $0 \%$ in MCTest dataset (Richardson et al., 2013) and $1 . 2 \%$ in SQuAD (Rajpurkar et al., 2016) according to Sugawara & Aizawa (2016). One related task is natural language inference, which requires models to label the logical relationships of sentence pairs. However, this task only considers three types of simple logical relationships and only needs reasoning at sentence-level. To push the development of models in logical reasoning from simple logical relationship classification to multiple complicated logical reasoning and from sentence-level to passage-level, it is necessary to introduce a reading comprehension dataset targeting logical reasoning.
|
| 17 |
+
|
| 18 |
+
A typical example of logical reasoning questions is shown in Table 1. Similar to the format of multiple-choice reading comprehension datasets (Richardson et al., 2013; Lai et al., 2017), it contains a context, a question and four options with only one right answer. To answer the question in this example, readers need to identify the logical connections between the lines to pinpoint the conflict, then understand each of the options and select an option that solves the conflict. Human minds need extensive training and practice to get used to complex reasoning, and it will take immense efforts for crowdsourcing workers to design such logical reasoning questions. Inspired by the datasets extracted from standardized examinations (Lai et al., 2017; Clark et al., 2018), we build a dataset by selecting such logical reasoning questions from standardized exams such as GMAT 2 and LSAT 3. We finally collect 6,138 pieces of logical reasoning questions, which constitute a Reading Comprehension dataset requiring logical reasoning (ReClor).
|
| 19 |
+
|
| 20 |
+
Human-annotated datasets usually contain biases (Schwartz et al., 2017; Cai et al., 2017; Bugert et al., 2017; Poliak et al., 2018; Gururangan et al., 2018; Zellers et al., 2019), which are often exploited by neural network models as shortcut solutions to achieve high testing accuracy. For data points whose options can be selected correctly without knowing the contexts and questions, we classify them as biased ones. In order to fully assess the logical reasoning ability of the models, we propose to identify the biased data points and group them as EASY set, and put the rest into HARD set. Based on our experiments on these separate sets, we find that even the state-of-the-art models can only perform well on EASY set and struggle on HARD set as shown in Figure 1. This phenomenon shows that current models can well capture the biases in the dataset but lack the ability to understand the text and reason based on connections between the lines. On the other hand, human beings perform similarly on both the EASY and HARD set. It is thus observed that there is still a long way to go to equip models with true logical reasoning ability.
|
| 21 |
+
|
| 22 |
+
The contributions of our paper are two-fold. First, we introduce ReClor, a new reading comprehension dataset requiring logical reasoning. We use option-only-input baselines trained with different random seeds to identify the data points with biases in the testing set, and group them as EASY set, with the rest as HARD set to facilitate comprehensive evaluation. Second, we evaluate several stateof-the-art models on ReClor and find these pre-trained language models can perform well on EASY set but struggle on the HARD set. This indicates although current models are good at exploiting biases in the dataset, they are far from capable of performing real logical reasoning yet.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Performance comparison of state-of-the-art models and humans (graduate students) on EASY and HARD set of ReClor testing set.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Reading Comprehension Datasets. A variety of reading comprehension datasets have been introduced to promote the development of this field. MCTest (Richardson et al., 2013) is a dataset with 2,000 multiple-choice reading comprehension questions about fictional stories in the format similar to ReClor. Rajpurkar et al. (2016) proposed SQuAD dataset, which contains 107,785 questionanswer pairs on 536 Wikipedia articles. The authors manually labeled 192 examples of the dataset and found that the examples mainly require reasoning of lexical or syntactic variation. In an analysis of the above-mentioned datasets, Sugawara & Aizawa (2016) found that none of questions requiring logical reasoning in MCTest dataset (Richardson et al., 2013) and only $1 . 2 \%$ in SQuAD dataset (Rajpurkar et al., 2016). Lai et al. (2017) introduced RACE dataset by collecting the English exams for middle and high school Chinese students in the age range between 12 to 18. They hired crowd workers on Amazon Mechanical Turk to label the reasoning type of 500 samples in the dataset and show that around $70 \%$ of the samples are in the category of word matching, paraphrasing or single-sentence reasoning. To encourage progress on deeper comprehension of language,
|
| 30 |
+
|
| 31 |
+
# Context:
|
| 32 |
+
|
| 33 |
+
In jurisdictions where use of headlights is optional when visibility is good, drivers who use headlights at all times are less likely to be involved in a collision than are drivers who use headlights only when visibility is poor. Yet Highway Safety Department records show that making use of headlights mandatory at all times does nothing to reduce the overall number of collisions.
|
| 34 |
+
|
| 35 |
+
Question: Which one of the following, if true, most helps to resolve the apparent discrepancy in the information above?
|
| 36 |
+
|
| 37 |
+
# Options:
|
| 38 |
+
|
| 39 |
+
A. In jurisdictions where use of headlights is optional when visibility is good, one driver in four uses headlights for daytime driving in good weather.
|
| 40 |
+
B. Only very careful drivers use headlights when their use is not legally required.
|
| 41 |
+
C. The jurisdictions where use of headlights is mandatory at all times are those where daytime visibility is frequently poor.
|
| 42 |
+
D. A law making use of headlights mandatory at all times is not especially difficult to enforce.
|
| 43 |
+
Answer: B
|
| 44 |
+
|
| 45 |
+
Table 1: An example in the ReClor dataset which is modified from the Law School Admission Council (2019b).
|
| 46 |
+
|
| 47 |
+
more reading comprehension datasets requiring more complicated reasoning types are introduced, such as iterative reasoning about the narrative of a story (Kocisk ˇ y et al., 2018), multi-hop reasoning \` across multiple sentences (Khashabi et al., 2018) and multiple documents (Welbl et al., 2018), commonsense knowledge reasoning (Mihaylov et al., 2018; Zhang et al., 2018; Huang et al., 2019) and numerical discrete reasoning over paragraphs (Dua et al., 2019). However, to the best of our knowledge, although there are some datasets targeting logical reasoning in other NLP tasks mentioned in the next section, there is no dataset targeting evaluating logical reasoning in reading comprehension task. This work introduces a new dataset to fill this gap.
|
| 48 |
+
|
| 49 |
+
Logical Reasoning in NLP. There are several tasks and datasets introduced to investigate logical reasoning in NLP. The task of natural language inference, also known as recognizing textual entailment (Fyodorov et al., 2000; Condoravdi et al., 2003; Bos & Markert, 2005; Dagan et al., 2005; MacCartney & Manning, 2009) requires models to take a pair of sentence as input and classify their relationship types, i.e., ENTAILMENT, NEUTRAL, or CONTRADICTION. SNLI (Bowman et al., 2015) and MultiNLI (Williams et al., 2018) datasets are proposed for this task. However, this task only focuses on sentence-level logical relationship reasoning and the relationships are limited to only a few types. Another task related to logical reasoning in NLP is argument reasoning comprehension task introduced by Habernal et al. (2018) with a dataset of this task. Given an argument with a claim and a premise, this task aims to select the correct implicit warrant from two options. Although the task is on passage-level logical reasoning, it is limited to only one logical reasoning type, i.e., identifying warrants. ReClor and the proposed task integrate various logical reasoning types into reading comprehension, with the aim to promote the development of models in logical reasoning not only from sentence-level to passage-level, but also from simple logical reasoning types to the complicated diverse ones.
|
| 50 |
+
|
| 51 |
+
Datasets from Examinations. There have been several datasets extracted from human standardized examinations in NLP, such as RACE dataset (Lai et al., 2017) mentioned above. Besides, NTCIR QA Lab (Shibuki et al., 2014) offers comparative evaluation for solving real-world university entrance exam questions; The dataset of CLEF QA Entrance Exams Task (Rodrigo et al., 2015) is extracted from standardized English examinations for university admission in Japan; ARC dataset (Clark et al., 2018) consists of 7,787 science questions targeting student grade level, ranging from 3rd grade to 9th; The dialogue-based multiple-choice reading comprehension dataset DREAM (Sun et al., 2019) contains 10,197 questions for 6,444 multi-turn multi-party dialogues from English language exams that are designed by human experts to assess the comprehension level of Chinese learners of English. Compared with these datasets, ReClor distinguishes itself by targeting logical reasoning.
|
| 52 |
+
|
| 53 |
+
# 3 RECLOR DATA COLLECTION AND ANALYSIS
|
| 54 |
+
|
| 55 |
+
# 3.1 DATA COLLECTION
|
| 56 |
+
|
| 57 |
+
The format of data in ReClor is similar to other multiple-choice reading comprehension datasets (Richardson et al., 2013; Lai et al., 2017), where a data point contains a context, a question and four answer options, among which only one option is right/most suitable. We collect reading comprehension problems that require complicated logical reasoning. However, producing such data requires the ability to perform complex logical reasoning, which makes it hard for crowdsourcing workers to generate such logical questions. Fortunately, we find the reading comprehension problems in some standardized tests, such as GMAT and LSAT, are highly in line with our expectation.
|
| 58 |
+
|
| 59 |
+
Table 2: Statistics of several multiple-choice MRC datasets.
|
| 60 |
+
|
| 61 |
+
<table><tr><td></td><td>ReClor</td><td>DREAM</td><td>MCTest</td><td>ARC</td><td>RACE</td></tr><tr><td>construction method</td><td>exams</td><td>exams</td><td>crowd-sourcing</td><td>exams</td><td>exams</td></tr><tr><td>context type</td><td>written text</td><td>dialogues</td><td>child's stories</td><td>-</td><td>written text</td></tr><tr><td># of options</td><td>4</td><td>3</td><td>4</td><td>4</td><td>4</td></tr><tr><td># of context</td><td>6,138</td><td>6,444</td><td>660</td><td>-</td><td>27,933</td></tr><tr><td># of questions</td><td>6,138</td><td>10,197</td><td>2,640</td><td>7,787</td><td>97,687</td></tr><tr><td>Vocab size</td><td>26,576</td><td>13,037</td><td>8,000</td><td>6,329</td><td>136,629</td></tr><tr><td>Context Len</td><td>73.6</td><td>85.9</td><td>210.1</td><td>1</td><td>321.9</td></tr><tr><td>Question Len</td><td>17.0</td><td>8.6</td><td>7.8</td><td>20.5</td><td>10.0</td></tr><tr><td>Option Len</td><td>20.6</td><td>5.3</td><td>3.4</td><td>4.2</td><td>5.3</td></tr></table>
|
| 62 |
+
|
| 63 |
+
We construct a dataset containing 6,138 logical reasoning questions sourced from open websites and books. In the original problems, there are five answer options in which only one is right. To comply with fair use of law4, we shuffle the order of answer options and randomly delete one of the wrong options for each data point, which results in four options with one right option and three wrong options. Furthermore, similar to ImageNet dataset5, ReClor is available for non-commercial research purpose only. We are also hosting a public evaluation server on EvalAI (Yadav et al., 2019) to benchmark progress on Reclor.
|
| 64 |
+
|
| 65 |
+
# 3.2 DATA ANALYSIS
|
| 66 |
+
|
| 67 |
+
As mentioned above, we collect 6,138 data points, in which $9 1 . 2 2 \%$ are from actual exams of GMAT and LSAT while others are from high-quality practice exams. They are divided into training set, validation set and testing set with 4,638, 500 and 1,000 data points respectively. The overall statistics of ReClor and comparison with other similar multiple-choice MRC datasets are summarized in Table 2. As shown, ReClor is of comparable size and relatively large vocabulary size. Compared with RACE, the length of the context of ReCor is much shorter. In RACE, there are many redundant sentences in context to answer a question. However, in ReClor, every sentence in the context passages is important, which makes this dataset focus on evaluating the logical reasoning ability of models rather than the ability to extract relevant information from a long context. The length of answer options of ReClor is largest among these datasets. We analyze and manually annotate the types of questions on the testing set and group them into 17 categories, whose percentages and descriptions are shown in Table 3. The percentages of different types of questions reflect those in the logical reasoning module of GMAT and LSAT. Some examples of different types of logical reasoning are listed in Figure 2, and more examples are listed in the Appendix C. Taking two examples, we further express how humans would solve such questions in Table 4, showing the challenge of ReClor.
|
| 68 |
+
|
| 69 |
+
# 3.3 DATA BIASES IN THE DATASET
|
| 70 |
+
|
| 71 |
+
The dataset is collected from exams devised by experts in logical reasoning, which means it is annotated by humans and may introduce biases in the dataset. Recent studies have shown that models can utilize the biases in a dataset of natural language understanding to perform well on the task without truly understanding the text (Schwartz et al., 2017; Cai et al., 2017; Bugert et al., 2017; Poliak et al., 2018; Gururangan et al., 2018; Zellers et al., 2019). It is necessary to analyze such data biases to help evaluate models. In the ReClor dataset, the common context and question are shared across the four options for each data point, so we focus on the analysis of the difference in lexical choice and sentence length of the right and wrong options without contexts and questions. We first investigate the biases of lexical choice. We lowercase the options and then use WordPiece tokenization (Wu et al., 2016) of BERTBASE (Devlin et al., 2019) to get the tokens. Similar to
|
| 72 |
+
|
| 73 |
+
Table 3: The percentage and description of each logical reasoning type. The descriptions are adapted from those specified by Khan Academy (2019).
|
| 74 |
+
|
| 75 |
+
<table><tr><td>Type</td><td>Description</td></tr><tr><td>Necessary Assumptions (11.4%)</td><td>identify the claim that must be true or is required in order for the</td></tr><tr><td>Sufficient Assumptions (3.0%)</td><td>argument to work.</td></tr><tr><td></td><td>identify a sufficient assumption,that is,an assumption that,if added to the argument, would make it logically valid.</td></tr><tr><td>Strengthen (9.4%) Weaken (11.3%)</td><td>identify information that would strengthen an argument identify information that would weaken an argument</td></tr><tr><td>Evaluation (1.3%)</td><td>identify information that would be useful to know to evaluate an</td></tr><tr><td>Implication (4.6%)</td><td>argument identify something that follows logically from a set of premises</td></tr><tr><td>Conclusion/Main Point (3.6%) Most Strongly Supported (5.6%)</td><td>identify the conclusion/main point of a line of reasoning find the choice that is most strongly supported by a stimulus</td></tr><tr><td>Explain or Resolve (8.4%) Principle (6.5%)</td><td>identifyinformation that would explain orresolve a situation identify the principle,or find a situation that conforms to a princi-</td></tr><tr><td></td><td>ple,or match the principles</td></tr><tr><td>Dispute (3.0%) Technique (3.6%)</td><td>identify or infer an issue in dispute</td></tr><tr><td>Role (3.2%)</td><td>identify the technique used in the reasoning of an argument describe the individual role that a statement is playing in a larger</td></tr><tr><td>Identifya Flaw (11.7%)</td><td>argument</td></tr><tr><td>Match Flaws (3.1%)</td><td>identify a flaw in an argument's reasoning</td></tr><tr><td></td><td>find a choice containing an argument that exhibits the same flaws</td></tr><tr><td>Match the Structure (3.0%)</td><td>as the passage's argument</td></tr><tr><td>Others (7.3%)</td><td>match the structure of an argument in a choice to the structure of the argument in the passage</td></tr></table>
|
| 76 |
+
|
| 77 |
+
Poliak et al. (2018), for the tokens in options, we analyze their conditional probability of label $l \in \{ \mathrm { r i g h t , w r o n g } \}$ given by the token $t$ by $p ( l | t ) = c o u n i ( t , l ) / c o u n t ( t )$ . The larger the correlation score is for a particular token, the more likely it contributes to the prediction of related option. Table 5 reports tokens in training set which occur at least twenty times with the highest scores since many of the tokens with the highest scores are of low frequency. We further analyze the lengths of right and wrong options (Gururangan et al., 2018) in training set. We notice a slight difference in the distribution of sentence length for right and wrong options. The average length for wrong options is around 21.82 whereas that for right options is generally longer with an average length of 23.06.
|
| 78 |
+
|
| 79 |
+
Table 5: Top 10 tokens that correlate to right options with more than 20 occurrences.
|
| 80 |
+
|
| 81 |
+
<table><tr><td>Token</td><td>Score (%) Freq</td></tr><tr><td>motive</td><td>65.2 23</td></tr><tr><td>##ce</td><td>62.5 24</td></tr><tr><td>thereby</td><td>56.0 25</td></tr><tr><td>consequence</td><td>52.4 21</td></tr><tr><td>warm</td><td>52.4 21</td></tr><tr><td>interfere</td><td>52.2 23</td></tr><tr><td>contributes</td><td>52.2 23</td></tr><tr><td>manufacture</td><td>52.0 25</td></tr><tr><td>included</td><td>52.0 25</td></tr><tr><td>preferences</td><td>52.0 25</td></tr></table>
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: The distribution of the option length in ReClor with respect to right and wrong labels.
|
| 85 |
+
|
| 86 |
+
# 4 EXPERIMENTS
|
| 87 |
+
|
| 88 |
+
# 4.1 BASELINE MODELS
|
| 89 |
+
|
| 90 |
+
Many neural network based models such as FastText (Joulin et al., 2017), Bi-LSTM, GPT (Radford et al., 2018), GPT-2 (Radford et al., 2019), BERT (Devlin et al., 2019), XLNet (Yang et al., 2019),
|
| 91 |
+
|
| 92 |
+
# Context:
|
| 93 |
+
|
| 94 |
+
If the purpose of laws is to contribute to people’s happiness, we have a basis for criticizing existing laws as well as proposing new laws. Hence, if that is not the purpose, then we have no basis for the evaluation of existing laws, from which we must conclude that existing laws acquire legitimacy simply because they are the laws
|
| 95 |
+
|
| 96 |
+
Question: The reasoning in the argument is flawed in that the argument
|
| 97 |
+
|
| 98 |
+
# Options:
|
| 99 |
+
|
| 100 |
+
A. takes a sufficient condition for a state of affairs to be a necessary condition for it B. draws a conclusion about how the world actually is on the basis of claims about how it should be C. infers a causal relationship from the mere presence of a correlation D. trades on the use of a term in one sense in a premise and in a different sense in the conclusion
|
| 101 |
+
|
| 102 |
+
Answer: A
|
| 103 |
+
|
| 104 |
+
# Reasoning Process of Humans:
|
| 105 |
+
|
| 106 |
+
We may first look at the question to understand the specific task of the question – identify a flaw. We then analyze the argument in the context. The conclusion ‘existing laws acquire legitimacy simply because they are the laws.’ is based on the argument (purpose is NOT happiness) $\bf \Pi \Pi ( N O T$ basis for criticizing laws), which is obtained from the first statement: (purpose is happiness) (basis for criticizing laws). However, we know $\neg A \neg B$ cannot be obtained from $A B$ . Therefore, we should choose option A that describes this flaw. The distractors here are different types of reasoning flaws. Prior knowledge of basic logical rules is needed to correctly answer this question.
|
| 107 |
+
|
| 108 |
+
# Context:
|
| 109 |
+
|
| 110 |
+
Psychologist: Phonemic awareness, or the knowledge that spoken language can be broken into component sounds, is essential for learning to read an alphabetic language. But one also needs to learn how sounds are symbolically represented by means of letters; otherwise, phonemic awareness will not translate into the ability to read an alphabetic language. Yet many children who are taught by the whole-language method, which emphasizes the ways words sound, learn to read alphabetic languages.
|
| 111 |
+
|
| 112 |
+
Question: Which one of the following can be properly inferred from the psychologist’s statements?
|
| 113 |
+
|
| 114 |
+
# Options:
|
| 115 |
+
|
| 116 |
+
A. The whole-language method invariably succeeds in teaching awareness of how spoken language can be broken into component sounds.
|
| 117 |
+
B. Some children who are taught by the whole-language method are not prevented from learning how sounds are represented by means of letters.
|
| 118 |
+
C. The whole-language method succeeds in teaching many children how to represent sounds symbolically by means of letters.
|
| 119 |
+
D. When the whole-language method succeeds in teaching someone how to represent sounds by means of letters, that person acquires the ability to read an alphabetic language.
|
| 120 |
+
|
| 121 |
+
Answer: B
|
| 122 |
+
|
| 123 |
+
# Reasoning Process of Humans:
|
| 124 |
+
|
| 125 |
+
Looking at the question and we know that it is asking about implication. From the first two sentences in context, we know that there are two necessary conditions to read an alphabetic language: phonemic awareness and symbolic letters. We also learn [(NOT symbolic letters) AND (phonemic awareness)] $\nrightarrow$ read an alphabetic language (denoted as Formula 1). The last sentence in the context says that many children are taught by the whole-language method to learn a language. As for option A, from the context, we only know the whole language method works for ‘many’ children, which cannot be inferred to ‘invariably’ works. As for option B, combing three sentences in the context, we know that the whole-language method meets the two necessary conditions to learn a language, especially the last sentence mentions ‘learn to read alphabetic languages’. Children learn to read alphabetic languages means that they must recognize symbolic letters that represent sound because symbolic letters is a necessary condition of read an alphabetic language; otherwise, they cannot read because of Formula 1 mentioned above. Therefore, option B is correct. As for option C, from the context we only know the whole-language method teaches phonemic awareness and read an alphabetic language. Symbolic letters may be taught by other methods, so C is wrong. As for D, similar to C, symbolic letters may be taught by other methods and we also cannot obtain: symbolic letters read an alphabetic language.
|
| 126 |
+
|
| 127 |
+
Table 4: Two examples to show how humans would solve the questions.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
|
| 131 |
+
Figure 2: Examples of some question types. The correct options are marked by $\checkmark$ . More examples are shown in the Appendix C.
|
| 132 |
+
|
| 133 |
+
RoBERTa (Liu et al., 2019) have achieved impressive results in various NLP tasks. We challenge these neural models with ReClor to investigate how well they can perform. Details of the baseline models and implementation are shown in the Appendix A and B.
|
| 134 |
+
|
| 135 |
+
# 4.2 EXPERIMENTS TO FIND BIASED DATA
|
| 136 |
+
|
| 137 |
+
As mentioned earlier, biases prevalently exist in human-annotated datasets (Poliak et al., 2018; Gururangan et al., 2018; Zellers et al., 2019; Niven & Kao, 2019), which are often exploited by models to perform well without truly understanding the text. Therefore, it is necessary to find out the biased data points in ReClor in order to evaluate models in a more comprehensive manner (Sugawara et al., 2018). To this end, we feed the five strong baseline models (GPT, GPT-2, BERTBASE, XLNetBASE and RoBERTaBASE) with ONLY THE ANSWER OPTIONS for each problem. In other words, we purposely remove the context and question in the inputs. In this way, we are able to identify those problems that can be answered correctly by merely exploiting the biases in answer options without knowing the relevant context and question. However, the setting of this task is a multiple-choice question with 4 probable options, and even a chance baseline could have $2 5 \%$ probability to get it right. To eliminate the effect of random guess, we set four different random seeds for each model and pick the data points that are predicted correctly in all four cases to form the EASY set. Then, the data points which are predicted correctly by the models at random could be nearly eliminated, since any data point only has a probability of $( \dot { 2 5 } \% ) ^ { 4 } = 0 . 3 9 \%$ to be guessed right consecutively for four times. Then we unite the sets of data points that are consistently predicted right by each model, because intuitively different models may learn different biases of the dataset. The above process is formulated as the following expression,
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r l } & { \mathbb { C } _ { \mathrm { E A S Y } } = ( \mathbb { C } _ { \mathrm { G P T } } ^ { \mathrm { s e e d _ { 1 } } } \cap \mathbb { C } _ { \mathrm { G P T } } ^ { \mathrm { s e e d _ { 2 } } } \cap \mathbb { C } _ { \mathrm { G P T } } ^ { \mathrm { s e e d _ { 3 } } } \cap \mathbb { C } _ { \mathrm { G P T } } ^ { \mathrm { s e e d _ { 4 } } } ) } \\ & { \cup ( \mathbb { C } _ { \mathrm { G P T } - 2 } ^ { \mathrm { s e e d _ { 1 } } } \cap \mathbb { C } _ { \mathrm { G P T } - 2 } ^ { \mathrm { s e e d _ { 2 } } } \cap \mathbb { C } _ { \mathrm { G P T } - 2 } ^ { \mathrm { s e e d _ { 3 } } } \cap \mathbb { C } _ { \mathrm { G P T } - 2 } ^ { \mathrm { s e e d _ { 4 } } } ) } \\ & { \cup ( \mathbb { C } _ { \mathrm { B E R T } } ^ { \mathrm { s e e d _ { 1 } } } \cap \mathbb { C } _ { \mathrm { B E R T } } ^ { \mathrm { s e e d _ { 2 } } } \cap \mathbb { C } _ { \mathrm { B E R T } } ^ { \mathrm { s e e d _ { 3 } } } \cap \mathbb { C } _ { \mathrm { B E R T } } ^ { \mathrm { s e e d _ { 4 } } } ) } \\ & { \cup ( \mathbb { C } _ { \mathrm { X L N e t } } ^ { \mathrm { s e e d _ { 1 } } } \cap \mathbb { C } _ { \mathrm { X L N e t } } ^ { \mathrm { s e e d _ { 2 } } } \cap \mathbb { C } _ { \mathrm { X L N e t } } ^ { \mathrm { s e e d _ { 3 } } } \cap \mathbb { C } _ { \mathrm { X L N e t } } ^ { \mathrm { s e e d _ { 4 } } } ) } \\ & \cup ( \mathbb { C } _ { \mathrm { B o B E R T a } } ^ { \mathrm { s e e d _ { 1 } } } \cap \mathbb { C } _ { \mathrm { B o B E R T a } } ^ { \mathrm { s e e d _ { 2 } } } \cap \mathbb { C } _ { \mathrm { B o B E R T a } } ^ { \mathrm { s e e d _ { 3 } } } \cap \mathbb { C } _ { \mathrm { B o B E R T a } } ^ \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\mathbb { C } _ { \mathrm { H A R D } } = \mathbb { C } _ { \mathrm { T E S T } } - \mathbb { C } _ { \mathrm { E A S Y } } ,
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
where $\mathbb { C } _ { \mathrm { B E R T } } ^ { \mathrm { s e e d } _ { 1 } }$ denotes the set of data points which are predicted correctly by BERTBASE with seed 1, and similarly for the rest. Table 6 shows the average performance for each model trained with four different random seeds and the number of data points predicted correctly by all of them. Finally, we get 440 data points from the testing set CTEST and we denote this subset as EASY set CEASY and the other as HARD set $\mathbb { C } _ { \mathrm { H A R D } }$ .
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>Val</td><td>Test</td><td>Number</td></tr><tr><td>Chance</td><td>25.0</td><td>25.0</td><td>3.9</td></tr><tr><td>GPT</td><td>45.8</td><td>42.2</td><td>238</td></tr><tr><td>GPT-2</td><td>46.8</td><td>42.6</td><td>245</td></tr><tr><td>BERTBASE</td><td>47.2</td><td>43.2</td><td>234</td></tr><tr><td>XLNetBASE</td><td>47.5</td><td>43.2</td><td>225</td></tr><tr><td>RoBERTaBASE</td><td>48.8</td><td>41.7</td><td>200</td></tr><tr><td>Union</td><td>1</td><td>1</td><td>440</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 6: Average accuracy of each model using four different random seeds with only answer options as input, and the number of their common correct predictions.
|
| 152 |
+
|
| 153 |
+
# 4.3 TRANSFER LEARNING THROUGH FINE-TUNING
|
| 154 |
+
|
| 155 |
+
Among multiple-choice reading comprehension or QA datasets from exams, although the size of ReClor is comparable to those of ARC (Clark et al., 2018) and DREAM (Sun et al., 2019), it is much smaller than RACE Lai et al. (2017). Recent studies (Min et al., 2017; Howard & Ruder, 2018; Huang et al., 2019; Jin et al., 2019) have shown the effectiveness of pre-training on similar tasks or datasets then fine-tuning on the target dataset for transfer learning. Jin et al. (2019) find that by first training on RACE (Lai et al., 2017) and then further fine-tuning on the target dataset, the performances of BERTBASE on multiple-choice dataset MC500 (Richardson et al., 2013) and DREAM (Sun et al., 2019) can significantly boost from $6 9 . 5 \%$ to $8 1 . 2 \%$ , and from $6 3 . 2 \%$ to $7 0 . 2 \%$ , respectively. However, they also find that the model cannot obtain significant improvement even performs worse if it is first fine-tuned on span-based dataset like $\mathrm { S Q u A D }$ (Rajpurkar et al., 2016). ReClor is a multiple-choice dataset, so we choose RACE for fine-tuning study.
|
| 156 |
+
|
| 157 |
+
# 4.4 RESULTS AND ANALYSIS
|
| 158 |
+
|
| 159 |
+
The performance of all tested models on the ReClor is presented in Table 7. This dataset is built on questions designed for students who apply for admission to graduate schools, thus we randomly choose 100 samples from the testing set and divide them into ten tests, which are distributed to ten different graduate students in a university. We take the average of their scores and present it as the baseline of graduate students. The data of ReClor are carefully chosen and modified from only high-quality questions from standardized graduate entrance exams. We set the ceiling performance to $100 \%$ since ambiguous questions are not included in the dataset.
|
| 160 |
+
|
| 161 |
+
The performance of fastText is better than random guess, showing that word correlation could be used to help improve performance to some extent. It is difficult for Bi-LSTM to converge on this dataset. Transformer-based pre-training models have relatively good performance, close to the performance of graduate students. However, we find that these models only perform well on EASY set with around $7 5 \%$ accuracy, showing these models have an outstanding ability to capture the biases of the dataset, but they perform poorly on HARD set with only around $30 \%$ accuracy. In contrast, humans can still keep good performance on HARD set. We notice the difference in testing accuracy performed by graduate students on EASY and HARD set, but this could be due to the small number of students participated in the experiments. Therefore, we say humans perform relatively consistent on both biased and non-biased dataset.
|
| 162 |
+
|
| 163 |
+
Table 7: Accuracy $( \% )$ of models and human performance. The column Input means whether to input context (C), question (Q) and answer options (A). The RACE column represents whether to first use RACE to fine-tune before training on ReClor.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Model</td><td>Input</td><td>RACE</td><td>Val</td><td>Test</td><td>Test-E</td><td>Test-H</td></tr><tr><td>Chance</td><td>(C,Q,A)</td><td></td><td>25.0</td><td>25.0</td><td>25.0</td><td>25.0</td></tr><tr><td>fastText</td><td rowspan="4">(C, Q, A)</td><td></td><td>32.0</td><td>30.8</td><td>40.2</td><td>23.4</td></tr><tr><td>Bi-LSTM</td><td></td><td>27.8</td><td>27.0</td><td>26.4</td><td>27.5</td></tr><tr><td>GPT</td><td></td><td>47.6</td><td>45.4</td><td>73.0</td><td>23.8</td></tr><tr><td>GPT-2</td><td></td><td>52.6</td><td>47.2</td><td>73.0</td><td>27.0</td></tr><tr><td>BERTBASE</td><td>(C,Q,A) (C,Q,A)</td><td>√</td><td>54.6 55.2</td><td>47.3</td><td>71.6</td><td>28.2</td></tr><tr><td rowspan="4">BERTLARGE</td><td>(A)</td><td></td><td>46.4</td><td>49.5 42.4</td><td>68.9 69.3</td><td>34.3 21.3</td></tr><tr><td>(Q,A)</td><td></td><td>48.8</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>53.8</td><td>43.4 49.8</td><td>72.7</td><td>20.4</td></tr><tr><td>(C, Q,A) (C,Q,A)</td><td>√</td><td></td><td></td><td>72.0</td><td>32.3</td></tr><tr><td rowspan="2">XLNetBASE</td><td>(C,Q,,A)</td><td></td><td>55.6 55.8</td><td>54.5 50.4</td><td>73.9</td><td>39.3</td></tr><tr><td>(C,Q,A)</td><td>√</td><td>62.0</td><td>55.5</td><td>75.2 76.1</td><td>30.9 39.3</td></tr><tr><td rowspan="4">XLNetLARGE</td><td>(A)</td><td></td><td>45.0</td><td>42.9</td><td>66.1</td><td>24.6</td></tr><tr><td>(Q,A)</td><td></td><td>47.8</td><td>43.4</td><td>68.6</td><td></td></tr><tr><td>(C, Q,A)</td><td></td><td>62.0</td><td>56.0</td><td>75.7</td><td>23.6</td></tr><tr><td>(C,Q,A)</td><td>√</td><td>70.8</td><td>62.4</td><td></td><td>40.5</td></tr><tr><td rowspan="2">RoBERTaBASE</td><td>(C,Q,A)</td><td></td><td></td><td></td><td>77.7</td><td>50.4</td></tr><tr><td>(C,Q,A)</td><td>√</td><td>55.0</td><td>48.5</td><td>71.1</td><td>30.7</td></tr><tr><td rowspan="4">RoBERTaLARGE</td><td></td><td></td><td>56.8</td><td>53.0</td><td>72.5</td><td>37.7</td></tr><tr><td>(A)</td><td></td><td>48.8</td><td>43.2</td><td>69.5</td><td>22.5</td></tr><tr><td>(Q,A)</td><td></td><td>49.8</td><td>45.8</td><td>72.0</td><td>25.2</td></tr><tr><td>(C,Q, A) (C,Q,A)</td><td>厂</td><td>62.6</td><td>55.6</td><td>75.5</td><td>40.0</td></tr><tr><td>Graduate Students</td><td>(C,Q,A)</td><td></td><td>68.0</td><td>65.1 63.0</td><td>78.9 57.1</td><td>54.3 67.2</td></tr><tr><td>Ceiling Performance</td><td>(C, Q, A)</td><td></td><td>二 1</td><td>100</td><td>100</td><td>100</td></tr></table>
|
| 166 |
+
|
| 167 |
+
It is noticed that if the models are first trained on RACE and then fine-tuned on ReClor, they could obtain significant improvement, especially on HARD set. The overall performance of RoBERTaLARGE is even better than that of graduate students. This similar phenomenon can also be observed on DREAM dataset (Sun et al., 2019) by Jin et al. (2019), which shows the potential of transfer learning for reasoning tasks. However, even after fine-tuning on RACE, the best performance of these strong baselines on HARD set is around $50 \%$ , still lower than that of graduate students and far away from ceiling performance.
|
| 168 |
+
|
| 169 |
+
Experiments in different input settings are also done. Compared with the input setting of answer options only (A), the setting of questions and answer options (Q, A) can not bring significant improvement. This may be because some questions e.g., Which one of the following is an assumption required by the argument?, Which one of the following, if true, most strengthens the argument? can be used in the same reasoning types of question, which could not offer much information. Further adding context causes significant boost, showing the high informativeness of the context.
|
| 170 |
+
|
| 171 |
+
We further analyze the model performance with respect to different question types of logical reasoning. Some results are shown in Figure 4 and the full results are shown in Figure 5, 6 and 7 in the Appendix E. Three models of BERTLARGE, XLNetLARGE and RoBERTaLARGE perform well on most of types. On HARD set, the three models perform poorly on certain types such as STRENGTHEN, WEAKEN and ROLE which require extensive logical reasoning. However, they perform relatively better on other certain types, such as CONCLUSION/MAIN POINT and MATCH STRUCTURES that are more straight-forward. For the result of transfer learning, we analyze XLNetLARGE in detail. Though the overall performance is significantly boosted after fine-tuning on RACE first, the histograms in the bottom of Figure 4 show that on EASY set, accuracy of the model with fine-tuning on RACE is similar to that without it among most question types, while on HARD set, significant improvement on some question types is observed, such as CONCLUSION/MAIN POINT and MOST STRONGLY SUPPORTED. This may be because these types require less logical reasoning to some extent compared with other types, and similar question types may also be found in RACE dataset. Thus, the pre-training on RACE helps enhance the ability of logical reasoning especially of relatively simple reasoning types, but more methods are still needed to further enhance the ability especially that of relatively complex reasoning types.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 4: Performance of models on EASY (left) and HARD (right) testing sets and that of models. XLNetLARGE +Fine-Tune means the model is first fine-tuned on RACE before training on ReClor.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION
|
| 177 |
+
|
| 178 |
+
In this paper, we introduce ReClor, a reading comprehension dataset requiring logical reasoning, with the aim to push research progress on logical reasoning in NLP forward from sentence-level to passage-level and from simple logical reasoning to multiple complicated one. We propose to identify biased data points and split the testing set into EASY and HARD group for biased and non-biased data separately. We further empirically study the different behaviors of state-of-the-art models on these two testing sets, and find recent powerful transformer-based pre-trained language models have an excellent ability to exploit the biases in the dataset but have difficulty in understanding and reasoning given the non-biased data with low performance close to or slightly better than random guess. These results show there is a long way to equip deep learning models with real logical reasoning abilities. We hope this work would inspire more research in future to adopt similar split technique and evaluation scheme when reporting their model performance. We also show by first fine-tuning on a large-scale dataset RACE then fine-tuning on ReClor, the models could obtain significant improvement, showing the potential of transfer learning to solve reasoning tasks.
|
| 179 |
+
|
| 180 |
+
# ACKNOWLEDGMENTS
|
| 181 |
+
|
| 182 |
+
We would like to thank the anonymous reviewers for their insightful comments and suggestions; thank Rishabh Jain from Georgia Tech for helping build up the leaderboard of ReClor on EvalAI. Jiashi Feng was partially supported by NUS IDS R-263-000-C67-646, ECRA R-263-000-C87-133, MOE Tier-II R-263-000-D17-112 and AI.SG R-263-000-D97-490. Weihao Yu and Zihang Jiang would like to thank TFRC program for the support of computational resources.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Common crawl. http://http://commoncrawl.org, 2019.
|
| 187 |
+
|
| 188 |
+
Khan Academy. https://www.khanacademy.org/test-prep/lsat/lsat-lessons/ logical-reasoning/a/logical-reasoning--article--question-typecatalog, 2019. Accessed Sept. 16, 2019.
|
| 189 |
+
|
| 190 |
+
Johan Bos and Katja Markert. Recognising textual entailment with logical inference. In Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing, pp. 628–635. Association for Computational Linguistics, 2005.
|
| 191 |
+
|
| 192 |
+
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 632–642, 2015.
|
| 193 |
+
|
| 194 |
+
Michael Bugert, Yevgeniy Puzikov, Andreas Ruckl ¨ e, Judith Eckle-Kohler, Teresa Martin, Eugenio ´ Mart´ınez-Camara, Daniil Sorokin, Maxime Peyrard, and Iryna Gurevych. Lsdsem 2017: Explor- ´ ing data generation methods for the story cloze test. In Proceedings of the 2nd Workshop on Linking Models of Lexical, Sentential and Discourse-level Semantics, pp. 56–61, 2017.
|
| 195 |
+
|
| 196 |
+
Zheng Cai, Lifu Tu, and Kevin Gimpel. Pay attention to the ending: Strong neural baselines for the roc story cloze task. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 616–622, 2017.
|
| 197 |
+
|
| 198 |
+
Jamie Callan, Mark Hoy, Changkuk Yoo, and Le Zhao. Clueweb09 data set, 2009.
|
| 199 |
+
|
| 200 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
|
| 201 |
+
|
| 202 |
+
Cleo Condoravdi, Dick Crouch, Valeria De Paiva, Reinhard Stolle, and Daniel G Bobrow. Entailment, intensionality and text understanding. In Proceedings of the HLT-NAACL 2003 workshop on Text meaning, pp. 38–45, 2003.
|
| 203 |
+
|
| 204 |
+
Law School Admission Council. https://www.lsac.org/lsat/taking-lsat/testformat/logical-reasoning, 2019a. Accessed Sept. 16, 2019.
|
| 205 |
+
|
| 206 |
+
Law School Admission Council. https://www.lsac.org/lsat/taking-lsat/testformat/logical-reasoning/logical-reasoning-sample-questions, 2019b. Accessed Sept. 16, 2019.
|
| 207 |
+
|
| 208 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Springer, 2005.
|
| 209 |
+
|
| 210 |
+
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), pp. 4171–4186, 2019.
|
| 211 |
+
|
| 212 |
+
Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. Drop: A reading comprehension benchmark requiring discrete reasoning over paragraphs. In Proceedings of NAACL-HLT, pp. 2368–2378, 2019.
|
| 213 |
+
|
| 214 |
+
Yaroslav Fyodorov, Yoad Winter, and Nissim Francez. A natural logic inference system. In Proceedings of the 2nd Workshop on Inference in Computational Semantics (ICoS-2). Citeseer, 2000.
|
| 215 |
+
|
| 216 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R Bowman, and Noah A Smith. Annotation artifacts in natural language inference data. arXiv preprint arXiv:1803.02324, 2018.
|
| 217 |
+
|
| 218 |
+
Ivan Habernal, Henning Wachsmuth, Iryna Gurevych, and Benno Stein. The argument reasoning comprehension task: Identification and reconstruction of implicit warrants. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1930–1940, 2018.
|
| 219 |
+
|
| 220 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 328–339, 2018.
|
| 221 |
+
|
| 222 |
+
Lifu Huang, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2391–2401, 2019.
|
| 223 |
+
|
| 224 |
+
Di Jin, Shuyang Gao, Jiun-Yu Kao, Tagyoung Chung, and Dilek Hakkani-tur. Mmm: Multi-stage multi-task learning for multi-choice reading comprehension. arXiv preprint arXiv:1910.00458, 2019.
|
| 225 |
+
|
| 226 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 427–431. Association for Computational Linguistics, April 2017.
|
| 227 |
+
|
| 228 |
+
Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. Looking beyond the surface: A challenge set for reading comprehension over multiple sentences. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 252–262, 2018.
|
| 229 |
+
|
| 230 |
+
Toma´s Ko ˇ cisk ˇ y, Jonathan Schwarz, Phil Blunsom, Chris Dyer, Karl Moritz Hermann, G \` abor Melis, ´ and Edward Grefenstette. The narrativeqa reading comprehension challenge. Transactions of the Association for Computational Linguistics, 6:317–328, 2018.
|
| 231 |
+
|
| 232 |
+
Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. Race: Large-scale reading comprehension dataset from examinations. arXiv preprint arXiv:1704.04683, 2017.
|
| 233 |
+
|
| 234 |
+
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 |
+
|
| 236 |
+
Bill MacCartney and Christopher D Manning. An extended model of natural logic. In Proceedings of the eighth international conference on computational semantics, pp. 140–156. Association for Computational Linguistics, 2009.
|
| 237 |
+
|
| 238 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018.
|
| 239 |
+
|
| 240 |
+
Sewon Min, Minjoon Seo, and Hannaneh Hajishirzi. Question answering through transfer learning from large fine-grained supervision data. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 510–517, 2017.
|
| 241 |
+
|
| 242 |
+
Timothy Niven and Hung-Yu Kao. Probing neural network comprehension of natural language arguments. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4658–4664, 2019.
|
| 243 |
+
|
| 244 |
+
Robert Parker, David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. English gigaword fifth edition, 2011.
|
| 245 |
+
|
| 246 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 247 |
+
|
| 248 |
+
Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. Hypothesis only baselines in natural language inference. In Proceedings of the Seventh Joint Conference on Lexical and Computational Semantics, pp. 180–191, 2018.
|
| 249 |
+
|
| 250 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/researchcovers/languageunsupervised/language understanding paper. pdf, 2018.
|
| 251 |
+
|
| 252 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
|
| 253 |
+
|
| 254 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
|
| 255 |
+
|
| 256 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018.
|
| 257 |
+
|
| 258 |
+
Matthew Richardson, Christopher JC Burges, and Erin Renshaw. Mctest: A challenge dataset for the open-domain machine comprehension of text. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 193–203, 2013.
|
| 259 |
+
|
| 260 |
+
Alvaro Rodrigo, Anselmo Penas, Yusuke Miyao, Eduard H Hovy, and Noriko Kando. Overview of clef qa entrance exams task 2015. In CLEF (Working Notes), 2015.
|
| 261 |
+
|
| 262 |
+
Roy Schwartz, Maarten Sap, Ioannis Konstas, Leila Zilles, Yejin Choi, and Noah A Smith. Story cloze task: Uw nlp system. In Proceedings of the 2nd Workshop on Linking Models of Lexical, Sentential and Discourse-level Semantics, pp. 52–55, 2017.
|
| 263 |
+
|
| 264 |
+
Hideyuki Shibuki, Kotaro Sakamoto, Yoshinobu Kano, Teruko Mitamura, Madoka Ishioroshi, Kelly Y Itakura, Di Wang, Tatsunori Mori, and Noriko Kando. Overview of the ntcir-11 qa-lab task. In Ntcir, 2014.
|
| 265 |
+
|
| 266 |
+
Saku Sugawara and Akiko Aizawa. An analysis of prerequisite skills for reading comprehension. In Proceedings of the Workshop on Uphill Battles in Language Processing: Scaling Early Achievements to Robust Methods, pp. 1–5, 2016.
|
| 267 |
+
|
| 268 |
+
Saku Sugawara, Kentaro Inui, Satoshi Sekine, and Akiko Aizawa. What makes reading comprehension questions easier? In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4208–4219, 2018.
|
| 269 |
+
|
| 270 |
+
Kai Sun, Dian Yu, Jianshu Chen, Dong Yu, Yejin Choi, and Claire Cardie. Dream: A challenge data set and models for dialogue-based reading comprehension. Transactions of the Association for Computational Linguistics, 7:217–231, 2019.
|
| 271 |
+
|
| 272 |
+
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.
|
| 273 |
+
|
| 274 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353–355, 2018.
|
| 275 |
+
|
| 276 |
+
Johannes Welbl, Pontus Stenetorp, and Sebastian Riedel. Constructing datasets for multi-hop reading comprehension across documents. Transactions of the Association for Computational Linguistics, 6:287–302, 2018.
|
| 277 |
+
|
| 278 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1112–1122, 2018.
|
| 279 |
+
|
| 280 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 281 |
+
|
| 282 |
+
Deshraj Yadav, Rishabh Jain, Harsh Agrawal, Prithvijit Chattopadhyay, Taranjeet Singh, Akash Jain, Shiv Baran Singh, Stefan Lee, and Dhruv Batra. Evalai: Towards better evaluation systems for ai agents. arXiv preprint arXiv:1902.03570, 2019.
|
| 283 |
+
|
| 284 |
+
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.
|
| 285 |
+
|
| 286 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019.
|
| 287 |
+
|
| 288 |
+
Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. Record: Bridging the gap between human and machine commonsense reading comprehension. arXiv preprint arXiv:1810.12885, 2018.
|
| 289 |
+
|
| 290 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pp. 19–27, 2015.
|
| 291 |
+
|
| 292 |
+
# A BASELINE MODELS
|
| 293 |
+
|
| 294 |
+
fastText. FastText (Joulin et al., 2017) models sentences as a bag of n-grams, and tries to predict the probability of each answer being correct independently. We choose the answer with the highest score as the prediction for the multiple-choice setting.
|
| 295 |
+
|
| 296 |
+
LSTM sentence encoder. A two-layer bi-LSTM is randomly initialized as a sentence encoder with GloVe word embedding (Pennington et al., 2014). With a span of text as input, the last hidden state of the second layer is max-pooled and then fed into a fully-connected layer to compute the output score.
|
| 297 |
+
|
| 298 |
+
GPT and GPT-2. GPT (Radford et al., 2018) and GPT-2 (Radford et al., 2019) are both transformer (Vaswani et al., 2017) based models which are pre-trained using unsupervised method with a standard language modeling objective. GPT is pre-trained on BooksCorpus; GPT-2 is pre-trained using a larger dataset called WebText. Here we use the smallest model proposed in (Radford et al., 2019) as our GPT-2 baseline. To fine-tune on ReClor, the final hidden vector corresponding to the last input token ([ classify ]) is used as the aggregate representation followed by an extra fully connected layer to compute the score.
|
| 299 |
+
|
| 300 |
+
BERT. BERT (Devlin et al., 2019) is also a transformer (Vaswani et al., 2017) based model which is trained by using BooksCorpus (Zhu et al., 2015) and English Wikipedia in two unsupervised tasks, i.e., Masked LM (MLM) and Next Sentence Prediction (NSP). During fine-tuning, the final hidden vector corresponding to the first input token ([CLS]) is used as the aggregate representation followed by two extra fully connected layers to compute the score.
|
| 301 |
+
|
| 302 |
+
XLNet. XLNet (Yang et al., 2019) is trained with Permutation Language Modeling and without NSP. In addition, beside BooksCorpus and English Wikipedia used in BERT, it uses Giga5 (Parker et al., 2011), ClueWeb 2012-B (extended from (Callan et al., 2009)), and Common Crawl (com, 2019) for pre-training. We use the final hidden vector corresponding to the last input token ${ \mathrm { < c l s > } }$ as the aggregate representation and introduce two fully connected layers to predict the score.
|
| 303 |
+
|
| 304 |
+
RoBERTa. RoBERTa (Liu et al., 2019) is an improved pre-training procedure of BERT with training the model longer, with bigger batches over more data and removing NSP objective etc.. Extra two fully connected layers are added to transform the final hidden vector of the first input token ( $< S >$ to the score.
|
| 305 |
+
|
| 306 |
+
The input format of different models is shown in Table 8.
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Model</td><td colspan="4">Input Format</td></tr><tr><td>GPTRadford etal. (2018)</td><td></td><td>_start_Context _delimiter-Question</td><td>Option</td><td>-classify-</td></tr><tr><td>GPT-2 Radford et al. (2019)</td><td></td><td>-start-Context _delimiter- Question</td><td>二 Option</td><td>-classify-</td></tr><tr><td>BERT(Devlin et al.,2019)</td><td></td><td>[CLS] Context [SEP] Question Il</td><td>Option [SEP]</td><td>[PAD]...</td></tr><tr><td>XLNet (Yang et al.,2019)</td><td><pad>...</td><td>Context <sep> Question |l Option <sep> <cls></td><td></td><td></td></tr><tr><td>RoBERTa (Liu et al., 2019)</td><td></td><td><s> Context </s> </s> Question Il Option </s> <pad>...</td><td></td><td></td></tr></table>
|
| 309 |
+
|
| 310 |
+
Table 8: Input formats of different models. Context, Question and Option represent the token sequences of the context, question and option respectively, and || denotes concatenation.
|
| 311 |
+
|
| 312 |
+
# B IMPLEMENTATION DETAIL
|
| 313 |
+
|
| 314 |
+
Adam is used by all models. For fastText, we use its python library6 by converting ReClor to the required form, and keep the default setting of the hyper parameters. For Bi-LSTM, we use a twolayer Bidirectional LSTM with the GloVe 300d word embedding (Pennington et al., 2014) followed by max-pooling and a fully-connected layer. We train the model for 100 epochs using a batch size of 64 and learning rate of 0.1. A learning rate decay of 0.5 is also applied every 10 epochs. For pre-training models, we modify the code of Transformers of Hugging Face7 to implement them on ReClor. We use a batch size of 24 and fine-tune for 10 epochs. The maximum input sequence length for all models is 256. The detailed hyperparameters are shown in Table 9.
|
| 315 |
+
|
| 316 |
+
Table 9: Hyperparameters for finetuning pre-training language models on ReClor
|
| 317 |
+
|
| 318 |
+
<table><tr><td>HYPERPARAM</td><td>GPT</td><td>GPT-2</td><td>BERTBASE</td><td>BERTLARGE</td><td>XLNetBASE</td><td>XLNetLARGE</td><td>RoBERTaBASE</td><td>RoBERTaLARGE</td></tr><tr><td>LearningRate Batch Size</td><td>6.25e-5</td><td>6.25e-5</td><td>2e-5</td><td>2e-5</td><td>2e-5 24</td><td>2e-5</td><td>1e-5</td><td>1e-5</td></tr><tr><td>Max Seq Length Learning Rate Decay</td><td></td><td></td><td></td><td></td><td>256 Linear</td><td></td><td></td><td></td></tr><tr><td>Number of Epochs Warm-up Proportion</td><td></td><td></td><td></td><td></td><td>10 0.1</td><td></td><td></td><td></td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.01</td><td>0.0</td><td>0.0</td><td>0.01</td><td>0.01</td><td>0.01</td><td>0.01</td></tr><tr><td>Adam Epsilon</td><td>1e-8</td><td>1e-8</td><td>1e-6</td><td>1e-6</td><td>1e-6</td><td>1e-6</td><td>1e-6</td><td>1e-6</td></tr><tr><td>Adam Betas Clip Grad Norm</td><td>(0.9,0.999)</td><td>(0.9,0.999)</td><td>(0.9,0.999)</td><td>(0.9,0.999)</td><td>(0.9,0.999) Not</td><td>(0.9,0.999)</td><td>(0.9,0.98)</td><td>(0.9,0.98)</td></tr></table>
|
| 319 |
+
|
| 320 |
+
# C EXAMPLES
|
| 321 |
+
|
| 322 |
+
Table 10: The definition and an example of the logical reasoning type - Necessary Assumptions
|
| 323 |
+
|
| 324 |
+
<table><tr><td>Type:Necessary Assumptions Definition: identify the claim that must be true or is required in order for the argument to work</td></tr><tr><td>Context: Slash-and-burn agriculture involves burning several acres of forest,leaving vegetable ash that provides ample fertilizer for three or four years of bountiful crops.On the cleared land nutrients leach out of the soil,however,and the land becomes too poor to support agriculture. New land is then cleared by burning and the process starts again.Since most farming in the tropics uses this method,forests in this region will</td></tr><tr><td>eventually be permanently eradicated. Question: The argument depends on the assumption that</td></tr><tr><td>Options: A.forests in the tropics do not regenerate well enough to restore themselves once they have been cleared</td></tr><tr><td>by the slash-and-burn method B.some other methods of agriculture are not as destructive to the environment in tropical regions as the</td></tr><tr><td></td></tr><tr><td>slash-and-burn method is C.forests in the tropics are naturally deficient in nutrients that are needed to support the growth of plants</td></tr></table>
|
| 325 |
+
|
| 326 |
+
Table 11: The definition and an example of the logical reasoning type - Sufficient Assumptions
|
| 327 |
+
|
| 328 |
+
<table><tr><td>Type:Sufficient Assumptions Definition: identify a sufficient assumption,that is,an assumption that, if added to the argument, would make it logically valid</td></tr><tr><td>Context: Geologist: A new method for forecasting earthquakes has reliably predicted several earthquakes. Unfor- tunately,this method can predict only that an earthquake willfall somewhere within a range of two and a half points on the Richter scale.Thus,since a difference of two and a half points can be the difference</td></tr><tr><td>between a marginally perceptible shaking and a quake that causes considerable damage,the new method is unlikely to be useful. Question:Which one of the follwing,if assumed,enables the geologist's conclusion to be properly</td></tr><tr><td>inferred? Options:</td></tr><tr><td>A. An earthquake-forecasting method is unlikely to be useful unless its predictions always differentiate earthquakes that are barely noticeable from ones that result in substantial destruction. B.Several wel-established methods for forecasting earthquakes can predict within much narrower ranges</td></tr><tr><td>than two and a half points on the Richter scale. C.Even if an earthquake-forecasting method makes predictions within a very narrow range on the Richter scale,this method is not likely to be useful unless its predictions are reliable.</td></tr></table>
|
| 329 |
+
|
| 330 |
+
Table 12: The definition and an example of the logical reasoning type - Strengthen
|
| 331 |
+
|
| 332 |
+
<table><tr><td>Type:Strengthen Definition: identify information that would strengthen an argument</td></tr><tr><td>Context: Financial success does not guarantee happiness.This claim is not mere proverbial wisdom but a fact verified by statistics. In a recently concluded survey,only one-third of the respondents who claimed to</td></tr><tr><td>have achieved financial success reported that they were happy. Question:Which one of the following,if true,most strongly supports the conclusion drawn from the survey results?</td></tr><tr><td>Options: A.Most of the respondents who reported they were unhappy were in fact happy.</td></tr><tr><td>B.The respondents who reported financial success were,for the most part, financially successful.</td></tr><tr><td>C.Many of the respondents who claimed not to have achieved financial success reported that they were happy five years ago. D.Many of the respondents who failed to report financial success were in fact financially successful.</td></tr></table>
|
| 333 |
+
|
| 334 |
+
Table 13: The definition and an example of the logical reasoning type - Weaken
|
| 335 |
+
|
| 336 |
+
<table><tr><td>Type:Weaken Definition: identify information that would weaken an argument</td></tr><tr><td>Context: “DNA fingerprinting” is a recently-introduced biochemical procedure that uses a pattrn derived from a person' s genetic material to match a suspect’ s genetic material against that of a specimen from a crime scene.Proponents have claimed astronomically high odds against obtaining a match by chance alone.</td></tr><tr><td>These odds are based on an assumption that there is independence between the diferent characteristics represented by a single pattern.</td></tr><tr><td>Question:Which one of the following,if true,casts the most doubt on the claim of the proponents of DNA fingerprinting? Options:</td></tr><tr><td>A. The skil required of laboratory technicians performing the DNA fingerprinting procedure is not ex- traordinary. B.There is a generally accepted theoretical basis for interpreting the pattrns produced by the procedure.</td></tr><tr><td>C.In the whole population there are various different subgroups,within each of which certain sets of</td></tr><tr><td>genetic characteristics are shared. D.In the investigation of certain genetic diseases,the techniques used in DNA fingerprinting have traced</td></tr></table>
|
| 337 |
+
|
| 338 |
+
Table 14: The definition and an example of the logical reasoning type - Evaluation
|
| 339 |
+
|
| 340 |
+
<table><tr><td>Type:Evaluation Definition: identify information that would be useful to know to evaluate an argument</td></tr><tr><td>Context: George: Some scientists say that global warming willoccur because people are releasing large amounts of carbon dioxide into the atmosphere by burning trees and fossil fuels.We can see,though,that the predicted</td></tr><tr><td>warming is occurring already.In the middle of last winter, we had a month of springlike weather in our area,and this fall,because of unusually mild temperatures,the leaves on our town’ s trees were three weeks late in turning color.</td></tr><tr><td>Question: Which one of the following would it be most relevant to investigate in evaluating the conclusion of George's argument?</td></tr><tr><td>Options:</td></tr><tr><td>A.whether air pollution is causing some trees in the area to lose their leaves</td></tr><tr><td>B.what proportion of global emissions of carbon dioxide is due to the burning of trees by humans</td></tr></table>
|
| 341 |
+
|
| 342 |
+
Table 15: The definition and an example of the logical reasoning type - Implication
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Type:Implication Definition:identify something that follows logically from a set of premises</td></tr><tr><td>Context: To be horrific,a monster must be threatening.Whether or not it presents psychological, moral or social dangers,or triggers enduring infantile fears,if a monster is physically dangerous then it is threatening.In</td></tr><tr><td>fact,even a physically benign monster is horrific if it inspires revulsion. Question:Which one of the following logically follows from the statements above?</td></tr><tr><td>Options:</td></tr><tr><td>A.Any horror-story monster that is threatening is also horrific. B.If a monster triggers infantile fears but is not physically dangerous,then it is not horrific.</td></tr><tr><td>C. All monsters that are not physically dangerous,but that are psychologically dangerous and inspire revulsion,are threatening.</td></tr></table>
|
| 345 |
+
|
| 346 |
+
Table 16: The definition and an example of the logical reasoning type - Conclusion/Main Point
|
| 347 |
+
|
| 348 |
+
<table><tr><td>Type: Conclusion/Main Point Definition: identify the conclusion/main point of a line of reasoning</td></tr><tr><td>Context: Whether or not one can rightfully call a person’s faithfulness a virtue depends in part on the object of that person’s faithfulness.Virtues are by definition praiseworthy,which is why no one considers resentment virtuous,even though it is in facta kind of faithfulness-faithfulness to hatreds or animosities.</td></tr><tr><td>Question: Which one of the following most accurately expresses the overall conclusion drawn in the argument?</td></tr><tr><td>Options: A.The object of a person's faithfulness partially determines whether or not that faithfulness is virtuous.</td></tr><tr><td>B.Virtuous behavior is praiseworthy by definition.</td></tr><tr><td>C.Resentment should not be considered a virtuous emotion.</td></tr><tr><td>D.Behavior that emerges from hatred or animosity cannot be called virtuous. Answer:A</td></tr></table>
|
| 349 |
+
|
| 350 |
+
<table><tr><td>Type:Most Strongly Supported Definition: find the choice that is most strongly supported by a stimulus</td></tr><tr><td>Context: After a nuclear power plant accident,researchers found radioactive isotopes of iodine,tellurium,and cesium-but no heavy isotopes-in the atmosphere downwind. This material came either from spent fuel rods or from the plant’ s core. Spent fuel rods never contain significant quantities of telurium isotopes. Radioactive material ejected into the atmosphere directly from the core would include heavy isotopes.</td></tr><tr><td>After the accident,steam, which may have been in contact with the core,was released from the plant. The core contains iodine,tellurium,and cesium isotopes,which are easily dissolved by steam.</td></tr><tr><td>Question: Of the following statements,which one is most strongly supported by the information above? Options:</td></tr><tr><td>A. The nuclear power plant's spent fuel rods were not damaged.</td></tr><tr><td>B.Spent fuel rods do not contain heavy isotopes in significant quantities.</td></tr><tr><td></td></tr><tr><td>C.The researchers found some radioactive material from spent fuel rods as wellas some material that was</td></tr><tr><td>ejected into the atmosphere directly from the plant's core. D.The radioactive material detected by the researchers was carried into the atmosphere by the steam that was released from the plant.</td></tr></table>
|
| 351 |
+
|
| 352 |
+
Table 17: The definition and an example of the logical reasoning type - Most Strongly Supported
|
| 353 |
+
|
| 354 |
+
<table><tr><td>Type:Explain or Resolve Definition: identify information that would explain or resolve a situation</td></tr><tr><td>Context: To reduce the mosquito population in a resort area, hundreds of trees were planted that bear fruit attractive to birds. Over the years,as the trees matured,they atracted a variety of bird species and greatly increased the summer bird population in the area. As expected,the birds ate many mosquitoes.However, the</td></tr><tr><td>planting of the fruit trees had the very opposite of its intended effect. Question: Which one of the following,if true, most helps to explain the apparently paradoxical result?</td></tr><tr><td>Options: A. Most of the species of birds that were atracted by the trees that were planted did not eat mosquitoes.</td></tr><tr><td>B.Increases and decreases in mosquito populations tend to follow a cyclical pattern. C.The species of birds that were attracted in the greatest number by the fruit of the trees that were planted</td></tr><tr><td>did not eat mosquitoes. D.The birds attracted to the area by the trees ate many more insects that prey on mosquitoes than they did mosquitoes.</td></tr></table>
|
| 355 |
+
|
| 356 |
+
Table 18: The definition and an example of the logical reasoning type - Explain or Resolve
|
| 357 |
+
|
| 358 |
+
Table 19: The definition and an example of the logical reasoning type - Principle
|
| 359 |
+
|
| 360 |
+
<table><tr><td>Type:Principle Definition: identify the principle,or find a situation that conforms to a principle,or match the principles</td></tr><tr><td>Context: Buying elaborate screensavers - programs that put moving images on a computer monitor to prevent</td></tr><tr><td>damage-can cost a company far more in employee time than it saves in electricity and monitor protection. Employees cannot resist spending time playing with screensavers that flash interesting graphics across</td></tr><tr><td>their screens. Question:</td></tr><tr><td>Which one of the following most closely conforms to the principle illustrated above?</td></tr><tr><td>Options:</td></tr><tr><td>A.An electronic keyboard may be cheaper to buy than a piano but more expensive to repair. B.An energy-efficient insulation system may cost more up front but will ultimately save money over the</td></tr><tr><td>life of the house. C.The time that it takes to have a pizza delivered may be longer than it takes to cook a complete dinner.</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>D.A complicated hotel security system may cost more in customer goodwillthan it saves in losses by</td></tr><tr><td>theft. Answer: D</td></tr></table>
|
| 361 |
+
|
| 362 |
+
Table 20: The definition and an example of the logical reasoning type - Dispute
|
| 363 |
+
|
| 364 |
+
<table><tr><td>Type:Dispute Definition: identify or infer an issue in dispute</td></tr><tr><td>Context: Raphaela: Forcing people to help others is morally wrong. Therefore, no government has the right to redistribute resources via taxation. Anyone who wants can help others voluntarily. Edward: Governments</td></tr><tr><td>do have that right, insofar as they give people the freedom to leave and hence not to live under their authority.</td></tr><tr><td>Question: Raphaela and Edward disagree about the truth of which one of the following?</td></tr><tr><td>Options:</td></tr><tr><td>A.Any government that forces people to help others should permit emigration.</td></tr><tr><td>B.Any government that permits emigration has the right to redistribute resources via taxation.</td></tr><tr><td>C.Any government that redistributes resources via taxation forces people to help others. D.Every government should allow people to help others voluntarily.</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table 21: The definition and an example of the logical reasoning type - Technique
|
| 367 |
+
|
| 368 |
+
<table><tr><td>Type:Technique Definition: identify the technique used in the reasoning of an argument</td></tr><tr><td>Context: Joanna: The only way for a company to be successful,after emerging from bankruptcy, is to produce the same goods or services that it did before going bankrupt.It is futile for such a company to try to learn a</td></tr><tr><td>whole new business.Ruth: Wrong. The Kelton Company was a major mining operation that went into bankruptcy. On emerging from bankruptcy, Kelton turned its mines into landfils and is presently a highly successful waste-management concern.</td></tr><tr><td>Question:</td></tr><tr><td>Ruth uses which one of the following argumentative techniques in countering Joanna's argument? Options:</td></tr><tr><td>A. She undermines a claim by showing that it rests on an ambiguity.</td></tr><tr><td>B.She offers an alternative explanation for a phenomenon.</td></tr><tr><td>C. She presents a counterexample to a claim. D.She establishes a conclusion by excluding the only plausible alternative to that conclusion.</td></tr></table>
|
| 369 |
+
|
| 370 |
+
Answer: C
|
| 371 |
+
|
| 372 |
+
Table 22: The definition and an example of the logical reasoning type - Role
|
| 373 |
+
|
| 374 |
+
<table><tr><td>Type: Role Definition: describe the individual role that a statement is playing in a larger argument</td></tr><tr><td>Context: The position that punishment should be proportional to how serious the offense is but that repeat offenders should receive harsher punishments than first-time offenders is unsustainable.It implies that considera-</td></tr><tr><td>tions as remote as what an offender did years ago are relevant to the seriousness of an offense. If such remote considerations were relevant,almost every other consideration would be too.But this would make determining the seriousness of an offense so diffcult that it would be impossible to apply the proportion-</td></tr><tr><td>ality principle. Question: The statement that considerations as remote as what an offender did years ago are relevant to the serious-</td></tr><tr><td>ness of an offense plays which one of the following roles in the argument? Options: A.It is an allegedly untenable consequence of a view rejected in the argument's overallconclusion.</td></tr><tr><td></td></tr><tr><td>B.It is a statement the argument provides grounds to accept and from which the overall conclusion is</td></tr><tr><td>inferred.</td></tr></table>
|
| 375 |
+
|
| 376 |
+
# Answer: A
|
| 377 |
+
|
| 378 |
+
<table><tr><td>Type:Identifya Flaw Definition: identify a flaw in an argument's reasoning</td></tr><tr><td>Context: The tidal range at a particular location is the difference in height between high tide and low tide.Tidal studies have shown that one of the greatest tidal ranges in the world is found in the Bay of Fundy and</td></tr><tr><td>reaches more than seventeen meters. Since the only forces involved in inducing the tides are the sun' s and moon’ s gravity,the magnitudes of tidal ranges also must be explained entirely by gravitational forces. Question:</td></tr><tr><td>Which one of the following most accurately describes a flaw in the reasoning above? Options:</td></tr><tr><td>A.It does not differentiate between the tidal effect of the sun and the tidal effect of the moon.</td></tr><tr><td>B.It fails to consider that the size of a tidal range could be afected by the conditions in which gravitational</td></tr><tr><td>forces act.</td></tr><tr><td>C.It presumes, without providing warrant, that most activity within the world's oceans is a result of an interplay of gravitational forces.</td></tr></table>
|
| 379 |
+
|
| 380 |
+
Table 23: The definition and an example of the logical reasoning type - Identify a Flaw
|
| 381 |
+
|
| 382 |
+
Table 24: The definition and an example of the logical reasoning type - Match Flaws
|
| 383 |
+
|
| 384 |
+
<table><tr><td>Type:Match Flaws Definition: find a choice containing an argument that exhibits the same flaws as the passage's argument</td></tr><tr><td>Context: The museum’ s night security guard maintains that the thieves who stole the portrait did not enter the museum at any point at or above ground level. Therefore,the thieves must have gained access to the</td></tr><tr><td>museum from below ground level. Question:</td></tr><tr><td>The flawed pattern of reasoning in the argument above is most similar to that in which one of the follow- ing? Options:</td></tr><tr><td>A.As had generally ben expected, not all questionnaires were sent inby the official deadline.It follows that plans must have been made for the processing of questionnaires received late.</td></tr><tr><td>B. The store's competitors claim that the store,in selling off the shirts at those prices, neither made any profit nor broke even. Consequently,the store's customers must have been able to buy shirts there at less</td></tr><tr><td>than the store's cost.</td></tr><tr><td>C.The product label establishes that this insecticide is safe for both humans and pets.Therefore,the insecticide must also be safe for such wild mammals as deer and rabbits. D.If the census is to be believed,the percentage of men who are married is higher than the percentage of</td></tr></table>
|
| 385 |
+
|
| 386 |
+
<table><tr><td>Type:Match the Structure Definition: match the structure of an argument in a choice to the structure of the argument in the passage</td></tr><tr><td>Context: It is an absurd idea that whatever artistic endeavor the government refuses to support it does not allow, as one can see by rephrasing the statement to read: No one is allowed to create art without a government</td></tr><tr><td>subsidy. Question:</td></tr><tr><td>The pattern of reasoning in which one of the following is most similar to that in the argument above? Options:</td></tr><tr><td>A.The notion that every scientist who has been supported by a government grant will be successful is</td></tr><tr><td>absurd,as one can see by rewording it:No scientist is alowed to do research without a government grant.</td></tr><tr><td>B.The notion that every scientist who is supported by a government grant willbe successful is absurd,as one can see by rewording it:No scientist lacking governmental support will be successful.</td></tr><tr><td>C.The claim that any driver who is not arrested does not break the law is absurd,as one can see by rewording it: Every driver who gets arrested has broken the law. D.The claim that any driver who is not arrested does not break the law is absurd,as one can see by</td></tr></table>
|
| 387 |
+
|
| 388 |
+
Table 25: The definition and an example of the logical reasoning type - Match the Structure
|
| 389 |
+
|
| 390 |
+
Table 26: The definition and an example of the logical reasoning type - Others
|
| 391 |
+
|
| 392 |
+
<table><tr><td>Type:Others Definition: other types of questions which are not included by the above</td></tr><tr><td>Context: PhishCo runs a number of farms in the arid province of Nufa,depending largely on irrigation. Now, as part of a plan to effciently increase the farms‘ total production, it plans to drill down toan aquifer containing warm,slightly salty water that will be used to raise fish in ponds.The water from the ponds willater be used to supplement piped-in irrigation water for PhishCo's vegetable fields,and the ponds and accompanying vegetation should help reduce the heat in the area of the farms.</td></tr><tr><td>Question: Which of the following would,if true,most strongly suggest that the plan,if implemented, would increase</td></tr><tr><td>the overall efficiency of PhishCo's farms? Options: A. Organic waste from fish in the pond water will help to fertilize fields where it is used for irrigation. B.Fish raised on PhishCo's farms are likely to be saleable in the nearest urban areas.</td></tr></table>
|
| 393 |
+
|
| 394 |
+
Answer: A
|
| 395 |
+
|
| 396 |
+
# D CONSISTENCY OF DIFFERENT MODELS
|
| 397 |
+
|
| 398 |
+
Table 27: Overlap of each pair of models after intersection among 4 random seeds.
|
| 399 |
+
|
| 400 |
+
<table><tr><td></td><td>GPT</td><td>GPT-2</td><td>BERTBASE</td><td>XLNetBASE</td><td>RoBERTaBASE</td></tr><tr><td>GPT</td><td>245</td><td>164</td><td>152</td><td>142</td><td>116</td></tr><tr><td>GPT-2</td><td></td><td>238</td><td>151</td><td>144</td><td>123</td></tr><tr><td>BERTBASE</td><td></td><td></td><td>234</td><td>138</td><td>124</td></tr><tr><td>XLNetBASE</td><td></td><td></td><td></td><td>225</td><td>125</td></tr><tr><td>RoBERTaBASE</td><td></td><td></td><td></td><td></td><td>200</td></tr></table>
|
| 401 |
+
|
| 402 |
+
# E RESULTS WITH RESPECT TO DIFFERENT QUESTION TYPES
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 5: Accuracy of all baseline models on overall testing set
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
Figure 6: Accuracy of all baseline models on EASY set of testing set
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
Figure 7: Accuracy of all baseline models on HARD set of testing set
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 8: Performance of BERTLARGE (top) and RoBERTaLARGE (bottom) on EASY (left) and HARD (right) testing sets.
|
md/train/HJl0jiRqtX/HJl0jiRqtX.md
ADDED
|
@@ -0,0 +1,620 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EDDI: EFFICIENT DYNAMIC DISCOVERY OF HIGH-VALUE INFORMATION WITH PARTIAL VAE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Making decisions requires information relevant to the task at hand. Many real-life decision making situations allow acquiring further relevant information at a specific cost. For example, in assessing the health status of a patient we may decide to take additional measurements such as diagnostic tests or imaging scans before making a final assessment. More information that is relevant allows for better decisions but it may be costly to acquire all of this information. How can we trade off the desire to make good decisions with the option to acquire further information at a cost? To this end, we propose a principled framework, named EDDI (Efficient Dynamic Discovery of high-value Information), based on the theory of Bayesian experimental design. In EDDI we propose a novel partial variational autoencoder (Partial VAE), to efficiently handle missing data over varying subsets of known information. EDDI combines this Partial VAE with an acquisition function that maximizes expected information gain on a set of target variables. EDDI is efficient and demonstrates that dynamic discovery of high-value information is possible; we show cost reduction at the same decision quality and improved decision quality at the same cost in benchmarks and in two health-care applications. We believe there is great potential for realizing these gains in real-world decision support systems.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Imagine that a person walks into a hospital with a broken arm. The first question from health-care personnel would be: “How did you break the arm?” instead of “Do you have a cold?”, because the answer reveals relevant information for this patient. Human experts dynamically acquire information based on the current understanding of the situation. Automating this human expertise of asking relevant questions is difficult. In other applications such as online questionnaires for example, most existing online questionnaire system either present exhaustive questions (Lewenberg et al., 2017; Shim et al., 2018) or use extremely time-consuming human labeling work to manually build a decision tree for a reduced number of questions (Zakim et al., 2008). This wastes the valuable time of experts or users (patients). An automated solution for personalized dynamic acquisition of information has great potential to save much of this time in many real-life applications.
|
| 12 |
+
|
| 13 |
+
What are the technical challenges to build an intelligent information acquisition system? Missing data is a key issue: taking the questionnaire scenario as an example, at any point in time we only observe a small subset of answers yet have to reason about possible answers for the remaining questions. We thus need an accurate probabilistic model that can perform inference given a variable subset of observed answers. Another key problem is deciding what to ask next: this requires assessing the worth of each possible question or measurement, the exact computation of which is intractable. However, compared to current active learning methods we select individual features, not instances; therefore, existing methods are not applicable. In addition, these traditional methods are often not scalable to the large volume of data available in many practical cases (Settles, 2012).
|
| 14 |
+
|
| 15 |
+
We propose the EDDI (Efficient Dynamic Discovery of high-value Information) framework as a scalable information acquisition system for any given task. We assume that information acquisition is always associated with cost. Given a task, such as estimating the costumers’ experience or assessing population health status, we dynamically decide which piece of information to acquire next. The framework is very general, and the information can be presented in any form such as answers to questions, or values of a lab test. Our contributions are:
|
| 16 |
+
|
| 17 |
+
• We propose a novel efficient information acquisition framework, EDDI (Section 3). To enable EDDI, we contribute technically: 1. A partial amortized inference method with different specifications for the inference network (Section 3.2). We extend a current amortized inference method, the variational autoencoder (VAE) (Kingma & Welling, 2014; Rezende et al., 2014), to account for partial observations. The resulting method, which we call Partial VAE, is inspired by the set formulation of the data (Qi et al., 2017; Zaheer et al., 2017). Partial VAE, as a probabilistic framework, is highly scalable, and serves as the base for the EDDI framework. However, Partial VAE itself is generic and can be used on its own as a non-linear probabilistic framework for missing-data imputation. 2. An information theoretic acquisition function with an efficient approximation, yielding a novel variable-wise active learning method (Section 3.3). Based on the partial VAE, we select the unobserved variable which contributes most to the task, such as health assessment, evaluated using the mutual information. This acquisition function does not have an analytical solution and we derive an efficient approximation.
|
| 18 |
+
• We demonstrate the performance of EDDI on various settings, and apply it in real-life health-care scenarios (Section 4). 1. We first show the superior performance of the Partial VAE framework on an image inpainting task (Section 4.1). 2. We then use 6 different datasets from the Machine Learning repository of University of Irvine (UCI) (Dheeru & Karra Taniskidou, 2017) to demonstrate the behavior of EDDI, comparing with multiple baseline methods (Section 4.2). 3. Finally, we evaluate EDDI on two real-life health-care applications: risk assessment in intensive care (Section 4.3) and public health assessment with national survey (Section 4.4), where traditional methods without amortized inference do not scale. EDDI shows clear improvements in these two applications.
|
| 19 |
+
|
| 20 |
+
# 2 RELATED WORK
|
| 21 |
+
|
| 22 |
+
EDDI requires a method that handles partially observed data to enable dynamic variable wise active learning. We thus review related methods for handling partial observation and doing active learning.
|
| 23 |
+
|
| 24 |
+
# 2.1 PARTIAL OBSERVATION
|
| 25 |
+
|
| 26 |
+
Missing data entries are common in many real-life applications, which has created a long history of research on the topic of dealing with missing data (Rubin, 1976; Dempster et al., 1977). We describe existing methods below:
|
| 27 |
+
|
| 28 |
+
Traditional methods without amortization Prediction based methods have shown advantages for missing value imputation (Scheffer, 2002). Efficient matrix factorization based methods have been recently applied (Keshavan et al., 2010; Jain et al., 2010; Salakhutdinov & Mnih, 2008), where the observations are assumed to be able to decompose as multiplication of low dimensional matrices. In particular, many probabilistic frameworks with various distribution assumptions (Salakhutdinov & Mnih, 2008; Blei et al., 2003) have been used for missing value imputation (Yu et al., 2016; Hamesse et al., 2018) and also recommender systems where unlabeled items are predicted (Stern et al., 2009; Wang & Blei, 2011; Gopalan et al., 2014).
|
| 29 |
+
|
| 30 |
+
The probabilistic matrix factorization method has been used in the active variable selection framework, the dimensionality reduction active learning model (DRAL),(Lewenberg et al., 2017). These traditional methods suffer from limited model capacity since they are commonly linear. Additionally, they do not scale to large volumes of data and thus are usually not applicable in real-world applications. For example, Lewenberg et al. (2017) test the performance of their method with a single user due to the heavy computational cost of traditional inference methods for probabilistic matrix factorization.
|
| 31 |
+
|
| 32 |
+
Utilizing Amortized Inference The amortized inference (Kingma & Welling, 2014; Rezende et al., 2014; Zhang et al., 2017) has significantly improved the scalability for probabilistic models such as variational autoencoders (VAEs). In the case of partially observed data, amortized inference is particularly of interest due to the need of speeding up test time applications. Wu et al. (2018) employ traditional non-amortized inference in order to perform partial inference of a pretrained VAE during test time. Amortized inference is only used during training, assuming the training dataset is fully observed. During test time, the traditional inference is used to infer missing data entries from the partially observed dataset using the pre-trained model. In this way, only training time is reduced. The model is restrictive since it is not scalable in the test time and the fully observed training set is not available for many applications.
|
| 33 |
+
|
| 34 |
+
Nazabal et al. (2018) uses zero imputation (ZI) for amortized inference for both training and test sets with missing data entries. ZI is a generic and straightforward method that first fills the missing data with zeros, and then feeds the imputed data as input for the inference network. The drawback of zero imputation is that it introduces bias when the data are not missing completely at random which leads to not well-learned model. We also observe artifacts when using it for the image inpainting task. In the end, independent of our work, Garnelo et al. (2018) explore interpreting variational autoencoder (amortized inference) as stochastic processes, which also handles partial observation per se.
|
| 35 |
+
|
| 36 |
+
# 2.2 ACTIVE LEARNING
|
| 37 |
+
|
| 38 |
+
Traditional Active Learning Active learning, also referred to as experimental design, aims to obtain optimal performance with fewer selected data (or experiments) (Lindley, 1956; MacKay, 1992; Settles, 2012). Traditional active learning aims to select the next data point to label. Many information theoretical approaches have shown promising results in various settings with different acquisition functions (MacKay, 1992; McCallumzy & Nigamy, 1998; Houlsby et al., 2011). These methods commonly assume that there exist fully observed data, and the acquisition decision is instance wise. Little work has dealt with missing values within instances. Zheng & Padmanabhan (2002) deal with missing data values by imputing with traditional non-probabilistic methods (Little & Rubin, 1987) first. It is still an instance-wise active learning framework.
|
| 39 |
+
|
| 40 |
+
Different from traditional active learning, our proposed framework aims to for perform variable-wise active learning for each instance. In this setting, information theoretical acquisition functions need a new design as well as non-trivial approximations. The most closely related work is the aforementioned DRAL (Lewenberg et al., 2017), which deals with variable-wise active learning for each instance.
|
| 41 |
+
|
| 42 |
+
Active Feartue Acquisition (AFA) Active sequential feature selection is of great need, especially in cost-sensitive applications. Thus, many methods have also been applied and resulted in the class of methodologies called Active Feature Acquisition (AFA) (Melville et al., 2004; Saar-Tsechansky et al., 2009; Thahir et al., 2012; Huang et al., 2018). For instance, Melville et al. (2004); Saar-Tsechansky et al. (2009) have designed objectives to select any feature from any instance to minimize the cost to archive high accuracy. The proposed framework is very general. However, the problem setting of AFA methods are entirely different from our active variable selection problem: AFA mainly studies the optimization of optimal training set that would result in the best classifier (model), under limited budget of costs, while our framework studies a slightly different problem: given a pretrained model, how to identify and acquire high value information with minimal costs. Hence, AFA can not be directly applied. Also, AFA requires fully observed variables at test time, while our framework does not require this assumption. Last but not the least, the realization of these framework relies on various heuristics and suffer from limited scalability.
|
| 43 |
+
|
| 44 |
+
# 3 METHOD
|
| 45 |
+
|
| 46 |
+
In this section, we first formalize the active variable selection problem that we aim to solve. Then, we present our Partial VAE to model and perform inference on partial observations. Finally, we complete the EDDI framework by presenting our acquisition function and estimation method.
|
| 47 |
+
|
| 48 |
+
# 3.1 PROBLEM FORMULATION
|
| 49 |
+
|
| 50 |
+
The core problem that we address in this paper is the following active variable selection problem. Let $\mathbf { x } = [ x _ { 1 } , \ldots , x _ { | I | } ]$ be a set of random variables with probability density $p ( \mathbf { x } )$ . Furthermore, let a subset of the variables $\mathbf { x } _ { O }$ , $O \subset I$ , be observed while the variables $\mathbf { \Delta x } _ { U }$ , $U = I \backslash O$ , are unobserved. We assume that we can query the value of variables $x _ { i }$ for $i \in U$ . The goal of active variable selection is to query a sequence of variables in $U$ with the goal of predicting a quantity of interest $f ( \mathbf { x } )$ , as accurately as possible while simultaneously performing as little queries as possible, where $f ( \cdot )$ can be any (random) function. This problem, in the simplified myopic setting, can be formalized as that of proposing the next variable $x _ { i ^ { * } }$ to be queried by maximizing a reward function $R$ , i.e.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 1: Illustration of Partial VAE encoder architecture.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
i ^ { * } = \underset { i \in U } { \arg \operatorname* { m a x } } R ( i \mid \mathbf { x } _ { O } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $R ( i \mid \mathbf { x } _ { O } )$ quantifies the merit of our prediction of $f ( \cdot )$ given $\mathbf { x } _ { 0 }$ and $x _ { i }$ . Furthermore, the reward can quantify other properties important to the problem, e.g. the cost of acquiring $x _ { i }$ .
|
| 60 |
+
|
| 61 |
+
# 3.2 PARTIAL AMORTIZATION OF INFERENCE QUERIES
|
| 62 |
+
|
| 63 |
+
We first introduce how to establish a generative probabilistic model of random variables $\mathbf { X }$ , that is capable of handling unobserved (missing) variables $\mathbf { \Delta x } _ { U }$ with variable size. Our approach to this, named the Partial VAE, is based on the Variational autoencoder (VAE), which enables inference to scale to large volumes of data.
|
| 64 |
+
|
| 65 |
+
VAE and amortized inference VAE defines a generative model where the data $\mathbf { X }$ are generated from latent variables $\mathbf { z }$ , defined as $\begin{array} { r } { p ( \mathbf { x } , \mathbf { z } ; \boldsymbol { \theta } ) = \prod _ { n } \bar { p } ( \mathbf { x } _ { n } | \mathbf { z } _ { n } ; \boldsymbol { \theta } ) p ( \mathbf { z } _ { n } ) } \end{array}$ . The data generation, $p _ { \theta } ( \mathbf { x } _ { n } | \mathbf { z } _ { n } )$ , is realized by a deep neural network. To approximate the the posterior of the latent variable $p _ { \pmb { \theta } } ( \mathbf { z } _ { n } | \mathbf { x } _ { n } )$ , VAE uses amortized variational inference. Specifically, it uses an encoder, which is another neural network with the data ${ \bf { X } } _ { n }$ as input to produce the variational approximation of the posterior $q ( \mathbf { z } _ { n } | \mathbf { x } _ { n } ; \phi )$ . As traditional variational inference, VAE is trained by maximizing an evidence lower bound (ELBO), which is equivalent to minimize the KL divergence between $p _ { \theta } ( \mathbf { \bar { z } } _ { n } | \mathbf { x } _ { n } )$ and $q ( { \bf z } _ { n } | { \bf x } _ { n } ; \phi )$ .
|
| 66 |
+
|
| 67 |
+
VAE is not directly applicable to data with missing values. Consider a partitioning that divides the variables into observed variables $\mathbf { x } _ { O }$ and unobserved variables $\mathbf { \Delta x } _ { U }$ . In this setting, we would like to efficiently and accurately infer $p ( \mathbf { z } | \mathbf { x } _ { O } )$ and $p ( \mathbf { x } _ { U } | \mathbf { x } _ { O } )$ . One challenge in the above setting is that there are many possible partitioning of $\{ U , O \}$ , where the size of observed ratings might vary. Therefore, classic approaches to train a VAE with variational bound and amortize inference networks are no longer directly applicable. We propose to extend amortization to our partial inference situation.
|
| 68 |
+
|
| 69 |
+
Partial VAE In a VAE, a factorized structure for $p ( \mathbf { x } | \mathbf { z } )$ is always assumed, i.e.
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
p ( \mathbf { x } | \mathbf { z } ) = \prod _ { i } p _ { i } ( \mathbf { x } _ { i } | \mathbf { z } ) .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
This implies that given $\mathbf { z }$ , the observed variables $\mathbf { x } _ { O }$ are conditionally independent of $\mathbf { \Delta x } _ { U }$ . Therefore,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r } { p ( \mathbf { x } _ { U } | \mathbf { x } _ { O } , \mathbf { z } ) = p ( \mathbf { x } _ { U } | \mathbf { z } ) , } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
and inferences about $\mathbf { \Delta x } _ { U }$ can be reduced to inference about $\mathbf { z }$ . Therefore, the key object of interest in this setting is $p ( \mathbf { z } | \mathbf { x } _ { O } )$ , i.e., the posterior over the shared latent variables $\mathbf { z }$ given the observed variables $\mathbf { x } _ { O }$ . Once knowledge about $\mathbf { z }$ is obtained, we can draw correct inferences about $\mathbf { \Delta x } _ { U }$ . To approximate $p ( \mathbf { z } | \mathbf { x } _ { O } )$ we introduce an auxiliary variational inference network $q ( { \bf z } | { \bf x } _ { O } )$ and define a partial variational upper bound,
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r l r } { D _ { \mathrm { K L } } ( q ( \mathbf { z } | \mathbf { x } _ { O } ) \| p ( \mathbf { z } | \mathbf { x } _ { O } ) ) } & { = } & { \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } _ { O } ) } [ \log q ( \mathbf { z } | \mathbf { x } _ { O } ) - \log p ( \mathbf { z } | \mathbf { x } _ { O } ) ] } \\ & { \leq } & { \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } _ { O } ) } [ \log q ( \mathbf { z } | \mathbf { x } _ { O } ) - \log p ( \mathbf { x } _ { O } | \mathbf { z } ) - \log p ( \mathbf { z } ) ] \equiv \mathcal { L } _ { p a r i a l } . } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
This bound, $\mathcal { L } _ { p a r t i a l }$ , depends only on the observation $\mathbf { x } _ { O }$ , which could vary between different data points. We call the auxiliary distribution $q ( { \bf z } | { \bf x } _ { O } )$ the partial inference net since it takes a set of partially observed variables $\mathbf { x } _ { O }$ whose length may vary. Specifying $q ( { \bf z } | { \bf x } _ { O } )$ requires distribution over random partitioning $\{ O , U \}$ .
|
| 88 |
+
|
| 89 |
+
Amortized Inference with partial observations Inspired by the Point Net (PN) approach for point cloud classification (Qi et al., 2017; Zaheer et al., 2017), we specify the approximate distribution $q ( { \bf z } | { \bf x } _ { O } )$ by a permutation invariant set function encoding, given by:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathbf { c } ( \mathbf { x } _ { O } ) : = g ( h ( \mathbf { s } _ { 1 } ) , h ( \mathbf { s } _ { 2 } ) , . . . , h ( \mathbf { s } _ { | O | } ) ) ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $| O |$ is the number of the observed variables, ${ \bf s } _ { d }$ carries the information of the input identify $\mathbf { e } _ { d }$ and the input value $x _ { d }$ . There are many ways to define $\mathbf { e } _ { d }$ . Naively, it could be the coordinates for points in the point cloud, and one-hot embedding of the number of questions in a questionnaire. With different problem settings, it can be beneficial to learn e as an embedding of the identity of the variable, either with or without an naive encoding as input. In this work, we treat e as an unknown embedding, which is optimized during training process.
|
| 96 |
+
|
| 97 |
+
There are also different ways to construct ${ \bf s } _ { d }$ . Concatenation, $\mathbf { s } _ { d } = [ \mathbf { e } _ { d } , x _ { d } ]$ , is commonly used in computer vision applications (Qi et al., 2017). Such architecture is illustrated in Figure 1(a). However, we note that the construction of ${ \bf s } _ { d }$ can be flexible. We propose to construct $\mathbf { s } = \mathbf { e } _ { d } * x _ { d }$ using elementwise multiplication, shown in Figure 1(b). We show that this formulation generalizes naive Zero Imputation (ZI) VAE (Nazabal et al., 2018). We call this approach Pointnet Plus (PNP) specification of Partial VAE. The theoretical consideration of relating ZI to PNP is presented in Appendix C.1.
|
| 98 |
+
|
| 99 |
+
We then use a neural network $h ( \cdot )$ to map input s from $\mathbb { R } ^ { M + 1 }$ to $\mathbb { R } ^ { K }$ , where $M$ is the dimension of each $\mathbf { e } _ { d }$ , $x _ { d }$ is a scalar, and $K$ is the latent space size. Key to the PN structure is the permutation invariant aggregation operation $g ( \cdot )$ , such as max-pooling or summation. In this way, the mapping $\mathbf { c } ( \mathbf { x } _ { O } )$ is invariant to permutations of elements of $\mathbf { x } _ { O }$ and $\mathbf { x } _ { O }$ can have arbitrary length. Finally, the fixed-size code $\mathbf { c } ( \mathbf { x } _ { O } )$ is fed into an ordinary amortized inference net, that transforms the code into the statistics of a multivariate Gaussian distribution to approximate $p ( \mathbf { z } | \mathbf { x } _ { O } )$ . The procedure is illustrated in the first dashed box in Figure 1, which is our basic Partial VAE method.
|
| 100 |
+
|
| 101 |
+
# 3.3 EFFICIENT DYNAMIC DISCOVERY OF HIGH-VALUE INFORMATION
|
| 102 |
+
|
| 103 |
+
We now cast the active variable selection problem (1) as adaptive Bayesian experimental design, utilizing $p ( \mathbf { x } _ { U } | \mathbf { x } _ { O } )$ inferred by Partial VAE. Algorithm 1 summarize the EDDI framework.
|
| 104 |
+
|
| 105 |
+
Information Reward We designed a variable selection acquisition function in an information theoretical way following Bayesian experimental design (Lindley, 1956; Bernardo, 1979). Lindley (1956) provides a generic formulation of Bayesian experimental design by maximizing the expected Shannon information. Bernardo (1979) generalizes it by considering the decision task context.
|
| 106 |
+
|
| 107 |
+
For a given task, we may be interested in statistics of some variables $\mathbf { X } _ { \phi }$ , where $\mathbf { x } _ { \phi } \subset \mathbf { x } _ { U }$ . Given a new instance (user), assume we have observed $\mathbf { x } _ { O }$ so far for this instance, and we need to select the next variable $x _ { i }$ (an element of ${ \bf x } _ { U \backslash \phi } )$ to observe. Following Bernardo (1979), We select $x _ { i }$ by maximizing:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
R ( i , \mathbf { x } _ { O } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { O } ) } D _ { \mathrm { K L } } \left[ p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { O } ) \| p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { O } ) \right] .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
In our paper, we mainly consider the case that a subset of interesting observations represents the statistics of interest $\mathbf { X } _ { \phi }$ . Sampling $\mathbf { x } _ { i } \sim p \big ( \mathbf { x } _ { i } \big | \mathbf { x } _ { o } \big )$ is approximated by $\mathbf { x } _ { i } \sim \hat { p } ( \mathbf { x } _ { i } | \mathbf { x } _ { o } )$ , where $\hat { p } ( \mathbf { x } _ { i } | \mathbf { x } _ { o } )$ is defined by the following process in Partial VAE. It is implemented by first sampling $\mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } _ { o } )$ , and then $\mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { z } )$ . The same applies for $p ( \mathbf { x } _ { i } , \mathbf { x } _ { \phi } | \mathbf { z } )$ appeared in Equation 9.
|
| 114 |
+
|
| 115 |
+
Efficient approximation of the Information reward The Partial VAE allows us to sample $\mathbf { x } _ { i } \sim$ $p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } )$ . However, the KL term in Equation 6,
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
D _ { K L } \left[ p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) \right] = - \int _ { \mathbf { x } _ { \phi } } p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \log \frac { p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) } { p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
is intractable to evaluate since both $p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } )$ and $p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } )$ are intractable. For high dimensional $\mathbf { X } _ { \phi }$ , entropy estimation could be difficult. The entropy term $\begin{array} { r } { \int _ { \mathbf { x } _ { \phi } } p \big ( \mathbf { x } _ { \phi } \big | \mathbf { x } _ { i } , \mathbf { x } _ { o } \big ) \log p \big ( \mathbf { x } _ { \phi } \big | \mathbf { x } _ { i } , \mathbf { x } _ { o } \big ) } \end{array}$ depends on $i$ hence cannot be ignored. In the following, we show how to approximate this expression.
|
| 122 |
+
|
| 123 |
+
Our proposal is based on the observation that analytic solutions of KL-divergences are available under specific variational distribution families of $q ( { \bf z } | { \bf x } _ { O } )$ (such as the Gaussian distribution commonly used in VAEs). Instead of calculating information reward in $\mathbf { X }$ space, we have shown that one can equivalently perform calculations in $\mathbf { z }$ space (cf. Appendix A.1):
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r l } & { R ( i , \mathbf { x } _ { o } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } D _ { K L } \left[ p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { o } ) \right] } \\ & { \phantom { x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x } - \mathbb { E } _ { \mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } D _ { K L } \left[ p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) \right] . } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Require: Training dataset $\mathbf { X } _ { \mathrm { t r m } }$ , which is partially observed; Test dataset $\mathbf { X } _ { \mathrm { t s t } }$ without any observation; Indices $\phi$ of target variables.
|
| 130 |
+
1: Train Partial VAE by optimizing partial variational bound with $\mathbf { X } _ { \mathrm { t r m } }$ (cf. Section 3.2)
|
| 131 |
+
2: Actively acquire feature value $x _ { i }$ to estimate $\mathbf { X } _ { \phi }$ for each test point (cf. Section 3.3) for each test instance do $\mathbf { x } _ { O } \gets \emptyset$ (no variable value has been observed for any test point) repeat Choose variable $x _ { i }$ from $U \backslash \phi$ to maximize the information reward (Equation 9) $\mathbf { x } _ { O } x _ { i } \cup \mathbf { x } _ { O }$ until Stopping criterion reached (e.g. the time budget) end for
|
| 132 |
+
|
| 133 |
+
Algorithm 1 EDDI: Algorithm Overview
|
| 134 |
+
Table 1: Comparing models trained on partially observed MNIST. VAE-full is an ideal reference.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Method</td><td>VAE-full</td><td>ZI</td><td>ZI-m</td><td>PN</td><td>PNP</td></tr><tr><td>Train ELBO</td><td>-95.05</td><td>-113.64</td><td>-117.29</td><td>-121.43</td><td>-113.64</td></tr><tr><td>TestELBO (Rnd.)</td><td>-101.46</td><td>-116.01</td><td>-118.61</td><td>-122.20</td><td>-114.01</td></tr><tr><td>Test ELBO (Reg.)</td><td>-101.46</td><td>-130.61</td><td>-123.87</td><td>-116.53</td><td>-113.19</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Note that Equation 8 is exact. Additionally, we use partial VAE approximation $p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx$ $q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } )$ , $p ( \mathbf { z } | \mathbf { x } _ { o } ) \approx q ( \mathbf { z } _ { i } | \mathbf { x } _ { o } )$ and $p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx q ( \mathbf { z } _ { i } | \mathbf { x } _ { i } , \mathbf { x } _ { o } )$ . This leads to the final approximation of the information reward:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r l } & { \hat { R } ( i , { \bf x } _ { o } ) = \mathbb { E } _ { { \bf x } _ { i } \sim \hat { p } ( { \bf x } _ { i } | { \bf x } _ { o } ) } D _ { K L } \left[ q ( { \bf z } | { \bf x } _ { i } , { \bf x } _ { o } ) | | q ( { \bf z } | { \bf x } _ { o } ) \right] } \\ & { \quad \quad \quad \quad - \mathbb { E } _ { { \bf x } _ { \phi } , { \bf x } _ { i } \sim \hat { p } ( { \bf x } _ { \phi } , { \bf x } _ { i } | { \bf x } _ { o } ) } D _ { K L } \left[ q ( { \bf z } | { \bf x } _ { \phi } , { \bf x } _ { i } , { \bf x } _ { o } ) | | q ( { \bf z } | { \bf x } _ { \phi } , { \bf x } _ { o } ) \right] . } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
With this approximation, the divergence between ${ q } ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } )$ and $q ( \mathbf { z } | \mathbf { x } _ { o } )$ can often computed analytically in Partial VAE setting, for example, under Gaussian parameterization. The only Monte Carlo sampling required is the one set of samples $\mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim p \big ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } \big | \mathbf { x } _ { o } \big )$ that can be shared across different KL terms in Equation 9.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
We evaluate our proposed EDDI framework with various settings. We first assess the Partial VAE component of EDDI alone on an image inpainting task both qualitatively and quantitatively (Section 4.1). We compare our proposed two PN-based Partial VAE with the zero-imputing (ZI) VAE (Nazabal et al., 2018). Additionally, we modify ZI VAE to use s mask matrix indicating which variables are currently observed as input. We name this method ZI-m VAE. We then demonstrate the performance of the entire EDDI framework on datasets from the UCI repository (Section 4.2 ), as well as in two real-life application scenarios: Risk assessment in intensive care (Section 4.3) and public health assessment with national health survey (Section 4.4). We compare the performance of EDDI, using four different Partial VAE settings, with three baselines. The first baseline is the random active feature selection strategy (denoted as RAND) which randomly picks the next variable to observe. The second baseline method is the single best strategy (denoted as SING) which finds a single global optimal order of picking up variables. This order is then applied to all data points. SING uses the objective function as in Equation (9) to find the optimal ordering by averaging over all the data.
|
| 149 |
+
|
| 150 |
+
# 4.1 IMAGE INPAINTING WITH PARTIAL VAE
|
| 151 |
+
|
| 152 |
+
We evaluate the performance of Partial VAE with the image inpainting task, which is to fill in the removed pixels in an image. We perform the evaluation in two different settings: We remove the pixels at random in the first setting, and remove a region of the pixels in the second setting.
|
| 153 |
+
|
| 154 |
+
Inpainting Random Missing Pixels We use MNIST dataset (LeCun, 1998) and remove pixels randomly for this task. The same setting are used for all methods (see Appendix B.1 for details). During training, we remove a random portion (uniformly sampled between $0 \%$ and $70 \%$ ) of pixels. We then impute missing pixels on a partially observed test set (constructed by removing $70 \%$ of the pixels). The performance of pixel imputation is evaluated by test ELBOs on missing pixels. The first two rows in Table 1 show training and test ELBOs for all algorithms using this partially observed dataset. Additionally, we show ordinary VAE (VAE-full) trained on the fully observed dataset as an ideal reference. Among all Partial VAE methods, the PNP approach performs best.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Image inpainting example with MNIST dataset using Partial VAE with four settings.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Information curves of active variable selection, demonstrated on three UCI datasets (based on PNP parameterization of Partial VAE). This displays negative test log likelihood (y axis, the lower the better) during the course of active selection $\mathbf { \dot { x } }$ -axis). Error bars represent standard errors.
|
| 161 |
+
|
| 162 |
+
Inpainting Regions We then consider inpainting large contiguous regions of images. It aims to evaluate the capability of the Partial VAEs to produce all possible outcomes with better uncertainty estimates. With the same trained model as before, we remove the region of the upper $60 \%$ pixels of the image in the test set. We then evaluate the average likelihoods of the models. The last row of Table 1 shows the results of the test ELBO in this case. PNP based Partial VAE performs better than other settings. Note that given only the lower half of a digit, the number cannot be identified uniquely. ZI (Figure 2(b)) fails to cover the different possible modes due to its limitation in posterior inference. ZIm (Figure 2(c)) is capable of producing multiple modes. However, some of the generated samples are not consistent with the given part (i.e., some digits of 2 are generated). Our proposed PN (Figure 2(d)) and PNP Figure 2(e)) are capable of recovering different modes, and are consistent with observations.
|
| 163 |
+
|
| 164 |
+
# 4.2 EDDI ON UCI DATASETS
|
| 165 |
+
|
| 166 |
+
Given the effectiveness of our proposed Partial VAE, we now demonstrate the performance of our proposed EDDI framework in comparison with random selection (RAND) and single optimal ordering (SING). We first apply EDDI on 6 different UCI datasets (cf. Appendix B.2) (Dheeru & Karra Taniskidou, 2017). We report the results of EDDI with all these four different specifications of Partial VAE (ZI, ZI-m, PN, PNP).
|
| 167 |
+
|
| 168 |
+
All Partial VAE are first trained on partially observed UCI datasets where a random portion of variables is removed. We actively select variable for each test point starting with empty observation $\mathbf { X } _ { O } = \varnothing$ . In all UCI datasets, We randomly sample $10 \%$ of the data as the test set. All experiments repeated for ten times.
|
| 169 |
+
|
| 170 |
+
Taking PNP based setting as an example, Figure 3 shows the negative test log likelihood on $\mathbf { X } _ { \phi }$ for each variable selection step with three different datasets, where $\mathbf { X } _ { \phi }$ is defined by the UCI task. We call this curve the information curve $( I C )$ . We see that EDDI can obtain information efficiently. It archives the same negative test log likelihood with less than half of the variables. Single optimal ordering also improves upon random ordering. However, it is less efficient compared with EDDI since EDDI perform active learning for each data instance which is “personalized”. Figure 4 shows an example of the decision processes using EDDI and SING. The first step of EDDI overlaps largely with SING. From the second step, EDDI makes “personalized” decisions.
|
| 171 |
+
|
| 172 |
+
Table 2: Average ranking of AUIC over 6 UCI datasets.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN</td></tr><tr><td>EDDI</td><td>5.72 (0.03)</td><td>5.54 (0.02)</td><td>5.08 (0.02)</td><td>5.25 (0.02)</td></tr><tr><td>Random</td><td>8.03 (0.03)</td><td>8.10 (0.03)</td><td>7.77 (0.03)</td><td>7.79 (0.03)</td></tr><tr><td>Single best</td><td>8.68 (0.03)</td><td>5.50 (0.02)</td><td>5.20 (0.02)</td><td>5.28(0.02)</td></tr></table>
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
|
| 178 |
+
<table><tr><td>Method</td><td>Time</td></tr><tr><td>DRAL</td><td>2747.16</td></tr><tr><td>EDDI</td><td>2.64</td></tr></table>
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: First four decision steps on Boston Housing test data. EDDI is “personalized” comparing SING. Full names of the variables are listed in the Appendix B.2.
|
| 182 |
+
Figure 5: Comparison of DRAL (Lewenberg et al., 2017) and EDDI on Boston Housing dataset. EDDI out performs DRAL significantly regarding test log likelihood in every step.
|
| 183 |
+
Table 3: Test CPU time (in seconds) per test point for active variable selection using EDDI and DRAL. EDDI is $1 0 ^ { 3 }$ times more computation efficient than DRAL (Lewenberg et al., 2017).
|
| 184 |
+
|
| 185 |
+
We also present the average performance among all datasets with different settings. The area under the information curve (AUIC), $\begin{array} { r } { \sum _ { t } - \log p \big ( \mathbf { x } _ { \phi } \big | \bar { \mathbf { x } } _ { O _ { t } } \big ) } \end{array}$ , can then be used to compare the performance across models and strategies. Smaller AUIC value (could be positive or negative) indicates better performance. However, due to different datasets have different scales of test likelihoods and different numbers of variables (indicated by steps), it is not fair to average the AUIC across datasets to compare overall performances. We thus define average ranking of AUIC that compares 12 methods (indexed by i) averaging these datasets as: $\begin{array} { r } { r _ { i } = \frac { 1 } { \sum _ { j } N _ { j } } \bar { \sum } _ { j = 1 } ^ { 6 } \sum _ { k = 1 } ^ { N _ { j } } r _ { i j k } , i = 1 , . . , 1 6 . } \end{array}$ . These 12 methods are cross combinations of four Partial VAE models with three variable selection strategies. $r _ { i }$ is the final ranking of ith combination, $r _ { i j k }$ is the ranking of the ith combination (based on AUIC value) regarding the kth test data point in the $j$ th UCI dataset, and $N _ { j }$ the size of the jth UCI dataset. This gives us $6 \Sigma _ { j } N _ { j }$ different rankings. Finally, we simply compute the mean and standard error statistics based on these rankings. Table 2 summarize the average ranking results. We provide additional statistical significance test (Wilcoxcon signed-rank test for paired data) in Appendix B.2.3. We can conclude that EDDI outperforms other variable selection order in all different Partial VAE settings. Among different partial VAE settings, PNP/PN-based settings perform better than ZI-based settings.
|
| 186 |
+
|
| 187 |
+
Comparison with non-amortized method Additionally, we compare EDDI to DRAL (Lewenberg et al., 2017) which is the state-of-the-art method for the same problem setting. As discussed in Section 2, DRAL is linear and requires high computational cost. The DRAL paper only tested their method on a single test data point due to its limitation on computational efficiency. We compare DRAL with EDDI on Boston Housing dataset with ten randomly selected test points here. Results are shown in Figure 5, where EDDI significantly outperforms DARL thanks to more flexible Partial VAE model. Additionally, EDDI is 1000 times more efficient than DARL as shown in Table 3.
|
| 188 |
+
|
| 189 |
+
# 4.3 RISK ASSESSMENT WITH MIMIC-III
|
| 190 |
+
|
| 191 |
+
We now apply EDDI to risk assessment tasks using the Medical Information Mart for Intensive Care (MIMIC III) database (Johnson et al. (2016)). MIMIC III is the most extensive publicly available clinical database, containing real-world records from over 40,000 critical care patients with 60,000 ICU stays. The risk assessment task is to predict the final mortality. We preprocess the data for this task following Harutyunyan et al. (2017) 1. This results in a dataset of 21139 patients. We treat the final mortality of a patient as a Bernoulli variable. For our task, we focus on variable selection, which corresponds to medical instrument selection. We thus further process the time series variables into static variables based on temporal averaging.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 6: Information curves of active variable selection on risk assessment task on MIMIC III, produced with PNP setting.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 7: Information curves of active (grouped) variable selection on risk assessment task on NHANES, produced with PNP setting.
|
| 198 |
+
|
| 199 |
+
Table 4: Average ranking on AUIC of MIMIC III
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>EDDI</td><td>Random</td><td>Single best</td></tr><tr><td>ZI</td><td>5.28 (0.01)</td><td>7.12 (0.02)</td><td>6.28 (0.01)</td></tr><tr><td>ZI-m</td><td>5.82 (0.01)</td><td>7.95 (0.01)</td><td>6.82 (0.01)</td></tr><tr><td>PN</td><td>5.24 (0.01)</td><td>7.91 (0.01)</td><td>6.24 (0.01)</td></tr><tr><td>PNP</td><td>5.23 (0.01)</td><td>7.82 (0.01)</td><td>6.23 (0.01)</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 5: Average ranking on AUIC of NHANES
|
| 204 |
+
|
| 205 |
+
<table><tr><td>Method</td><td>EDDI</td><td>Random</td><td>Single best</td></tr><tr><td>ZI</td><td>5.68 (0.13)</td><td>8.44 (0.13)</td><td>6.36 (0.13)</td></tr><tr><td>ZI-m</td><td>7.63 (0.12)</td><td>8.69 (0.12)</td><td>8.97 (0.12)</td></tr><tr><td>PN</td><td>5.64 (0.16)</td><td>6.14 (0.15)</td><td>5.56 (0.16)</td></tr><tr><td>PNP</td><td>4.41 (0.12)</td><td>5.34 (0.14)</td><td>5.13 (0.12)</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Figure 6 shows the information curve of different strategies, using PNP based Partial VAE as an example (more results in Appendix B.3). Table 4 shows the average ranking of AUIC with different settings. In this application, EDDI significantly outperforms other variable selection strategies in all different settings of Partial VAE, and PNP based setting performs best.
|
| 208 |
+
|
| 209 |
+
# 4.4 PUBLIC HEALTH ASSESSMENT WITH NHANES
|
| 210 |
+
|
| 211 |
+
Finally, we apply our methods to public health assessment using NHANES 2015-2016 data cdc (2005). NHANES is a program with adaptable components of measurements, to assess the health and nutritional status of adults and children in the United States. Every year, approximately thousands individuals of all ages are interviewed in their homes and complete the health examination component of the survey. This 2015-2016 NHANES data contains three major sections, the questionnaire interview, examinations and lab tests for 9971 subjects in the publicly available version of this cycle. In our setting, we consider the whole set of lab test results (139 dimensions of variables) as the target variable of interest $\mathbf { X } _ { \phi }$ since they are expensive and reflects the subject’s health status, and we active select the questions from the extensive questionnaire (665 variables).
|
| 212 |
+
|
| 213 |
+
In NHANES, the entire questionnaire is divided into 73 different groups. In practice, questions in the same group are often examined together. Therefore, we perform active variable selection on the group level: at each step, the algorithm will be selecting one group to observe. This is more challenging than the experiments in previous sections since it requires the generative model to simulate a group of unobserved data in Equation (9) at the same time. When evaluating test likelihood on the target variable of interest, we treat variables in each group equally. For a fair comparison, the calculation of the area under the information curve (AUIC) is weighted by the size of the group chosen by the algorithms. Specifically, AUIC is calculated after spline interpolation. The information curve plots in Figure 7, together with Table 5 of AUIC statistics show that our EDDI outperforms other baselines. This experiment shows that EDDI is capable of performing active selection on a large pool of grouped variables to estimate a high dimensional target.
|
| 214 |
+
|
| 215 |
+
# 5 CONCLUSION
|
| 216 |
+
|
| 217 |
+
In this paper, we present EDDI, a novel and efficient framework for dynamic active variable selection for each instance. Within the EDDI framework, we propose Partial VAE which performs amortized inference to handle missing data. Partial VAE alone can be used as a non-linear computational efficient probabilistic imputation method. Based on Partial VAE, we design a variable wise acquisition function for EDDI and derived corresponding approximation method. EDDI has demonstrated its effectiveness on active variable selection tasks across multiple real-world applications. In the future, we would extend the EDDI framework to handle more complicated scenarios, such as time-series, or the cold-start situation.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
National health and nutrition examination survey, 2005. URL https://www.cdc.gov/nchs/ nhanes/.
|
| 222 |
+
|
| 223 |
+
José M Bernardo. Expected information as expected utility. The Annals of Statistics, pp. 686–690, 1979.
|
| 224 |
+
|
| 225 |
+
David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of Machine Learning Research, 3(Jan):993–1022, 2003.
|
| 226 |
+
|
| 227 |
+
Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society. Series B (methodological), pp. 1–38, 1977.
|
| 228 |
+
|
| 229 |
+
Dua Dheeru and Efi Karra Taniskidou. UCI machine learning repository, 2017. URL http: //archive.ics.uci.edu/ml.
|
| 230 |
+
|
| 231 |
+
Marta Garnelo, Dan Rosenbaum, Chris J Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo J Rezende, and SM Eslami. Conditional neural processes. arXiv preprint arXiv:1807.01613, 2018.
|
| 232 |
+
|
| 233 |
+
Prem K Gopalan, Laurent Charlin, and David Blei. Content-based recommendations with poisson factorization. In Advances in Neural Information Processing Systems, pp. 3176–3184, 2014.
|
| 234 |
+
|
| 235 |
+
Charles Hamesse, Paul Ackermann, Hedvig Kjellström, and Cheng Zhang. Simultaneous measurement imputation and outcome prediction for achilles tendon rupture rehabilitation. In ICML/IJCAI Joint Workshop on Artificial Intelligence in Health, 2018.
|
| 236 |
+
|
| 237 |
+
Hrayr Harutyunyan, Hrant Khachatrian, David C Kale, and Aram Galstyan. Multitask learning and benchmarking with clinical time series data. arXiv preprint arXiv:1703.07771, 2017.
|
| 238 |
+
|
| 239 |
+
Neil Houlsby, Ferenc Huszár, Zoubin Ghahramani, and Máté Lengyel. Bayesian active learning for classification and preference learning. arXiv preprint arXiv:1112.5745, 2011.
|
| 240 |
+
|
| 241 |
+
Sheng-Jun Huang, Miao Xu, Ming-Kun Xie, Masashi Sugiyama, Gang Niu, and Songcan Chen. Active feature acquisition with supervised matrix completion. arXiv preprint arXiv:1802.05380, 2018.
|
| 242 |
+
|
| 243 |
+
Prateek Jain, Raghu Meka, and Inderjit S Dhillon. Guaranteed rank minimization via singular value projection. In Advances in Neural Information Processing Systems, 2010.
|
| 244 |
+
|
| 245 |
+
Alistair EW Johnson, Tom J Pollard, Lu Shen, H Lehman Li-wei, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. Mimic-iii, a freely accessible critical care database. Scientific Data, 3:160035, 2016.
|
| 246 |
+
|
| 247 |
+
Raghunandan H Keshavan, Andrea Montanari, and Sewoong Oh. Matrix completion from noisy entries. Journal of Machine Learning Research, 2010.
|
| 248 |
+
|
| 249 |
+
Diederik P. Kingma and Jimmy Lei Ba. Adam: a method for stochastic optimization. In International Conference on Learning Representations, pp. 1–13, 2015.
|
| 250 |
+
|
| 251 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representation, 2014.
|
| 252 |
+
|
| 253 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 254 |
+
|
| 255 |
+
Yoad Lewenberg, Yoram Bachrach, Ulrich Paquet, and Jeffrey S Rosenschein. Knowing what to ask: A bayesian active learning approach to the surveying problem. In AAAI, pp. 1396–1402, 2017.
|
| 256 |
+
|
| 257 |
+
Dennis V Lindley. On a measure of the information provided by an experiment. The Annals of Mathematical Statistics, pp. 986–1005, 1956.
|
| 258 |
+
|
| 259 |
+
RJA Little and DB Rubin. Statistical analysis with missing data. Technical report, J. Wiley, 1987.
|
| 260 |
+
|
| 261 |
+
David JC MacKay. Information-based objective functions for active data selection. Neural computation, 4(4):590–604, 1992.
|
| 262 |
+
|
| 263 |
+
Andrew Kachites McCallumzy and Kamal Nigamy. Employing em and pool-based active learning for text classification. In International Conference on Machine Learning, pp. 359–367. Citeseer, 1998.
|
| 264 |
+
|
| 265 |
+
Prem Melville, Maytal Saar-Tsechansky, Foster Provost, and Raymond Mooney. Active feature-value acquisition for classifier induction. In International Conference on Data Mining, pp. 483–486. IEEE, 2004.
|
| 266 |
+
|
| 267 |
+
Alfredo Nazabal, Pablo M Olmos, Zoubin Ghahramani, and Isabel Valera. Handling incomplete heterogeneous data using vaes. arXiv preprint arXiv:1807.03653, 2018.
|
| 268 |
+
|
| 269 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017.
|
| 270 |
+
|
| 271 |
+
Rajesh Ranganath, Dustin Tran, and David Blei. Hierarchical variational models. In International Conference on Machine Learning, pp. 324–333, 2016.
|
| 272 |
+
|
| 273 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Interantional Conference on Machine Learning, 2014.
|
| 274 |
+
|
| 275 |
+
Donald B Rubin. Inference and missing data. Biometrika, 63(3):581–592, 1976.
|
| 276 |
+
|
| 277 |
+
Maytal Saar-Tsechansky, Prem Melville, and Foster Provost. Active feature-value acquisition. Management Science, 55(4):664–684, 2009.
|
| 278 |
+
|
| 279 |
+
Ruslan Salakhutdinov and Andriy Mnih. Bayesian probabilistic matrix factorization using markov chain monte carlo. In International conference on Machine learning, pp. 880–887. ACM, 2008.
|
| 280 |
+
|
| 281 |
+
Judi Scheffer. Dealing with missing data. 2002.
|
| 282 |
+
|
| 283 |
+
Burr Settles. Active learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 6 (1):1–114, 2012.
|
| 284 |
+
|
| 285 |
+
Hajin Shim, Sung Ju Hwang, and Eunho Yang. Joint active feature acquisition and classification with variable-size set encoding. In Advances in Neural Information Processing Systems, 2018.
|
| 286 |
+
|
| 287 |
+
David Stern, Ralf Herbrich, and Thore Graepel. Matchbox: Large scale bayesian recommendations. In International World Wide Web Conference, 2009.
|
| 288 |
+
|
| 289 |
+
Mohamed Thahir, Tarun Sharma, and Madhavi K Ganapathiraju. An efficient heuristic method for active feature acquisition and its application to protein-protein interaction prediction. In BMC proceedings, volume 6, pp. S2. BioMed Central, 2012.
|
| 290 |
+
|
| 291 |
+
Chong Wang and David M Blei. Collaborative topic modeling for recommending scientific articles. In International Conference on Knowledge Discovery and Data Mining, pp. 448–456. ACM, 2011.
|
| 292 |
+
|
| 293 |
+
Ga Wu, Justin Domke, and Scott Sanner. Conditional inference in pre-trained variational autoencoders via cross-coding. arXiv preprint arXiv:1805.07785, 2018.
|
| 294 |
+
|
| 295 |
+
Hsiang-Fu Yu, Nikhil Rao, and Inderjit S Dhillon. Temporal regularized matrix factorization for high-dimensional time series prediction. In Advances in Neural Information Processing Systems, pp. 847–855, 2016.
|
| 296 |
+
|
| 297 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pp. 3394–3404, 2017.
|
| 298 |
+
|
| 299 |
+
David Zakim, Niko Braun, Peter Fritz, and Mark Dominik Alscher. Underutilization of information and knowledge in everyday medical practice: Evaluation of a computer-based solution. BMC Medical Informatics and Decision Making, 8(1):50, 2008.
|
| 300 |
+
|
| 301 |
+
Cheng Zhang, Judith Butepage, Hedvig Kjellstrom, and Stephan Mandt. Advances in variational inference. arXiv preprint arXiv:1711.05597, 2017.
|
| 302 |
+
|
| 303 |
+
Zhiqiang Zheng and Balaji Padmanabhan. On active learning for data acquisition. In International Conference on Data Mining, pp. 562–569. IEEE, 2002.
|
| 304 |
+
|
| 305 |
+
# A ADDITIONAL DERIVATIONS
|
| 306 |
+
|
| 307 |
+
# A.1 INFORMATION REWARD APPROXIMATION
|
| 308 |
+
|
| 309 |
+
In our paper, given the VAE model $p ( \mathbf { x } | z )$ and a partial inference network $q ( \mathbf { z } | \mathbf { x } _ { o } )$ , the experimental design problem is formulated as maximization of the information reward:
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
R ( i , \mathbf { x } _ { o } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } [ D _ { K L } ( p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) ) ]
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
Where $\begin{array} { r } { p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } ) = \int _ { \mathbf { z } } p ( \mathbf { x } _ { \phi } \vert \mathbf { z } ) q ( \mathbf { z } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \end{array}$ , $\begin{array} { r } { p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { o } ) = \int _ { \mathbf { z } } p ( \mathbf { x } _ { \phi } \vert \mathbf { z } ) q ( \mathbf { z } \vert \mathbf { x } _ { o } ) } \end{array}$ and $q ( \mathbf { z } | \mathbf { x } _ { o } )$ are approximate condition distributions given by partial VAE models. Now we consider the problem of directly approximating $R ( i , { \bf x } _ { o } )$ .
|
| 316 |
+
|
| 317 |
+
Applying the chain rule of KL-divergence, we have:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l } & { D _ { K L } \big ( p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \big \vert p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { o } ) \big ) = D _ { K L } \big ( p ( \mathbf { x } _ { \phi } , \mathbf { z } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \big \vert p ( \mathbf { x } _ { \phi } , \mathbf { z } \vert \mathbf { x } _ { o } ) \big ) } \\ & { \qquad - \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \left[ D _ { K L } \big ( p ( \mathbf { z } \vert \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \big \vert p ( \mathbf { z } \vert \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) \big ) \right] , } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Using again the KL-divergence chain rule on $D _ { K L } ( p ( \mathbf { x } _ { \phi } , \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { x } _ { \phi } , \mathbf { z } | \mathbf { x } _ { o } ) )$ , we have:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r l } & { D _ { K L } \big ( p ( \mathbf { x } _ { \phi } , \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \vert p ( \mathbf { x } _ { \phi } , \mathbf { z } | \mathbf { x } _ { o } ) \big ) } \\ & { \ = D _ { K L } \big ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \vert p ( \mathbf { z } | \mathbf { x } _ { o } ) \big ) + D _ { K L } \big ( p ( \mathbf { x } _ { \phi } | \mathbf { z } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \vert p ( \mathbf { x } _ { \phi } | \mathbf { z } , \mathbf { x } _ { o } ) \big ) } \\ & { \ = D _ { K L } \big ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \vert p ( \mathbf { z } | \mathbf { x } _ { o } ) \big ) + D _ { K L } \big ( p ( \mathbf { x } _ { \phi } | \mathbf { z } ) \vert \vert p ( \mathbf { x } _ { \phi } | \mathbf { z } ) \big ) } \\ & { \ = D _ { K L } \big ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \vert \vert p ( \mathbf { z } | \mathbf { x } _ { o } ) \big ) . } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
The KL-divergence term in the reward formula is now rewritten as follows,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { r l } & { D _ { K L } ( p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) ) = D _ { K L } ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { o } ) ) } \\ & { \qquad - \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \left[ D _ { K L } ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) \right] . } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
One can then plug in the partial VAE inference approximation:
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) , ~ p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) , ~ p ( \mathbf { z } | \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { o } )
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Finally, the information reward is now approximated as:
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } & { R ( i , \mathbf { x } _ { o } ) \approx \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \left[ D _ { K L } ( q ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | q ( \mathbf { z } | \mathbf { x } _ { o } ) ) \right] } \\ & { \qquad - \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \left[ D _ { K L } ( q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) \right] } \\ & { \qquad = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \left[ D _ { K L } ( q ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | q ( \mathbf { z } | \mathbf { x } _ { o } ) ) \right] } \\ & { \qquad - \mathbb { E } _ { \mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \left[ D _ { K L } ( q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) \right] = \hat { R } ( i , \mathbf { x } _ { o } ) . } \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
This new objective tries to maximize the shift of belief on latent variables $\mathbf { z }$ by introducing $\mathbf { x } _ { i }$ , while penalizing the information that cannot be absorbed by $\mathbf { X } _ { \phi }$ (by the penalty term $D _ { K L } ( q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) ;$ ). Moreover, it is more computationally efficient since one set of samples $\mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim p \big ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } \big | \mathbf { x } _ { o } \big )$ can be shared across different terms, and the KL-divergence between common parameterizations of encoder (such as Gaussians and normalizing flows) can be computed exactly without the need for approximate integrals. Note also that under approximation
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) , ~ p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) , ~ p ( \mathbf { z } | \mathbf { x } _ { o } ) \approx q ( \mathbf { z } | \mathbf { x } _ { o } )
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
, sampling $\mathbf { x } _ { i } \sim p \big ( \mathbf { x } _ { i } \big | \mathbf { x } _ { o } \big )$ is approximated by $\mathbf { x } _ { i } \sim \hat { p } ( \mathbf { x } _ { i } | \mathbf { x } _ { o } )$ , where $\hat { p } ( \mathbf x _ { i } | \mathbf x _ { o } )$ is defined by the following process in Partial VAE. It is implemented by first sampling $\mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } _ { o } )$ , and then $\mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { z } )$ . The same applies for $p ( \mathbf { x } _ { i } , \mathbf { x } _ { \phi } | \mathbf { z } )$ .
|
| 354 |
+
|
| 355 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 356 |
+
|
| 357 |
+
# B.1 IMAGE INPAINTING
|
| 358 |
+
|
| 359 |
+
# B.1.1 PREPROCESSING AND MODEL DETAILS
|
| 360 |
+
|
| 361 |
+
For our MNIST experiment, we randomly draw $10 \%$ of the whole data to be our test set. Partial VAE models (ZI, ZI-m, PNP and PNs) share the same size of architecture with 20 dimensional diagonal
|
| 362 |
+
|
| 363 |
+
Gaussian latent variables: the generator (decoder) is a 20-200-500-500 fully connected neural network with ReLU activations (where D is the data dimension, $D = 7 8 4 _ { . }$ ). The inference nets (encoder) share the same structure of D-500-500-200-40 that maps the observed data into distributional parameters of the latent space. For the PN-based parameterizations, we use a 500 dimensional feature mapping $h$ parameterized by a single layer neural network, and 20 dimensional ID vectors $\mathbf { e } _ { i }$ (see Section 3.2) for each variable. We choose the symmetric operator $g$ to be the basic summation operator.
|
| 364 |
+
|
| 365 |
+
During training, we apply Adam optimization (Kingma & Ba, 2015) with default hyperparameter setting, learning rate of 0.001 and a batch size of 100. We generate partially observed MNIST dataset by adding artificially missingness at random in the training dataset during training. We first draw a missing rate parameter from a uniform distribution $\mathcal { U } ( 0 , 0 . 7 )$ and randomly choose variables as unobserved. This step is repeated at each iteration. We train our models for 3K iterations.
|
| 366 |
+
|
| 367 |
+
# B.1.2 IMAGE GENERATION OF PARTIAL VAES
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 8: Random images generated using (a) naive zero imputing, (b) zero imputing with mask, (c) PN and (d) PNP, respectively.
|
| 371 |
+
|
| 372 |
+
# B.2 UCI DATASETS
|
| 373 |
+
|
| 374 |
+
We applied EDDI on 6 UCI datasets; Boston Housing, Concrete compressive strength, energy efficiency, wine quality, $\operatorname { K i n } 8 \mathrm { n m }$ , and Yacht Hydrodynamics. The variables of interest $\mathbf { X } _ { \phi }$ are chosen to be the target variables of each UCI dataset in the experiment.
|
| 375 |
+
|
| 376 |
+
# B.2.1 PREPROCESSING AND MODEL DETAILS
|
| 377 |
+
|
| 378 |
+
All data are normalized and then scaled between 0 and 1. For each of the 10 - in total- repetitions, we randomly draw $10 \%$ of the data to be our test set. Partial VAE models (ZI, ZI-m, PNP and PNs) share the same size of architecture with 10 dimensional diagonal Gaussian latent variables: the generator (decoder) is a 10-50-100-D neural network with ReLU activations (where D is the data dimensions). The inference nets (encoder) share the same structure D-100-50-20 that maps the observed data into distributional parameters of the latent space. For the PN-based parameterizations, we further use a 20 dimensional feature mapping $h$ parameterized by a single layer neural network and 10 dimensional $\mathrm { I D }$ vectors $\mathbf { e } _ { i }$ (please refer to section 3.2) for each variable. We choose the symmetric operator $g$ to be the basic summation operator.
|
| 379 |
+
|
| 380 |
+
As in the image inpainting experiment, we apply Adam optimization during training with default hyperparameter setting, and a batch size of 100 and ingest random missingness as before. We trained our models for 3K iterations.
|
| 381 |
+
|
| 382 |
+
During active learning, we draw 50 samples in order to estimate the expectation under $\mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim$ $p ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } | \mathbf { x } _ { o } )$ in Equation (8). Negative likelihoods of the target variable is also estimated using 50 samples of $\mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } )$ through $\begin{array} { r } { p ( \mathbf { x } _ { \phi } \vert \mathbf { x } _ { o } ) \approx \frac { 1 } { M } \sum _ { m = 1 } ^ { M } p ( \mathbf { x } _ { \phi } \vert \mathbf { z } _ { m } ) } \end{array}$ , where ${ \mathbf z } _ { m } \sim q ( { \mathbf z } | { \mathbf x } _ { o } )$ .
|
| 383 |
+
|
| 384 |
+
# B.2.2 TABLES ON AREA UNDER THE INFORMATION CURVE (AUIC)
|
| 385 |
+
|
| 386 |
+
In addition to the area under the information curve (AUIC) ranking metric provided in the paper, the average area under the information curve (Avg. AUIC) on each dataset can also be used to compare the performance across models and strategies. AUIC is defined to be $\begin{array} { r } { \sum _ { t } - \log p \big ( \mathbf { x } _ { \phi } \big | \mathbf { x } _ { O _ { t } } \big ) } \end{array}$ , where $\mathbf { x } _ { O _ { t } }$ is the basket of variables observed at step $t$ . By definition, smaller AUIC value (could be positive or negative) indicates better performance. We present the AUIC for each dataset in Table 6, 7, 8, 9, 10, and $1 1 ^ { 2 }$ .
|
| 387 |
+
|
| 388 |
+
Readers might have found that it seems that the avg. AUIC results in Tables 6 - 11 contradicts the avg. ranking of AUIC results in Table 2 of the main text. However, this is not the case. In Tables Tables 6 - 11, AUIC numbers only provide a simplified statistics of marginal distributions of each method’s performance. Here, the distribution of performance is defined by first sample a data point from the data distribution, and then we obtain the performance of a active learning method of interest by evaluating its performance (AUIC) on this single data point. On the contrary, the average AUIC ranking measure actually takes into account the joint distributions of the performance of all methods, since ranking is a function of the performance of all methods.
|
| 389 |
+
|
| 390 |
+
With this additional information of correlations, this gives a more accurate evaluation regarding the actual performance of different methods. Notably, in practical scenario of active variable selection, the latter setting is obviously more sensible and fare.
|
| 391 |
+
|
| 392 |
+
The above conjecture is further validated and confirmed by applying the nonparametric statistical test, namely the Wilcoxcon signed-rank significance test on the performance of different methods, which are detailed in Appendix B.2.3. Wilcoxon test is a very powerful statistical test which includes the information of the joint distribution in paired samples. In our case, the term paired samples refers to the situation that different algorithms are evaluated on exactly the same set of test data points, which introduces correlations between the performances of different algorithms.
|
| 393 |
+
|
| 394 |
+
Table 6: Average AUIC over Boston Housing dataset
|
| 395 |
+
|
| 396 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1))</td></tr><tr><td>EDDI</td><td>-25.03 (0.09)</td><td>-24.74(0.15)</td><td>-24.49 (0.24)</td><td>-24.54 (0.10)</td><td>-24.41 (0.09)</td></tr><tr><td>Random</td><td>-23.85 (0.14)</td><td>-24.52 (0.08)</td><td>-23.36 (0.18 )</td><td>-23.43 (0.14)</td><td>-23.33 (0.13)</td></tr><tr><td>Single best</td><td>-24.77 (0.12)</td><td>-23.62 (0.20)</td><td>-23.71 (0.15)</td><td>-23.82 (0.13)</td><td>-23.87 (0.09)</td></tr></table>
|
| 397 |
+
|
| 398 |
+
Table 7: Average AUIC over Concrete dataset
|
| 399 |
+
|
| 400 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>-12.07 (0.04)</td><td>-12.07 (0.05)</td><td>-12.09 (0.07)</td><td>-12.15 (0.06)</td><td>-12.17 (0.07)</td></tr><tr><td>Random</td><td>-11.00 (0.09)</td><td>-12.03 (0.03)</td><td>-11.17. (0.07)</td><td>-12.07 (0.06)</td><td>-11.12 (0.12)</td></tr><tr><td>Single best</td><td>-12.03 (0.06)</td><td>-11.13 (0.10)</td><td>-12.07 (0.06)</td><td>-12.11 (0.04)</td><td>-12.16 (0.06)</td></tr></table>
|
| 401 |
+
|
| 402 |
+
Table 8: Average AUIC over Energy dataset
|
| 403 |
+
|
| 404 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>-13.63 (0.06)</td><td>-14.56 (0.07)</td><td>-14.49 (0.06)</td><td>-14.65 (0.08)</td><td>-14.68 (0.07)</td></tr><tr><td>Random</td><td>-9.89 (0.15)</td><td>-14.53 (0.06)</td><td>-11.49. (0.16)</td><td>-11.67 (0.17)</td><td>-11.51 (0.16)</td></tr><tr><td>Single best</td><td>-12.79 (0.07)</td><td>-11.62 (0.08)</td><td>-14.36 (0.09)</td><td>-14.56 (0.08 )</td><td>-14.66 (0.07)</td></tr></table>
|
| 405 |
+
|
| 406 |
+
Table 9: Average AUIC over Wine dataset
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>-14.24 (0.06)</td><td>-15.04 (0.02)</td><td>-15.04 (0.05)</td><td>-15.13 (0.05)</td><td>-15.10 (0.03)</td></tr><tr><td>Random</td><td>-11.07 (0.20)</td><td>-15.10 (0.05)</td><td>-12.38 (0.9)</td><td>-12.57 (0.14)</td><td>-12.26 (0.15)</td></tr><tr><td>Single best</td><td>-13.85 (0.10)</td><td>-12.55 (0.10)</td><td>-15.02 (0.05)</td><td>-14.99 (0.03)</td><td>-15.04 (0.03)</td></tr></table>
|
| 409 |
+
|
| 410 |
+
2Note that the notation of PN(5) indicates an extension of the PN-Partial VAE method which will be discussed in detail later in the Appendix B.5.
|
| 411 |
+
|
| 412 |
+
Table 10: Average AUIC over kin8nm dataset
|
| 413 |
+
|
| 414 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>-20.31 (0.02)</td><td>-20.25 (0.01)</td><td>-20.18 (0.04)</td><td>-20.20 (0.02)</td><td>-20.15 (0.02)</td></tr><tr><td>Random</td><td>-19.40 (0.04)</td><td>-20.24 (0.02)</td><td>-19.29 (0.04)</td><td>-19.41 (0.02)</td><td>-19.28 (0.05)</td></tr><tr><td>Single best</td><td>-20.28 (0.02)</td><td>-19.35 (0.04)</td><td>-20.23 (0.03)</td><td>-20.19 (0.01)</td><td>-20.19 (0.03)</td></tr></table>
|
| 415 |
+
|
| 416 |
+
Table 11: Average AUIC over Yacht dataset
|
| 417 |
+
|
| 418 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>-14.37 (0.02)</td><td>-14.50 (0.02)</td><td>-14.57 (0.02)</td><td>-14.53 (0.02)</td><td>-14.56 (0.02)</td></tr><tr><td>Random</td><td>-12.83 (0.03)</td><td>-14.50 (0.02)</td><td>-13.03 (0.04)</td><td>-12.93 (0.04)</td><td>-13.08 (0.02)</td></tr><tr><td>Single best</td><td>-14.43 (0.03)</td><td>-12.91 (0.03)</td><td>-14.57 (0.02)</td><td>-14.50 (0.03)</td><td>-14.54(0.02)</td></tr></table>
|
| 419 |
+
|
| 420 |
+
# B.2.3 STATISTICAL SIGNIFCANT TEST RESULTS
|
| 421 |
+
|
| 422 |
+
In this section, we perform Wilcoxcon signed-rank significance test on the performance of different methods, to support our result in Table 2. Since Table 2 suggests that EDDI-PNP-Partial VAE is the best algorithm overall, we set EDDI-PNP-Partial VAE as default and perform Wilcoxcon test between EDDI-PNP-Partial VAE and all other 15 different settings, to see whether the improvement is significant. Table 12 displays the corresponding p-value for each test. It is obvious that in all 15 tests, the EDDI-PNP-Partial VAE results are significant (compared with the standard $\alpha = 0 . 0 5$ cutoff). This provides strong evidence that confirms our results in Table 2 and our conjecture in Appendix B.2.2.
|
| 423 |
+
|
| 424 |
+
Table 12: p- values of Wilcoxon signed-rank test of EDDI-PNP vs. 11 other settings, on 6 UCI datasets.
|
| 425 |
+
|
| 426 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN</td></tr><tr><td>EDDI</td><td><10-48</td><td><10-23</td><td>N/A</td><td><10-2</td></tr><tr><td>Random</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Single best</td><td>0</td><td><10-13</td><td><10-2</td><td><10-4</td></tr></table>
|
| 427 |
+
|
| 428 |
+
B.2.4 ADDITIONAL AUIC PLOTS OF PN, ZI AND ZI-M ON UCI DATASETS
|
| 429 |
+
|
| 430 |
+
Here we present additional plots of the information curve during active variable selection. Figure 9 presents the results for the Boston Housing, the Energy and the Wine datasets and for the three approaches, i.e. PN, ZI and masked ZI.
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 9: Information curves of active variable selection for the three UCI datasets and the three approaches, i.e. (First row) PointNet (PN), (Second row) Zero Imputing (ZI), and (Third row) Zero Imputing with mask $\left( \mathrm { Z I - m } \right)$ . Green: random strategy; Black: EDDI; Pink: Single best ordering. This displays negative test log likelihood (y axis, the lower the better) during the course of active selection $\mathbf { \bar { X } } ^ { \prime }$ -axis).
|
| 434 |
+
|
| 435 |
+
B.2.5 RMSE PLOTS OF PN, ZI AND ZI-M ON UCI DATASETS
|
| 436 |
+
|
| 437 |
+
Here we present additional plots of the RMSE curves during active learning. Figure 10 presents the results for the Boston Housing, the Energy and the Wine datasets and for the three approaches, i.e. PN, ZI and masked ZI.
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Figure 10: RMSE curves of active variable selection for the three UCI datasets and the three approaches, i.e. (First row) PointNet (PN), (Second row) Zero Imputing (ZI), and (Third row) Zero Imputing with mask (ZI-m). Green: random strategy; Black: EDDI; Pink: Single best ordering. This displays RMSE (y axis, the lower the better) during the course of active selection $\mathbf { \bar { x } }$ -axis).
|
| 441 |
+
|
| 442 |
+
# B.2.6 COMPARISONS BETWEEN EDDI AND LASSO-BASED METHOD
|
| 443 |
+
|
| 444 |
+
Here we present additional results of a new baseline, the LASSO-based feature selection. This is not presented in the main text since LASSO is designed for a different problem setting. It requires fully observed data, and only works in regression problems with one dimensional outputs. Both MIMIC III and NHANES tasks do not fulfill these requirements. Additionally, LASSO aims to select a global set of features to obtain the best performance instead of select the most informative feature given partially observed information, thus cannot be used in a sequential setting. We thus construct the LASSO feature selection baseline as follows for comparison: we first apply LASSO regression on training dataset which is fully observed in these UCI datasets, and select the features (denoted by $\mathcal { A }$ ) that correspond to non-zero coefficients. Then, during test time, LASSO strategy will observe the features one by one from $\mathcal { A }$ randomly. When all variables selected by LASSO are already picked, we stop the feature selection progress. Since LASSO does not support evaluation of model likelihood as well as it is linear, we use the corresponding partial-VAE (ZI,ZI-m,PNP,PN) to make predictions and evaluate the model log likelihood.
|
| 445 |
+
|
| 446 |
+
Figure 11 presents the results for the Boston Housing, the Energy and the Wine datasets as examples. Full results of all UCI datasets are presented in Table 13. Note that in Table 13, Wilcoxon signed-rank test is performed between EDDI and LASSO strategies for each Partial VAE models, respectively. The results indicates that EDDI significantly outperforms LASSO in all circumstances. This is despite the fact that EDDI is a greedy sequential variable selection method that built upon partially observed data, while LASSO-baseline makes use of the information from fully observed data, and selects the set of variables in a non-greedy, global manner, which is often unrealistic in many pratical application settings.
|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
Figure 11: Information curves of active variable selection for the three UCI datasets and PNP-Partial VAE. Black: EDDI; Blue: Single best ordering. This displays negative test log likelihood (y axis, the lower the better) during the course of active selection ( $\mathbf { \bar { X } }$ -axis).
|
| 450 |
+
|
| 451 |
+
Table 13: Avg. rankings of AUIC, and p- values of Wilcoxon signed-rank test that EDDI outperforms LASSO (on 6 UCI datasets).
|
| 452 |
+
B.2.7 ILLUSTRATION OF DECISION PROCESS OF EDDI (BOSTON HOUSING AS EXAMPLE)
|
| 453 |
+
|
| 454 |
+
<table><tr><td>Method</td><td>ZI</td><td>ZI-m</td><td>PNP</td><td>PN</td></tr><tr><td>EDDI</td><td>4.66 (0.02)</td><td>4.53(0.02)</td><td>4.14(0.02)</td><td>4.24(0.02)</td></tr><tr><td>LASSO</td><td>4.86(0.02)</td><td>4.63(0.02)</td><td>4.41(0.02)</td><td>4.48(0.02)</td></tr><tr><td>p-value</td><td><10-4</td><td><10-6</td><td><10-24</td><td><10-19</td></tr></table>
|
| 455 |
+
|
| 456 |
+
The decision process facilitated by the active selection of the variables (for the EDDI framework) is efficiently illustrated in Figure 12 and Figure 13 for the Boston Housing dataset and for the PNP and PNP with single best ordering approaches, respectively.
|
| 457 |
+
|
| 458 |
+
For completeness, we provide details regarding the abbreviations of the variables used in the Boston dataset and appear both figures.
|
| 459 |
+
|
| 460 |
+
CR - per capita crime rate by town
|
| 461 |
+
PRD - proportion of residential land zoned for lots over 25,000 sq.ft. PNB - proportion of non-retail business acres per town.
|
| 462 |
+
CHR - Charles River dummy variable (1 if tract bounds river; 0 otherwise) NOC - nitric oxides concentration (parts per 10 million)
|
| 463 |
+
ANR - average number of rooms per dwelling
|
| 464 |
+
AOUB - proportion of owner-occupied units built prior to 1940
|
| 465 |
+
DTB - weighted distances to five Boston employment centres
|
| 466 |
+
ARH - index of accessibility to radial highways
|
| 467 |
+
TAX - full-value property-tax rate per $\$ 10,000$
|
| 468 |
+
OTR - pupil-teacher ratio by town
|
| 469 |
+
PB - proportion of blacks by town
|
| 470 |
+
LSP - $\%$ lower status of the population
|
| 471 |
+
|
| 472 |
+
# B.3 MIMIC-III
|
| 473 |
+
|
| 474 |
+
Here we provide additional results of our approach on the MIMIC-III dataset.
|
| 475 |
+
|
| 476 |
+

|
| 477 |
+
Figure 12: Information reward estimated during the first 4 active variable selection steps on a randomly chosen Boston Housing test data point. Model: PNP, strategy: EDDI. Each row contains two plots regarding the same time step. Bar plots on the left show the information reward estimation of each variable on the y-axis. All unobserved variables start with green bars, and turns purple once selected by the algorithm. Right: violin plot of the posterior density estimations of remaining unobserved variables.
|
| 478 |
+
|
| 479 |
+
# B.3.1 PREPROCESSING AND MODEL DETAILS
|
| 480 |
+
|
| 481 |
+
For our active learning experiments on MIMIC III datasets, we chose the variable of interest $\mathbf { X } _ { \phi }$ to be the binary mortality indicator of the dataset. All data (except the binary mortality indicator)
|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
Figure 13: Information reward estimated during the first 4 active variable selection steps on a randomly chosen Boston Housing test data point. Models: PNP, strategy: single ordering. Each row contains two plots regarding the same time step. Bar plots on the left show the information reward estimation of each variable on the y-axis. All unobserved variables start with green bars, and turns purple once selected by the algorithm. Right: violin plot of the posterior density estimations of remaining unobserved variables.
|
| 485 |
+
|
| 486 |
+
are normalized and then scaled between 0 and 1. We transformed the categorical variables into real-valued using the dictionary deduced from (Johnson et al., 2016) that makes use of the actual medical implications of each possible values. The binary mortality indicator are treated as Bernoulli variables and Bernoulli likelihood function is applied. For each repetition (of the 5 in total), we randomly draw $10 \%$ of the whole data to be our test set. Partial VAE models (ZI, ZI-m, PNP and PNs) share the same size of architecture with 10 dimensional diagonal Gaussian latent variables: the generator (decoder) is a 10-50-100-D neural network with ReLU activations (where D is the data dimensions). The inference nets (encoder) share the same structure of D-100-50-20 that maps the observed data into distributional parameters of the latent space. Additionally, for PN-based parameterizations, we further use a 20 dimensional feature mapping $h$ parameterized by a single layer neural network, and 10 dimensional ID vectors $\mathbf { e } _ { i }$ (please refer to section 3.2) for each variable. We choose the symmetric operator $g$ to be the basic summation operator.
|
| 487 |
+
|
| 488 |
+
Adam optimization and random missingness is applied as in the previous experiments. We trained our models for 3K iterations. During active learning, we draw 50 samples in order to estimate the expectation under $\mathbf { x } _ { \phi } , \mathbf { x } _ { i } \sim p \big ( \mathbf { x } _ { \phi } , \mathbf { x } _ { i } \big | \mathbf { x } _ { o } \big )$ in Equation (8). Negative likelihoods of the target variable is also estimated using 50 samples of $\mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } )$ through $\begin{array} { r } { p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) \approx \frac { 1 } { M } \sum _ { m = 1 } ^ { M } p ( \mathbf { x } _ { \phi } | \mathbf { z } _ { m } ) } \end{array}$ , where ${ \mathbf z } _ { m } \sim q ( { \mathbf z } | { \mathbf x } _ { o } )$ .
|
| 489 |
+
|
| 490 |
+
# B.3.2 ADDITIONAL PLOTS OF ZI, PN AND ZI-M ON MIMIC III
|
| 491 |
+
|
| 492 |
+
Figure 14 shows the information curves of active variable selection on the risk assessment task for MIMIC-III as produced by the three approaches, i.e. ZI, PN and masked ZI.
|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
Figure 14: Information curves of active variable selection on risk assessment task on MIMIC III, produced from: (a) Zero Imputing (ZI), (b) PointNet (PN) and (c) Zero Imputing with mask $\left( \mathrm { Z I - m } \right)$ . Green: random strategy; Black: EDDI; Pink: Single best ordering. This displays negative test log likelihood (y axis, the lower the better) during the course of active selection ( $\mathbf { \bar { x } }$ -axis)
|
| 496 |
+
|
| 497 |
+
# B.4 NHANES
|
| 498 |
+
|
| 499 |
+
# B.4.1 PREPROCESSING AND MODEL DETAILS
|
| 500 |
+
|
| 501 |
+
For our active learning experiments on NHANES datasets, we chose the variable of interest $\mathbf { X } _ { \phi }$ to be the lab test result section of the dataset. All data are normalized and scaled between 0 and 1. For categorical variables, these are transformed into real-valued variables using the code that comes with the dataset, which makes use of the actual ordering of variables in questionnaire. Then, for each repetition (of the 5 repetitions in total), we randomly draw 8000 data as training set and 100 data to be test set. All partial VAE models (ZI, ZI-m, PNP and PNs) uses gaussian likelihoods, with an diagonal Gaussian inference model (encoder). Partial VAE models share the same size of architecture with 20 dimensional diagonal Gaussian latent variables: the generator (decoder) is a 20-50-100-D neural network. The inference nets (encoder) share the same structure of D-100-50-20 that maps the observed data into distributional parameters of the latent space. Additionally, for PN-based parameterizations, we further use a 20 dimensional feature mapping $h$ parameterized by a single layer neural network, and 100 dimensional ID vectors $\mathbf { e } _ { i }$ (please refer to section 3.2) for each variable. We choose the symmetric operator $g$ to be the basic summation operator.
|
| 502 |
+
|
| 503 |
+
Adam optimization and random missingness is applied as in the previous experiments. We trained all models 1K iterations. During active learning, 10 samples were drawn to estimate the expectation in Equation (9). Negative likelihoods of the target variable is also estimated using 10 samples.
|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
Figure 15: Illustration of recurrent PN architecture. We show the example using 2 recurrent steps. The output $c _ { ( 2 ) }$ is directly connected to the rest of the inference network in this case. One can use more steps. To form the input for the $i + 1$ recurrent step, we concatenate the $c _ { ( i ) }$ to the input.
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure 16: Negative test log likelihoods of pilot runs for (recurrent) PN-based methods on MNIST dataset. we perform plot runs of PN1, PN2, PN5, PNP1, PNP1, PNP2, PNP5 (PN- $\mathbf { \nabla } \cdot \mathbf { X }$ stands for $\mathbf { X }$ recurrent steps of PN) on MNIST dataset for 300 iterations.All curves has been smoothed for clear comparison.
|
| 510 |
+
|
| 511 |
+
B.5 PN/PNP MODEL STRUCTURE DETERMINATION: SHOULD WE USE RECURRENT EXTENSIONS
|
| 512 |
+
|
| 513 |
+
One straightforward extention of PN/PNP Partial VAEs proposed in this paper is, to generalize PN and PNP by recurrently reuse the code $c$ to enlarge the capacity of PN:
|
| 514 |
+
|
| 515 |
+
Figure 15 shows the mechanism of the recurrent PN with two recurrent steps using concatenated $\mathbf { s } _ { ( 1 ) d } = [ \mathbf { e } _ { d } , \mathbf { x } _ { d } ]$ as an example. The first step is the same as the PN setting with the $K$ dimensional output $c _ { ( 1 ) }$ , where $( 1 )$ is the recurrent step index. For the second step, we concatenate the learned $c _ { ( 1 ) }$ to $\mathbf { s _ { ( 1 ) } }$ to form the new input for the next recurrent step $\mathbf s _ { ( 2 ) d } = [ \mathbf s _ { ( 1 ) d } , c _ { ( 1 ) } ]$ . There can be arbitrary number of recurrent steps using the input ${ \bf s } _ { ( n ) d } = [ { \bf s } _ { ( n - 1 ) d } , c _ { ( n - 1 ) } ]$ . Within each recurrent step, the parameters for the neural network $h _ { ( n ) }$ are shared, however, different steps have different parameters. When $n = 1$ , we recover the original PN partial VAE setting.
|
| 516 |
+
|
| 517 |
+
The question is, should we include the recurrent structure in our Partial VAE? In this section, we present preliminary result for this purpose. We perform plot runs of PN1, PN2, PN5, PNP1, PNP1, PNP2, PNP5 (PN- $\mathbf { \nabla } \cdot \mathbf { X }$ stands for PN model with x recurrent steps) on MNIST dataset for 300 iterations. Other model settings are consistent with Section B.1.1. Results of negative test log likelihoods are shown in Figure 16: Based on Figure 16, the conclusion is: based on MNIST dataset along, by increasing the recurrent steps of PN, the performance roughly increases slightly. Meanwhile, we can observe that increasing the recurrent steps does not improve PNP. However, the difference is not significant.
|
| 518 |
+
|
| 519 |
+
In section B.2.2, a comparison between recurrent PN (PN5) and vanilla PN (PN1) is considered for each UCI dataset, see Table 6, 7, 8, 9, 10, and 11. Additionally, the average ranking of AUIC of PN5 and PN1 is summarized in Table 14:
|
| 520 |
+
|
| 521 |
+
Table 14: Average Ranking of AUIC between PN5-Partial VAE and PN1-Partial VAE
|
| 522 |
+
|
| 523 |
+
<table><tr><td>Method</td><td>PN(5)</td><td>PN(1)</td></tr><tr><td>EDDI</td><td>2.83 (0.01)</td><td>2.78 (0.01)</td></tr><tr><td>Random</td><td>4.12 (0.01)</td><td>4.07 (0.01)</td></tr><tr><td>Single best</td><td>4.37 (0.01)</td><td>2.80 (0.01)</td></tr></table>
|
| 524 |
+
|
| 525 |
+
It is clear that one can not conclude that on average, PN5 significantly outperforms PN1. Therefore, as far as active learning tasks under the settings in our experiments are considered, we believe the recurrent generalization of PNs will not be a crucial factor for boosting a performance.
|
| 526 |
+
|
| 527 |
+
# C ADDITIONAL THEORETICAL CONTRIBUTIONS
|
| 528 |
+
|
| 529 |
+
# C.1 ZERO IMPUTING AS A POINT NET
|
| 530 |
+
|
| 531 |
+
Here we present how the zero imputing (ZI) and PointNet (PN) approaches relate.
|
| 532 |
+
|
| 533 |
+
Zero imputation with inference net In ZI, the natural parameter of $\lambda$ (e.g., Gaussian parameters in variational autoencoders) is approximated using the following neural network:
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
f ( \mathbf { x } ) : = \sum _ { l = 1 } ^ { L } w _ { l } ^ { ( 1 ) } \sigma ( \mathbf { w } _ { l } ^ { ( 0 ) } \mathbf { x } ^ { T } )
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
where $L$ is the number of hidden units, $\mathbf { X }$ is the input image with $x _ { i }$ be the value of the $i ^ { t h }$ pixel. To deal with partially observed data $\mathbf { x } = \mathbf { x } _ { o } \cup \mathbf { x } _ { u }$ , $\mathrm { Z I }$ simply sets all $\mathbf { X } _ { u }$ to zero, and use the full inference model $f ( \mathbf { x } )$ to perform approximate inference.
|
| 540 |
+
|
| 541 |
+
PointNet parameterizationThe PN approach approximates the natural parameter $\lambda$ by a permutation invariant set function
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
g ( h ( \mathbf { s } _ { 1 } ) , h ( \mathbf { s } _ { 2 } ) , . . . , h ( \mathbf { s } _ { O } ) ) ,
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
where $\mathbf { s } _ { i } = \left[ x _ { i } , \mathbf { e } _ { i } \right]$ , $\mathbf { e } _ { i }$ is the $I$ dimensional embedding/ID/location vector of the $i ^ { t h }$ pixel, $g ( \cdot )$ is a symmetric operation such as max-pooling and summation, and $h ( \cdot )$ is a nonlinear feature mapping from $\mathbb { R } ^ { I + 1 }$ to $\mathbb { R } ^ { K }$ (we will always refer $h$ as feature maps ). In the current version of the partial-VAE implementation, where Gaussian approximation is used, we set $K = 2 H$ with $H$ being the dimension of latent variables. We set $g$ to be the element-wise summation operator, i.e. a mapping from $\mathbb { R } ^ { K O }$ to $\mathbb { R } ^ { K }$ defined by:
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
g ( h ( \mathbf { s } _ { 1 } ) , h ( \mathbf { s } _ { 2 } ) , . . . , h ( \mathbf { s } _ { O } ) ) = \sum _ { i \in O } h ( \mathbf { s } _ { i } ) .
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
This parameterization corresponds to products of multiple Exp-Fam factors $\begin{array} { r } { \prod _ { i \in O } \exp \{ - \langle h ( \mathbf { s } _ { i } ) , \Phi \rangle \} } \end{array}$
|
| 554 |
+
|
| 555 |
+
From PN to ZI To derive the PN correspondence of the above ZI network we define the following PN functions:
|
| 556 |
+
|
| 557 |
+
$$
|
| 558 |
+
h ( \mathbf { s } _ { i } ) : = \mathbf { e } _ { i } * x _ { i }
|
| 559 |
+
$$
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
g ( h ( \mathbf { s } _ { 1 } ) , h ( \mathbf { s } _ { 2 } ) , . . . , h ( \mathbf { s } _ { O } ) ) : = \sum _ { k = 1 } ^ { I } \theta _ { k } \sigma ( \sum _ { i \in O } h _ { k } ( \mathbf { s } _ { i } ) ) ,
|
| 563 |
+
$$
|
| 564 |
+
|
| 565 |
+
where $h _ { k } ( \cdot )$ is the $k ^ { t h }$ output feature of $h ( \cdot )$ . The above PN parameterization is also permutation invariant; setting $L = I$ , $\mathbf { \theta } _ { l } = w _ { l } ^ { ( 1 ) } , ( \mathbf { w } _ { l } ^ { ( 0 ) } ) _ { i } = ( \mathbf { e } _ { i } ) _ { l }$ the resulting PN model is equivalent to the ZI neural network.
|
| 566 |
+
|
| 567 |
+
Generalizing ZI from PN perspective In the ZI approach, the missing values are replaced with zeros. However, this ad-hoc approach does not distinguish missing values from actual observed zero values. In practice, being able to distinguish between these two is crucial for improving uncertainty estimation during partial inference. One the other hand, we have found that PN-based partial VAE experiences difficulties in training. To alleviate both issues, we proposed a generalization of the ZI approach that follows a PN perspective. One of the advantages of PN is setting the feature maps of the unobserved variables to zero instead of the related weights. As discussed before, these two approaches are equivalent to each other only if the factors are linear. More generally, we can parameterize the PN by:
|
| 568 |
+
|
| 569 |
+
$$
|
| 570 |
+
\begin{array} { c } { { h ^ { ( 1 ) } ( { \bf s } _ { i } ) : = { \bf e } _ { i } \ast x _ { i } } } \\ { { h ^ { ( 2 ) } ( h _ { i } ^ { ( 1 ) } ) : = N N _ { 1 } ( h _ { i } ^ { ( 1 ) } ) } } \\ { { g ( h ( { \bf s } _ { 1 } ) , h ( { \bf s } _ { 2 } ) , . . . , h ( { \bf s } _ { O } ) ) : = N N _ { 2 } ( \sigma ( \underset { i \in O } { \sum } h _ { k } ^ { ( 2 ) } ( h _ { i } ^ { ( 1 ) } ) ) ) , } } \end{array}
|
| 571 |
+
$$
|
| 572 |
+
|
| 573 |
+
where $N N _ { 1 }$ is a mapping from $\mathbb { R } ^ { I }$ to $\mathbb { R } ^ { K }$ defined by a neural network, and $N N _ { 2 }$ is a mapping from $\mathbb { R } ^ { K }$ to $\mathbb { R } ^ { 2 H }$ defined by another neural network.
|
| 574 |
+
|
| 575 |
+
# C.2 APPROXIMATION DIFFICULTY OF THE ACQUISITION FUNCTION
|
| 576 |
+
|
| 577 |
+
Traditional variational approximation approaches provide wrong approximation direction when applied in this case (resulting in an upper bound of the objective $R _ { \phi } ( i , { \bf x } _ { O } )$ which we maximize). Justification issues aside, (black box) variational approximation requires sampling from approximate posterior $q ( { \bf z } | { \bf x } _ { O } )$ , which leads to extra uncertainties and computations. For common proposals of approximation:
|
| 578 |
+
|
| 579 |
+
• Directly estimate entropy via sampling $\Rightarrow$ problematic for high dimensional target variables
|
| 580 |
+
• Using reversed information reward $\begin{array} { r l r } { \mathbb { E } _ { { \mathbf { x } } _ { i } \sim p ( { \mathbf { x } } _ { i } \mid { \mathbf { x } } _ { o } ) } [ D _ { K L } ( \mathrm { ~ ~ \lambda ~ } } & { { } } & { \mid \mid p ( { \mathbf { x } } _ { \phi } \mid { \mathbf { x } } _ { o } , { \mathbf { x } } _ { i } ) ) ] } \end{array}$ , and then apply ELBO (KL-divergence) $\Rightarrow$ This does not make sense mathematically, since this will result in upper bound approximation of the (reversed) information objective, this is in the wrong direction.
|
| 581 |
+
• Ranganath’s bound (Ranganath et al., 2016) on estimating entropy $\Rightarrow$ gives upper bound of the objective, wrong direction.
|
| 582 |
+
• All the above methods also needs samples from latent space (therefore second level approximation needed).
|
| 583 |
+
|
| 584 |
+
# C.3 CONNECTION OF EDDI INFORMATION REWARD WITH BALD
|
| 585 |
+
|
| 586 |
+
We briefly discuss connection of EDDI information reward with BALD (Houlsby et al., 2011) and. MacKay’s work (MacKay, 1992). Assuming the model is correct, i.e. $q = p$ , we have
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\begin{array} { r l } & { R ( i , \mathbf { x } _ { o } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \left[ D _ { K L } ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { o } ) ) \right] } \\ & { \qquad - \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \left[ D _ { K L } ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) | | p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) \right] . } \end{array}
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
Note that based on McKay’s relationship between entropy and KL-divergence reduction, we have:
|
| 593 |
+
|
| 594 |
+
$$
|
| 595 |
+
\begin{array} { r l } & { \quad { \mathbb { E } } _ { { \mathbf { x } } _ { i } \sim p ( { \mathbf { x } } _ { i } \mid { \mathbf { x } } _ { o } ) } [ D _ { K L } ( p ( { \mathbf { z } } | { \mathbf { x } } _ { i } , { \mathbf { x } } _ { o } ) | | p ( { \mathbf { z } } | { \mathbf { x } } _ { o } ) ) ] } \\ & { = { \mathbb { E } } _ { { \mathbf { x } } _ { i } \sim p ( { \mathbf { x } } _ { i } \mid { \mathbf { x } } _ { o } ) } [ H ( p ( { \mathbf { z } } | { \mathbf { x } } _ { i } , { \mathbf { x } } _ { o } ) ) - H ( p ( { \mathbf { z } } | { \mathbf { x } } _ { o } ) ) ] ] . } \end{array}
|
| 596 |
+
$$
|
| 597 |
+
|
| 598 |
+
Similarly, we have
|
| 599 |
+
|
| 600 |
+
$$
|
| 601 |
+
\begin{array} { r l } & { \mathbb { E } _ { { \mathbf { x } _ { i } } \sim p ( { \mathbf { x } _ { i } } | { \mathbf { x } _ { o } } ) } \mathbb { E } _ { { \mathbf { x } _ { \phi } } \sim p ( { \mathbf { x } _ { \phi } } | { \mathbf { x } _ { i } } , { \mathbf { x } _ { o } } ) } [ D _ { K L } ( p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { i } } , { \mathbf { x } _ { o } } ) | | p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { o } } ) ) ] } \\ & { = \mathbb { E } _ { { \mathbf { x } _ { \phi } } \sim p ( { \mathbf { x } _ { \phi } } | { \mathbf { x } _ { o } } ) } \mathbb { E } _ { { \mathbf { x } _ { i } } \sim p ( { \mathbf { x } _ { i } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { o } } ) } [ D _ { K L } ( p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { i } } , { \mathbf { x } _ { o } } ) | | p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { o } } ) ) ] } \\ & = \mathbb { E } _ { { \mathbf { x } _ { \phi } \sim p ( { \mathbf { x } _ { \phi } } | { \mathbf { x } _ { o } } ) } } \mathbb { E } _ { { \mathbf { x } _ { i } \sim p ( { \mathbf { x } _ { i } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { o } } ) } [ H ( p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { i } } , { \mathbf { x } _ { o } } ) ) - H ( p ( { \mathbf { z } } | { \mathbf { x } _ { \phi } } , { \mathbf { x } _ { o } } ) ) ] } \\ & = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( { \mathbf { x } _ { i } } | { \mathbf { x } _ { o } } ) } \mathbb { E } _ { \mathbf { x } _ { \phi } } \sim p ( { \mathbf { x } _ { \phi } } | { \mathbf { x } _ { i } } , { \mathbf { x } _ { o } } ) [ H ( p ( \mathbf { z } | { \mathbf { x } _ { \phi } } , \mathbf { x } \end{array}
|
| 602 |
+
$$
|
| 603 |
+
|
| 604 |
+
where MacKay’s result is applied to $\mathbb { E } _ { { \mathbf { x } } _ { i } \sim p ( { \mathbf { x } } _ { i } \mid { \mathbf { x } } _ { \phi } , { \mathbf { x } } _ { o } ) } \left[ D _ { K L } \big ( p ( { \mathbf { z } } | { \mathbf { x } } _ { \phi } , { \mathbf { x } } _ { i } , { \mathbf { x } } _ { o } ) \big | \big | p ( { \mathbf { z } } | { \mathbf { x } } _ { \phi } , { \mathbf { x } } _ { o } ) \big ) \right] .$ Putting everything together, we have
|
| 605 |
+
|
| 606 |
+
$$
|
| 607 |
+
\begin{array} { r l } & { R ( i , \mathbf { x } _ { o } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) - H ( p ( \mathbf { z } | \mathbf { x } _ { o } ) ) ] ] } \\ & { \quad \quad - \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) ] + \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) ] } \\ & { \quad \quad = \{ \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) ] - \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) ] \} } \\ & { \quad \quad - \{ \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { o } ) ) ] - \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { o } ) ) ] \} . } \end{array}
|
| 608 |
+
$$
|
| 609 |
+
|
| 610 |
+
We can show that
|
| 611 |
+
|
| 612 |
+
$$
|
| 613 |
+
\begin{array} { r l } & { \quad H ( p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) - \mathbb { E } _ { \mathbf { x } _ { \phi } \sim p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } [ H ( p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) ) ] } \\ & { = - \displaystyle \int _ { \mathbf { z } } p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \log p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) d \mathbf { z } + \displaystyle \int _ { \mathbf { z } , \mathbf { x } _ { \phi } } p ( \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \log p ( \mathbf { z } | \mathbf { x } _ { \phi } , \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } \\ & { = \displaystyle \int _ { \mathbf { z } , \mathbf { x } _ { \phi } } p ( \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) \log \frac { p ( \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } { p ( \mathbf { z } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) p ( \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ) } } \\ & { = \mathcal { S } [ \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } ] , } \end{array}
|
| 614 |
+
$$
|
| 615 |
+
|
| 616 |
+
which is exactly the conditional mutual information $\mathcal { I } \left[ \mathbf { z } , \mathbf { x } _ { \phi } \vert \mathbf { x } _ { i } , \mathbf { x } _ { o } \right]$ used in BALD. Therefore, our chain rule representation of reward function leads us to
|
| 617 |
+
|
| 618 |
+
$$
|
| 619 |
+
R ( i , \mathbf { x } _ { o } ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathcal { I } \left[ \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { i } , \mathbf { x } _ { o } \right] - \mathbb { E } _ { \mathbf { x } _ { i } \sim p ( \mathbf { x } _ { i } | \mathbf { x } _ { o } ) } \mathcal { I } \left[ \mathbf { z } , \mathbf { x } _ { \phi } | \mathbf { x } _ { o } \right] .
|
| 620 |
+
$$
|
md/train/Hke0V1rKPS/Hke0V1rKPS.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# JACOBIAN ADVERSARIALLY REGULARIZED NETWORKS FOR ROBUSTNESS
|
| 2 |
+
|
| 3 |
+
Alvin Chan1∗, Yi Tay1, Yew-Soon $\mathbf { O n g ^ { 1 } }$ , Jie $\mathbf { F u ^ { 2 } }$ 1Nanyang Technological University, 2Mila, Polytechnique Montreal
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Adversarial examples are crafted with imperceptible perturbations with the intent to fool neural networks. Against such attacks, adversarial training and its variants stand as the strongest defense to date. Previous studies have pointed out that robust models that have undergone adversarial training tend to produce more salient and interpretable Jacobian matrices than their non-robust counterparts. A natural question is whether a model trained with an objective to produce salient Jacobian can result in better robustness. This paper answers this question with affirmative empirical results. We propose Jacobian Adversarially Regularized Networks (JARN) as a method to optimize the saliency of a classifier’s Jacobian by adversarially regularizing the model’s Jacobian to resemble natural training images1. Image classifiers trained with JARN show improved robust accuracy compared to standard models on the MNIST, SVHN and CIFAR-10 datasets, uncovering a new angle to boost robustness without using adversarial training examples.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning models have shown impressive performance in a myriad of classification tasks (LeCun et al., 2015). Despite their success, deep neural image classifiers are found to be easily fooled by visually imperceptible adversarial perturbations (Szegedy et al., 2013). These perturbations can be crafted to reduce accuracy during test time or veer predictions towards a target class. This vulnerability not only poses a security risk in using neural networks in critical applications like autonomous driving (Bojarski et al., 2016) but also presents an interesting research problem about how these models work.
|
| 12 |
+
|
| 13 |
+
Many adversarial attacks have come into the scene (Carlini & Wagner, 2017; Papernot et al., 2018; Croce & Hein, 2019), not without defenses proposed to counter them (Gowal et al., 2018; Zhang et al., 2019). Among them, the best defenses are based on adversarial training (AT) where models are trained on adversarial examples to better classify adversarial examples during test time (Madry et al., 2017). While several effective defenses that employ adversarial examples have emerged (Qin et al., 2019; Shafahi et al., 2019), generating strong adversarial training examples adds non-trivial computational burden on the training process (Kannan et al., 2018; Xie et al., 2019).
|
| 14 |
+
|
| 15 |
+
Adversarially trained models gain robustness and are also observed to produce more salient Jacobian matrices (Jacobians) at the input layer as a side effect (Tsipras et al., 2018). These Jacobians visually resemble their corresponding images for robust models but look much noisier for standard non-robust models. It is shown in theory that the saliency in Jacobian is a result of robustness (Etmann et al., 2019). A natural question to ask is this: can an improvement in Jacobian saliency induce robustness in models? In other words, could this side effect be a new avenue to boost model robustness? To the best of our knowledge, this paper is the first to show affirmative findings for this question.
|
| 16 |
+
|
| 17 |
+
To enhance the saliency of Jacobians, we draw inspirations from neural generative networks (Choi et al., 2018; Dai & Wipf, 2019). More specifically, in generative adversarial networks (GANs) (Goodfellow et al., 2014), a generator network learns to generate natural-looking images with a training objective to fool a discriminator network. In our proposed approach, Jacobian Adversarially
|
| 18 |
+
|
| 19 |
+
Regularized Networks (JARN), the classifier learns to produce salient Jacobians with a regularization objective to fool a discriminator network into classifying them as input images. This method offers a new way to look at improving robustness without relying on adversarial examples during training. With JARN, we show that directly training for salient Jacobians can advance model robustness against adversarial examples in the MNIST, SVHN and CIFAR-10 image dataset. When augmented with adversarial training, JARN can provide additive robustness to models thus attaining competitive results. All in all, the prime contributions of this paper are as follows:
|
| 20 |
+
|
| 21 |
+
• We show that directly improving the saliency of classifiers’ input Jacobian matrices can increase its adversarial robustness.
|
| 22 |
+
• To achieve this, we propose Jacobian adversarially regularized networks (JARN) as a method to train classifiers to produce salient Jacobians that resemble input images. Through experiments in MNIST, SVHN and CIFAR-10, we find that JARN boosts adversarial robustness in image classifiers and provides additive robustness to adversarial training.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 25 |
+
|
| 26 |
+
Given an input $\mathbf { x }$ , a classifier $f ( \mathbf { x } ; \theta ) : \mathbf { x } \mapsto \mathbb { R } ^ { k }$ maps it to output probabilities for $k$ classes in set $C$ , where $\theta$ is the classifier’s parameters and $\mathbf { y } \in \mathbb { R } ^ { k }$ is the one-hot label for the input. With a training dataset $D$ , the standard method to train a classifier $f$ is empirical risk minimization (ERM), through minθ $\mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim D } \mathcal { L } ( \mathbf { x } , \mathbf { y } )$ , where $\mathcal { L } ( \mathbf { x } , \mathbf { y } )$ is the standard cross-entropy loss function defined as
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\mathcal { L } ( \mathbf { x } , \mathbf { y } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim D } \left[ - \mathbf { y } ^ { \top } \log f ( \mathbf { x } ) \right]
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
While ERM trains neural networks that perform well on holdout test data, their accuracy drops drastically in the face of adversarial test examples. With an adversarial perturbation of magnitude $\varepsilon$ at input $\mathbf { x }$ , a model is robust against this attack if
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\underset { i \in C } { \arg \operatorname* { m a x } } f _ { i } ( \mathbf { x } ; \theta ) = \underset { i \in C } { \arg \operatorname* { m a x } } f _ { i } ( \mathbf { x } + \delta ; \theta ) , \forall \delta \in B _ { p } ( \varepsilon ) = \delta : \| \delta \| _ { p } \leq \varepsilon
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
We focus on $p = \infty$ in this paper.
|
| 39 |
+
|
| 40 |
+
Adversarial Training To improve models’ robustness, adversarial training (AT) (Goodfellow et al., 2016) seek to match the training data distribution with the adversarial test distribution by training classifiers on adversarial examples. Specifically, AT minimizes the loss function:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathcal { L } ( \mathbf { x } , \mathbf { y } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim D } \left[ \operatorname* { m a x } _ { \delta \in B ( \varepsilon ) } \mathcal { L } ( \mathbf { x } + \delta , \mathbf { y } ) \right]
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where the inner maximization, $\mathrm { m a x } _ { \delta \in B ( \varepsilon ) } \mathcal { L } ( \mathbf { x } + \delta , \mathbf { y } )$ , is usually performed with an iterative gradient-based optimization. Projected gradient descent (PGD) is one such strong defense which performs the following gradient step iteratively:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\delta \gets \mathrm { P r o j } \left[ \delta - \eta \mathrm { \ s i g n } \left( \nabla _ { \delta } \mathcal { L } ( \mathbf { x } + \delta , \mathbf { y } ) \right) \right]
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\begin{array} { r } { \operatorname { P r o j } ( \mathbf { x } ) = \arg \operatorname* { m i n } _ { \zeta \in B ( \varepsilon ) } \| \mathbf { x } - \zeta \| } \end{array}$ . The computational cost of solving Equation (3) is dominated by the inner maximization problem of generating adversarial training examples. A naive way to mitigate the computational cost involved is to reduce the number gradient descent iterations but that would result in weaker adversarial training examples. A consequence of this is that the models are unable to resist stronger adversarial examples that are generated with more gradient steps, due to a phenomenon called obfuscated gradients (Carlini & Wagner, 2017; Uesato et al., 2018).
|
| 53 |
+
|
| 54 |
+
Since the introduction of AT, a line of work has emerged that also boosts robustness with adversarial training examples. Capturing the trade-off between natural and adversarial errors, TRADES (Zhang et al., 2019) encourages the decision boundary to be smooth by adding a regularization term to reduce the difference between the prediction of natural and adversarial examples. Qin et al. (2019)
|
| 55 |
+
|
| 56 |
+
seeks to smoothen the loss landscape through local linearization by minimizing the difference between the real and linearly estimated loss value of adversarial examples. To improve adversarial training, Zhang & Wang (2019) generates adversarial examples by feature scattering, i.e., maximizing feature matching distance between the examples and clean samples.
|
| 57 |
+
|
| 58 |
+
Tsipras et al. (2018) observes that adversarially trained models display an interesting phenomenon: they produce salient Jacobian matrices $( \nabla _ { \mathbf x } \mathcal L )$ that loosely resemble input images while less robust standard models have noisier Jacobian. Etmann et al. (2019) explains that linearized robustness (distance from samples to decision boundary) increases as the alignment between the Jacobian and input image grows. They show that this connection is strictly true for linear models but weakens for non-linear neural networks. While these two papers show that robustly trained models result in salient Jacobian matrices, our paper aims to investigate whether directly training to generate salient Jacobian matrices can result in robust models.
|
| 59 |
+
|
| 60 |
+
Non-Adversarial Training Regularization Provable defenses are first proposed to bound minimum adversarial perturbation for certain types of neural networks (Hein & Andriushchenko, 2017; Weng et al., 2018; Raghunathan et al., 2018). One of the most advanced defense from this class of work (Wong et al., 2018) uses a dual network to bound the adversarial perturbation with linear programming. The authors then optimize this bound during training to boost adversarial robustness. Apart from this category, closer to our work, several works have studied a regularization term on top of the standard training objective to reduce the Jacobian’s Frobenius norm. This term aims to reduce the effect input perturbations have on model predictions. Drucker & Le Cun (1991) first proposed this to improve model generalization on natural test samples and called it ‘double backpropagation’. Two subsequent studies found this to also increases robustness against adversarial examples Ross & Doshi-Velez (2018); Jakubovitz & Giryes (2018). Recently, Hoffman et al. (2019) proposed an efficient method to approximate the input-class probability output Jacobians of a classifier to minimize the norms of these Jacobians with a much lower computational cost. Simon-Gabriel et al. (2019) proved that double backpropagation is equivalent to adversarial training with $l _ { 2 }$ examples. Etmann et al. (2019) trained robust models using double backpropagation to study the link between robustness and alignment in non-linear models but did not propose a new defense in their paper. While the double backpropagation term improves robustness by reducing the effect that perturbations in individual pixel have on the classifiers prediction through the Jacobians norm, it does not have the aim to optimize Jacobians to explicitly resemble their corresponding images semantically. Different from these prior work, we train the classifier with an adversarial loss term with the aim to make the Jacobian resemble input images more closely and show in our experiments that this approach confers more robustness.
|
| 61 |
+
|
| 62 |
+
# 3 JACOBIAN ADVERSARIALLY REGULARIZED NETWORKS (JARN)
|
| 63 |
+
|
| 64 |
+
Motivation Robustly trained models are observed to produce salient Jacobian matrices that resemble the input images. This begs a question in the reverse direction: will an objective function that encourages Jacobian to more closely resemble input images, will standard networks become robust? To study this, we look at neural generative networks where models are trained to produce natural-looking images. We draw inspiration from generative adversarial networks (GANs) where a generator network is trained to progressively generate more natural images that fool a discriminator model, in a min-max optimization scenario (Goodfellow et al., 2014). More specifically, we frame a classifier as the generator model in the GAN framework so that its Jacobians can progressively fool a discriminator model to interpret them as input images.
|
| 65 |
+
|
| 66 |
+
Another motivation lies in the high computational cost of the strongest defense to date, adversarial training. The cost on top of standard training is proportional to the number of steps its adversarial examples take to be crafted, requiring an additional backpropagation for each iteration. Especially with larger datasets, there is a need for less resource-intensive defense. In our proposed method (JARN), there is only one additional backpropagation through the classifier and the discriminator model on top of standard training. We share JARN in the following paragraphs and offer some theoretical analysis in $\ S 3 . 1$ .
|
| 67 |
+
|
| 68 |
+
Jacobian Adversarially Regularized Networks Denoting input as $\mathbf { x } \in \mathbb { R } ^ { h w c }$ for $h \times w$ -size images with $c$ channels, one-hot label vector of $k$ classes as $\mathbf { y } \in \mathbb { R } ^ { k }$ , we express $f _ { \mathrm { c l s } } ( \mathbf { x } ) \in \mathbb { R } ^ { k }$ as the prediction of the classifier $( f _ { \mathrm { c l s } } )$ , parameterized by $\theta$ . The standard cross-entropy loss is
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathcal { L } _ { \mathrm { c l s } } = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) } \left[ - \mathbf { y } ^ { \top } \log f _ { \mathrm { c l s } } ( \mathbf { x } ) \right]
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
With gradient backpropagation to the input layer, through $f _ { \mathrm { c l s } }$ with respect to ${ \mathcal L } _ { \mathrm { c l s } }$ , we can get the Jacobian matrix $J \in \bar { \mathbb { R } ^ { h w c } }$ as:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
J ( \mathbf { x } ) : = \nabla _ { \mathbf { x } } \mathcal { L } _ { \mathrm { c l s } } = \left[ \frac { \partial \mathcal { L } _ { \mathrm { c l s } } } { \partial \mathbf { x } _ { 1 } } \quad \hdots \quad \frac { \partial \mathcal { L } _ { \mathrm { c l s } } } { \partial \mathbf { x } _ { d } } \right]
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $d = h w c$ . The next part of JARN entails adversarial regularization of Jacobian matrices to induce resemblance with input images. Though the Jacobians of robust models are empirically observed to be similar to images, their distributions of pixel values do not visually match (Etmann et al., 2019). The discriminator model may easily distinguish between the Jacobian and natural images through this difference, resulting in the vanishing gradient (Arjovsky et al., 2017) for the classifier train on. To address this, an adaptor network $( f _ { a p t } )$ is introduced to map the Jacobian into the domain of input images. In our experiments, we use a single 1x1 convolutional layer with tanh activation function to model $f _ { a p t }$ , expressing its model parameters as $\psi$ . With the $J$ as the input of fapt, we get the adapted Jacobian matrix J 0 ∈ Rhwc,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
J ^ { \prime } = f _ { \mathrm { a p t } } ( J )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
We can frame the classifier and adaptor networks as a generator $G ( \mathbf { x } , \mathbf { y } )$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
G _ { \theta , \psi } ( \mathbf { x } , \mathbf { y } ) = f _ { \mathrm { a p t } } ( \nabla _ { \mathbf { x } } \mathcal { L } _ { \mathrm { c l s } } ( \mathbf { x } , \mathbf { y } ) )
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
learning to model distribution of $p { _ { J ^ { \prime } } }$ that resembles $p _ { \mathbf { x } }$
|
| 93 |
+
|
| 94 |
+
We now denote a discriminator network, parameterized by $\phi$ , as $f _ { \mathrm { d i s c } }$ that outputs a single scalar. $f _ { \mathrm { d i s c } } ( \mathbf { x } )$ represents the probability that $\mathbf { x }$ came from training images $p _ { \mathbf { x } }$ rather than $p { _ { J ^ { \prime } } }$ . To train $G _ { \theta , \psi }$ to produce $J ^ { \prime }$ that $f _ { \mathrm { d i s c } }$ perceive as natural images, we employ the following adversarial loss:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { a d v } } = \mathbb { E } _ { \mathbf { x } } [ \log f _ { \mathrm { d i s c } } ( \mathbf { x } ) ] + \mathbb { E } _ { J ^ { \prime } } [ \log ( 1 - f _ { \mathrm { d i s c } } ( J ^ { \prime } ) ) ] } \\ & { \qquad = \mathbb { E } _ { \mathbf { x } } [ \log f _ { \mathrm { d i s c } } ( \mathbf { x } ) ] + \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) } [ \log ( 1 - f _ { \mathrm { d i s c } } ( G _ { \theta , \psi } ( \mathbf { x } ) ) ) ] } \\ & { \qquad = \mathbb { E } _ { \mathbf { x } } [ \log f _ { \mathrm { d i s c } } ( \mathbf { x } ) ] + \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) } \left[ \log ( 1 - f _ { \mathrm { d i s c } } ( \ f _ { \mathrm { a p t } } ( \nabla _ { \mathbf { x } } \mathcal { L } _ { \mathrm { c l s } } ( \mathbf { x } , \mathbf { y } ) ) ) ) \right] } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Combining this regularization loss with the classification loss function $\mathcal { L } _ { \mathrm { c l s } }$ in Equation (5), we can optimize through stochastic gradient descent to approximate the optimal parameters for the classifier $f _ { \mathrm { c l s } }$ as follows,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\theta ^ { * } = \arg \operatorname* { m i n } _ { \theta } ( \mathcal { L } _ { c l s } + \lambda _ { a d v } \mathcal { L } _ { a d v } )
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\lambda _ { a d v }$ control how much Jacobian adversarial regularization term dominates the training.
|
| 107 |
+
|
| 108 |
+
Since the adaptor network $( f _ { \mathrm { a p t } } )$ is part of the generator $G$ , its optimal parameters $\psi ^ { * }$ can be found with minimization of the adversarial loss,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\psi ^ { * } = \arg \operatorname* { m i n } _ { \psi } \mathcal { L } _ { a d v }
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
On the other hand, the discriminator $( f _ { \mathrm { d i s c } } )$ is optimized to maximize the adversarial loss term to distinguish Jacobian from input images correctly,
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\phi ^ { * } = \arg \operatorname* { m a x } _ { \phi } \mathcal { L } _ { a d v }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Analogous to how generator from GANs learn to generate images from noise, we add $[ - \varepsilon , - \varepsilon ]$ uniformly distributed noise to input image pixels during JARN training phase. Figure 1 shows a summary of JARN training phase while Algorithm 1 details the corresponding pseudo-codes. In our experiments, we find that using JARN framework only on the last few epoch $( 2 5 \% )$ to train the classifier confers similar adversarial robustness compared to training with JARN for the whole duration. This practice saves compute time and is used for the results reported in this paper.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 1: Training architecture of JARN.
|
| 124 |
+
|
| 125 |
+
# Algorithm 1: Jacobian Adversarially Regularized Network
|
| 126 |
+
|
| 127 |
+
<table><tr><td colspan="2">1 Input:Training data Dtrain,Learning rates for classifier fels,adaptor fapt and discriminator fdisc: (α,β,~)</td></tr><tr><td>2 for each training iteration do</td><td></td></tr><tr><td>3</td><td>Sample (x,y)~ Dtrain</td></tr><tr><td>4</td><td>X ←x+ε,~unif[-ε,ε]</td></tr><tr><td>5</td><td>Lcls ← -yTlog fels(x) >(1) Compute classification cross-entropy loss</td></tr><tr><td>6</td><td>J ←∀xLcls >(2) Compute Jacobian matrix</td></tr><tr><td>7</td><td>J'←fapt(J) > (3)Adapt Jacobian to image domain</td></tr><tr><td>8</td><td>Ladv ←log fdisc(x) +log(1-fdisc(J')) (4) Compute adversarial loss</td></tr><tr><td>9</td><td>θ←θ-αVθ(Lcls+XaduLadu) >(5a) Update the classifier fels to minimize Lcls and Ladv</td></tr><tr><td>10</td><td>←-βLad D(5b) Update the adaptor fapt to minimize Ladu ←+γLadv</td></tr><tr><td>11</td><td>>(5c) Update the discriminator fdisc to maximize Ladv</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 3.1 THEORETICAL ANALYSIS
|
| 130 |
+
|
| 131 |
+
Here, we study the link between JARN’s adversarial regularization term with the notion of linearized robustness. Assuming a non-parameteric setting where the models have infinite capacity, we have the following theorem while optimizing $G$ with the adversarial loss $\mathcal { L } _ { a d v }$ .
|
| 132 |
+
|
| 133 |
+
Theorem 3.1. The global minimum of $\mathcal { L } _ { a d \nu }$ is achieved when $G ( \mathbf { x } )$ maps x to itself, i.e., $G ( \mathbf { x } ) = \mathbf { x }$ .
|
| 134 |
+
|
| 135 |
+
Its proof is deferred to $\ S \ A$ . If we assume Jacobian $J$ of our classifier $f _ { \mathrm { c l s } }$ to be the direct output of $G$ , then $J = G ( \mathbf { x } ) = \mathbf { x }$ at the global minimum of the adversarial objective.
|
| 136 |
+
|
| 137 |
+
In Etmann et al. (2019), it is shown that the linearized robustness of a model is loosely upperbounded by the alignment between the Jacobian and the input image. More concretely, denoting $\Psi ^ { i }$ as the logits value of class $i$ in a classifier $F$ , its linearized robustness $\rho$ can be expressed as $\begin{array} { r } { \rho ( \mathbf { x } ) : = \operatorname* { m i n } _ { j \neq i ^ { * } } \frac { \Psi ^ { i ^ { * } } ( \mathbf { x } ) - \Psi ^ { j } ( \mathbf { x } ) } { \| \nabla _ { \mathbf { x } } \Psi ^ { i ^ { * } } ( \mathbf { x } ) - \nabla _ { \mathbf { x } } \Psi ^ { j } ( \mathbf { x } ) \| } } \end{array}$ Here we quote the theorem from Etmann et al. (2019):
|
| 138 |
+
|
| 139 |
+
Theorem 3.2 (Linearized Robustness Bound). (Etmann et al., 2019) Defining $i ^ { * } = \arg \operatorname* { m a x } _ { i } \Psi ^ { i }$ and $j ^ { * } = \arg \operatorname* { m a x } _ { j \neq i ^ { * } } \Psi ^ { j }$ as top two prediction, we let the Jacobian with respect to the difference in top two logits be $\overset { \cdot } { \underset { \cdot } { g } } : = \nabla _ { \mathbf x } ( \Psi ^ { i ^ { * } } - \Psi ^ { j ^ { * } } ) ( \mathbf x )$ . Expressing alignment between the Jacobian with the input as $\begin{array} { r } { \alpha ( \mathbf { x } ) = \frac { | \langle \mathbf { x } , g \rangle | } { \| g \| } } \end{array}$ |hx,gi|kgk , then
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\rho ( \mathbf { x } ) \leq \alpha ( \mathbf { x } ) + { \frac { C } { \| g \| } }
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $C$ is a positive constant.
|
| 146 |
+
|
| 147 |
+
Combining with what we have in Theorem 3.1, assuming $J$ to be close to $g$ in a fixed constant term, the alignment term $\alpha ( \mathbf { x } )$ in Equation (13) is maximum when ${ \mathcal { L } } _ { \mathrm { a d v } }$ reaches its global minimum. Though this is not a strict upper bound and, to facilitate the training in JARN in practice, we use an adaptor network to transform the Jacobian, i.e., $J ^ { \prime } = f _ { \mathrm { a p t } } ( J )$ , our experiments show that model robustness can be improved with this adversarial regularization.
|
| 148 |
+
|
| 149 |
+
# 4 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
We conduct experiments on three image datasets, MNIST, SVHN and CIFAR-10 to evaluate the adversarial robustness of models trained by JARN.
|
| 152 |
+
|
| 153 |
+
# 4.1 MNIST
|
| 154 |
+
|
| 155 |
+
Setup MNIST consists of $6 0 \mathrm { k }$ training and $1 0 \mathrm { k }$ test binary-colored images. We train a CNN, sequentially composed of 3 convolutional layers and 1 final softmax layer. All 3 convolutional layers have a stride of 5 while each layer has an increasing number of output channels (64-128-256). For JARN, we use $\lambda _ { \mathrm { a d v } } = 1$ , a discriminator network of 2 CNN layers (64-128 output channels) and update it for every $1 0 ~ f _ { \mathrm { c l s } }$ training iterations. We evaluate trained models against adversarial examples with $l _ { \infty }$ perturbation $\varepsilon = 0 . 3$ , crafted from FGSM and PGD (5 & 40 iterations). FGSM generates weaker adversarial examples with only one gradient step and is weaker than the iterative PGD method.
|
| 156 |
+
|
| 157 |
+
Results The CNN trained with JARN shows improved adversarial robustness from a standard model across the three types of adversarial examples (Table 1). In the MNIST experiments, we find that data augmentation with uniform noise to pixels alone provides no benefit in robustness from the baseline.
|
| 158 |
+
|
| 159 |
+
Table 1: MNIST accuracy $( \% )$ on adversarial and clean test samples.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Model</td><td>FGSM</td><td>PGD5</td><td>PGD40</td><td>Clean</td></tr><tr><td>Standard</td><td>76.5</td><td>0</td><td>0</td><td>98.7</td></tr><tr><td>Uniform Noise</td><td>77.5</td><td>0</td><td>0.02</td><td>98.7</td></tr><tr><td>JARN</td><td>98.4</td><td>98.1</td><td>98.1</td><td>98.8</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 4.2 SVHN
|
| 164 |
+
|
| 165 |
+
Setup SVHN is a 10-class house number image classification dataset with 73257 training and 26032 test images, each of size $3 2 \times 3 2 \times 3$ . We train the Wide-Resnet model following hyperparameters from (Madry et al., 2017)’s setup for their CIFAR-10 experiments. For JARN, we use $\lambda _ { \mathrm { a d v } } = 5$ , a discriminator network of 5 CNN layers (16-32-64-128-256 output channels) and update it for every $2 0 ~ f _ { \mathrm { c l s } }$ training iterations. We evaluate trained models against adversarial examples with $( \varepsilon = 8 / 2 5 5 )$ , crafted from FGSM and 5, 10, 20-iteration PGD attack.
|
| 166 |
+
|
| 167 |
+
Results Similar to the findings in $\ S 4 . 1$ , JARN advances the adversarial robustness of the classifier from the standard baseline against all four types of attacks. Interestingly, uniform noise image augmentation increases adversarial robustness from the baseline in the SVHN experiments, concurring with previous work that shows noise augmentation improves robustness (Ford et al., 2019).
|
| 168 |
+
|
| 169 |
+
Table 2: SVHN accuracy $( \% )$ on adversarial and clean test samples.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model</td><td>FGSM</td><td>PGD5</td><td>PGD10</td><td>PGD20</td><td>Clean</td></tr><tr><td>Standard</td><td>64.4</td><td>26.0</td><td>5.47</td><td>1.96</td><td>94.7</td></tr><tr><td>Uniform Noise</td><td>65.0</td><td>42.6</td><td>18.4</td><td>9.21</td><td>95.3</td></tr><tr><td>JARN</td><td>67.2</td><td>57.5</td><td>37.7</td><td>26.79</td><td>94.9</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 4.3 CIFAR-10
|
| 174 |
+
|
| 175 |
+
Setup CIFAR-10 contains $3 2 \times 3 2 \times 3$ colored images labeled as 10 classes, with 50k training and 10k test images. We train the Wide-Resnet model using similar hyperparameters to (Madry et al., 2017) for our experiments. Following the settings from Madry et al. (2017), we compare with a strong adversarial training baseline (PGD-AT7) that involves training the model with adversarial examples generate with 7-iteration PGD attack. For JARN, we use $\lambda _ { \mathrm { a d v } } = 1$ , a discriminator network of 5 CNN layers (32-64-128-256-512 output channels) and update it for every $2 0 ~ f _ { \mathrm { c l s } }$ training iterations. We evaluate trained models against adversarial examples with $\langle \varepsilon = 8 / 2 5 5 )$ , crafted from FGSM and PGD (5, 10 & 20 iterations). We also add in a fast gradient sign attack baseline (FGSMAT1) that generates adversarial training examples with only 1 gradient step. Though FGSM-trained models are known to rely on obfuscated gradients to counter weak attacks, we augment it with JARN to study if there is additive robustness benefit against strong attacks. We also implemented double backpropagation (Drucker & Le Cun, 1991; Ross & Doshi-Velez, 2018) to compare.
|
| 176 |
+
|
| 177 |
+
Results Similar to results from the previous two datasets, the JARN classifier performs better than the standard baseline for all four types of adversarial examples. Compared to the model trained with uniform-noise augmentation, JARN performs closely in the weaker FGSM attack while being more robust against the two stronger PGD attacks. JARN also outperforms the double backpropagation baseline, showing that regularizing for salient Jacobians confers more robustness than regularizing for smaller Jacobian Frobenius norm values. The strong PGD-AT7 baseline shows higher robustness against PGD attacks than the JARN model. When we train JARN together with 1-step adversarial training (JARN-AT1), we find that the model’s robustness exceeds that of strong PGD-AT7 baseline on all four adversarial attacks, suggesting JARN’s gain in robustness is additive to that of AT.
|
| 178 |
+
|
| 179 |
+
Table 3: CIFAR-10 accuracy $( \% )$ on adversarial and clean test samples.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model</td><td>FGSM</td><td>PGD5</td><td>PGD10</td><td>PGD20</td><td>Clean</td></tr><tr><td>Standard</td><td>13.4</td><td>0</td><td>0</td><td>0</td><td>95.0</td></tr><tr><td>Uniform Noise</td><td>67.4</td><td>44.6</td><td>19.7</td><td>7.48</td><td>94.0</td></tr><tr><td>FGSM-AT1</td><td>94.5</td><td>0.25</td><td>0.02</td><td>0.01</td><td>91.7</td></tr><tr><td>Double Backprop</td><td>28.3</td><td>0.05</td><td>0</td><td>0</td><td>95.7</td></tr><tr><td>JARN</td><td>67.2</td><td>50.0</td><td>27.6</td><td>15.5</td><td>93.9</td></tr><tr><td>PGD-AT7</td><td>56.2</td><td>55.5</td><td>47.3</td><td>45.9</td><td>87.3</td></tr><tr><td>JARN-AT1</td><td>65.7</td><td>60.1</td><td>51.8</td><td>46.7</td><td>84.8</td></tr></table>
|
| 182 |
+
|
| 183 |
+
# 4.3.1 GENERALIZATION OF ROBUSTNESS
|
| 184 |
+
|
| 185 |
+
Adversarial training (AT) based defenses generally train the model on examples generated by perturbation of a fixed $\varepsilon$ . Unlike AT, JARN by itself does not have $\varepsilon$ as a training parameter. To study how JARN-AT1 robustness generalizes, we conduct PGD attacks of varying $\varepsilon$ and strength (5, 10 and 20 iterations). We also include another PGD-AT7 baseline that was trained at a higher $\varepsilon = ( 1 2 / 2 5 5 )$ . JARN-AT1 shows higher robustness than the two PGD-AT7 baselines against attacks with higher $\varepsilon$ values $( \leq 8 / 2 5 5 )$ ) across the three PGD attacks, as shown in Figure 2. We also observe that the PGD-AT7 variants outperform each other on attacks with $\varepsilon$ values close to their training $\varepsilon$ , suggesting that their robustness is more adapted to resist adversarial examples that they are trained on. This relates to findings by Tramer & Boneh (2019) which shows that robustness from adversarial training \` is highest against the perturbation type that models are trained on.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 2: Generalization of model robustness to PGD attacks of different $\varepsilon$ values.
|
| 189 |
+
|
| 190 |
+
# 4.3.2 LOSS LANDSCAPE
|
| 191 |
+
|
| 192 |
+
We compute the classification loss value along the adversarial perturbation’s direction and a random orthogonal direction to analyze the loss landscape of the models. From Figure 3, we see that the models trained by the standard and FGSM-AT method display loss surfaces that are jagged and nonlinear. This explains why the FGSM-AT display modest accuracy at the weaker FGSM attacks but fail at attacks with more iterations, a phenomenon called obfuscated gradients (Carlini & Wagner, 2017; Uesato et al., 2018) where the initial gradient steps are still trapped within the locality of the input but eventually escape with more iterations. The JARN model displays a loss landscape that is less steep compared to the standard and FGSM-AT models, marked by the much lower (1 order of magnitude) loss value in Figure 3c. When JARN is combined with one iteration of adversarial training, the JARN-AT1 model is observed to have much smoother loss landscapes, similar to that of the PGD-AT7 model, a strong baseline previously observed to be free of obfuscated gradients. This suggests that JARN and AT have additive benefits and JARN-AT1’s adversarial robustness is not attributed to obfuscated gradients.
|
| 193 |
+
|
| 194 |
+
A possible explanation behind the improved robustness through increasing Jacobian saliency is that the space of Jacobian shrinks under this regularization, i.e., Jacobians have to resemble non-noisy images. Intuitively, this means that there would be fewer paths for an adversarial example to reach an optimum in the loss landscape, improving the model’s robustness.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 3: Loss surfaces of models along the adversarial perturbation and a random direction.
|
| 198 |
+
|
| 199 |
+
# 4.3.3 SALIENCY OF JACOBIAN
|
| 200 |
+
|
| 201 |
+
The Jacobian matrices of JARN model and PGD-AT are salient and visually resemble the images more than those from the standard model (Figure 4). Upon closer inspection, the Jacobian matrices of the PGD-AT model concentrate their values at small regions around the object of interest whereas those of the JARN model cover a larger proportion of the images. One explanation is that the JARN model is trained to fool the discriminator network and hence generates Jacobian that contains details of input images to more closely resemble them.
|
| 202 |
+
|
| 203 |
+
# 4.3.4 COMPUTE TIME
|
| 204 |
+
|
| 205 |
+
Training with JARN is computationally more efficient when compared to adversarial training (Table 4). Even when combined with FGSM adversarial training JARN, it takes less than half the time of 7-step PGD adversarial training while outperforming it in robustness.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 4: Jacobian matrices of CIFAR-10 models.
|
| 209 |
+
|
| 210 |
+
Table 4: Average wall-clock time per training epoch for CIFAR-10 adversarial defenses.
|
| 211 |
+
|
| 212 |
+
<table><tr><td>Model</td><td>PGD-AT7</td><td>JARN-AT1</td><td>FGSM-AT1</td><td>JARN only</td></tr><tr><td>Time (sec)</td><td>704</td><td>294</td><td>267</td><td>217</td></tr></table>
|
| 213 |
+
|
| 214 |
+
# 4.3.5 SENSITIVITY TO HYPERPARAMETERS
|
| 215 |
+
|
| 216 |
+
The performance of GANs in image generation has been well-known to be sensitive to training hyperparameters. We test JARN performance across a range of $\lambda _ { a d v }$ , batch size and discriminator update intervals that are different from $\ S 4 . 3$ and find that its performance is relatively stable across hyperparameter changes, as shown in Appendix Figure 5. In a typical GAN framework, each training step involves a real image sample and an image generated from noise that is decoupled from the real sample. In contrast, a Jacobian is conditioned on its original input image and both are used in the same training step of JARN. This training step resembles that of VAE-GAN (Larsen et al., 2015) where pairs of real images and its reconstructed versions are used for training together, resulting in generally more stable gradients and convergence than GAN. We believe that this similarity favors JARN’s stability over a wider range of hyperparameters.
|
| 217 |
+
|
| 218 |
+
# 4.3.6 BLACK-BOX TRANSFER ATTACKS
|
| 219 |
+
|
| 220 |
+
Transfer attacks are adversarial examples generated from an alternative, substitute model and evaluated on the defense to test for gradient masking (Papernot et al., 2016; Carlini et al., 2019). More specifically, defenses relying on gradient masking will display lower robustness towards transfer attacks than white-box attacks. When evaluated on such black-box attacks using adversarial examples generated from a PGD-AT7 trained model and their differently initialized versions, both JARN and JARN-AT1 display higher accuracy than when under white-box attacks (Table 5). This demonstrates that JARN’s robustness does not rely on gradient masking. Rather unexpectedly, JARN performs better than JARN-AT1 under the PGD-AT7 transfer attacks, which we believe is attributed to its better performance on clean test samples.
|
| 221 |
+
|
| 222 |
+
Table 5: CIFAR-10 accuracy $( \% )$ on transfer attack where adversarial examples are generated from a PGD-AT7 trained model.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Model</td><td>PGD-AT7 FGSM</td><td>PGD20</td><td>SameModel FGSM PGD20</td><td>FGSM</td><td>White-box PGD20</td><td>Clean</td></tr><tr><td>JARN</td><td>79.6</td><td>76.7</td><td>73.6 17.4</td><td>67.2</td><td>15.5</td><td>93.9</td></tr><tr><td>JARN-AT1</td><td>66.4</td><td>63.0</td><td>70.3 59.3</td><td>65.7</td><td>46.7</td><td>84.8</td></tr></table>
|
| 225 |
+
|
| 226 |
+
# 5 CONCLUSIONS
|
| 227 |
+
|
| 228 |
+
In this paper, we show that training classifiers to give more salient input Jacobian matrices that resemble images can advance their robustness against adversarial examples. We achieve this through an adversarial regularization framework (JARN) that train the model’s Jacobians to fool a discriminator network into classifying them as images. Through our experiments in three image datasets, JARN boosts adversarial robustness of standard models and give competitive performance when added on to weak defenses like FGSM. Our findings open the viability of improving the saliency of Jacobian as a new avenue to boost adversarial robustness.
|
| 229 |
+
|
| 230 |
+
# ACKNOWLEDGMENTS
|
| 231 |
+
|
| 232 |
+
This work is funded by the National Research Foundation, Singapore under its AI Singapore programme [Award No.: AISG-RP-2018-004] and the Data Science and Artificial Intelligence Research Center (DSAIR) at Nanyang Technological University.
|
| 233 |
+
|
| 234 |
+
# REFERENCES
|
| 235 |
+
|
| 236 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 237 |
+
|
| 238 |
+
Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, et al. End to end learning for self-driving cars. arXiv preprint arXiv:1604.07316, 2016.
|
| 239 |
+
|
| 240 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39–57. IEEE, 2017.
|
| 241 |
+
|
| 242 |
+
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, and Aleksander Madry. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 243 |
+
|
| 244 |
+
Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 245 |
+
|
| 246 |
+
Francesco Croce and Matthias Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. arXiv preprint arXiv:1907.02044, 2019.
|
| 247 |
+
|
| 248 |
+
Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019.
|
| 249 |
+
|
| 250 |
+
Harris Drucker and Yann Le Cun. Double backpropagation increasing generalization performance. In IJCNN-91-Seattle International Joint Conference on Neural Networks, volume 2, pp. 145–150. IEEE, 1991.
|
| 251 |
+
|
| 252 |
+
Christian Etmann, Sebastian Lunz, Peter Maass, and Carola-Bibiane Schonlieb. On the con- ¨ nection between adversarial robustness and saliency map interpretability. arXiv preprint arXiv:1905.04172, 2019.
|
| 253 |
+
|
| 254 |
+
Nic Ford, Justin Gilmer, Nicolas Carlini, and Dogus Cubuk. Adversarial examples are a natural consequence of test error in noise. arXiv preprint arXiv:1901.10513, 2019.
|
| 255 |
+
|
| 256 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 257 |
+
|
| 258 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 259 |
+
|
| 260 |
+
Sven Gowal, Krishnamurthy Dvijotham, Robert Stanforth, Rudy Bunel, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. On the effectiveness of interval bound propagation for training verifiably robust models. arXiv preprint arXiv:1810.12715, 2018.
|
| 261 |
+
|
| 262 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems, pp. 2266–2276, 2017.
|
| 263 |
+
|
| 264 |
+
Judy Hoffman, Daniel A Roberts, and Sho Yaida. Robust learning with jacobian regularization. arXiv preprint arXiv:1908.02729, 2019.
|
| 265 |
+
|
| 266 |
+
Daniel Jakubovitz and Raja Giryes. Improving dnn robustness to adversarial attacks using jacobian regularization. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 514–529, 2018.
|
| 267 |
+
|
| 268 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
|
| 269 |
+
|
| 270 |
+
Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. arXiv preprint arXiv:1512.09300, 2015.
|
| 271 |
+
|
| 272 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 273 |
+
|
| 274 |
+
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.
|
| 275 |
+
|
| 276 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
|
| 277 |
+
|
| 278 |
+
Nicolas Papernot, Fartash Faghri, Nicholas Carlini, Ian Goodfellow, Reuben Feinman, Alexey Kurakin, Cihang Xie, Yash Sharma, Tom Brown, Aurko Roy, Alexander Matyasko, Vahid Behzadan, Karen Hambardzumyan, Zhishuai Zhang, Yi-Lin Juang, Zhi Li, Ryan Sheatsley, Abhibhav Garg, Jonathan Uesato, Willi Gierke, Yinpeng Dong, David Berthelot, Paul Hendricks, Jonas Rauber, and Rujun Long. Technical report on the cleverhans v2.1.0 adversarial examples library. arXiv preprint arXiv:1610.00768, 2018.
|
| 279 |
+
|
| 280 |
+
Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Alhussein Fawzi, Soham De, Robert Stanforth, Pushmeet Kohli, et al. Adversarial robustness through local linearization. arXiv preprint arXiv:1907.02610, 2019.
|
| 281 |
+
|
| 282 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy S Liang. Semidefinite relaxations for certifying robustness to adversarial examples. In Advances in Neural Information Processing Systems, pp. 10877–10887, 2018.
|
| 283 |
+
|
| 284 |
+
Andrew Slavin Ross and Finale Doshi-Velez. Improving the adversarial robustness and interpretability of deep neural networks by regularizing their input gradients. In Thirty-second AAAI conference on artificial intelligence, 2018.
|
| 285 |
+
|
| 286 |
+
Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! arXiv preprint arXiv:1904.12843, 2019.
|
| 287 |
+
|
| 288 |
+
Carl-Johann Simon-Gabriel, Yann Ollivier, Leon Bottou, Bernhard Scholkopf, and David Lopez- ¨ Paz. First-order adversarial vulnerability of neural networks and input dimension. In International Conference on Machine Learning, pp. 5809–5817, 2019.
|
| 289 |
+
|
| 290 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 291 |
+
|
| 292 |
+
Florian Tramer and Dan Boneh. Adversarial training and robustness for multiple perturbations. \` arXiv preprint arXiv:1904.13000, 2019.
|
| 293 |
+
|
| 294 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. arXiv preprint arXiv:1805.12152, 2018.
|
| 295 |
+
|
| 296 |
+
Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. arXiv preprint arXiv:1802.05666, 2018.
|
| 297 |
+
|
| 298 |
+
Tsui-Wei Weng, Pin-Yu Chen, Lam M Nguyen, Mark S Squillante, Ivan Oseledets, and Luca Daniel. Proven: Certifying robustness of neural networks with a probabilistic approach. arXiv preprint arXiv:1812.08329, 2018.
|
| 299 |
+
|
| 300 |
+
Eric Wong, Frank Schmidt, Jan Hendrik Metzen, and J Zico Kolter. Scaling provable adversarial defenses. In Advances in Neural Information Processing Systems, pp. 8400–8409, 2018.
|
| 301 |
+
|
| 302 |
+
Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 501–509, 2019.
|
| 303 |
+
|
| 304 |
+
Haichao Zhang and Jianyu Wang. Defense against adversarial attacks using feature scattering-based adversarial training. arXiv preprint arXiv:1907.10764, 2019.
|
| 305 |
+
|
| 306 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. arXiv preprint arXiv:1901.08573, 2019.
|
| 307 |
+
|
| 308 |
+
# A PROOF OF THEOREM 3.1
|
| 309 |
+
|
| 310 |
+
Theorem A.1. The global minimum of $\mathcal { L } _ { a d \nu }$ is achieved when $G ( \mathbf { x } )$ maps x to itself, i.e., $G ( \mathbf { x } ) = \mathbf { x }$
|
| 311 |
+
|
| 312 |
+
Proof. From (Goodfellow et al., 2014), for a fixed $G$ , the optimal discriminator is
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
f _ { \mathrm { d i s c } } ^ { * } ( \mathbf { x } ) = \frac { p _ { \mathrm { d a t a } } ( \mathbf { x } ) } { p _ { \mathrm { d a t a } } ( \mathbf { x } ) + p _ { G } ( \mathbf { x } ) }
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
We can include the optimal discriminator into Equation (9) to get
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\begin{array} { r l } { \mathcal { L } _ { \mathrm { a b v } } ( G ) = \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log f _ { \mathrm { d a s c } } ^ { * } ( \mathbf { x } ) ] + \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log ( 1 - f _ { \mathrm { d i s c } } ^ { * } ( G ( \mathbf { x } ) ) ) ] } & { } \\ { = \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log f _ { \mathrm { d i s c } } ^ { * } ( \mathbf { x } ) ] + \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { E } } } [ \log ( 1 - f _ { \mathrm { d i s c } } ^ { * } ( \mathbf { x } ) ) ] } & { } \\ { = \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log \frac { p _ { \mathrm { d a s t a } } ( \mathbf { x } ) } { p _ { \mathrm { d a s t } } ( \mathbf { x } ) + p _ { G } ( \mathbf { x } ) } ] + \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log \frac { p _ { G } ( \mathbf { x } ) } { p _ { \mathrm { d a s t } } ( \mathbf { x } ) + p _ { G } ( \mathbf { x } ) } ] } & { } \\ { = \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { d a s c } } } [ \log \frac { p _ { \mathrm { d a s t a } } ( \mathbf { x } ) } { \frac { p _ { \mathrm { d a s t a } } ( \mathbf { x } ) + p _ { G } ( \mathbf { x } ) } { 2 } } ] + \mathbb { E } _ { \mathbf { x } \sim p _ { \mathrm { G } } } [ \log \frac { p _ { \mathrm { G } } ( \mathbf { x } ) } { \frac { 1 } { 2 } ( p _ { \mathrm { d a s t } } ( \mathbf { x } ) + p _ { G } ( \mathbf { x } ) ) } ] - 2 \log 2 } & { } \\ { = K L ( p _ { \mathrm { d a s t } } \| \frac { p _ { \mathrm { d a s t } } + p _ { G } } { 2 } ) + K L ( p _ { \mathrm { G } } \| \frac { p _ { \mathrm { d a s t } } + p _ { G } } { 2 } ) - \log 4 } & { } \\ { = 2 \cdot J S ( p _ { \mathrm { d a s t } } | | p _ { \mathrm { G } } ) - \log 4 } & { } \end{array}
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
where $K L$ and $J S$ are the Kullback-Leibler and Jensen-Shannon divergence respectively. Since the Jensen-Shannon divergence is always non-negative, ${ \mathcal { L } } _ { \mathrm { a d v } } ( G )$ reaches its global minimum value of $- \log 4$ when $J S ( p _ { \mathrm { d a t a } } | | p _ { \mathrm { G } } ) ~ = ~ 0$ . When $G ( \mathbf { x } ) \ : = \ : \mathbf { x }$ , we get $p _ { \mathrm { d a t a } } ~ = ~ p _ { \mathrm { G } }$ and consequently $J S ( p _ { \mathrm { d a t a } } | | p _ { \mathrm { G } } ) = 0$ , thus completing the proof.
|
| 325 |
+
|
| 326 |
+
# B SENSITIVITY TO HYPERPARAMETERS
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 5: Accuracy of JARN with different hyperparameters on CIFAR-10 test samples.
|
md/train/HktRlUlAZ/HktRlUlAZ.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# POLAR TRANSFORMER NETWORKS
|
| 2 |
+
|
| 3 |
+
Carlos Esteves, Christine Allen-Blanchette, Xiaowei Zhou, Kostas Daniilidis GRASP Laboratory, University of Pennsylvania {machc, allec, xiaowz, kostas}@seas.upenn.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Convolutional neural networks (CNNs) are inherently equivariant to translation. Efforts to embed other forms of equivariance have concentrated solely on rotation. We expand the notion of equivariance in CNNs through the Polar Transformer Network (PTN). PTN combines ideas from the Spatial Transformer Network (STN) and canonical coordinate representations. The result is a network invariant to translation and equivariant to both rotation and scale. PTN is trained end-to-end and composed of three distinct stages: a polar origin predictor, the newly introduced polar transformer module and a classifier. PTN achieves stateof-the-art on rotated MNIST and the newly introduced SIM2MNIST dataset, an MNIST variation obtained by adding clutter and perturbing digits with translation, rotation and scaling. The ideas of PTN are extensible to 3D which we demonstrate through the Cylindrical Transformer Network.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Whether at the global pattern or local feature level (Granlund, 1978), the quest for (in/equi)variant representations is as old as the field of computer vision and pattern recognition itself. State-of-the-art in “hand-crafted” approaches is typified by SIFT (Lowe, 2004). These detector/descriptors identify the intrinsic scale or rotation of a region (Lindeberg, 1994; Chomat et al., 2000) and produce an equivariant descriptor which is normalized for scale and/or rotation invariance. The burden of these methods is in the computation of the orbit (i.e. a sampling the transformation space) which is necessary to achieve equivariance. This motivated steerable filtering which guarantees transformed filter responses can be interpolated from a finite number of filter responses. Steerability was proved for rotations of Gaussian derivatives (Freeman et al., 1991) and extended to scale and translations in the shiftable pyramid (Simoncelli et al., 1992). Use of the orbit and SVD to create a filter basis was proposed by Perona (1995)and in parallel, Segman et al. (1992) proved for certain classes of transformations there exists canonical coordinates where deformation of the input presents as translation of the output. Following this work, Nordberg & Granlund (1996) and Hel-Or & Teo (1996); Teo & Hel-Or (1998) proposed a methodology for computing the bases of equivariant spaces given the Lie generators of a transformation. and most recently, Sifre & Mallat (2013) proposed the scattering transform which offers representations invariant to translation, scaling, and rotations.
|
| 12 |
+
|
| 13 |
+
The current consensus is representations should be learned not designed. Equivariance to translations by convolution and invariance to local deformations by pooling are now textbook (LeCun et al. (2015), p.335) but approaches to equivariance of more general deformations are still maturing. The main veins are: Spatial Transformer Network (STN) (Jaderberg et al., 2015) which similarly to SIFT learn a canonical pose and produce an invariant representation through warping, work which constrains the structure of convolutional filters (Worrall et al., 2016) and work which uses the filter orbit (Cohen & Welling, 2016b) to enforce an equivariance to a specific transformation group.
|
| 14 |
+
|
| 15 |
+
In this paper, we propose the Polar Transformer Network (PTN), which combines the ideas of STN and canonical coordinate representations to achieve equivariance to translations, rotations, and dilations. The three stage network learns to identify the object center then transforms the input into logpolar coordinates. In this coordinate system, planar convolutions correspond to group-convolutions in rotation and scale. PTN produces a representation equivariant to rotations and dilations without the challenging parameter regression of STN. We enlarge the notion of equivariance in CNNs beyond Harmonic Networks (Worrall et al., 2016) and Group Convolutions (Cohen & Welling, 2016b) by capturing both rotations and dilations of arbitrary precision. Similar to STN; however, PTN accommodates only global deformations.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: In the log-polar representation, rotations around the origin become vertical shifts, and dilations around the origin become horizontal shifts. The distance between the yellow and green lines is proportional to the rotation angle/scale factor. Top rows: sequence of rotations, and the corresponding polar images. Bottom rows: sequence of dilations, and the corresponding polar images.
|
| 19 |
+
|
| 20 |
+
We present state-of-the-art performance on rotated MNIST and SIM2MNIST, which we introduce. To summarize our contributions:
|
| 21 |
+
|
| 22 |
+
• We develop a CNN architecture capable of learning an image representation invariant to translation and equivariant to rotation and dilation. We propose the polar transformer module, which performs a differentiable log-polar transform, amenable to backpropagation training. The transform origin is a latent variable. • We show how the polar transform origin can be learned effectively as the centroid of a single channel heatmap predicted by a fully convolutional network.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
One of the first equivariant feature extraction schemes was proposed by Nordberg & Granlund (1996) who suggested the discrete sampling of 2D-rotations of a complex angle modulated filter. About the same time, the image and optical processing community discovered the Mellin transform as a modification of the Fourier transform (Zwicke & Kiss, 1983; Casasent & Psaltis, 1976). The Fourier-Mellin transform is equivariant to rotation and scale while its modulus is invariant.
|
| 27 |
+
|
| 28 |
+
During the 80’s and 90’s invariances of integral transforms were developed through methods based in the Lie generators of the respective transforms starting from one-parameter transforms (Ferraro & Caelli, 1988) and generalizing to Abelian subgroups of the affine group (Segman et al., 1992).
|
| 29 |
+
|
| 30 |
+
Closely related to the (in/equi)variance work is work in steerability, the interpolation of responses to any group action using the response of a finite filter basis. An exact steerability framework began in Freeman et al. (1991), where rotational steerability for Gaussian derivatives was explicitly computed. It was extended to the shiftable pyramid (Simoncelli et al., 1992), which handle rotation and scale. A method of approximating steerability by learning a lower dimensional representation of the image deformation from the transformation orbit and the SVD was proposed by Perona (1995).
|
| 31 |
+
|
| 32 |
+
A unification of Lie generator and steerability approaches was introduced by Teo & Hel-Or (1998) who used SVD to reduce the number of basis functions for a given transformation group. Teo and Hel-Or developed the most extensive framework for steerability (Teo & Hel-Or, 1998; Hel-Or & Teo, 1996), and proposed the first approach for non-Abelian groups starting with exact steerability for the largest Abelian subgroup and incrementally steering for the remaining subgroups. Cohen & Welling (2016a); Jacobsen et al. (2017) recently combined steerability and learnable filters.
|
| 33 |
+
|
| 34 |
+
The most recent “hand-crafted” approach to equivariant representations is the scattering transform (Sifre & Mallat, 2013) which composes rotated and dilated wavelets. Similar to SIFT (Lowe, 2004) this approach relies on the equivariance of anchor points (e.g. the maxima of filtered responses in (translation) space). Translation invariance is obtained through the modulus operation which is computed after each convolution. The final scattering coefficient is invariant to translations and equivariant to local rotations and scalings.
|
| 35 |
+
|
| 36 |
+
Laptev et al. (2016) achieve transformation invariance by pooling feature maps computed over the input orbit, which scales poorly as it requires forward and backward passes for each orbit element.
|
| 37 |
+
|
| 38 |
+
Within the context of CNNs, methods of enforcing equivariance fall to two main veins. In the first, equivariance is obtained by constraining filter structure similarly to Lie generator based approaches (Segman et al., 1992; Hel-Or & Teo, 1996). Harmonic Networks (Worrall et al., 2016) use filters derived from the complex harmonics achieving both rotational and translational equivariance. The second requires the use of a filter orbit which is itself equivariant to obtain group equivariance. Cohen & Welling (2016b) convolve with the orbit of a learned filter and prove the equivariance of group-convolutions and preservation of rotational equivariance in the presence of rectification and pooling. Dieleman et al. (2015) process elements of the image orbit individually and use the set of outputs for classification. Gens & Domingos (2014) produce maps of finite-multiparameter groups, Zhou et al. (2017) and Marcos et al. (2016) use a rotational filter orbit to produce oriented feature maps and rotationally invariant features, and Lenc & Vedaldi (2015) propose a transformation layer which acts as a group-convolution by first permuting then transforming by a linear filter.
|
| 39 |
+
|
| 40 |
+
Our approach, PTN, is akin to the second vein. We achieve global rotational equivariance and expand the notion of CNN equivariance to include scaling. PTN employs log-polar coordinates (canonical coordinates in Segman et al. (1992)) to achieve rotation-dilation group-convolution through translational convolution subject to the assumption of an image center estimated similarly to the STN. Most related to our method is Henriques & Vedaldi (2016), which achieves equivariance by warping the inputs to a fixed grid, with no learned parameters.
|
| 41 |
+
|
| 42 |
+
When learning features from 3D objects, invariance to transformations is usually achieved through augmenting the training data with transformed versions of the inputs (Wu et al., 2015), or pooling over transformed versions during training and/or test (Maturana & Scherer, 2015; Qi et al., 2016). Sedaghat et al. (2016) show that a multi-task approach, i.e. prediction of both the orientation and class, improves classification performance. In our extension to 3D object classification, we explicitly learn representations equivariant to rotations around a family of parallel axes by transforming the input to cylindrical coordinates about a predicted axis.
|
| 43 |
+
|
| 44 |
+
# 3 THEORETICAL BACKGROUND
|
| 45 |
+
|
| 46 |
+
This section is divided into two parts, the first offers a review of equivariance and groupconvolutions. The second offers an explicit example of the equivariance of group-convolutions through the 2D similarity transformations group, SIM(2), comprised of translations, dilations and rotations. Reparameterization of SIM(2) to canonical coordinates allows for the application of the SIM(2) group-convolution using translational convolution.
|
| 47 |
+
|
| 48 |
+
# 3.1 GROUP EQUIVARIANCE
|
| 49 |
+
|
| 50 |
+
Equivariant representations are highly sought after as they encode both class and deformation information in a predictable way. Let $G$ be a transformation group and $L _ { g } I$ be the group action applied to an image $I$ . A mapping $\Phi : E F$ is said to be equivariant to the group action $L _ { g }$ , $g \in G$ if
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\Phi ( L _ { g } I ) = L _ { g } ^ { \prime } ( \Phi ( I ) )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $L _ { g }$ and $L _ { g } ^ { \prime }$ correspond to application of $g$ to $E$ and $F$ respectively and satisfy ${ \cal L } _ { g h } = { \cal L } _ { g } { \cal L } _ { h }$ . Invariance is the special case of equivariance where $L _ { g } ^ { \prime }$ is the identity. In the context of image classification and CNNs, $g \in G$ can be thought of as an image deformation and $\Phi$ a mapping from the image to a feature map.
|
| 57 |
+
|
| 58 |
+
The inherent translational equivariance of CNNs is independent of the convolutional kernel and evident in the corresponding translation of the output in response to translation of the input. Equivariance to other types of deformations can be achieved through application of the group-convolution, a generalization of translational convolution. Letting $f ( g )$ and $\phi ( g )$ be real valued functions on $G$ with $L _ { h } f ( g ) = f ( h ^ { - 1 } g )$ , the group-convolution is defined Kyatkin & Chirikjian (2000)
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
( f \star _ { G } \phi ) ( g ) = \int _ { h \in G } f ( h ) \phi ( h ^ { - 1 } g ) d h .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
A slight modification to the definition is necessary in the first CNN layer since the group is acting on the image. The group-convolution reduces to translational convolution when $G$ is translation in $\mathbb { R } ^ { n }$ with addition as the group operator,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { c } { { ( f \star \phi ) ( x ) = \displaystyle \int _ { h } f ( h ) \phi ( h ^ { - 1 } x ) d h } } \\ { { = \displaystyle \int _ { h } f ( h ) \phi ( x - h ) d h . } } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Group-convolution requires integrability over a group and identification of the appropriate measure dg. It can be proved that given the measure $d g$ , group-convolution is always group equivariant:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { l } { \displaystyle ( L _ { a } f \star _ { G } \phi ) ( g ) = \int _ { h \in G } f ( a ^ { - 1 } h ) \phi ( h ^ { - 1 } g ) d h } \\ { \displaystyle = \int _ { b \in G } f ( b ) \phi ( ( a b ) ^ { - 1 } g ) d b } \\ { \displaystyle = \int _ { b \in G } f ( b ) \phi ( b ^ { - 1 } a ^ { - 1 } g ) d b } \\ { \displaystyle = ( f \star _ { G } \phi ) ( a ^ { - 1 } g ) } \\ { \displaystyle = L _ { a } ( ( f \star _ { G } \phi ) ) ( g ) . } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
This is depicted in response of an equivariant representation to input deformation (Figure 2 (left)).
|
| 77 |
+
|
| 78 |
+
# 3.2 EQUIVARIANCE IN SIM(2)
|
| 79 |
+
|
| 80 |
+
A similarity transformation, $\rho \in { \mathrm { S I M } } ( 2 )$ , acts on a point in $\boldsymbol { x } \in \mathbb { R } ^ { 2 }$ by
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\rho x \to s R x + t \quad s \in \mathbb { R } ^ { + } , R \in S O ( 2 ) , t \in \mathbb { R } ^ { 2 } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $S O ( 2 )$ is the rotation group. To take advantage of the standard planar convolution in classical CNNs we decompose a $\rho \in { \mathrm { S I M } } ( 2 )$ into a translation, $t$ in $\mathbb { R } ^ { 2 }$ and a dilated-rotation $r$ in $\mathbf { S } \mathbf { O } ( 2 ) \times \mathbb { R } ^ { + }$ .
|
| 87 |
+
|
| 88 |
+
Equivariance to SIM(2) is achieved by learning the center of the dilated rotation, shifting the original image accordingly then transforming the image to canonical coordinates. In this reparameterization the standard translational convolution is equivalent to the dilated-rotation group-convolution.
|
| 89 |
+
|
| 90 |
+
The origin predictor is an application of STN to global translation prediction (Jaderberg et al., 2015), the centroid of the output is taken as the origin of the input.
|
| 91 |
+
|
| 92 |
+
Transformation of the image $L _ { t } I = I ( t - t _ { 0 } )$ (canonization in Soatto (2013)) reduces the SIM(2) deformation to a dilated-rotation if $t _ { o }$ is the true translation. After centering, we perform ${ \mathrm { S O } } ( 2 ) \times$ $\mathbb { R } ^ { + }$ convolutions on the new image $I _ { o } = I ( x - t _ { o } )$ :
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
f ( r ) = \int _ { x \in \mathbb { R } ^ { 2 } } I _ { o } ( x ) \phi ( r ^ { - 1 } x ) \ d x
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
and the feature maps $f$ in subsequent layers
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
h ( r ) = \int _ { s \in S O ( 2 ) \times \mathbb { R } ^ { + } } f ( s ) \phi ( s ^ { - 1 } r ) \ d s
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $r , s \in \mathrm { S O } ( 2 ) \times \mathbb { R } ^ { + }$ . We compute this convolution through use of canonical coordinates for Abelian Lie-groups (Segman et al., 1992). The centered image $I _ { o } ( x , y ) ^ { 1 }$ is transformed to logpolar coordinates, $I ( e ^ { \xi } \cos ( \theta ) , e ^ { \xi } \sin ( \theta ) )$ hereafter written $\lambda ( \xi , \theta )$ with $( \xi , \theta ) \in { \bf S O } ( 2 ) \times \mathbb { R } ^ { + }$ for
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Left: Group-convolutions in $S O ( 2 )$ . The images in the left most column differ by $9 0 °$ rotation, the filters are shown in the top row. Application of the rotational group-convolution with an arbitrary filter results is shown to produce an equivariant representation. The inner-product each of filter orbit (rotated from $0 - 3 6 0 ^ { \circ }$ ) and the image is plotted in blue for the top image and red for the bottom image. Observe how the filter response is shifted by $9 0 °$ . Right: Group-convolutions in $\mathbf { S } \mathbf { O } ( 2 ) \times \mathbb { R } ^ { + }$ . Images in the left most column differ by a rotation of $\pi / 4$ and scaling of 1.2. Careful consideration of the resulting heatmaps (shown in canonical coordinates) reveals a shift corresponding to the deformation of the input image.
|
| 108 |
+
|
| 109 |
+
notational convenience. The shift of the dilated-rotation equivariant representation in response to input deformation is shown in Figure 2 (right) using canonical coordinates.
|
| 110 |
+
|
| 111 |
+
In canonical coordinates $s ^ { - 1 } r = \xi _ { r } - \xi , \theta _ { r } - \theta$ and the $\mathbf { S } \mathbf { O } ( 2 ) \times \mathbb { R } ^ { + }$ group-convolution2 can be expressed and efficiently implemented as a planar convolution
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\int _ { s } f ( s ) \phi ( s ^ { - 1 } r ) \ d s = \int _ { s } \lambda ( \xi , \theta ) \phi ( \xi _ { r } - \xi , \theta _ { r } - \theta ) \ d \xi d \theta .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
To summarize, we (1) construct a network of translational convolutions, (2) take the centroid of the last layer, (3) shift the original image to accordingly, (4) convert to log-polar coordinates, and (5) apply a second network3 of translational convolutions. The result is a feature map equivariant to dilated-rotations around the origin.
|
| 118 |
+
|
| 119 |
+
# 4 ARCHITECTURE
|
| 120 |
+
|
| 121 |
+
PTN is comprised of two main components connected by the polar transformer module. The first part is the polar origin predictor and the second is the classifier (a conventional fully convolutional network). The building block of the network is a $3 \times 3 \times K$ convolutional layer followed by batch normalization, an ReLU and occasional subsampling through strided convolution. We will refer to this building block simply as block. Figure 3 shows the architecture.
|
| 122 |
+
|
| 123 |
+
# 4.1 POLAR ORIGIN PREDICTOR
|
| 124 |
+
|
| 125 |
+
The polar origin predictor operates on the original image and comprises a sequence of blocks followed by a $1 \times 1$ convolution. The output is a single channel feature map, the centroid of which is taken as the origin of the polar transform.
|
| 126 |
+
|
| 127 |
+
There are some difficulties in training a neural network to predict coordinates in images. Some approaches (Toshev & Szegedy, 2014) attempt to use fully connected layers to directly regress the coordinates with limited success. A better option is to predict heatmaps (Tompson et al., 2014; Newell et al., 2016), and take their argmax. However, this can be problematic since backpropogation gradients are zero in all but one point, which impedes learning.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 3: Network architecture. The input image passes through a fully convolutional network, the polar origin predictor, which outputs a heatmap. The centroid of the heatmap (two coordinates), together with the input image, goes into the polar transformer module, which performs a polar transform with origin at the input coordinates. The obtained polar representation is invariant with respect to the original object location; and rotations and dilations are now shifts, which are handled equivariantly by a conventional classifier CNN.
|
| 131 |
+
|
| 132 |
+
The usual approach to heatmap prediction is evaluation of a loss against some ground truth. In this approach the argmax gradient problem is circumvented by supervision. In PTN the the gradient of the output coordinates must be taken with respect to the heatmap since the polar origin is unknown and must be learned. Use of argmax is avoided by using the centroid of the heatmap as the polar origin. The gradient of the centroid with respect to the heatmap is constant and nonzero for all points, making learning possible.
|
| 133 |
+
|
| 134 |
+
# 4.2 POLAR TRANSFORMER MODULE
|
| 135 |
+
|
| 136 |
+
The polar transformer module takes the origin prediction and image as inputs and outputs the logpolar representation of the input. The module uses the same differentiable image sampling technique as STN (Jaderberg et al., 2015), which allows output coordinates $V _ { i }$ to be expressed in terms of the input $U$ and the source sample point coordinates $( x _ { i } ^ { s } , y _ { i } ^ { s } )$ . The log-polar transform in terms of the source sample points and target regular grid $( x _ { i } ^ { t } , y _ { i } ^ { t } )$ is:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { l c r } { { x _ { i } ^ { s } = x _ { 0 } + r ^ { x _ { i } ^ { t } / W } \cos { \frac { 2 \pi y _ { i } ^ { t } } { H } } } } \\ { { y _ { i } ^ { s } = y _ { 0 } + r ^ { x _ { i } ^ { t } / W } \sin { \frac { 2 \pi y _ { i } ^ { t } } { H } } } } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $( x _ { 0 } , y _ { 0 } )$ is the origin, $W , H$ are the output width and height, and $r$ is the maximum distance from the origin, set to $0 . 5 \sqrt { H ^ { 2 } + W ^ { 2 } }$ in our experiments.
|
| 143 |
+
|
| 144 |
+
# 4.3 WRAP-AROUND PADDING
|
| 145 |
+
|
| 146 |
+
To maintain feature map resolution, most CNN implementations use zero-padding. This is not ideal for the polar representation, as it is periodic about the angular axis. A rotation of the input result in a vertical shift of the output, wrapping at the boundary; hence, identification of the top and bottom most rows is most appropriate. This is achieved with wrap-around padding on the vertical dimension.The top most row of the feature map is padded using the bottom rows and vice versa. Zero-padding is used in the horizontal dimension. Table 5 shows a performance evaluation.
|
| 147 |
+
|
| 148 |
+
# 4.4 POLAR ORIGIN AUGMENTATION
|
| 149 |
+
|
| 150 |
+
To improve robustness of our method, we augment the polar origin during training time by adding a random shift to the regressed polar origin coordinates. Note that this comes for little computational cost compared to conventional augmentation methods such as rotating the input image. Table 5 quantifies the performance gains of this kind of augmentation.
|
| 151 |
+
|
| 152 |
+
# 5 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
# 5.1 ARCHITECTURES
|
| 155 |
+
|
| 156 |
+
We briefly define the architectures in this section, see A for details. CCNN is a conventional fully convolutional network; PCNN is the same, but applied to polar images with central origin. STN is our implementation of the spatial transformer networks (Jaderberg et al., 2015). PTN is our polar transformer networks, and PTN-CNN is a combination of PTN and CCNN. The suffixes S and B indicate small and big networks, according to the number of parameters. The suffixes $^ +$ and $^ { + + }$ indicate training and training+test rotation augmentation.
|
| 157 |
+
|
| 158 |
+
We perform rotation augmentation for polar-based methods. In theory, the effect of input rotation is just a shift in the corresponding polar image, which should not affect the classifier CNN. In practice, interpolation and angle discretization effects result in slightly different polar images for rotated inputs, so even the polar-based methods benefit from this kind of augmentation.
|
| 159 |
+
|
| 160 |
+
# 5.2 ROTATED MNIST (LAROCHELLE ET AL., 2007)
|
| 161 |
+
|
| 162 |
+
Table 1 shows the results. We divide the analysis in two parts; on the left, we show approaches with smaller networks and no rotation augmentation, on the right there are no restrictions.
|
| 163 |
+
|
| 164 |
+
Between the restricted approaches, the Harmonic Network (Worrall et al., 2016) outperforms the PTN by a small margin, but with almost 4x more training time, because the convolutions on complex variables are more costly. Also worth mentioning is the poor performance of the STN with no augmentation, which shows that learning the transformation parameters is much harder than learning the polar origin coordinates.
|
| 165 |
+
|
| 166 |
+
Between the unrestricted approaches, most variants of PTN-B outperform the current state of the art, with significant improvements when combined with CCNN and/or test time augmentation.
|
| 167 |
+
|
| 168 |
+
Finally, we note that the PCNN achieves a relatively high accuracy in this dataset because the digits are mostly centered, so using the polar transform origin as the image center is reasonable. Our method, however, outperforms it by a high margin, showing that even in this case, it is possible to find an origin away from the image center that results in a more distinctive representation.
|
| 169 |
+
|
| 170 |
+
Table 1: Performance on rotated MNIST. Errors are averages of several runs, with standard deviations within parenthesis. Times are average training time per epoch.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Model</td><td>error[%]</td><td>params</td><td>time [s]</td><td>Model</td><td>error [%]</td><td>params</td><td>time [s]</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PTN-S</td><td>1.83 (0.04)</td><td>27k</td><td>3.64 (0.04)</td><td>PTN-B+</td><td>1.14 (0.08)</td><td>129k</td><td>4.38 (0.02)</td></tr><tr><td>PCNN-S</td><td>2.6 (0.08)</td><td>22k</td><td>2.61 (0.04)</td><td>PTN-B++</td><td>0.95 (0.09)</td><td>129k</td><td>4.386</td></tr><tr><td>CCNN-S</td><td>5.76 (0.35)</td><td>22k</td><td>2.43 (0.02)</td><td>PTN-CNN-B+</td><td>1.01 (0.06)</td><td>254k</td><td>7.36</td></tr><tr><td>STN-S</td><td>7.87 (0.18)</td><td>43k</td><td>3.90 (0.05)</td><td>PTN-CNN-B++</td><td>0.89 (0.06)</td><td>254k</td><td>7.366</td></tr><tr><td>HNet1</td><td>1.69</td><td>33k</td><td>13.29 (0.19)</td><td>PCNN-B+</td><td>1.37 (0.00)</td><td>124k</td><td>3.30 (0.04)</td></tr><tr><td>P4CNN 2</td><td>2.28</td><td>22k</td><td></td><td>CCNN-B+</td><td>1.53 (0.07)</td><td>124k</td><td>2.98 (0.02)</td></tr><tr><td></td><td></td><td></td><td></td><td>STN-B+</td><td>1.31 (0.05)</td><td>146k</td><td>4.57 (0.04)</td></tr><tr><td></td><td></td><td></td><td></td><td>OR-TIPooling</td><td>1.54</td><td>~1M</td><td>-</td></tr><tr><td></td><td></td><td></td><td></td><td>TI-Pooling</td><td>1.2</td><td>~1M</td><td>42.90</td></tr><tr><td></td><td></td><td></td><td></td><td>RotEqNet5</td><td>1.01</td><td>100k</td><td>-</td></tr></table>
|
| 173 |
+
|
| 174 |
+
1, 2, 3, 4, 5 Worrall et al. (2016); Cohen & Welling (2016b); Zhou et al. (2017); Laptev et al. (2016); Marcos et al. (2016) 6 Test time performance is 8x slower when using test time augmentation
|
| 175 |
+
|
| 176 |
+
# 5.3 OTHER MNIST VARIANTS
|
| 177 |
+
|
| 178 |
+
We also perform experiments in other MNIST variants. MNIST R, RTS are replicated from Jaderberg et al. (2015). We introduce SIM2MNIST, with a more challenging set of transformations from SIM(2). See B for more details about the datasets.
|
| 179 |
+
|
| 180 |
+
Table 2 shows the results. We can see that the PTN performance mostly matches the STN on both MNIST R and RTS. The deformations on these datasets are mild and data is plenty, so the performance may be saturated.
|
| 181 |
+
|
| 182 |
+
On SIM2MNIST, however, the deformations are more challenging and the training set 5x smaller. The PCNN performance is significantly lower, which reiterates the importance of predicting the best
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Left: The rows alternate between samples from SIM2MNIST, where the predicted origin is shown in green, and their learned polar representation. Note how rotations and dilations of the object become shifts. Right: Each row shows a different input and correspondent feature maps on the last convolutional layer. The first and second rows show that the $1 8 0 ^ { \circ }$ rotation results in a half-height vertical shift of the feature maps. The third and fourth rows show that the $2 . 4 \times$ dilation results in a shift right of the feature maps. The first and third rows show invariance to translation.
|
| 186 |
+
|
| 187 |
+
polar origin. The HNet outperforms the other methods (except the PTN), thanks to its translation and rotation equivariance properties. Our method is more efficient both in number of parameters and training time, and is also equivariant to dilations, achieving the best performance by a large margin.
|
| 188 |
+
|
| 189 |
+
Table 2: Performance on MNIST variants.
|
| 190 |
+
|
| 191 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNISTR</td><td rowspan="2"></td><td colspan="2">MNISTRTS</td><td rowspan="2">time</td><td colspan="2">SIM2MNIST1</td><td rowspan="2">time</td></tr><tr><td>error [%]</td><td>pars</td><td>time error [%]</td><td>pars</td><td>error [%]</td><td>pars</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PTN-S+</td><td>0.88 (0.04)</td><td>29k</td><td>19.72</td><td>0.78 (0.05)</td><td>32k</td><td>24.48</td><td>5.44 (0.03)</td><td>35k</td><td>11.92</td></tr><tr><td>PTN-B+</td><td>0.62 (0.04)</td><td>129k</td><td>20.37</td><td>0.57 (0.03)</td><td>134k</td><td>28.74</td><td>5.03 (0.11)</td><td>134k</td><td>12.02</td></tr><tr><td>PCNN-B+</td><td>0.81 (0.04)</td><td>124k</td><td>13.97</td><td>0.70 (0.01)</td><td>129k</td><td>17.19</td><td>15.46 (0.22)</td><td>129k</td><td>5.33</td></tr><tr><td>CCNN-B+</td><td>0.74 (0.01)</td><td>124k</td><td>12.79</td><td>0.62 (0.07)</td><td>129k</td><td>15.97</td><td>11.73 (0.57)</td><td>129k</td><td>5.28</td></tr><tr><td>STN-B+</td><td>0.61 (0.02)</td><td>146k</td><td>23.12</td><td>0.54 (0.02)</td><td>150k</td><td>27.90</td><td>12.35 (1.61)</td><td>150k</td><td>10.41</td></tr><tr><td>STN (Jaderberg et al., 2015)</td><td>0.7</td><td>400k</td><td>-</td><td>0.5</td><td>400k</td><td></td><td></td><td></td><td>-</td></tr><tr><td>HNet (Worrall et al., 2016)</td><td></td><td>=</td><td>=</td><td></td><td>=</td><td></td><td>9.28 (0.05)</td><td>44k</td><td>31.42</td></tr><tr><td>TI-Pooling (Laptev et al.,2016)</td><td>0.8</td><td>~1M</td><td></td><td></td><td></td><td></td><td></td><td>-</td><td>-</td></tr></table>
|
| 192 |
+
|
| 193 |
+
1 No augmentation is used with SIM2MNIST, despite the $^ +$ suffixes 2 Our modified version, with two extra layers with subsampling to account for larger input
|
| 194 |
+
|
| 195 |
+
# 5.4 VISUALIZATION
|
| 196 |
+
|
| 197 |
+
We visualize network activations to confirm our claims about invariance to translation and equivariance to rotations and dilations.
|
| 198 |
+
|
| 199 |
+
Figure 4 (left) shows some of the predicted polar origins and the results of the polar transform. We can see that the network learns to reject clutter and to find a suitable origin for the polar transform, and that the representation after the polar transformer module does present the properties claimed.
|
| 200 |
+
|
| 201 |
+
We proceed to visualize if the properties are preserved in deeper layers. Figure 4 (right) shows the activations of selected channels from the last convolutional layer, for different rotations, dilations, and translations of the input. The reader can verify that the equivariance to rotations and dilations, and the invariance to translations are indeed preserved during the sequence of convolutional layers.
|
| 202 |
+
|
| 203 |
+
# 5.5 EXTENSION TO 3D OBJECT CLASSIFICATION
|
| 204 |
+
|
| 205 |
+
We extend our model to perform 3D object classification from voxel occupancy grids. We assume that the inputs are transformed by random rotations around an axis from a family of parallel axes. Then, a rotation around that axis corresponds to a translation in cylindrical coordinates.
|
| 206 |
+
|
| 207 |
+
In order to achieve equivariance to rotations, we predict an axis and use it as the origin to transform to cylindrical coordinates. If the axis is parallel to one of the input grid axes, the cylindrical transform amounts to channel-wise polar transforms, where the origin is the same for all channels and each channel is a 2D slice of the 3D voxel grid. In this setting, we can just apply the polar transformer layer to each slice.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 5: Top: rotated voxel occupancy grids. Bottom: corresponding cylindrical representations. Note how rotations around a vertical axis correspond to translations over a horizontal axis.
|
| 211 |
+
|
| 212 |
+
We use a technique similar to the anisotropic probing of Qi et al. (2016) to predict the axis. Let $z$ denote the input grid axis parallel to the rotation axis. We treat the dimension indexed by $z$ as channels, and run regular 2D convolutional layers, reducing the number of channels on each layer, eventually collapsing to a single 2D heatmap. The heatmap centroid gives one point of the axis, and the direction is parallel to $z$ . In other words, the centroid is the origin of all channel-wise polar transforms. We then proceed with a regular 3D CNN classifier, acting on the cylindrical representation. The 3D convolutions are equivariant to translations; since they act on cylindrical coordinates, the learned representation is equivariant to input rotations around axes parallel to $z$ .
|
| 213 |
+
|
| 214 |
+
We run experiments on ModelNet40 (Wu et al., 2015), which contains objects rotated around the gravity direction $( z )$ . Figure 5 shows examples of input voxel grids and their cylindrical coordinates representation, while table 3 shows the classification performance. To the best of our knowledge, our method outperforms all published voxel-based methods, even with no test time augmentation. However, the multi-view based methods generally outperform the voxel-based. (Qi et al., 2016).
|
| 215 |
+
|
| 216 |
+
Note that we could also achieve equivariance to scale by using log-cylindrical or log-spherical coordinates, but none of these change of coordinates would result in equivariance to arbitrary 3D rotations.
|
| 217 |
+
|
| 218 |
+
Table 3: ModelNet40 classification performance. We compare only with voxel-based methods.
|
| 219 |
+
|
| 220 |
+
<table><tr><td>Model</td><td>Avg. class accuracy [%]</td><td>Avg.instance accuracy [%]</td></tr><tr><td>Cylindrical Transformer (Ours)</td><td>86.5</td><td>89.9</td></tr><tr><td>3D ShapeNets (Wu et al.,2015)</td><td>77.3</td><td></td></tr><tr><td>VoxNet (Maturana& Scherer,2015)</td><td>83</td><td>-</td></tr><tr><td>MO-SubvolumeSup (Qi et al.,2016)</td><td>86.0</td><td>= 89.2</td></tr><tr><td>MO-Aniprobing (Qi et al.,2016)</td><td>85.6</td><td>89.9</td></tr></table>
|
| 221 |
+
|
| 222 |
+
# 6 CONCLUSION
|
| 223 |
+
|
| 224 |
+
We have proposed a novel network whose output is invariant to translations and equivariant to the group of dilations/rotations. We have combined the idea of learning the translation (similar to the spatial transformer) but providing equivariance for the scaling and rotation, avoiding, thus, fully connected layers required for the pose regression in the spatial transformer. Equivariance with respect to dilated rotations is achieved by convolution in this group. Such a convolution would require the production of multiple group copies, however, we avoid this by transforming into canonical coordinates. We improve the state of the art performance on rotated MNIST by a large margin, and outperform all other tested methods on a new dataset we call SIM2MNIST. We expect our approach to be applicable to other problems, where the presence of different orientations and scales hinder the performance of conventional CNNs.
|
| 225 |
+
|
| 226 |
+
# REFERENCES
|
| 227 |
+
|
| 228 |
+
David Casasent and Demetri Psaltis. Scale invariant optical transform. Optical Engineering, 15(3):153258– 153258, 1976.
|
| 229 |
+
|
| 230 |
+
Olivier Chomat, Vincent Colin de Verdiere, Daniela Hall, and James L Crowley. Local scale selection for \` gaussian based description techniques. In European Conference on Computer Vision, pp. 117–134. Springer, 2000.
|
| 231 |
+
|
| 232 |
+
Taco S. Cohen and Max Welling. Steerable cnns. 2016a. URL http://arxiv.org/abs/1612. 08498v1.
|
| 233 |
+
|
| 234 |
+
Taco S Cohen and Max Welling. Group equivariant convolutional networks. arXiv preprint arXiv:1602.07576, 2016b.
|
| 235 |
+
|
| 236 |
+
Sander Dieleman, Kyle W Willett, and Joni Dambre. Rotation-invariant convolutional neural networks for galaxy morphology prediction. Monthly notices of the royal astronomical society, 450(2):1441–1459, 2015.
|
| 237 |
+
|
| 238 |
+
Mario Ferraro and Terry M Caelli. Relationship between integral transform invariances and lie group theory. JOSA A, 5(5):738–742, 1988.
|
| 239 |
+
|
| 240 |
+
William T Freeman, Edward H Adelson, et al. The design and use of steerable filters. IEEE Transactions on Pattern analysis and machine intelligence, 13(9):891–906, 1991.
|
| 241 |
+
|
| 242 |
+
Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014.
|
| 243 |
+
|
| 244 |
+
Goesta H Granlund. In search of a general picture processing operator. Computer Graphics and Image Processing, 8(2):155–173, 1978.
|
| 245 |
+
|
| 246 |
+
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.
|
| 247 |
+
|
| 248 |
+
Yacov Hel-Or and Patrick C Teo. Canonical decomposition of steerable functions. In Computer Vision and Pattern Recognition, 1996. Proceedings CVPR’96, 1996 IEEE Computer Society Conference on, pp. 809– 816. IEEE, 1996.
|
| 249 |
+
|
| 250 |
+
Joao F Henriques and Andrea Vedaldi. Warped convolutions: Efficient invariance to spatial transformations. ˜ arXiv preprint arXiv:1609.04382, 2016.
|
| 251 |
+
|
| 252 |
+
Jorn-Henrik Jacobsen, Bert de Brabandere, and Arnold W. M. Smeulders. Dynamic steerable blocks in deep ¨ residual networks. CoRR, 2017. URL http://arxiv.org/abs/1706.00598v2.
|
| 253 |
+
|
| 254 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
|
| 255 |
+
|
| 256 |
+
Alexander B Kyatkin and Gregory S Chirikjian. Algorithms for fast convolutions on motion groups. Applied and Computational Harmonic Analysis, 9(2):220–241, 2000.
|
| 257 |
+
|
| 258 |
+
Dmitry Laptev, Nikolay Savinov, Joachim M. Buhmann, and Marc Pollefeys. Ti-pooling: Transformationinvariant pooling for feature learning in convolutional neural networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
|
| 259 |
+
|
| 260 |
+
Hugo Larochelle, Dumitru Erhan, Aaron Courville, James Bergstra, and Yoshua Bengio. An empirical evaluation of deep architectures on problems with many factors of variation. In Proceedings of the 24th international conference on Machine learning, pp. 473–480. ACM, 2007.
|
| 261 |
+
|
| 262 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 263 |
+
|
| 264 |
+
Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 991– 999, 2015.
|
| 265 |
+
|
| 266 |
+
Tony Lindeberg. Scale-space theory: A basic tool for analyzing structures at different scales. Journal of applied statistics, 21(1-2):225–270, 1994.
|
| 267 |
+
|
| 268 |
+
David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004.
|
| 269 |
+
|
| 270 |
+
Diego Marcos, Michele Volpi, Nikos Komodakis, and Devis Tuia. Rotation equivariant vector field networks. CoRR, 2016.
|
| 271 |
+
|
| 272 |
+
Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for real-time object recognition. In Intelligent Robots and Systems (IROS), 2015 IEEE/RSJ International Conference on, pp. 922–928. IEEE, 2015.
|
| 273 |
+
|
| 274 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 5, 2011.
|
| 275 |
+
|
| 276 |
+
Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. 2016.
|
| 277 |
+
|
| 278 |
+
Klas Nordberg and Gosta Granlund. Equivariance and invariance-an approach based on lie groups. In Image Processing, 1996. Proceedings., International Conference on, volume 3, pp. 181–184. IEEE, 1996.
|
| 279 |
+
|
| 280 |
+
Pietro Perona. Deformable kernels for early vision. IEEE Transactions on pattern analysis and machine intelligence, 17(5):488–499, 1995.
|
| 281 |
+
|
| 282 |
+
Charles R. Qi, Hao Su, Matthias Niessner, Angela Dai, Mengyuan Yan, and Leonidas J. Guibas. Volumetric and multi-view cnns for object classification on 3d data. 2016.
|
| 283 |
+
|
| 284 |
+
Nima Sedaghat, Mohammadreza Zolfaghari, and Thomas Brox. Orientation-boosted voxel nets for 3d object recognition. CoRR, 2016.
|
| 285 |
+
|
| 286 |
+
Joseph Segman, Jacob Rubinstein, and Yehoshua Y Zeevi. The canonical coordinates method for pattern deformation: Theoretical and computational considerations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 14(12):1171–1183, 1992.
|
| 287 |
+
|
| 288 |
+
Laurent Sifre and Stephane Mallat. Rotation, scaling and deformation invariant scattering for texture discrimi- ´ nation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1233–1240, 2013.
|
| 289 |
+
|
| 290 |
+
Eero P Simoncelli, William T Freeman, Edward H Adelson, and David J Heeger. Shiftable multiscale transforms. IEEE transactions on Information Theory, 38(2):587–607, 1992.
|
| 291 |
+
|
| 292 |
+
Stefano Soatto. Actionable information in vision. In Machine learning for computer vision, pp. 17–48. Springer, 2013.
|
| 293 |
+
|
| 294 |
+
Patrick C Teo and Yacov Hel-Or. Design of multi-parameter steerable functions using cascade basis reduction. In Computer Vision, 1998. Sixth International Conference on, pp. 187–192. IEEE, 1998.
|
| 295 |
+
|
| 296 |
+
Jonathan J Tompson, Arjun Jain, Yann LeCun, and Christoph Bregler. Joint training of a convolutional network and a graphical model for human pose estimation. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 1799–1807. Curran Associates, Inc., 2014.
|
| 297 |
+
|
| 298 |
+
Alexander Toshev and Christian Szegedy. Deeppose: Human pose estimation via deep neural networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2014.
|
| 299 |
+
|
| 300 |
+
Daniel E Worrall, Stephan J Garbin, Daniyar Turmukhambetov, and Gabriel J Brostow. Harmonic networks: Deep translation and rotation equivariance. arXiv preprint arXiv:1612.04642, 2016.
|
| 301 |
+
|
| 302 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1912–1920, 2015.
|
| 303 |
+
|
| 304 |
+
Yanzhao Zhou, Qixiang Ye, Qiang Qiu, and Jianbin Jiao. Oriented response networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 305 |
+
|
| 306 |
+
Philip E Zwicke and Imre Kiss. A new implementation of the mellin transform and its application to radar classification of ships. IEEE Transactions on pattern analysis and machine intelligence, 4(2):191–199, 1983.
|
| 307 |
+
|
| 308 |
+
# APPENDICES
|
| 309 |
+
|
| 310 |
+
# A ARCHITECTURES DETAILS
|
| 311 |
+
|
| 312 |
+
• Conventional CNN (CCNN), a fully convolutional network, composed of a sequence of convolutional layers and some rounds of subsampling .
|
| 313 |
+
Polar CNN (PCNN), same architecture as CCNN, operating on polar images. The logpolar transform is pre-computed at the image center before training, as in Henriques & Vedaldi (2016). The fundamental difference between our method and this is that we learn the polar origin implicitly, instead of fixing it.
|
| 314 |
+
• Spatial Transformer Network (STN), our implementation of Jaderberg et al. (2015), replacing the localization network by four blocks of 20 filters and stride 2, followed by a 20 unit fully connected layer, which we found to perform better. The transformation regressed is in SIM(2), and a CCNN comes after the transform.
|
| 315 |
+
Polar Transformer Network (PTN), our proposed method. The polar origin predictor comprises three blocks of 20 filters each, with stride 2 on the first block (or the first two blocks, when input is $9 6 \times 9 6$ ). The classification network is the CCNN.
|
| 316 |
+
PTN-CNN, we classify based on the sum of the per class scores of instances of PTN and CCNN trained independently.
|
| 317 |
+
|
| 318 |
+
The following suffixes qualify the architectures described above:
|
| 319 |
+
|
| 320 |
+
• S, “small” network, with seven blocks of 20 filters and one round of subsampling (equivalent to the Z2CNN in Cohen & Welling (2016b)).
|
| 321 |
+
• B, “big” network, with 8 blocks with the following number of filters: 16, 16, 32, 32, 32, 64, 64, 64. Subsampling by strided convolution is used whenever the number of filters increase. We add up to two 2 extra blocks of 16 filters with stride 2 at the beginning to handle larger input resolutions (one for $4 2 \times 4 2$ and two for $9 6 \times 9 6$ ).
|
| 322 |
+
• $^ +$ , training time rotation augmentation by continuous angles.
|
| 323 |
+
• $^ { + + }$ , training and test time rotation augmentation. We input 8 rotated versions the the query image and classify using the sum of the per class scores.
|
| 324 |
+
|
| 325 |
+
Cylindrical transformer network: The axis prediction part of the cylindrical transformer network is composed of four 2D blocks, with $5 \times 5$ kernels and 32, 16, 8, and 4 channels, no subsampling. The classifier is composed of eight 3D convolutional blocks, with $3 \times 3 \times 3$ kernels, the following number of filters: 32, 32, 32, 64, 64, 64, 128, 128, and subsampling whenever the number of filters increase. Total number of params is approximately 1M.
|
| 326 |
+
|
| 327 |
+
# B DATASET DETAILS
|
| 328 |
+
|
| 329 |
+
• Rotated MNIST The rotated MNIST dataset (Larochelle et al., 2007) is composed of $2 8 \times$ 28, $3 6 0 ^ { \circ }$ rotated images of handwritten digits. The training, validation and test sets are of sizes 10k, 2k, and $5 0 \mathrm { k }$ , respectively.
|
| 330 |
+
MNIST R, we replicate it from Jaderberg et al. (2015). It has $6 0 \mathrm { k }$ training and 10k testing samples, where the digits of the original MNIST are rotated between $[ - 9 0 ^ { \circ } , 9 0 ^ { \circ } ]$ . It is also know as half-rotated MNIST (Laptev et al., 2016).
|
| 331 |
+
MNIST RTS, we replicate it from Jaderberg et al. (2015). It has 60k training and $1 0 \mathrm { k }$ testing samples, where the digits of the original MNIST are rotated between $[ - 4 5 ^ { \circ } , 4 5 ^ { \circ } ]$ , scaled between 0.7 and 1.2, and shifted within a $4 2 \times 4 2$ black canvas.
|
| 332 |
+
SIM2MNIST, we introduce a more challenging dataset, based on MNIST, perturbed by random transformations from SIM(2). The images are $9 6 \times 9 6$ , with $3 6 0 ^ { \circ }$ rotations; the scale factors range from 1 to 2.4, and the digits can appear anywhere in the image. The training, validation and test set have size 10k, 5k, and $5 0 \mathrm { k }$ , respectively.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 6: ROTSVHN samples. Since the digits are cropped from larger images, no artifacts are introduced when rotating. The 6s and 9s are indistinguishable when rotated. Note that there are usually visible digits on the sides, which pose a challenge for classification and PTN origin prediction.
|
| 336 |
+
|
| 337 |
+
Table 4: SVHN classification performance. The minus suffix indicate removal of 6s and 9s. PTN shows slightly worse performance on the unperturbed dataset, but is clearly superior when rotations are present.
|
| 338 |
+
|
| 339 |
+
<table><tr><td></td><td>SVHN</td><td>ROTSVHN</td><td>SVHN-</td><td>ROTSVHN-</td></tr><tr><td>PTN-ResNet32 (Ours)</td><td>2.82 (0.07)</td><td>7.90 (0.14)</td><td>2.85 (0.07)</td><td>3.96 (0.04)</td></tr><tr><td>ResNet32</td><td>2.25 (0.15)</td><td>9.83 (0.29)</td><td>2.09 (0.06)</td><td>5.39 (0.09)</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# C SVHN EXPERIMENTS
|
| 342 |
+
|
| 343 |
+
In order to demonstrate the efficacy of PTN on real-world RGB images, we run experiments on the Street View House Numbers (SVHN) dataset Netzer et al. (2011), and a rotated version that we introduce (ROTSVHN) . The dataset contains cropped images of single digits, as well as the slightly larger images from where the digits are cropped. Using the latter, we can extract the rotated digits without introducing artifacts. Figure 6 shows some examples from the ROTSVHN.
|
| 344 |
+
|
| 345 |
+
We use a 32 layer Residual Network (He et al., 2016) as a baseline (ResNet32). The PTN-ResNet32 has 8 residual convolutional layers as the origin predictor, followed by a ResNet32.
|
| 346 |
+
|
| 347 |
+
In contrast with handwritten digits, the 6s and 9s in house numbers are usually indistinguishable. To remove this effect from our analysis, we also run experiments removing those classes from the datasets (which is denoted by appending a minus to the dataset name). Table 4 shows the results.
|
| 348 |
+
|
| 349 |
+
The reader will note that rotations cause a significant performance loss on the conventional ResNet; the error increases from $2 . 0 9 \%$ to $5 . 3 9 \%$ , even when removing 6s and 9s from the dataset. With PTN, on the other hand, the error goes from $2 . 8 5 \%$ to $3 . 9 6 \%$ , which shows our method is more robust to the perturbations, although the performance on the unperturbed datasets is slightly worse. We expect the PTN to be even more advantageous when large scale variations are also present.
|
| 350 |
+
|
| 351 |
+
# D ABLATION STUDY
|
| 352 |
+
|
| 353 |
+
We quantify the performance boost obtained with wrap around padding, polar origin augmentation, and training time rotation augmentation. Results are based on the PTN-B variant trained on Rotated MNIST. We remove one operation at a time and verify that the performance consistently drops, which indicates that all operations are indeed helpful. Table 5 shows the results.
|
| 354 |
+
|
| 355 |
+
Table 5: Ablation study. Rotation and polar origin augmentation during training time, and wrap around padding all contribute to reduce the error. Results are from PTN-B on the rotated MNIST.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Origin aug.</td><td>Rotation aug.</td><td>Wrap padding</td><td>Error [%]</td></tr><tr><td>Yes</td><td>Yes</td><td>Yes</td><td>1.12 (0.03)</td></tr><tr><td>No</td><td>Yes</td><td>Yes</td><td>1.33 (0.12)</td></tr><tr><td>Yes</td><td>No</td><td>Yes</td><td>1.46 (0.11)</td></tr><tr><td>Yes</td><td>Yes</td><td>No</td><td>1.31 (0.06)</td></tr></table>
|
md/train/HyexAiA5Fm/HyexAiA5Fm.md
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SCALABLE UNBALANCED OPTIMAL TRANSPORT USING GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Karren D. Yang & Caroline Uhler Laboratory for Information & Decision Systems Institute for Data, Systems and Society Massachusetts Institute of Technology Cambridge, MA, USA {karren, cuhler}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generative adversarial networks (GANs) are an expressive class of neural generative models with tremendous success in modeling high-dimensional continuous measures. In this paper, we present a scalable method for unbalanced optimal transport (OT) based on the generativeadversarial framework. We formulate unbalanced OT as a problem of simultaneously learning a transport map and a scaling factor that push a source measure to a target measure in a cost-optimal manner. We provide theoretical justification for this formulation, showing that it is closely related to an existing static formulation by Liero et al. (2018). We then propose an algorithm for solving this problem based on stochastic alternating gradient updates, similar in practice to GANs, and perform numerical experiments demonstrating how this methodology can be applied to population modeling.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
We consider the problem of unbalanced optimal transport: given two measures, find a cost-optimal way to transform one measure to the other using a combination of mass variation and transport. Such problems arise, for example, when modeling the transformation of a source population into a target population (Figure 1a). In this setting, one needs to model mass transport to account for the features that are evolving, as well as local mass variations to allow sub-populations to become more or less prominent in the target population (Schiebinger et al., 2017).
|
| 12 |
+
|
| 13 |
+
Classical optimal transport (OT) considers the problem of pushing a source to a target distribution in a way that is optimal with respect to some transport cost without allowing for mass variations. Modern approaches are based on the Kantorovich formulation (Kantorovich, 1942), which seeks the optimal probabilistic coupling between measures and can be solved using linear programming methods for discrete measures. Recently, Cuturi (2013) showed that regularizing the objective using an entropy term allows the dual problem to be solved more efficiently using the Sinkhorn algorithm. Stochastic methods based on the dual objective have been proposed for the continuous setting (Genevay et al., 2016; Seguy et al., 2017; Arjovsky et al., 2017). Optimal transport has been applied to many areas, such as computer graphics (Ferradans et al., 2014; Solomon et al., 2015) and domain adaptation (Courty et al., 2014; 2017).
|
| 14 |
+
|
| 15 |
+
In many applications where a transport cost is not available, transport maps can also be learned using generative models such as generative adversarial networks (GANs) (Goodfellow et al., 2014), which push a source distribution to a target distribution by training against an adversary. Numerous transport problems in image translation (Mirza & Osindero, 2014; Zhu et al., 2017; Yi et al., 2017), natural language translation (He et al., 2016), domain adaptation (Bousmalis et al., 2017) and biological data integration (Amodio &
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (a) Illustration of the problem of modeling the transformation of a source population $\mu$ to a target population $\nu$ . In this example, one sub-population is growing more rapidly than the others. (b) Schematic of Monge-like formulations of unbalanced optimal transport. The objective is to learn a transport map $T$ (for transporting mass) and scaling factor $\xi$ (for mass variation) to push the source $\mu$ to the target $\nu$ , using a deterministic transport map (top) (Chizat et al., 2015) or a stochastic transport map (bottom).
|
| 19 |
+
|
| 20 |
+
Krishnaswamy, 2018) have been tackled using variants of GANs, with strategies such as conditioning or cycle-consistency employed to enforce correspondence between original and transported samples. However, all these methods conserve mass between the source and target and therefore cannot handle mass variation.
|
| 21 |
+
|
| 22 |
+
Several formulations have been proposed for extending the theory of OT to the setting where the measures can have unbalanced masses (Chizat et al., 2015; 2018; Kondratyev et al., 2016; Liero et al., 2018; Frogner et al., 2015). In terms of numerical methods, a class of scaling algorithms (Chizat et al., 2016) that generalize the Sinkhorn algorithm for balanced OT have been developed for approximating the solution to optimal entropy-transport problems; this formulation of unbalanced OT by Liero et al. (2018) corresponds to the Kantorovich OT problem in which the hard marginal constraints are relaxed using divergences to allow for mass variation. In practice, these algorithms have been used to approximate unbalanced transport plans between discrete measures for applications such as computer graphics (Chizat et al., 2016), tumor growth modeling (Chizat & Di Marino, 2017) and computational biology (Schiebinger et al., 2017). However, while optimal entropy-transport allows mass variation, it cannot explicitly model it, and there are currently no methods that can perform unbalanced OT between continuous measures.
|
| 23 |
+
|
| 24 |
+
Contributions. Inspired by the recent successes of GANs for high-dimensional transport problems, we present a novel framework for unbalanced optimal transport that directly models mass variation in addition to transport. Concretely, our contributions are the following:
|
| 25 |
+
|
| 26 |
+
• We propose to solve a Monge-like formulation of unbalanced OT, in which the goal is to learn a stochastic transport map and scaling factor to push a source to a target measure in a cost-optimal manner. This generalizes the unbalanced Monge OT problem by Chizat et al. (2015).
|
| 27 |
+
• By relaxing this problem, we obtain an alternative form of the optimal entropy-transport problem by Liero et al. (2018), which confers desirable theoretical properties.
|
| 28 |
+
• We develop scalable methodology for solving the relaxed problem. Our derivation uses a convex conjugate representation of divergences, resulting in an alternating gradient descent method similar to GANs (Goodfellow et al., 2014).
|
| 29 |
+
• We demonstrate in practice how our methodology can be applied towards population modeling using the MNIST and USPS handwritten digits datasets, the CelebA dataset, and a recent single-cell RNA-seq dataset from zebrafish embrogenesis.
|
| 30 |
+
|
| 31 |
+
In addition to these main contributions, for completeness we also propose a new scalable method (Algorithm 2) in the Appendix for solving the optimal-entropy transport problem by Liero et al. (2018) in the continuous setting. The algorithm extends the work of Seguy et al. (2017) to unbalanced OT and is a scalable alternative to the algorithm of Chizat et al. (2016) for very large or continuous datasets.
|
| 32 |
+
|
| 33 |
+
# 2 PRELIMINARIES
|
| 34 |
+
|
| 35 |
+
Notation. Let $\mathcal { X } , \mathcal { Y } \subseteq \mathbb { R } ^ { n }$ be topological spaces and let $\boldsymbol { B }$ denote the Borel $\sigma$ -algebra. Let $\mathcal { M } _ { + } ^ { 1 } ( \mathcal { X } ) , \mathcal { M } _ { + } ( \mathcal { X } )$ denote respectively the space of probability measures and finite non-negative measures over $\mathcal { X }$ . For a measurable function $T$ , let $T _ { \# }$ denote its pushforward operator: if $\mu$ is a measure, then $T _ { \# } \mu$ is the pushforward measure of $\mu$ under $T$ . Finally, let $\pi ^ { \mathcal { X } }$ , $\pi ^ { y }$ be functions that project onto $\mathcal { X }$ and $\mathcal { V }$ ; for a joint measure $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ , $\pi _ { \# } ^ { \chi } \gamma$ and $\pi _ { \# } ^ { \dot { y } } \gamma$ are its marginals with respect to $\mathcal { X }$ and $\mathcal { V }$ respectively.
|
| 36 |
+
|
| 37 |
+
Optimal transport (OT) addresses the problem of transporting between measures in a cost-optimal manner. Monge (1781) formulated this problem as a search over deterministic transport maps. Specifically, given $\mu \in \mathcal { M } _ { + } ^ { 1 } ( \mathcal { X } ) , \nu \in \mathcal { M } _ { + } ^ { 1 } ( \mathcal { Y } )$ and a cost function $c : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + }$ , Monge OT seeks a measurable function $T : \mathcal { X } \overset { \cdot } { } \mathcal { Y }$ minimizing
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\operatorname* { i n f } _ { T } \int _ { \mathcal { X } } c ( x , T ( x ) ) d \mu ( x )
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
subject to the constraint $T _ { \# } \mu = \nu$ . While the optimal $T$ has an intuitive interpretation as an optimal transport map, the Monge problem is non-convex and not always feasible depending on the choices of $\mu$ and $\nu$ . The Kantorovich $o T$ problem is a convex relaxation of the Monge problem that formulates OT as a search over probabilistic transport plans. Given $\mu \in \mathcal { M } _ { + } ^ { 1 } ( \mathcal { X } ) , \nu \in \bar { \mathcal { M } } _ { + } ^ { 1 } ( \mathcal { V } )$ and a cost function $c : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + }$ , Kantorovich OT seeks a joint measure $\gamma \in \mathcal { M } _ { + } ^ { 1 } ( \mathcal { X } \times \mathcal { Y } )$ subject to $\pi _ { \# } ^ { \chi } \gamma = \mu$ and $\pi _ { \# } ^ { y } \gamma = \nu$ minimizing
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
W ( \mu , \nu ) : = \operatorname* { i n f } _ { \gamma } \int _ { \chi \times y } c ( x , y ) d \gamma ( x , y ) .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Note that the conditional probability distributions $\gamma _ { y | x }$ specify stochastic maps from $\mathcal { X }$ to $\mathcal { V }$ and can be considered a “one-to-many” version of the deterministic map from the Monge problem. In terms of numerical methods, the relaxed problem is a linear program that is always feasible and can be solved in $O ( n ^ { 3 } )$ time for discrete $\mu , \nu$ . Cuturi (2013) recently showed that introducing entropic regularization results in a simpler dual optimization problem that can be solved efficiently using the Sinkhorn algorithm. Based on the entropyregularized dual problem, Genevay et al. (2016) and Seguy et al. (2017) proposed stochastic algorithms for computing transport plans that can handle continuous measures.
|
| 50 |
+
|
| 51 |
+
Unbalanced OT. Several formulations that extend classical OT to handle mass variation have been proposed (Chizat et al., 2015; 2018; Kondratyev et al., 2016). Existing numerical methods are based on a Kantorovichlike formulation known as optimal-entropy transport (Liero et al., 2018). This formulation is obtained by relaxing the marginal constraints of (2) using divergences as follows: given two positive measures $\dot { \mu } \in \mathcal { M } _ { + } ( \bar { \mathcal { X } } )$ and $\nu \ \overset { \cdot } { \in } \ \mathcal { M } _ { + } ( \mathcal { V } )$ and a cost function $c : \bar { \mathcal { X } } \times \mathcal { Y } \mathbb { R } ^ { + }$ , optimal entropy-transport finds a measure $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ that minimizes
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
W _ { u b } ( \mu , \nu ) : = \operatorname* { i n f } _ { \gamma } \int _ { \mathcal { X } \times \mathcal { Y } } c ( x , y ) d \gamma ( x , y ) + D _ { \psi _ { 1 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi _ { 2 } } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma | \nu ) ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $D _ { \psi _ { 1 } } , D _ { \psi _ { 2 } }$ are $\psi$ -divergences induced by $\psi _ { 1 } , \psi _ { 2 }$ . The $\psi$ -divergence between non-negative finite measures $P , Q$ over $\mathcal { T } \subseteq \mathbb { R } ^ { d }$ induced by a lower semi-continuous, convex entropy function $\psi : \mathbb { R } \to \mathbb { R } \cup \{ \infty \}$ is
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
D _ { \psi } ( P | Q ) : = \psi _ { \infty } ^ { \prime } P ^ { \perp } ( { \cal T } ) + \int _ { \cal T } \psi \left( \frac { d P } { d Q } \right) d Q ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $\begin{array} { r } { \psi _ { \infty } ^ { \prime } : = \operatorname* { l i m } _ { s \infty } \frac { \psi ( s ) } { s } } \end{array}$ and $\frac { d P } { d Q } Q + P ^ { \perp }$ is the Lebesgue decomposition of $P$ with respect to $Q$ . Note that mass variation is allowed since the marginals of $\gamma$ are not constrained to be $\mu$ and $\nu$ . In terms of numerical
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 2: Motivating examples for Unbalanced Monge OT.
|
| 67 |
+
|
| 68 |
+
methods, the state-of-the-art in the discrete setting is a class of iterative scaling algorithms (Chizat et al., 2016) that generalize the Sinkhorn algorithm for computing regularized OT plans (Cuturi, 2013). There are no practical algorithms for unbalanced OT between continuous measures, especially in high-dimensional spaces.
|
| 69 |
+
|
| 70 |
+
# 3 SCALABLE UNBALANCED OT USING GANS
|
| 71 |
+
|
| 72 |
+
In this section, we propose the first algorithm for unbalanced OT that directly models mass variation and can be applied towards transport between high-dimensional continuous measures. The starting point of our development is the following Monge-like formulation of unbalanced OT, in which the goal is to learn a stochastic transport map and scaling factor to push a source to a target measure in a cost-optimal manner.
|
| 73 |
+
|
| 74 |
+
Unbalanced Monge OT. Let $c _ { 1 } : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + }$ be the cost of transport and $c _ { 2 } : \mathbb { R } ^ { + } \mathbb { R } ^ { + }$ the cost of mass variation. Let the probability space $( { \mathcal { Z } } , B ( { \mathcal { Z } } ) , \lambda )$ be the source of randomness in the transport map $T$ . Given two positive measures $\mu \in \mathcal { M } _ { + } ( \mathcal { X } )$ and $\nu \in \mathcal { M } _ { + } ( \mathcal { V } )$ , we seek a transport map $T : \mathcal { X } \times \mathcal { Z } \mathcal { Y }$ and a scaling factor $\xi : \mathcal { X } \to \mathbb { R } ^ { + }$ minimizing
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
L ( \mu , \nu ) : = \operatorname* { i n f } _ { T , \xi } \int _ { \mathcal { X } } \int _ { \mathcal { Z } } c _ { 1 } ( x , T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) + \int _ { \mathcal { X } } c _ { 2 } ( \xi ( x ) ) d \mu ( x ) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
subject to the constraint $T _ { \# } ( \xi \mu \times \lambda ) = \nu$ . Concretely, the first and second terms of (5) penalize the cost of mass transport and variation respectively, and the equality constraint ensures that $( T , \xi )$ pushes $\mu$ to $\nu$ exactly. A special case of (5) is the unbalanced Monge OT problem by Chizat et al. (2015), which employs a deterministic transport map (Figure 1b). We consider the more general case of stochastic (i.e. one-to-many) maps because it is a more suitable model for many practical problems. For example, in cell biology, it is natural to think of one cell in a source population as potentially giving rise to multiple cells in a target population. In practice, one can take $\mathcal { Z } = \mathbb { R } ^ { n }$ and $\lambda$ to be the standard Gaussian measure if a stochastic map is desired; otherwise $\lambda$ can be set to a deterministic distribution. The following are examples of problems that can be modeled using unbalanced Monge OT.
|
| 81 |
+
|
| 82 |
+
Example 3.1 (Figure 2a). Suppose the objective is to model the transformation from a source measure (Column 1) to the target measure (Column 2), which represent a population of interest at two distinct time points. The transport map $T$ models the transport/movement of points from the source to the target, while the scaling factor $\xi$ models the growth (replication) or shrinkage (death) of these points. Different models of transformation are optimal depending on the relative costs of mass transport and variation (Columns 3-6).
|
| 83 |
+
|
| 84 |
+
Example 3.2 (Figure 2b). Suppose the objective is to transport points from a source measure (1st panel, color) to a target measure (1st panel, grey) in the presence of class imbalances. A pure transport map would muddle together points from different classes, while an unbalanced transport map with a scaling factor is able to ameliorate the class imbalance (2nd panel). In this case, the scaling factor tells us explicitly how to downweigh or upweigh samples in the source distribution to balance the classes with the target distribution (3rd panel).
|
| 85 |
+
|
| 86 |
+
Relaxation. From an optimization standpoint, it is challenging to satisfy the constraint $T _ { \# } ( \xi \mu \times \lambda ) = \nu$ . We hence consider the following relaxation of (5) using a divergence penalty in place of the equality constraint:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
L _ { \psi } ( \mu , \nu ) : = \operatorname* { i n f } _ { T , \xi } \int _ { \mathcal { X } } \int _ { \mathcal { Z } } c _ { 1 } ( x , T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) + \int _ { \mathcal { X } } c _ { 2 } ( \xi ( x ) ) d \mu ( x ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
using an appropriate choice of $\psi$ that satisfies the requirements of Lemma C.2 in the Appendix1.This relaxation is the Monge-like version of the optimal-entropy transport problem (3) by Liero et al. (2018). Specifically, $( T , \xi )$ specifies a joint measure $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ given by
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\gamma ( C ) : = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { C } ( x , T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) , \quad \forall C \in \mathcal { B } ( \mathcal { X } ) \times \mathcal { B } ( \mathcal { Y } ) ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
and by reformulating (6) in terms of $\gamma$ instead of $( T , \xi )$ , one obtains the objective function for optimal-entropy transport. The main difference between the formulations is their search space, since not all joint measures $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ can be specified by some choice of $( T , \xi )$ . For example, if $T$ is a deterministic transport map, then $\gamma$ is necessarily restricted to the set of deterministic couplings. Even if $T$ is sufficiently random, it is generally not possible to specify all joint measures $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ : in the asymmetric Monge formulation (6), all the mass transported to $\mathcal { V }$ must come from somewhere within the support of $\mu$ , since the scaling factor $\xi$ allows mass to grow but not to materialize outside of its original support. Therefore equivalence can be established in general only when restricting the support of $\gamma$ to $s u p p ( \mu ) \times \mathcal { Y }$ as described in the following lemma, whose proof is given in the Appendix.
|
| 99 |
+
|
| 100 |
+
Lemma 3.3. Let $\mathcal { G }$ be the set of joint measures supported on supp $( \mu ) \times \mathcal { V }$ , and define
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\tilde { W } _ { c , \psi _ { 1 } , \psi _ { 2 } } ( \mu , \nu ) : = \operatorname* { i n f } _ { \gamma \in \mathcal { G } } \int c d \gamma + D _ { \psi _ { 1 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi _ { 2 } } ( \pi _ { \# } ^ { \mathcal { V } } \gamma | \nu ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$I f ( \mathcal { Z } , B ( \mathcal { Z } ) , \lambda )$ is atomless and $c _ { 2 }$ is an entropy function, then $L _ { \psi } ( \mu , \nu ) = \tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ .
|
| 107 |
+
|
| 108 |
+
Based on the relation between (3) and (6), several theoretical results for (6) follow from the analysis of optimal entropy-transport by Liero et al. (2018). Importantly, one can show the following theorem, namely that for an appropriate and sufficiently large choice of divergence penalty, solutions of the relaxed problem (6) converge to solutions of the original problem (5). The proof is given in the Appendix.
|
| 109 |
+
|
| 110 |
+
Theorem 3.4. Suppose $c _ { 1 } , c _ { 2 } , \psi$ satisfy the existence assumptions of Proposition $B . I$ in the Appendix, and let $( { \mathcal { Z } } , B ( { \mathcal { Z } } ) , \lambda )$ be an atomless probability space. Furthermore, let $\psi$ be uniquely minimized at $\psi ( 1 ) = 0$ . Then for a sequence $0 < \zeta ^ { 1 } < \cdots < \zeta ^ { k } < \cdots$ diverging to $\infty$ indexed by $k$ , $\begin{array} { r } { \operatorname* { l i m } _ { k \to \infty } L _ { \zeta ^ { k } \psi } ( \mu , \nu ) = L ( \mu , \nu ) } \end{array}$ . Additionally, let $\gamma ^ { k }$ be the joint measure specified by a minimizer of $L _ { \zeta ^ { k } \psi } ( \mu , \nu )$ . If $L ( \mu , \nu ) < \infty$ , then up to extraction of a subsequence, $\gamma ^ { k }$ converges weakly to $\gamma ,$ , the joint measure specified by a minimizer of $L ( \mu , \nu )$ .
|
| 111 |
+
|
| 112 |
+
Algorithm. Using the relaxation of unbalanced Monge OT in (6), we now show that the transport map and scaling factor can be learned by stochastic gradient methods. While the divergence term cannot easily be minimized using the definition in (4), we can write it as a penalty witnessed by an adversary function $f : \mathcal { V } \to ( - \mathrm { \bar { \infty } } , \psi _ { \infty } ^ { \prime } ]$ using the convex conjugate representation (see Lemma B.2):
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) = \operatorname* { s u p } _ { f } \int _ { \mathcal X } \int _ { \mathcal Z } f ( T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) - \int _ { \mathcal Y } \psi ^ { * } ( f ( y ) ) d \nu ( y ) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\psi ^ { * }$ is the convex conjugate of $\psi$ . The objective in (6) can now be optimized using alternating stochastic gradient updates after parameterizing $T , \xi$ , and $f$ with neural networks; see Algorithm 1 2. The optimization procedure is similar to GAN training and can be interpreted as an adversarial game between $( T , \xi )$ and $f$ :
|
| 119 |
+
|
| 120 |
+
• $T$ takes a point $x \sim \mu$ and transports it from $\mathcal { X }$ to $\mathcal { V }$ by generating $T ( x , z )$ where $z \sim \lambda$ .
|
| 121 |
+
• $\xi$ determines the importance weight of each transported point.
|
| 122 |
+
• Their shared objective is to minimize the divergence between transported samples and real samples from $\nu$ that is measured by the adversary $f$ .
|
| 123 |
+
• Additionally, cost functions $c _ { 1 }$ and $c _ { 2 }$ encourage $T , \xi$ to find the most cost-efficient strategy.
|
| 124 |
+
|
| 125 |
+
# Algorithm 1 Generative-Adversarial Framework for Unbalanced Monge OT
|
| 126 |
+
|
| 127 |
+
Input: Initial parameters $\theta$ , $\phi$ , $\omega$ ; step size $\eta$ ; normalized measures $\tilde { \mu } , \tilde { \nu }$ , constants $c _ { \mu } , c _ { \nu }$ .
|
| 128 |
+
Output: Updated parameters $\theta , \phi , \omega$ .
|
| 129 |
+
while $( \theta , \phi , \omega )$ not converged do Sample $x _ { 1 } , \cdots , x _ { n }$ from $\tilde { \mu }$ $, y _ { 1 } , \cdots , y _ { n }$ from $\tilde { \nu }$ , $z _ { 1 } , \cdots , z _ { n }$ from $\lambda$ ; $\begin{array} { r l r } { { \operatorname { \mathrm { ~ \Lambda ~ } } ^ { \mathrm { n o \to 1 , \Lambda ~ } } , \mathrm { \Lambda } ^ { \mathrm { \tiny ~ , ~ \times ~ n e a s e a ~ } , ~ p = 1 , \Lambda } , \mathrm { \Lambda } ^ { \mathrm { \tiny ~ , ~ \wedge ~ s o u s e a ~ } , ~ p = 1 , \Lambda } , } } \\ & { } & { \ell ( \theta , \phi , \omega ) : = \cfrac { 1 } { n } \sum _ { i = 1 } ^ { n } [ c _ { \mu } c _ { 1 } ( x _ { i } , T _ { \theta } ( x _ { i } , z _ { i } ) ) \xi _ { \phi } ( x _ { i } ) + c _ { \mu } c _ { 2 } ( \xi _ { \phi } ( x _ { i } ) ) } \\ & { } & { \mathrm + c _ { \mu } \xi _ { \phi } ( x _ { i } ) f _ { \omega } ( T _ { \theta } ( x _ { i } , z _ { i } ) ) - c _ { \nu } \psi ^ { * } ( f _ { \omega } ( y _ { i } ) ) . ] } \end{array}$ (8) Update $\omega$ by gradient descent on $- \ell ( \theta , \phi , \omega )$ . Update $\theta , \phi$ by gradient descent $\ell ( \theta , \phi , \omega )$ .
|
| 130 |
+
end while
|
| 131 |
+
|
| 132 |
+
Table 1 in the Appendix provides some examples of divergences with corresponding entropy functions and convex conjugates that can be plugged into (7). Further practical considerations for implementation and training are discussed in Appendix C.
|
| 133 |
+
|
| 134 |
+
Relation to other approaches. The probabilistic Monge-like formulation (6) is similar to the Kantorovichlike entropy-transport problem (3) in theory, but they result in quite different numerical methods in practice. Algorithm 1 solves the non-convex formulation (6) and learns a transport map $T$ and scaling factor $\xi$ parameterized by neural networks, enabling scalable optimization using stochastic gradient descent. The networks are immediately useful for many practical applications; for instance, it only requires a single forward pass to compute the transport and scaling of a point from the source domain to the target. Furthermore, the neural architectures of $T , \xi$ imbue their function classes with a particular structure, and when chosen appropriately, enable effective learning of these functions in high-dimensional settings. Due to the non-convexity of the optimization problem, however, Algorithm 1 is not guaranteed to find the global optimum. In contrast, the scaling algorithm of Chizat et al. (2016) based on (3) solves a convex optimization problem and is proven to converge, but is currently only practical for discrete problems and has limited scalability. For completeness, in Section A of the Appendix, we propose a new stochastic method based on the same dual objective as Chizat et al. (2016) that can handle transport between continuous measures (Algorithm 2 in the Appendix). This method generalizes the approach of Seguy et al. (2017) for handling transport between continuous measures and overcomes the scalability limitations of Chizat et al. (2016). However, the output is in the form of the dual solution, which is less interpretable for practical applications compared to the output of Algorithm 1. In particular, while one can compute a deterministic transport map known as a barycentric projection from the dual solution, it is unclear how best to obtain a scaling factor or a stochastic transport map that can generate samples outside of the target dataset. In the numerical experiments of Section 4, we show the advantage of directly learning a transport map and scaling factor using Algorithm 1.
|
| 135 |
+
|
| 136 |
+
The problem of learning a scaling factor (or weighting factor) that “balances” measures $\mu$ and $\nu$ also arises in causal inference. Generally, $\mu$ is the distribution of covariates from a control population and $\nu$ is the distribution from a treated population. The goal is to scale the importance of different members from the control population based on how likely they are to be present in the treated population, in order to eliminate selection biases in the inference of treatment effects. Kallus (2018) proposed a generative-adversarial method for learning the scaling factor, but they do not consider transport.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3: Learning weights on MNIST data using unbalanced OT.
|
| 140 |
+
|
| 141 |
+
# 4 NUMERICAL EXPERIMENTS
|
| 142 |
+
|
| 143 |
+
In this section, we illustrate in practice how Algorithm 1 performs unbalanced OT, with applications geared towards population modeling.
|
| 144 |
+
|
| 145 |
+
MNIST-to-MNIST. We first apply Algorithm 1 to perform unbalanced optimal transport between two modified MNIST datasets. The source dataset consists of regular MNIST digits with the class distribution shown in column 1 of Figure 3a. The target dataset consists of either regular (for the experiment in Figure 3b) or dimmed (for the experiment in Figure 3c) MNIST digits with the class distribution shown in column 2 of Figure 3a. The class imbalance between the source and target datasets imitates a scenerio in which certain classes (digits 0-3) become more popular and others (6-9) become less popular in the target population, while the change in brightness is meant to reflect population drift. We evaluated Algorithm 1 on the problem of transporting the source distribution to the target distribution, enforcing a high cost of transport (w.r.t. Euclidean distance). In both cases, we found that the scaling factor over each of the digit classes roughly reflects its ratio of imbalance between the source and target distributions (Figure 3b-c). These experiments validate that the scaling factor learned by Algorithm 1 reflects the class imbalances and can be used to model growth or decline of different classes in a population. Figure 3d is a schematic illustrating the reweighting that occurs during unbalanced OT.
|
| 146 |
+
|
| 147 |
+
MNIST-to-USPS. Next, we apply unbalanced OT from the MNIST dataset to the USPS dataset. As before, these two datasets are meant to imitate a population sampled at two different time points, this time with a large degree of evolution. We use Algorithm 1 to model the evolution of the MNIST distribution to the USPS distribution, taking as transport cost the Euclidean distance between the original and transported images. A summary of the unbalanced transport is visualized in Figure 4a. Each arrow originates from a real MNIST image and points towards the predicted appearance of this image in the USPS dataset. The size of the image reflects the scaling factor of the original MNIST image, i.e. whether it is relatively increasing or decreasing in prominence in the USPS dataset compared to the MNIST dataset according to the unbalanced OT model. Even though the Euclidean distance is not an ideal measure of correspondence between MNIST and USPS digits, many MNIST digits were able to preserve their likeness during the transport (Figure 4b). We analyzed which MNIST digits were considered as increasing or decreasing in prominence by the model. The MNIST digits with higher scaling factors were generally brighter (Figure 4c) and covered a larger area of pixels (Figure 4d) compared to the MNIST digits with lower scaling factors. These results are consistent with the observation that the target USPS digits are generally brighter and contain more pixels.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Unbalanced Optimal Transport from MNIST to USPS digits.
|
| 151 |
+
|
| 152 |
+
CelebA-Young-to-CelebA-Aged. We applied Algorithm 1 on the CelebA dataset to perform unbalanced OT from the population of young faces to the population of aged faces. This synthetic problem imitates a real application of interest, which is modeling the transformation of a population based on samples taken from two timepoints. Since the Euclidean distance between two faces is a poor measure of semantic similarity, we first train a variational autoencoder (VAE) (Kingma & Welling, 2013) on the CelebA dataset and encode all samples into the latent space. We then apply Algorithm 1 to perform unbalanced OT from the encoded young to the encoded aged faces, taking the transport cost to be the Euclidean distance in the latent space. A summary of the unbalanced transport is visualized in Figure 5a. Each arrow originates from a real face from the young population and points towards the predicted appearance of this face in the aged population. Generally, the transported faces retain the most salient features of the original faces (Figure 5b), although there are exceptions (e.g. gender swaps) which reflects that some features are not prominent components of the VAE encodings. Interestingly, the young faces with higher scaling factors were significantly enriched for males compared to young faces with lower scaling factors; $9 . 6 \%$ (9,913/103,287) of young female faces had a high scaling factor as compared to $1 8 . 5 \%$ (8,029/53,447) for young male faces (Figure 5c, top, $p = 0$ ). In other words, our model predicts growth in the prominence of male faces compared to female faces as the CelebA population evolves from young to aged. After observing this phenomenon, we confirmed based on checking the ground truth labels that there was indeed a strong gender imbalance between the young and aged populations: while the young population is predominantly female, the aged population is predominantly male (Figure 5c, bottom).
|
| 153 |
+
|
| 154 |
+
Zebrafish embroygenesis. A problem of great interest in biology is lineage tracing of cells between different developmental stages or during disease progression. This is a natural application of transport in which the source and target distributions are unbalanced: some cells in the earlier stage are more poised to develop into cells seen in the later stage. To showcase the relevance of learning the scaling factor, we apply Algorithm 1 to recent single-cell gene expression data from two stages of zebrafish embryogenesis (Farrell et al., 2018). The source population is from a late stage of blastulation and the target population from an early stage of gastrulation (Figure 6a). The results of the transport are plotted in Figure 6b-c after dimensionality reduction by PCA and T-SNE (Maaten & Hinton, 2008). To assess the scaling factor, we extracted the cells from the blastula stage with higher scaling factors (i.e. over 90th percentile) and compared them to the remainder of the cells using differential gene expression analysis, producing a ranked list of upregulated genes. Using the GOrilla tool (Eden et al., 2009), we found that the cells with higher scaling factors were significantly enriched for genes associated with differentiation and development of the mesoderm (Figure 6d). This experiment shows that analysis of the scaling factor can be applied towards interesting and meaningful biological discovery.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 5: Unbalanced Optimal Transport from Young to Aged CelebA Faces.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 6: Unbalanced OT on Zebrafish Single-Cell Gene Expression Data. (a) Illustration of the blastula and gastrula stages of zebrafish embryogenesis. (b) T-SNE plot (Maaten & Hinton, 2008) of the unbalanced OT results for a subset of datapoints. The color of the transported points indicates the relative magnitude of the scaling factor $( \mathrm { b l a c k } = \mathrm { h i g h }$ , white $\mathbf { \tau } = 1 0 \mathbf { w }$ ). (c) Same plot as (b), where we have colored the source points instead of the transported points. (d) GOrilla output of significantly enriched processes (Eden et al., 2009) based on ranked list of enriched genes in cells with high scaling factors (black points from (c)) from a differential gene expression analysis. Processes in the graph are organized from more general (upstream) to more specific (downstream).
|
| 161 |
+
|
| 162 |
+
# REFERENCES
|
| 163 |
+
|
| 164 |
+
Amjad Almahairi, Sai Rajeswar, Alessandro Sordoni, Philip Bachman, and Aaron Courville. Augmented cyclegan: Learning many-to-many mappings from unpaired data. arXiv:1802.10151, 2018.
|
| 165 |
+
|
| 166 |
+
Matthew Amodio and Smita Krishnaswamy. Magan: Aligning biological manifolds. arXiv:1803.00385, 2018.
|
| 167 |
+
|
| 168 |
+
Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial networks.´ arXiv:1701.04862, 2017.
|
| 169 |
+
|
| 170 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. In ´ International Conference on Machine Learning, pp. 214–223, 2017.
|
| 171 |
+
|
| 172 |
+
Mathieu Blondel, Vivien Seguy, and Antoine Rolet. Smooth and sparse optimal transport. arXiv:1710.06276, 2017.
|
| 173 |
+
|
| 174 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pp. 7, 2017.
|
| 175 |
+
|
| 176 |
+
Lena ´ ¨ıc Chizat and Simone Di Marino. A tumor growth model of Hele-Shaw type as a gradient flow. arXiv:1712.06124, 2017.
|
| 177 |
+
|
| 178 |
+
Lenaic Chizat, Gabriel Peyre, Bernhard Schmitzer, and Fran ´ c¸ois-Xavier Vialard. Unbalanced optimal transport: geometry and Kantorovich formulation. arXiv:1508.05216, 2015.
|
| 179 |
+
|
| 180 |
+
Lenaic Chizat, Gabriel Peyre, Bernhard Schmitzer, and Fran ´ c¸ois-Xavier Vialard. Scaling algorithms for unbalanced transport problems. arXiv:1607.05816, 2016.
|
| 181 |
+
|
| 182 |
+
Lenaic Chizat, Gabriel Peyre, Bernhard Schmitzer, and Fran ´ c¸ois-Xavier Vialard. An interpolating distance between optimal transport and Fisher–Rao metrics. Foundations of Computational Mathematics, 18(1): 1–44, 2018.
|
| 183 |
+
|
| 184 |
+
Nicolas Courty, Remi Flamary, and Devis Tuia. Domain adaptation with regularized optimal transport. In ´ Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 274–289. Springer, 2014.
|
| 185 |
+
|
| 186 |
+
Nicolas Courty, Remi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal transport for domain ´ adaptation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(9):1853–1865, 2017.
|
| 187 |
+
|
| 188 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, pp. 2292–2300, 2013.
|
| 189 |
+
|
| 190 |
+
Richard M. Dudley. Real Analysis and Probability: 0. Chapman and Hall/CRC, 2018.
|
| 191 |
+
|
| 192 |
+
Eran Eden, Roy Navon, Israel Steinfeld, Doron Lipson, and Zohar Yakhini. GOrilla: a tool for discovery and visualization of enriched GO terms in ranked gene lists. BMC Bioinformatics, 10(1):48, 2009.
|
| 193 |
+
|
| 194 |
+
Jeffrey A. Farrell, Yiqun Wang, Samantha J. Riesenfeld, Karthik Shekhar, Aviv Regev, and Alexander F. Schier. Single-cell reconstruction of developmental trajectories during zebrafish embryogenesis. Science, 360, 2018.
|
| 195 |
+
|
| 196 |
+
Sira Ferradans, Nicolas Papadakis, Gabriel Peyre, and Jean-Fran ´ c¸ois Aujol. Regularized discrete optimal transport. SIAM Journal on Imaging Sciences, 7(3):1853–1882, 2014.
|
| 197 |
+
|
| 198 |
+
Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a Wasserstein loss. In Advances in Neural Information Processing Systems, pp. 2053–2061, 2015.
|
| 199 |
+
|
| 200 |
+
Aude Genevay, Marco Cuturi, Gabriel Peyre, and Francis Bach. Stochastic optimization for large-scale optimal´ transport. In Advances in Neural Information Processing Systems, pp. 3440–3448, 2016.
|
| 201 |
+
|
| 202 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
|
| 203 |
+
|
| 204 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANS. In Advances in Neural Information Processing Systems, pp. 5767–5777, 2017.
|
| 205 |
+
|
| 206 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems, pp. 820–828, 2016.
|
| 207 |
+
|
| 208 |
+
Nathan Kallus. Deepmatch: Balancing deep covariate representations for causal inference using adversarial training. arXiv:1802.05664, 2018.
|
| 209 |
+
|
| 210 |
+
Leonid V. Kantorovich. On the translocation of masses. In Dokl. Akad. Nauk. USSR (NS), volume 37, pp. 199–201, 1942.
|
| 211 |
+
|
| 212 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational Bayes. arXiv:1312.6114, 2013.
|
| 213 |
+
|
| 214 |
+
Stanislav Kondratyev, Leonard Monsaingeon, Dmitry Vorotnikov, et al. A new optimal transport distance on ´ the space of finite Radon measures. Advances in Differential Equations, 21(11/12):1117–1164, 2016.
|
| 215 |
+
|
| 216 |
+
Matthias Liero, Alexander Mielke, and Giuseppe Savare. Optimal entropy-transport problems and a new ´ Hellinger–Kantorovich distance between positive measures. Inventiones Mathematicae, 211(3):969–1117, 2018.
|
| 217 |
+
|
| 218 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
|
| 219 |
+
|
| 220 |
+
Lars Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for GANs do actually converge? In International Conference on Machine Learning, pp. 3478–3487, 2018.
|
| 221 |
+
|
| 222 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv:1411.1784, 2014.
|
| 223 |
+
|
| 224 |
+
Gaspard Monge. Memoire sur la th ´ eorie des d ´ eblais et des remblais. ´ Histoire de l’Academie Royale des ´ Sciences de Paris, 1781.
|
| 225 |
+
|
| 226 |
+
XuanLong Nguyen, Martin J. Wainwright, and Michael I. Jordan. Estimating divergence functionals and the likelihood ratio by penalized convex risk minimization. In Advances in Neural Information Processing Systems, pp. 1089–1096, 2008.
|
| 227 |
+
|
| 228 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-GAN: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
|
| 229 |
+
|
| 230 |
+
Geoffrey Schiebinger, Jian Shu, Marcin Tabaka, Brian Cleary, Vidya Subramanian, Aryeh Solomon, Siyan Liu, Stacie Lin, Peter Berube, Lia Lee, et al. Reconstruction of developmental landscapes by optimal-transport analysis of single-cell gene expression sheds light on cellular reprogramming. BioRxiv, pp. 191056, 2017.
|
| 231 |
+
|
| 232 |
+
Vivien Seguy, Bharath Bhushan Damodaran, Remi Flamary, Nicolas Courty, Antoine Rolet, and Mathieu ´ Blondel. Large-scale optimal transport and mapping estimation. arXiv:1711.02283, 2017.
|
| 233 |
+
Justin Solomon, Fernando De Goes, Gabriel Peyre, Marco Cuturi, Adrian Butscher, Andy Nguyen, Tao Du, ´ and Leonidas Guibas. Convolutional wasserstein distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):66, 2015.
|
| 234 |
+
Zili Yi, Hao (Richard) Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In ICCV, pp. 2868–2876, 2017.
|
| 235 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv:1703.10593, 2017.
|
| 236 |
+
|
| 237 |
+
# APPENDIX
|
| 238 |
+
|
| 239 |
+
# A DUAL STOCHASTIC METHOD
|
| 240 |
+
|
| 241 |
+
In this section, we present a stochastic method for unbalanced OT based on the regularized dual formulation of (Chizat et al., 2015), which can be considered a natural generalization of Seguy et al. (2017). The dual formulation of (3) is given by
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\operatorname* { s u p } _ { u , v } - \int \psi _ { 1 } ^ { * } ( - u ) d \mu - \int \psi _ { 2 } ^ { * } ( - v ) d \nu
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
subject to $u \oplus v \ \leq c$ , where the supremum is taken over functions $u : \mathcal { X } [ - \psi _ { 1 \infty } ^ { \prime } , \infty ]$ and $v : \mathcal { V } $ $[ - \psi _ { 2 \infty } ^ { \prime } , \infty ]$ . This is a constrained optimization problem that is challenging to solve. A standard technique for making the dual problem unconstrained is to add a strongly convex regularization term to the primal objective (Blondel et al., 2017), such as an entropic regularization term (Cuturi, 2013):
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
R _ { e } ( \gamma ) = \epsilon D _ { \psi _ { K L } } ( \gamma | \mu \otimes \nu )
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
where $\epsilon > 0$ . Concretely, this term has a “smoothing” effect on the transport plan, in the sense that it encourages plans with high entropy. By the Fenchel-Rockafellar theorem, the dual of the regularized problem is given by,
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
W _ { u b } ^ { \epsilon } ( \mu , \nu ) : = \operatorname* { s u p } _ { u , v } - \int \psi _ { 1 } ^ { * } ( - u ) d \mu - \int \psi _ { 2 } ^ { * } ( - v ) d \nu - \epsilon \int e ^ { ( u + v - c ) / \epsilon } d ( \mu \otimes \nu ) ,
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
where the supremum is taken over functions $u : \mathcal { X } [ - \psi _ { 1 \infty } ^ { \prime } , \infty ]$ and $v : \mathcal { V } [ - \psi _ { 2 \infty } ^ { \prime } , \infty ]$ , and the relationship between the primal optimizer $\gamma ^ { * }$ and dual optimizer $( u ^ { * } , v ^ { * } )$ is given by
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
d \gamma ^ { \ast } = e ^ { ( u ^ { \ast } + v ^ { \ast } - c ) / \epsilon } d ( \mu \otimes \nu ) .
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
Next, we rewrite (9) in terms of expectations. We assume that one has access to samples from $\mu , \nu$ , and in the setting where $\mu , \nu$ are not normalized, then samples to the normalized measures $\tilde { \mu } , \tilde { \nu }$ as well as the normalization constants. Based on these assumptions, we have
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\begin{array} { r } { \mathcal { N } _ { u b } ^ { \epsilon } ( \mu , \nu ) = \underset { u , v } { \operatorname* { s u p } } - c _ { \mu } \mathbb { E } _ { x \sim \tilde { \mu } } \psi _ { 1 } ^ { * } ( - u ( x ) ) - c _ { \nu } \mathbb { E } _ { y \sim \tilde { \nu } } \psi _ { 2 } ^ { * } ( - v ( y ) ) - \epsilon c _ { \mu } c _ { \nu } \mathbb { E } _ { x \sim \tilde { \mu } , y \sim \tilde { \nu } } e ^ { ( u ( x ) + v ( y ) - c ( x , y ) ) / \epsilon } . } \end{array}
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
If $\psi _ { 1 } ^ { * } , \psi _ { 2 } ^ { * }$ are differentiable, we can parameterize $u , v$ with neural networks $u _ { \theta } , v _ { \phi }$ and optimize $\theta , \phi$ using stochastic gradient descent. This is described in Algorithm 2. Note that this algorithm is a generalization of the algorithm of (Seguy et al., 2017) from classical OT to unbalanced OT. Indeed, taking $\psi _ { 1 } , \psi _ { 2 }$ to be equality constraints, (9) becomes
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\operatorname* { s u p } _ { u , v } \int u d \mu + \int v d \nu - \epsilon \int e ^ { ( u + v - c ) / \epsilon } d ( \mu \otimes \nu ) ,
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
which is the dual of the entropy-regularized classical OT problem.
|
| 278 |
+
|
| 279 |
+
# Algorithm 2 SGD for Unbalanced OT
|
| 280 |
+
|
| 281 |
+
Input: Initial parameters $\theta$ , $\phi$ ; step size $\eta$ ; regularization parameter $\epsilon$ ; constants $c _ { \mu } , c _ { \nu }$ and normalized
|
| 282 |
+
measures $\tilde { \mu }$ , $\tilde { \nu }$
|
| 283 |
+
Output: Updated parameters $\theta$ , $\phi$
|
| 284 |
+
while $( \theta , \phi )$ not converged do Sample $( x _ { 1 } , y _ { 1 } ) , \cdot \cdot \cdot , ( x _ { n } , y _ { n } )$ from $\tilde { \mu } \otimes \tilde { \nu }$
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\ell ( \theta , \phi ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } [ c _ { \mu } \psi _ { 1 } ^ { * } ( - u ( x _ { i } ) ) + c _ { \nu } \psi _ { 2 } ^ { * } ( - v ( y _ { i } ) ) + \epsilon c _ { \mu } c _ { \nu } e ^ { ( u ( x _ { i } ) + v ( y _ { i } ) - c ( x _ { i } , y _ { i } ) ) / \epsilon } ]
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
Update $\theta , \phi$ by gradient descent on $\ell ( \theta , \phi )$
|
| 291 |
+
|
| 292 |
+
The dual solution $( u ^ { * } , v ^ { * } )$ learned from Algorithm 2 can be used to reconstruct the primal solution $\gamma ^ { * }$ based on the relation in (10). Concretely, $\gamma ^ { * }$ is a transport map that indicates the amount of mass transported between every pair of points in $\mathcal { X }$ and $\mathcal { V }$ . Note that the marginals of $\gamma ^ { * }$ with respect to $\mathcal { X }$ and $\mathcal { V }$ are not necessarily $\mu$ and $\nu$ , which is where mass variation is implicitly built into the problem. Given $\gamma ^ { * }$ , it is possible to also learn an “averaged” deterministic mapping from $\mathcal { X }$ to $\mathcal { V }$ . A standard approach is to take the barycentric projection $T : \mathcal { X } \mathcal { Y }$ , defined as,
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
T ( x ) = \operatorname* { m i n } _ { z \in \mathcal { V } } \mathbb { E } _ { y \sim \gamma ^ { * } ( \cdot | x ) } d ( z , y ) ,
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
with respect to some distance $d : \mathcal { V } \times \mathcal { V } \mathbb { R } ^ { + }$ . Seguy et al. (2017) proposed a stochastic algorithm for learning such a map from the dual solution, which we reproduce in Algorithm 3.
|
| 299 |
+
|
| 300 |
+
# Algorithm 3 Learning Barycentric Projection
|
| 301 |
+
|
| 302 |
+
<table><tr><td>Input:Learned functions u,U; initial Tθ; distance function d Output: Updated Te</td></tr><tr><td>while Tθ not converged do Sample (x1,yi),..,(xn,yn) from μ ⑧i</td></tr><tr><td></td></tr><tr><td>n</td></tr><tr><td>1 d(xi,Tθ(yi))e(u(xi)+u(yi)-c(xi,yi))/∈</td></tr><tr><td>l(0):= n</td></tr><tr><td>i=1</td></tr><tr><td>Update Tθ by gradient descent on l(0) end while</td></tr></table>
|
| 303 |
+
|
| 304 |
+
# B SUPPLEMENT TO SECTION 3
|
| 305 |
+
|
| 306 |
+
# B.1 RELAXATION TO OPTIMAL-ENTROPY TRANSPORT
|
| 307 |
+
|
| 308 |
+
The objectives in (6) and (3) are equivalent if one reformulates (6) in terms of $\gamma$ instead of $( T , \xi )$ , where $\gamma \in \mathcal { M } _ { + } ( \mathcal { X } \times \mathcal { Y } )$ is a joint measure given by
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\gamma ( C ) : = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { C } ( x , T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) , \quad \forall C \in \mathcal { B } ( \mathcal { X } ) \times \mathcal { B } ( \mathcal { Y } ) .
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
Furthermore, the formulations are equivalent if one restricts the search space of (3) to contain only those joint measures that can be specified by some $( T , \xi )$ . This relation between the formulations is formalized by Lemma 3.3.
|
| 315 |
+
|
| 316 |
+
Proof of Lemma 3.3. First we show $L _ { \psi } ( \mu , \nu ) \ge \tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ . If $L _ { \psi } ( \mu , \nu ) = \infty$ , this is trivial, so assume $L _ { \psi } ( \mu , \nu ) < \infty$ . Let $( T , \xi )$ be any solution and define $\gamma$ by (12). Note by this definition that
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\pi _ { \# } ^ { \chi } \gamma ( A ) = \int _ { \chi } \mathbb { 1 } _ { A } ( x ) \xi ( x ) d \mu ( x ) , \quad \forall A \in B ( \mathcal { X } ) ,
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
i.e. $\xi$ is the Radon-Nikodym derivative of $\pi _ { \# } ^ { \chi } \gamma$ with respect to $\mu$ . Also
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\pi _ { \# } ^ { \mathcal { Y } } \gamma ( B ) = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { B } ( T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) = T _ { \# } ( \xi \mu \times \lambda ) ( B ) , \quad \forall B \in B ( \mathcal { Y } ) .
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
It follows that
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { l } { \displaystyle \int _ { \mathcal X } \left( \int _ { \mathcal z } c _ { 1 } ( x , T ( x , z ) ) d \lambda ( z ) \right) \xi ( x ) d \mu ( x ) + \int _ { \mathcal X } c _ { 2 } ( \xi ( x ) ) d \mu ( x ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) } \\ { = \int _ { \mathcal X \times \mathcal Y } c _ { 1 } ( x , y ) d \gamma ( x , y ) + \int _ { \mathcal X } c _ { 2 } ( \xi ( x ) ) d \mu ( x ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
= \int _ { \mathcal { X } \times \mathcal { Y } } c _ { 1 } ( x , y ) d \gamma ( x , y ) + \int _ { \mathcal { X } } c _ { 2 } ( \frac { d \pi _ { \# } ^ { \mathcal { X } } \gamma } { d \mu } ) d \mu ( x ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu )
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
\begin{array} { r l } & { = \displaystyle \int _ { \mathcal { X } \times \mathcal { Y } } c _ { 1 } ( x , y ) d \gamma ( x , y ) + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) } \\ & { = \displaystyle \int _ { \mathcal { X } \times \mathcal { Y } } c _ { 1 } ( x , y ) d \gamma ( x , y ) + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma | \nu ) } \\ & { \geq \tilde { W } _ { c , \psi _ { 1 } , \psi _ { 2 } } ( \mu , \nu ) . } \end{array}
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
Since this inequality holds for any $( T , \xi )$ , taking the infimum over the left-hand side yields $L _ { \psi } ( \mu , \nu ) \ge \tilde { W } _ { c , \psi _ { 1 } , \psi _ { 2 } } \dot { ( } \mu , \nu )$ .
|
| 343 |
+
|
| 344 |
+
To show $L _ { \psi } ( \mu , \nu ) \leq \tilde { W } _ { c , \psi _ { 1 } , \psi _ { 2 } } ( \mu , \nu )$ , assume $\tilde { W } _ { c , \psi _ { 1 } , \psi _ { 2 } } ( \mu , \nu ) < \infty$ and let $\gamma$ be any solution. By the disintegration theorem, there exists a family of probability measures $\{ \gamma _ { y | x } \} _ { x \in \mathcal { X } }$ in $\mathcal { M } _ { + } ^ { 1 } ( \mathcal { V } )$ such that
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\gamma ( C ) = \int _ { \mathcal { X } } \int _ { \mathcal { Y } } \mathbb { 1 } _ { C } ( x , y ) d \gamma _ { y \mid x } ( y ) d \pi _ { \# } ^ { \mathcal { X } } \gamma , \quad \forall C \in \mathcal { B } ( \mathcal { X } ) \times \mathcal { B } ( \mathcal { Y } ) .
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Since $( { \mathcal { Z } } , B ( { \mathcal { Z } } ) , \lambda )$ is atomless, it follows from Proposition 9.1.2 and Theorem 13.1.1 in (Dudley, 2018) that there exists a family of measurable functions $\{ T _ { x } : \mathcal { Z } \mathcal { V } \} _ { x \in \mathcal { X } }$ such that $\gamma _ { y | x }$ is the pushforward measure of $\lambda$ under $T _ { x }$ for all $x \in \mathcal { X }$ . Denoting $T ( x , z ) : ( x , z ) \mapsto T _ { x } ( z )$ , then by a change of variables,
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\gamma ( C ) = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { C } ( x , T ( x , z ) ) d \lambda ( z ) d \pi _ { \# } ^ { \mathcal { X } } \gamma , \quad \forall C \in \mathcal { B } ( \mathcal { X } ) \times \mathcal { B } ( \mathcal { Y } ) .
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
By hypothesis, $\pi _ { \# } ^ { \chi } \gamma$ is restricted to the support of $\mu$ , i.e. $\pi _ { \# } ^ { \chi } \gamma \ll \mu$ . Let $\xi$ be the Radon-Nikodym derivative $\frac { d \pi _ { \# } ^ { \chi } \gamma } { d \mu }$ . It follows from the Radon-Nikodym theorem that $( T , \xi )$ satisfy
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\gamma ( C ) = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { C } ( x , T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) , \quad \forall C \in \mathcal { B } ( \mathcal { X } ) \times \mathcal { B } ( \mathcal { Y } ) ,
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
which is the same relation as in (12). Same as before,
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\pi _ { \# } ^ { \chi } \gamma ( A ) = \int _ { \chi } \mathbb { 1 } _ { A } ( x ) \xi ( x ) d \mu ( x ) , \quad \forall A \in B ( \mathcal { X } ) ,
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
and
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\pi _ { \# } ^ { \mathcal { Y } } \gamma ( B ) = \int _ { \mathcal { X } } \int _ { \mathcal { Z } } \mathbb { 1 } _ { B } ( T ( x , z ) ) d \lambda ( z ) \xi ( x ) d \mu ( x ) = T _ { \# } ( \xi \mu \times \lambda ) ( B ) , \quad \forall B \in B ( \mathcal { Y } ) .
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
It then follows that
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\begin{array} { l } { { \displaystyle \int _ { \mathbb { X } \times \mathbb { V } } c _ { 1 } d \gamma + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma | \nu ) } } \\ { { \displaystyle = \int _ { \mathbb { X } } \left( \int _ { \mathbb { V } } c _ { 1 } ( x , y ) d \gamma _ { y | x } ( y ) \right) d \pi _ { \# } ^ { \mathcal { X } } \gamma + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma | \nu ) } } \end{array}
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
= \int _ { \mathcal { X } } \left( \int _ { \mathcal { Z } } c ( x , T ( x , z ) ) d \lambda ( z ) \right) d \pi _ { \# } ^ { \mathcal { X } } \gamma + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \gamma | \mu ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma | \nu )
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\begin{array} { l l l } { { \displaystyle = \int _ { \mathcal X } \left( \int _ { \mathcal Z } c ( x , T ( x , z ) ) d \lambda ( z ) \right) d \pi _ { \# } ^ { \mathcal X } \gamma + \int c _ { 2 } ( \frac { d \pi _ { \# } ^ { \mathcal X } \gamma } { d \mu } ) d \mu ( x ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal Y } \gamma | \nu ) } } \\ { { \displaystyle = \int _ { \mathcal X } \left( \int _ { \mathcal Z } c ( x , T ( x , z ) ) d \lambda ( z ) \right) \xi ( x ) d \mu ( x ) + \int c _ { 2 } ( \xi ( x ) ) d \mu ( x ) + D _ { \psi } ( \pi _ { \# } ^ { \mathcal Y } \gamma | \nu ) } } \end{array}
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r l } & { = \displaystyle \int _ { \mathcal { X } } \left( \int _ { \mathcal { Z } } c ( x , T ( x , z ) ) d \lambda ( z ) \right) d \mu ( x ) + \int c _ { 2 } ( \xi ( x ) ) d \mu ( x ) + D _ { \psi } ( T _ { \# } ( \xi \mu \times \lambda ) | \nu ) } \\ & { \geq L _ { \psi } ( \mu , \nu ) . } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Since this inequality holds for any $\gamma$ , this implies that $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu ) \geq L _ { \psi } ( \mu , \nu )$ , which completes the proof.
|
| 393 |
+
|
| 394 |
+
Due to the near equivalence of the formulations, several theoretical results for (6) follow from the analysis of optimal entropy-transport by Liero et al. (2018), such as the following existence and uniqueness result:
|
| 395 |
+
|
| 396 |
+
Proposition B.1. Suppose $L _ { \psi } ( \mu , \nu ) < \infty$ , $c _ { 2 }$ is convex and lower semi-continuous, and $( \mathcal { Z } , B ( \mathcal { Z } ) , \lambda )$ is atomless. If $( i ) c _ { 1 }$ has compact sublevel sets in $\mathcal { X } \times \mathcal { V }$ and $c _ { 2 \infty } ^ { \prime } + \psi _ { \infty } ^ { \prime } > 0$ , or (ii) $c _ { 2 \infty } ^ { \prime } = \psi _ { \infty } ^ { \prime } = \infty$ then $a$ minimizer of $L _ { \psi } ( \mu , \nu )$ exists. If $c _ { 2 } , \psi$ are strictly convex, $\psi _ { \infty } ^ { \prime } = \infty$ and $c _ { 1 }$ satisfies Corollary 3.6 (Liero et al., 2018), then the joint measure $\gamma$ specified by any minimizer of $L _ { \psi } ( \mu , \nu )$ is unique.
|
| 397 |
+
|
| 398 |
+
Proof of Proposition B.1. Note that $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ is equivalent to $W _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ when $\mathcal { X }$ is restricted to the support of $\mu$ . If $c _ { 1 } , c _ { 2 } , \psi$ satisfy (i) or (ii), they also satisfy (i) and (ii) when $\mathcal { X }$ is restricted to the support of $\mu$ . By Theorem 3.3 of (Liero et al., 2018), $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ has a minimizer. It follows from the construction of the proof of Lemma 3.3 that a minimizer of $L _ { \psi } ( \mu , \nu )$ also exists. For uniqueness, if $\psi _ { \infty } ^ { \prime } = \infty$ , then it follows from Lemma 3.5 of (Liero et al., 2018) and the fact that minimizers are restricted to $\mathcal { G }$ that the marginals $\pi _ { \# } ^ { \chi } \gamma$ $\pi _ { \# } ^ { y } \gamma$ are uniquely determined for any solution $\gamma$ of $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \psi } ( \mu , \nu )$ . The uniqueness of $\gamma$ then follows from the proof of Corollary 3.6 in (Liero et al., 2018). It follows from the construction of the proof of Lemma 3.3 that the product measure generated by the minimizers of $L _ { \psi } ( \mu , \nu )$ is unique, which completes the proof. □
|
| 399 |
+
|
| 400 |
+
For certain cost functions and divergences, it can be shown that $L _ { \psi }$ defines a proper metric between positive measures $\mu$ and $\nu$ , i.e. taking $c _ { 2 } , \psi$ to be entropy functions corresponding to the KL-divergence and $c _ { 1 } = \log \cos _ { + } ^ { 2 } ( d ( x , y ) )$ , then $L _ { \psi } ( \mu , \nu )$ corresponds to the Hellinger-Kantorovich (Liero et al., 2018) or the Wasserstein-Fisher-Rao (Chizat et al., 2018) metric between positive measures $\mu$ and $\nu$ .
|
| 401 |
+
|
| 402 |
+
Based on Lemma 3.3, the theoretical analysis of Liero et al. (2018), and standard results on constrained optimization, it can be shown that for an appropriate and sufficiently large choice of divergence penalty, solutions of the relaxed problem (6) converge to solutions of the original problem (5) (Theorem 3.4).
|
| 403 |
+
|
| 404 |
+
Proof of Theorem 3.4. Since $\zeta ^ { k } \psi ( s )$ converges pointwise to the equality constraint $\iota _ { = } ( s )$ , which is 0 for $s = 1$ and $\infty$ otherwise, by Lemma 3.9 in (Liero et al., 2018), we have that $\begin{array} { r } { \operatorname* { l i m } \operatorname* { i n f } _ { k \infty } \tilde { W } _ { c _ { 1 } , c _ { 2 } , \zeta ^ { k } \psi } ( \mu , \nu ) \geq } \end{array}$ $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu )$ . Additionally, $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \zeta ^ { k } \psi } ( \mu , \nu ) \leq \tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu )$ for any value of $k$ since for any minimizer $\gamma$ of $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu )$ , it holds that $\pi _ { \# } ^ { y } \gamma = \nu$ . Hence
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { \mathbb { C } } } ( \mu , \nu ) = \int c _ { 1 } d \gamma + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \chi } \gamma | \mu ) + D _ { \zeta ^ { k } \psi _ { 2 } } ( \pi _ { \# } ^ { \ y } \gamma | \nu ) \geq \tilde { W } _ { c _ { 1 } , c _ { 2 } , \zeta ^ { k } \psi } ( \mu , \nu ) ,
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
for all $k$ . Therefore, $\begin{array} { r } { \operatorname* { l i m } _ { k \to \infty } \tilde { W } _ { c _ { 1 } , c _ { 2 } , \zeta ^ { k } \psi } ( \mu , \nu ) = \tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu ) } \end{array}$ , which then by Lemma 3.3 implies the first part of the proposition.
|
| 411 |
+
|
| 412 |
+
For the second part, by the hypothesis we have that $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu ) = C < \infty$ and as a consequence $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \zeta ^ { k } \psi } ( \mu , \nu ) \leq C$ for all $k$ . Hence, by Proposition 2.10 in (Liero et al., 2018), the sequence of minimizers $\gamma ^ { k }$ is bounded. If the assumptions of Proposition B.1 are satisfied, then the sequence $\gamma ^ { k }$ is equally tight. For assumption (ii) this follows by Proposition 2.10 in (Liero et al., 2018) and for assumption (i) this follows by the Markov inequality: for any $\lambda > 0$ ,
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\gamma ^ { k } ( \{ ( x , y ) \in \mathcal { X } \times \mathcal { Y } | c _ { 1 } ( x , y ) > \lambda \} ) \le \frac { 1 } { \lambda } \int c _ { 1 } d \gamma ^ { k } \le \frac { C } { \lambda } .
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Since $\gamma ^ { k }$ are bounded and equally tight, by an extension of Prokhorov’s theorem (Theorem 2.2 of (Liero et al., 2018)), there exists a subsequence of $\gamma ^ { k }$ that is weakly convergent to some $\bar { \gamma }$ . Then by lower semicontinuity, we obtain that
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\int c _ { 1 } d \bar { \gamma } + D _ { c _ { 2 } } ( \pi _ { \# } ^ { \mathcal { X } } \bar { \gamma } | \mu ) + \operatorname* { l i m } _ { k \to \infty } D _ { \zeta ^ { k } \psi _ { 2 } } ( \pi _ { \# } ^ { \mathcal { Y } } \gamma ^ { k } | \nu ) \leq \tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu ) = C
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
Since $D _ { \zeta ^ { k } \psi } ( \pi _ { \# } ^ { y } \gamma ^ { k } | \nu ) = \zeta ^ { k } D _ { \psi } ( \pi _ { \# } ^ { y } \gamma ^ { k } | \nu ) \geq 0$ and $\zeta ^ { k } \to \infty$ , for the left side to be finite, $D _ { \psi } ( \pi _ { \# } ^ { y } \gamma ^ { k } | \nu )$ must converge to $0$ , so $D _ { \psi } ( \pi _ { \# } ^ { y } \bar { \gamma } | \nu ) = 0$ by lower semicontinuity. Therefore, $\bar { \gamma }$ is a minimizer of $\tilde { W } _ { c _ { 1 } , c _ { 2 } , \iota _ { = } } ( \mu , \nu )$ . By construction of the proof of Lemma 3.3, $\gamma ^ { k }$ is equivalent to the product measure induced by minimizers of $L _ { \zeta ^ { k } \psi } ( \mu , \nu )$ , which implies the second part of the proposition. □
|
| 425 |
+
|
| 426 |
+
# B.2 CONVEX CONJUGATE FORM OF DIVERGENCES
|
| 427 |
+
|
| 428 |
+
In this section, we present the convex conjugate form of $\psi$ -divergence used to rewrite the main objective as a min-max problem.
|
| 429 |
+
|
| 430 |
+
Lemma B.2. For non-negative finite measures $P , Q$ over $\mathcal { T } \subset \mathbb { R } ^ { d }$ , it holds that
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
D _ { \psi } ( P | Q ) \geq \operatorname* { s u p } _ { f \in { \mathcal { F } } } \int f d P - \psi ^ { * } ( f ) d Q
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
where $\mathcal { F }$ is a subset of measurable functions $\{ f : \mathcal { T } \to ( - \infty , \psi _ { \infty } ^ { \prime } ] \}$ . Equality holds if and only $i f \exists f \in { \mathcal { F } }$ such that (i) the restriction of $f$ to the support of $Q$ belongs to the subdifferential of $\psi ( { \frac { d P } { d Q } } )$ , i.e. the Radon-Nikodym derivative of $P$ with respect to $Q$ and (ii) $f = \psi _ { \infty } ^ { \prime }$ over the support of $P ^ { \perp }$ .
|
| 437 |
+
|
| 438 |
+
We provide a simple proof of this result. A similar result under stronger assumptions was shown in Nguyen et al. (2008) and used by Nowozin et al. (2016) for generative modeling. A rigorous proof can be found in Liero et al. (2018).
|
| 439 |
+
|
| 440 |
+
Proof of Lemma B.2. Note that
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\begin{array} { r l } & { D _ { \varphi } ( P | Q ) = \psi _ { \infty } ^ { \prime } P _ { \perp } ( T ) + \int _ { T } \psi \left( \frac { d P } { d Q } \right) d Q } \\ & { \quad \quad \quad = \psi _ { \infty } ^ { \prime } P _ { \perp } ( T ) + \int _ { T \in \cup \operatorname { i n f } } \{ \frac { d P } { d Q } - \psi ^ { \prime } ( \xi ) \} d Q } \\ & { \quad \quad \quad \quad ( \mathrm { b y ~ d e i n i o n ~ o f ~ c o m e x ~ c o n i n g ~ a t e } ) } \\ & { \quad \quad \quad = \psi _ { \infty } ^ { \prime } P _ { \perp } ( T ) + \int _ { T \in \{ c = - \infty , \psi _ { \infty } ^ { \prime } \} } \{ \xi \frac { d P } { d Q } - \psi ^ { \prime } ( \xi ) \} d Q } \\ & { \quad \quad \quad ( \mathrm { b y ~ L o m u a B . } ) \mathrm { b z ~ i s f o r ~ } } \\ & { \quad \quad \quad = \int _ { T \in \{ c = - \infty , \psi _ { \infty } ^ { \prime } \} } \{ \xi d P _ { \perp } + \xi \frac { d P } { d Q } d Q - \psi ^ { \prime } ( \xi ) d Q \} } \\ & { \quad \quad \quad = \operatorname* { s u p } _ { \xi \in \mathcal { S } } \int _ { T } d \phi - \psi ^ { \prime } ( f ) d \phi . } \end{array}
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
By first-order optimality conditions, the optimal $f$ over the support of $Q$ is obtained when $\textstyle { \frac { d P } { d Q } }$ belongs to the subdifferential of $\psi ^ { * } ( f )$ , or equivalently when $f$ belongs to the subdifferential of $\psi ( { \frac { d P } { d Q } } )$ . It is straightforward to see that the optimal $f$ over the support of $P _ { \perp }$ is equal to $\psi _ { \infty } ^ { \prime }$ , which completes the proof. □
|
| 447 |
+
|
| 448 |
+
Lemma B.3. If $\begin{array} { r } { \dot { \boldsymbol { \xi } } > \psi _ { \infty } ^ { \prime } : = \operatorname* { l i m } _ { s \to \infty } \frac { \psi ( s ) } { s } } \end{array}$ ψ(s) , then ψ∗(ξ) = ∞.
|
| 449 |
+
|
| 450 |
+
Proof.
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\begin{array} { l } { \displaystyle \psi ^ { * } ( \xi ) = \underset { s \in \mathbb { R } } { \operatorname* { s u p } } s \xi - \psi ( s ) } \\ { \displaystyle \qquad \geq \underset { s \infty } { \operatorname* { l i m } } s ( \xi - \frac { \psi ( s ) } { s } ) } \\ { \displaystyle = \infty \mathrm { ~ i f ~ } \xi > \psi _ { \infty } ^ { \prime } } \end{array}
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
# C PRACTICAL CONSIDERATIONS FOR NUMERICAL EXPERIMENTS
|
| 457 |
+
|
| 458 |
+
Choice of cost functions. Proposition B.1 gives sufficient conditions on $c _ { 1 } , c _ { 2 }$ for the problem to be wellposed. In practice, it is often convenient the cost of transport, $c _ { 1 }$ , to be some measurement of correspondence between $\mathcal { X }$ and $\mathcal { V }$ . For example, we can take $c _ { 1 } ( x , y )$ to be the Euclidean distance between $x$ and $y$ after mapping them to some common feature space. For the cost of mass adjustment, $c _ { 2 }$ , it is generally sensible to choose some convex function that vanishes at 1 (i.e. no mass adjustment) and such that $\begin{array} { r } { \operatorname* { l i m } _ { x 0 } c _ { 2 } ( x ) = } \end{array}$ $\begin{array} { r } { \operatorname* { l i m } _ { x \infty } c _ { 2 } ( x ) = \infty } \end{array}$ to prevent $\xi$ from becoming too small or too large. Any of the entropy functions shown in Table 1 are reasonable choices.
|
| 459 |
+
|
| 460 |
+
<table><tr><td rowspan=1 colspan=1>Name</td><td rowspan=1 colspan=1>(s)</td><td rowspan=1 colspan=1>D(P|Q)</td><td rowspan=1 colspan=1>*(s)</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>Activation Layer</td></tr><tr><td rowspan=1 colspan=1>Kullback-Leibler (KL)</td><td rowspan=1 colspan=1>slogs-s+1</td><td rowspan=1 colspan=1>ʃlogddP-ʃdP+ʃdQ</td><td rowspan=1 colspan=1>e</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>N/A</td></tr><tr><td rowspan=1 colspan=1>Pearson x²</td><td rowspan=1 colspan=1>(s-1)²</td><td rowspan=1 colspan=1>器-1)2dQ</td><td rowspan=1 colspan=1>+s</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>N/A</td></tr><tr><td rowspan=1 colspan=1>Hellinger</td><td rowspan=1 colspan=1>(√s-1)²</td><td rowspan=1 colspan=1>品一1)²dQ</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1-es</td></tr><tr><td rowspan=1 colspan=1>Jensen-Shannon</td><td rowspan=1 colspan=1>slogs-(s+1)logs1</td><td rowspan=1 colspan=1>1DKL(P|PQ+DKL(QIP+Q)</td><td rowspan=1 colspan=1>-log(2-e)</td><td rowspan=1 colspan=1>log2</td><td rowspan=1 colspan=1>log(2)-log(1+e-))</td></tr></table>
|
| 461 |
+
|
| 462 |
+
Table 1: Table of some common $\psi$ -divergences, associated entropy functions $\psi$ , and convex conjugates $\psi ^ { * }$ for Algorithm 1, partly adapted from (Nowozin et al., 2016).
|
| 463 |
+
|
| 464 |
+
Choice of $\psi$ . In Nowozin et al. (2016), it was shown that any $\psi$ -divergence could be used to train generative models, i.e. to match a generated distribution $P$ to a true data distribution $Q$ . This is due to Jensen’s inequality: for any convex lower semi-continous entropy function $\psi$ , $D _ { \psi } ( P | Q )$ is uniquely minimized when $P = Q$ , where $P , Q$ are probability measures. However, this does not generally hold when $P , Q$ are not probability measures, as illustrated by the following example.
|
| 465 |
+
|
| 466 |
+
Example C.1. In the original GAN paper, the discrminative objective,
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\operatorname* { s u p } _ { f } \int \log f ( x ) d P ( x ) - \int \log ( 1 - f ( x ) ) d Q ( x ) ,
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
corresponds to $D _ { \psi } ( P | Q )$ with $\psi ( s ) = s \log s - ( s + 1 ) \log ( s + 1 )$ (Nowozin et al., 2016). If $P , Q$ are probability measures, this divergence is equivalent to the Jensen-Shannon divergence and is minimized when $P = Q$ . If $P , Q$ are non-negative measures with unconstrained total mass, the divergence is minimized when $P = \infty$ and $Q = 0$ .
|
| 473 |
+
|
| 474 |
+
When $P , Q$ are not probability measures, we require an additional constraint on $\psi$ to ensure that divergence minimization matchces $P$ to $Q$ :
|
| 475 |
+
|
| 476 |
+
Lemma C.2. Suppose $P , Q$ are non-negative finite measures over $T \subseteq \mathbb { R } ^ { n }$ . If $\psi ( s )$ attains a unique minimum at $s = 1$ with $\psi ( 1 ) = 0$ and $\psi _ { \infty } ^ { \prime } > 0$ , then ${ \dot { D } } _ { \psi } ( P | Q ) = 0 \Rightarrow P = Q$ . Otherwise, then $P \neq Q$ in general when $D _ { \psi } ( P | Q )$ is minimized.
|
| 477 |
+
|
| 478 |
+
Proof. Suppose $\psi ( s )$ attains a unique minimum at $s = 1$ with $\psi ( 1 ) = 0$ , $\psi _ { \infty } ^ { \prime } > 0$ , and $P \neq Q$ over a region with positive measure. It is straightforward to see by the definition in (4) that $D _ { \psi } ( P | Q ) > 0$ , since at least one of the two terms will be strictly positive. Therefore, the first statement holds. For the second statement, suppose either $\psi ( s )$ does not attain a unique minimum at $s = 1$ or $\psi _ { \infty } ^ { \prime } \leq 0$ . If $\psi ( s )$ attains a minimum at some $s ^ { \prime } \neq 1$ , then taking $P = s ^ { \prime } Q$ results in a divergence that is equal to or less than $P = Q$ . If $\psi _ { \infty } ^ { \prime } \leq 0$ , then letting $P = Q + P _ { \perp }$ where $P _ { \perp }$ is a positive measure orthogonal to $Q$ results in a divergence that is equal to or less than $P = Q$ . □
|
| 479 |
+
|
| 480 |
+
Table 1 provides some examples of $\psi$ corresponding to common divergences that can be used for unbalanced OT.
|
| 481 |
+
|
| 482 |
+
Choice of $f$ . According to Lemma B.2, $f$ should belong to a class of functions that maps from $\mathcal { V }$ to $\left( - \infty , \psi _ { \infty } ^ { \prime } \right]$ . In practice, this can be enforced by parameterizing $f$ using a neural network with a final layer that maps to the correct range, also known as an output activation layer (Nowozin et al., 2016). Table 1 provides some examples of activation layers that can be used.
|
| 483 |
+
|
| 484 |
+
Choice of neural architectures. For our experiments in Section 4, we used fully-connected feedforward networks with 3 hidden layers and ReLU activations. For $T$ , the output activation layer was a sigmoid function to map the final pixel brightness to the range $( 0 , 1 )$ . For $\xi$ , the output activation layer was a softplus function to map the scaling factor weight to the range $( 0 , \infty )$ .
|
| 485 |
+
|
| 486 |
+
Gradient penalties. The training of GANs using alternating stochastic gradient descent is not guaranteed to converge locally (Mescheder et al., 2018). Stability can be improved using regularization in the form of added instance noise (Arjovsky & Bottou, 2017) or gradient penalties (Gulrajani et al., 2017). We observed that enforcing gradient penalities on $\xi$ and $f$ , while not necessary, improved the stability of Algorithm 1. A gradient penalty on $\xi$ effectively restricts the search to sufficiently smooth $\xi$ , which is reasonable in practice considering that similar regions of the source measure often have similar rates of growth or contraction. A gradient penalty on $f$ changes the nature of the relaxation from (5) to (6): the right-hand side of (7) is no longer equivalent to the $\psi$ -divergence, but is rather a lower-bound with a relation to bounded Lipschitz metrics (Gulrajani et al., 2017). In this case, while the problem formulation is not equivalent to optimal entropy-transport, it is still a valid relaxation of unbalanced Monge OT in (5).
|
| 487 |
+
|
| 488 |
+
Choice of $\lambda$ . One can take $\lambda$ to be the standard Gaussian measure if a stochastic mapping is desired, similar to Almahairi et al. (2018). If a deterministic mapping is desired, then $\lambda$ is set to a deterministic distribution.
|
| 489 |
+
|
| 490 |
+
Improved training dynamics. Recall that the objective function for our alternating gradient updates is
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\begin{array} { l } { \displaystyle \ell ( \theta , \phi , \omega ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } [ c _ { \mu } c _ { 1 } ( x _ { i } , T _ { \theta } ( x _ { i } , z _ { i } ) ) \xi _ { \phi } ( x _ { i } ) + c _ { \mu } c _ { 2 } ( \xi _ { \phi } ( x _ { i } ) ) } \\ { \displaystyle + c _ { \mu } \xi _ { \phi } ( x _ { i } ) f _ { \omega } ( T _ { \theta } ( x _ { i } , z _ { i } ) ) - c _ { \nu } \psi ^ { * } ( f _ { \omega } ( y _ { i } ) ) ] . } \end{array}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
Early in training, $\xi _ { \phi }$ can become very small for some $x _ { i }$ as none of the transported samples resemble samples from the target distribution. As a result, $T _ { \theta }$ may improve very slowly for some inputs $x _ { i }$ . One way to address this issue without changing the fixed point is to update $\xi _ { \phi } , f _ { \omega }$ using the above objective and update $T _ { \theta }$ using the following objective.
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
\ell ( \theta , \phi , \omega ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } c _ { \mu } [ c _ { 1 } ( x _ { i } , T _ { \theta } ( x _ { i } , z _ { i } ) ) + f _ { \omega } ( T _ { \theta } ( x _ { i } , z _ { i } ) ) ]
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
Note that we have omitted terms in the original objective that do not include $T _ { \theta }$ , and which therefore do not affect the gradient update. For the terms that remain, the difference is that we are rescaling the contribution of each sample $x _ { i }$ by $1 / \xi ( x _ { i } )$ . As long as $\xi ( x _ { i } ) > 0$ , this has the effect of rescaling the gradient update of the loss function with respect to each $T _ { \theta } ( x _ { i } , z _ { i } )$ without changing the direction of the update.
|
md/train/HylVB3AqYm/HylVB3AqYm.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PROXYLESSNAS: DIRECT NEURAL ARCHITECTURE SEARCH ON TARGET TASK AND HARDWARE
|
| 2 |
+
|
| 3 |
+
Han Cai, Ligeng Zhu, Song Han Massachusetts Institute of Technology {hancai, ligeng, songhan}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural architecture search (NAS) has a great impact by automatically designing effective neural network architectures. However, the prohibitive computational demand of conventional NAS algorithms (e.g. $1 0 ^ { 4 }$ GPU hours) makes it difficult to directly search the architectures on large-scale tasks (e.g. ImageNet). Differentiable NAS can reduce the cost of GPU hours via a continuous representation of network architecture but suffers from the high GPU memory consumption issue (grow linearly w.r.t. candidate set size). As a result, they need to utilize proxy tasks, such as training on a smaller dataset, or learning with only a few blocks, or training just for a few epochs. These architectures optimized on proxy tasks are not guaranteed to be optimal on the target task. In this paper, we present ProxylessNAS that can directly learn the architectures for large-scale target tasks and target hardware platforms. We address the high memory consumption issue of differentiable NAS and reduce the computational cost (GPU hours and GPU memory) to the same level of regular training while still allowing a large candidate set. Experiments on CIFAR-10 and ImageNet demonstrate the effectiveness of directness and specialization. On CIFAR-10, our model achieves $2 . 0 8 \%$ test error with only 5.7M parameters, better than the previous state-of-the-art architecture AmoebaNet-B, while using $6 \times$ fewer parameters. On ImageNet, our model achieves $3 . 1 \%$ better top-1 accuracy than MobileNetV2, while being $1 . 2 \times$ faster with measured GPU latency. We also apply ProxylessNAS to specialize neural architectures for hardware with direct hardware metrics (e.g. latency) and provide insights for efficient CNN architecture design.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural architecture search (NAS) has demonstrated much success in automating neural network architecture design for various deep learning tasks, such as image recognition (Zoph et al., 2018; Cai et al., 2018a; Liu et al., 2018a; Zhong et al., 2018) and language modeling (Zoph & Le, 2017). Despite the remarkable results, conventional NAS algorithms are prohibitively computation-intensive, requiring to train thousands of models on the target task in a single experiment. Therefore, directly applying NAS to a large-scale task (e.g. ImageNet) is computationally expensive or impossible, which makes it difficult for making practical industry impact. As a trade-off, Zoph et al. (2018) propose to search for building blocks on proxy tasks, such as training for fewer epochs, starting with a smaller dataset (e.g. CIFAR-10), or learning with fewer blocks. Then top-performing blocks are stacked and transferred to the large-scale target task. This paradigm has been widely adopted in subsequent NAS algorithms (Liu et al., 2018a;b; Real et al., 2018; Cai et al., 2018b; Liu et al., 2018c; Tan et al., 2018; Luo et al., 2018).
|
| 12 |
+
|
| 13 |
+
However, these blocks optimized on proxy tasks are not guaranteed to be optimal on the target task, especially when taking hardware metrics such as latency into consideration. More importantly, to enable transferability, such methods need to search for only a few architectural motifs and then repeatedly stack the same pattern, which restricts the block diversity and thereby harms performance.
|
| 14 |
+
|
| 15 |
+
In this work, we propose a simple and effective solution to the aforementioned limitations, called ProxylessNAS, which directly learns the architectures on the target task and hardware instead of with proxy (Figure 1). We also remove the restriction of repeating blocks in previous NAS works (Zoph et al., 2018; Liu et al., 2018c) and allow all of the blocks to be learned and specified. To achieve GPU Hours GPU Memory this, we reduce the computational cost (GPU hours and GPU memory) of architecture search to the same level of regular training in the following ways.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: ProxylessNAS directly optimizes neural network architectures on target task and hardware. Benefiting from the directness and specialization, ProxylessNAS can achieve remarkably better results than previous proxy-based approaches. On ImageNet, with only 200 GPU hours (200 $\times$ fewer than MnasNet (Tan et al., 2018)), our searched CNN model for mobile achieves the same level of top-1 accuracy as MobileNetV2 1.4 while being $1 . 8 \times$ faster.
|
| 19 |
+
|
| 20 |
+
GPU hour-wise, inspired by recent works (Liu et al., 2018c; Bender et al., 2018), we formulate NAS as a path-level pruning process. Specifically, we directly train an over-parameterized network that contains all candidate paths (Figure 2). During training, we explicitly introduce architecture parameters to learn which paths are redundant, while these redundant paths are pruned at the end of training to get a compact optimized architecture. In this way, we only need to train a single network without any meta-controller (or hypernetwork) during architecture search.
|
| 21 |
+
|
| 22 |
+
However, naively including all the candidate paths leads to GPU memory explosion (Liu et al., Normal Train NAS DARTS & One-shot Proxyless (Ours)2018c; Bender et al., 2018), as the memory consumption grows linearly w.r.t. the number of choices. Need Proxy Need Proxy No ProxyThus, GPU memory-wise, we binarize the architecture parameters (1 or 0) and force only one path to be active at run-time, which reduces the required memory to the same level of training a compact model. We propose a gradient-based approach to train these binarized parameters based on BinaryConnect (Courbariaux et al., 2015). Furthermore, to handle non-differentiable hardware objectives (using latency as an example) for learning specialized network architectures on target hardware, we model network latency as a continuous function and optimize it as regularization loss. Additionally, we also present a REINFORCE-based (Williams, 1992) algorithm as an alternative strategy to handle hardware metrics.
|
| 23 |
+
|
| 24 |
+
In our experiments on CIFAR-10 and ImageNet, benefiting from the directness and specialization, our method can achieve strong empirical results. On CIFAR-10, our model reaches $2 . 0 8 \%$ test error with only 5.7M parameters. On ImageNet, our model achieves $7 5 . 1 \%$ top-1 accuracy which is $3 . 1 \%$ higher than MobileNetV2 (Sandler et al., 2018) while being $1 . 2 \times$ faster. Our contributions can be summarized as follows:
|
| 25 |
+
|
| 26 |
+
• ProxylessNAS is the first NAS algorithm that directly learns architectures on the largescale dataset (e.g. ImageNet) without any proxy while still allowing a large candidate set and removing the restriction of repeating blocks. It effectively enlarged the search space and achieved better performance.
|
| 27 |
+
• We provide a new path-level pruning perspective for NAS, showing a close connection between NAS and model compression (Han et al., 2016). We save memory consumption by one order of magnitude by using path-level binarization.
|
| 28 |
+
• We propose a novel gradient-based approach (latency regularization loss) for handling hardware objectives (e.g. latency). Given different hardware platforms: CPU/GPU/Mobile, ProxylessNAS enables hardware-aware neural network specialization that’s exactly optimized for the target hardware. To our best knowledge, it is the first work to study specialized neural network architectures for different hardware architectures. Extensive experiments showed the advantage of the directness property and the specialization property of ProxylessNAS. It achieved state-of-the-art accuracy performances on CIFAR-10 and ImageNet under latency constraints on different hardware platforms (GPU, CPU and mobile phone). We also analyze the insights of efficient CNN models specialized for different hardware platforms and raise the awareness that specialized neural network architecture is needed on different hardware architectures for efficient inference.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
The use of machine learning techniques, such as reinforcement learning or neuro-evolution, to replace human experts in designing neural network architectures, usually referred to as neural architecture search, has drawn an increasing interest (Zoph & Le, 2017; Liu et al., 2018a;b;c; Cai et al., 2018a;b; Pham et al., 2018; Brock et al., 2018; Bender et al., 2018; Elsken et al., 2017; 2018b; Kamath et al., 2018). In NAS, architecture search is typically considered as a meta-learning process, and a meta-controller (e.g. a recurrent neural network (RNN)), is introduced to explore a given architecture space with training a network in the inner loop to get an evaluation for guiding exploration. Consequently, such methods are computationally expensive to run, especially on large-scale tasks, e.g. ImageNet.
|
| 33 |
+
|
| 34 |
+
Some recent works (Brock et al., 2018; Pham et al., 2018) try to improve the efficiency of this meta-learning process by reducing the cost of getting an evaluation. In Brock et al. (2018), a hypernetwork is utilized to generate weights for each sampled network and hence can evaluate the architecture without training it. Similarly, Pham et al. (2018) propose to share weights among all sampled networks under the standard NAS framework (Zoph & Le, 2017). These methods speed up architecture search by orders of magnitude, however, they require a hypernetwork or an RNN controller and mainly focus on small-scale tasks (e.g. CIFAR) rather than large-scale tasks (e.g. ImageNet).
|
| 35 |
+
|
| 36 |
+
Our work is most closely related to One-Shot (Bender et al., 2018) and DARTS (Liu et al., 2018c), both of which get rid of the meta-controller (or hypernetwork) by modeling NAS as a single training process of an over-parameterized network that comprises all candidate paths. Specifically, OneShot trains the over-parameterized network with DropPath (Zoph et al., 2018) that drops out each path with some fixed probability. Then they use the pre-trained over-parameterized network to evaluate architectures, which are sampled by randomly zeroing out paths. DARTS additionally introduces a real-valued architecture parameter for each path and jointly train weight parameters and architecture parameters via standard gradient descent. However, they suffer from the large GPU memory consumption issue and hence still need to utilize proxy tasks. In this work, we address the large memory issue in these two methods through path binarization.
|
| 37 |
+
|
| 38 |
+
Another relevant topic is network pruning (Han et al., 2016) that aim to improve the efficiency of neural networks by removing insignificant neurons (Han et al., 2015) or channels (Liu et al., 2017). Similar to these works, we start with an over-parameterized network and then prune the redundant parts to derive the optimized architecture. The distinction is that they focus on layer-level pruning that only modifies the filter (or units) number of a layer but can not change the topology of the network, while we focus on learning effective network architectures through path-level pruning. We also allow both pruning and growing the number of layers.
|
| 39 |
+
|
| 40 |
+
# 3 METHOD
|
| 41 |
+
|
| 42 |
+
We first describe the construction of the over-parameterized network with all candidate paths, then introduce how we leverage binarized architecture parameters to reduce the memory consumption of training the over-parameterized network to the same level as regular training. We propose a gradient-based algorithm to train these binarized architecture parameters. Finally, we present two techniques to handle non-differentiable objectives (e.g. latency) for specializing neural networks on target hardware.
|
| 43 |
+
|
| 44 |
+
# 3.1 CONSTRUCTION OF OVER-PARAMETERIZED NETWORK
|
| 45 |
+
|
| 46 |
+
Denote a neural network as $\mathcal { N } ( e , \cdots , e _ { n } )$ where $e _ { i }$ represents a certain edge in the directed acyclic graph (DAG). Let $\mathcal { O } = \{ o _ { i } \}$ be the set of $N$ candidate primitive operations (e.g. convolution, pooling, identity, zero, etc). To construct the over-parameterized network that includes any architecture in the search space, instead of setting each edge to be a definite primitive operation, we set each edge to be a mixed operation that has $N$ parallel paths (Figure 2), denoted as $m _ { \mathcal { O } }$ . As such, the over-parameterized network can be expressed as $\mathcal { N } ( e = m _ { \ O } ^ { 1 } , \cdot \cdot \cdot , e _ { n } = m _ { \ O } ^ { n } )$ ).
|
| 47 |
+
|
| 48 |
+
Given input $x$ , the output of a mixed operation $m _ { \mathcal { O } }$ is defined based on the outputs of its $N$ paths. In One-Shot, $m _ { \mathcal { O } } ( x )$ is the sum of $\{ o _ { i } ( x ) \}$ , while in DARTS, $m _ { \mathcal { O } } ( x )$ is weighted sum of $\{ o _ { i } ( x ) \}$ where the weights are calculated by applying softmax to $N$ real-valued architecture parameters $\left\{ \alpha _ { i } \right\}$
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Learning both weight parameters and binarized architecture parameters.
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
m _ { \mathcal { O } } ^ { \mathrm { { O n e - S h o t } } } ( x ) = \sum _ { i = 1 } ^ { N } o _ { i } ( x ) , \qquad m _ { \mathcal { O } } ^ { \mathrm { { D A R T S } } } ( x ) = \sum _ { i = 1 } ^ { N } p _ { i } o _ { i } ( x ) = \sum _ { i = 1 } ^ { N } \frac { \exp ( \alpha _ { i } ) } { \sum _ { j } \exp ( \alpha _ { j } ) } o _ { i } ( x ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
As shown in Eq. (1), the output feature maps of all $\mathbf { N }$ paths are calculated and stored in the memory, while training a compact model only involves one path. Therefore, One-Shot and DARTS roughly need $N$ Direct measurement:expensive and slow Latcheap, fatimes GPU memory and GPU hours compared to training a compact model. On largescale dataset, this can easily exceed the memory limits of hardware with large design space. In the following section, we solve this memory issue based on the idea of path binarization.
|
| 58 |
+
|
| 59 |
+
# 3.2 LEARNING BINARIZED PATH
|
| 60 |
+
|
| 61 |
+
To reduce memory footprint, we keep only one path when training the over-parameterized network. Unlike Courbariaux et al. (2015) which binarize individual weights, we binarize entire paths. We introduce $N$ real-valued architecture parameters $\{ \alpha _ { i } \}$ and then transforms the real-valued path weights to binary gates:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
g = \mathrm { b i n a r i z e } ( p _ { 1 } , \cdots , p _ { N } ) = \left\{ \begin{array} { l l } { { { \left[ 1 , 0 , \cdots ~ , 0 \right] } } } & { { \mathrm { w i t h ~ p r o b a b i l i t y } ~ p _ { 1 } , } } \\ { { \cdots } } & { { } } \\ { { \left[ 0 , 0 , \cdots ~ , 1 \right] } } & { { \mathrm { w i t h ~ p r o b a b i l i t y } ~ p _ { N } . } } \end{array} \right.
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Based on the binary gates $g$ i 5x53x3 , the output of the mixed operation is given as:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
m _ { \mathcal { O } } ^ { \mathrm { B i n a r y } } ( x ) = \sum _ { i = 1 } ^ { N } g _ { i } o _ { i } ( x ) = \left\{ { \begin{array} { l l } { o _ { 1 } ( x ) } & { \mathrm { w i t h ~ p r o b a b i l i t y } ~ p _ { 1 } } \\ { \cdots } & { } \\ { o _ { N } ( x ) } & { \mathrm { w i t h ~ p r o b a b i l i t y } ~ p _ { N } . } \end{array} } \right. .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
As illustrated in Eq. (3) and Figure 2, by using the binary gates rather than real-valued path weights (Liu et al., 2018c), only one path of activation is active in memory at run-time and the memory requirement of training the over-parameterized network is thus reduced to the same level of training a compact model. That’s more than an order of magnitude memory saving.
|
| 74 |
+
|
| 75 |
+
# 3.2.1 TRAINING BINARIZED ARCHITECTURE PARAMETERS
|
| 76 |
+
|
| 77 |
+
MIT Red-1Figure 2 illustrates the training procedure of the weight parameters and binarized architecture parameters in the over-parameterized network. When training weight parameters, we first freeze the architecture parameters and stochastically sample binary gates according to Eq. (2) for each batch of input data. Then the weight parameters of active paths are updated via standard gradient descent on the training set (Figure 2 left). When training architecture parameters, the weight parameters are frozen, then we reset the binary gates and update the architecture parameters on the validation set (Figure 2 right). These two update steps are performed in an alternative manner. Once the training of architecture parameters is finished, we can then derive the compact architecture by pruning redundant paths. In this work, we simply choose the path with the highest path weight.
|
| 78 |
+
|
| 79 |
+
Unlike weight parameters, the architecture parameters are not directly involved in the computation graph and thereby cannot be updated using the standard gradient descent. In this section, we introduce a gradient-based approach to learn the architecture parameters.
|
| 80 |
+
|
| 81 |
+
In BinaryConnect (Courbariaux et al., 2015), the real-valued weight is updated using the gradient w.r.t. its corresponding binary gate. In our case, analogously, the gradient w.r.t. architecture parameters can be approximately estimated using $\partial L / \partial g _ { i }$ in replace of $\bar { \partial } L / \partial p _ { i }$ :
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\frac { \partial L } { \partial \alpha _ { i } } = \sum _ { j = 1 } ^ { N } \frac { \partial L } { \partial p _ { j } } \frac { \partial p _ { j } } { \partial \alpha _ { i } } \approx \sum _ { j = 1 } ^ { N } \frac { \partial L } { \partial g _ { j } } \frac { \partial p _ { j } } { \partial \alpha _ { i } } = \sum _ { j = 1 } ^ { N } \frac { \partial L } { \partial g _ { j } } \frac { \partial \bigg ( \frac { \exp ( \alpha _ { j } ) } { \sum _ { k } \exp ( \alpha _ { k } ) } \bigg ) } { \partial \alpha _ { i } } = \sum _ { j = 1 } ^ { N } \frac { \partial L } { \partial g _ { j } } p _ { j } \big ( \delta _ { i j } - p _ { i } \big ) ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\delta _ { i j } = 1$ if $i = j$ and $\delta _ { i j } = 0$ if $i \neq j$ . Since the binary gates $g$ are involved in the computation graph, as shown in Eq. (3), $\partial L / \partial g _ { j }$ can be calculated through backpropagation. However, computing $\partial L / \partial g _ { j }$ requires to calculate and store $o _ { j } ( x )$ . Therefore, directly using Eq. (4) to update the architecture parameters would also require roughly $N$ times GPU memory compared to training a compact model.
|
| 88 |
+
|
| 89 |
+
To address this issue, we consider factorizing the task of choosing one path out of $\mathbf { N }$ candidates into multiple binary selection tasks. The intuition is that if a path is the best choice at a particular position, it should be the better choice when solely compared to any other path.2
|
| 90 |
+
|
| 91 |
+
Following this idea, within an update step of the architecture parameters, we first sample two paths according to the multinomial distribution $( p _ { 1 } , \cdots , p _ { N } )$ and mask all the other paths as if they do not exist. As such the number of candidates temporarily decrease from $N$ to 2, while the path weights $\{ p _ { i } \}$ and binary gates $\{ g _ { i } \}$ are reset accordingly. Then we update the architecture parameters of these two sampled paths using the gradients calculated via Eq. (4). Finally, as path weights are computed by applying softmax to the architecture parameters, we need to rescale the value of these two updated architecture parameters by multiplying a ratio to keep the path weights of unsampled paths unchanged. As such, in each update step, one of the sampled paths is enhanced (path weight increases) and the other sampled path is attenuated (path weight decreases) while all other paths keep unchanged. In this way, regardless of the value of $N$ , only two paths are involved in each update step of the architecture parameters, and thereby the memory requirement is reduced to the same level of training a compact model.
|
| 92 |
+
|
| 93 |
+
# 3.3 HANDLING NON-DIFFERENTIABLE HARDWARE METRICS
|
| 94 |
+
|
| 95 |
+
Besides accuracy, latency (not FLOPs) is another very important objective when designing efficient neural network architectures for hardware. Unfortunately, unlike accuracy that can be optimized using the gradient of the loss function, latency is non-differentiable. In this section, we present two algorithms to handle the non-differentiable objectives.
|
| 96 |
+
|
| 97 |
+
# 3.3.1 MAKING LATENCY DIFFERENTIABLE
|
| 98 |
+
|
| 99 |
+
To make latency differentiable, we model the latency of a network as a continuous function of the neural network dimensions 3. Consider a mixed operation with a candidate set $\{ o _ { j } \}$ and each $o _ { j }$ is associated with a path weight $p _ { j }$ which represents the probability of choosing $o _ { j }$ . As such, we have the expected latency of a mixed operation (i.e. a learnable block) as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathbb { E } [ \mathrm { l a t e n c y } _ { i } ] = \sum _ { j } p _ { j } ^ { i } \times F ( o _ { j } ^ { i } ) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\mathbb { E } [ \mathrm { l a t e n c y } _ { i } ]$ is the expected latency of the $i ^ { t h }$ learnable block, $F ( \cdot )$ denotes the latency prediction model and $\bar { F } ( o _ { j } ^ { i } )$ is the predicted latency of $o _ { j } ^ { i }$ . The gradient of $\mathbb { E } [ \mathrm { l a t e n c y } _ { i } ]$ w.r.t. architecture parameters can thereby be given as: $\partial \mathbb { E } [ \mathrm { l a t e n c y } _ { i } ] / \partial p _ { j } ^ { i } = F ( o _ { j } ^ { i } ) .$ .
|
| 106 |
+
|
| 107 |
+
For the whole network with a sequence of mixed operations (Figure 3 left), since these operations are executed sequentially during inference, the expected latency of the network can be expressed with the sum of these mixed operations’ expected latencies:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathbb { E } [ \mathrm { l a t e n c y } ] = \sum _ { i } \mathbb { E } [ \mathrm { l a t e n c y } _ { i } ] ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Making latency differentiable by introducing latency regularization loss.
|
| 115 |
+
|
| 116 |
+
We incorporate the expected latency of the network into the normal loss function by multiplying a scaling factor $\lambda _ { 2 } ( > 0 \bar { ) }$ which controls the trade-off between accuracy and latency. The final loss function is given as (also shown in Figure 3 right)
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
L o s s = L o s s _ { C E } + \lambda _ { 1 } | | w | | _ { 2 } ^ { 2 } + \mathrm { ~ \qquad ~ } ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $L o s s _ { C E }$ denotes the cross-entropy loss and $\lambda _ { 1 } | | w | | _ { 2 } ^ { 2 }$ is the weight decay term.
|
| 123 |
+
|
| 124 |
+
# 3.3.2 REINFORCE-BASED APPROACH
|
| 125 |
+
|
| 126 |
+
As an alternative to BinaryConnect, we can utilize REINFORCE to train binarized weights as well. Consider a network that has binarized parameters $\alpha$ , the goal of updating binarized parameters is to find the optimal binary gates $g$ that maximizes a certain reward, denoted as $R ( \cdot )$ . Here we assume the network only has one mixed operation for ease of illustration. Therefore, according to REINFORCE (Williams, 1992), we have the following updates for binarized parameters:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r l } & { \quad J ( \alpha ) = \mathbb { E } _ { g \sim \alpha } [ R ( \mathcal { N } _ { g } ) ] = \displaystyle \sum _ { i } p _ { i } R ( \mathcal { N } ( e = o _ { i } ) ) , } \\ & { \quad \nabla _ { \alpha } J ( \alpha ) = \displaystyle \sum _ { i } R ( \mathcal { N } ( e = o _ { i } ) ) \nabla _ { \alpha } p _ { i } = \displaystyle \sum _ { i } R ( \mathcal { N } ( e = o _ { i } ) ) p _ { i } \nabla _ { \alpha } \log ( p _ { i } ) , } \\ & { \quad \quad \quad = \mathbb { E } _ { g \sim \alpha } [ R ( \mathcal { N } _ { g } ) \nabla _ { \alpha } \log ( p ( g ) ) ] \approx \displaystyle \frac { 1 } { M } \displaystyle \sum _ { i = 1 } ^ { M } R ( \mathcal { N } _ { g ^ { i } } ) \nabla _ { \alpha } \log ( p ( g ^ { i } ) ) , } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
where $g ^ { i }$ denotes the $i ^ { t h }$ sampled binary gates, $p ( g ^ { i } )$ denotes the probability of sampling $g ^ { i }$ according to Eq. (2) and $\mathcal { N } _ { g ^ { i } }$ is the compact network according to the binary gates $g ^ { i }$ . Since Eq. (8) does not require $R ( \mathcal { N } _ { g } )$ to be differentiable w.r.t. $g$ , it can thus handle non-differentiable objectives. An interesting observation is that Eq. (8) has a similar form to the standard NAS (Zoph & Le, 2017), while it is not a sequential decision-making process and no RNN meta-controller is used in our case. Furthermore, since both gradient-based updates and REINFORCE-based updates are essentially two different update rules to the same binarized architecture parameters, it is possible to combine them to form a new update rule for the architecture parameters.
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS AND RESULTS
|
| 135 |
+
|
| 136 |
+
We demonstrate the effectiveness of our proposed method on two benchmark datasets (CIFAR-10 and ImageNet) for the image classification task. Unlike previous NAS works (Zoph et al., 2018; Liu et al., 2018c) that first learn CNN blocks on CIFAR-10 under small-scale setting (e.g. fewer blocks), then transfer the learned block to ImageNet or CIFAR-10 under large-scale setting by repeatedly stacking it, we directly learn the architectures on the target task (either CIFAR-10 or ImageNet) and target hardware (GPU, CPU and mobile phone) while allowing each block to be specified.
|
| 137 |
+
|
| 138 |
+
# 4.1 EXPERIMENTS ON CIFAR-10
|
| 139 |
+
|
| 140 |
+
Architecture Space. For CIFAR-10 experiments, we use the tree-structured architecture space that is introduced by Cai et al. (2018b) with PyramidNet (Han et al., 2017) as the backbone4. Specifically, we replace all $3 \times 3$ convolution layers in the residual blocks of a PyramidNet with tree-structured cells, each of which has a depth of 3 and the number of branches is set to be 2 at each node (except the leaf nodes). For further details about the tree-structured architecture space, we refer to the original paper (Cai et al., 2018b). Additionally, we use two hyperparameters to control the depth and width of a network in this architecture space, i.e. $B$ and $F$ , which respectively represents the number of blocks at each stage (totally 3 stages) and the number of output channels of the final block.
|
| 141 |
+
|
| 142 |
+
Table 1: ProxylessNAS achieves state-of-the-art performance on CIFAR-10.
|
| 143 |
+
|
| 144 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Params</td><td rowspan=1 colspan=1>Test error (%)</td></tr><tr><td rowspan=1 colspan=1>DenseNet-BC (Huang et al., 2017)PyramidNet (Han etal., 2017)Shake-Shake + c/o (DeVries & Taylor, 2017)PyramidNet + SD(Yamada et al., 2018)</td><td rowspan=1 colspan=1>25.6M26.0M26.2M26.0M</td><td rowspan=1 colspan=1>3.463.312.562.31</td></tr><tr><td rowspan=1 colspan=1>ENAS+ c/o (Pham et al., 2018)DARTS + c/o (Liu et al., 2018c)NASNet-A + c/o (Zoph et al., 2018)PathLevel EAS + c/o (Cai et al., 2018b)AmoebaNet-B + c/o (Real et al., 2018)</td><td rowspan=1 colspan=1>4.6M3.4M27.6M14.3M34.9M</td><td rowspan=1 colspan=1>2.892.832.402.302.13</td></tr><tr><td rowspan=1 colspan=1>Proxyless-R+c/o (ours)Proxyless-G+c/o (ours)</td><td rowspan=1 colspan=1>5.8M5.7M</td><td rowspan=1 colspan=1>2.302.08</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Training Details. We randomly sample 5,000 images from the training set as a validation set for learning architecture parameters which are updated using the Adam optimizer with an initial learning rate of 0.006 for the gradient-based algorithm (Section 3.2.1) and 0.01 for the REINFORCEbased algorithm (Section 3.3.2). In the following discussions, we refer to these two algorithms as Proxyless-G (gradient) and Proxyless-R (REINFORCE) respectively.
|
| 147 |
+
|
| 148 |
+
After the training process of the over-parameterized network completes, a compact network is derived according to the architecture parameters, as discussed in Section 3.2.1. Next, we train the compact network using the same training settings except that the number of training epochs increases from 200 to 300. Additionally, when the DropPath regularization (Zoph et al., 2018; Huang et al., 2016) is adopted, we further increase the number of training epochs to 600 (Zoph et al., 2018).
|
| 149 |
+
|
| 150 |
+
Results. We apply the proposed method to learn architectures in the tree-structured architecture space with $B = 1 8$ and $F = 4 0 0$ . Since we do not repeat cells and each cell has 12 learnable edges, totally $1 2 \times 1 8 \times 3 = 6 4 8$ decisions are required to fully determine the architecture.
|
| 151 |
+
|
| 152 |
+
The test error rate results of our proposed method and other state-of-the-art architectures on CIFAR10 are summarized in Table 1, where $\mathrm { { ^ { 6 6 } c / o ^ { 3 } } }$ indicates the use of Cutout (DeVries & Taylor, 2017). Compared to these state-of-the-art architectures, our proposed method can achieve not only lower test error rate but also better parameter efficiency. Specifically, Proxyless-G reaches a test error rate of $2 . 0 8 \%$ which is slightly better than AmoebaNet-B (Real et al., 2018) (the previous best architecture on CIFAR-10). Notably, AmoebaNet-B uses 34.9M parameters while our model only uses 5.7M parameters which is $6 \times$ fewer than AmoebaNet-B. Furthermore, compared with PathLevel EAS (Cai et al., 2018b) that also explores the tree-structured architecture space, both Proxyless-G and Proxyless-R achieves similar or lower test error rate results with half fewer parameters. The strong empirical results of our ProxylessNAS demonstrate the benefits of directly exploring a large architecture space instead of repeatedly stacking the same block.
|
| 153 |
+
|
| 154 |
+
# 4.2 EXPERIMENTS ON IMAGENET
|
| 155 |
+
|
| 156 |
+
For ImageNet experiments, we focus on learning efficient CNN architectures (Iandola et al., 2016; Howard et al., 2017; Sandler et al., 2018; Zhu et al., 2018) that have not only high accuracy but also low latency on specific hardware platforms. Therefore, it is a multi-objective NAS task (Hsu et al., 2018; Dong et al., 2018; Elsken et al., 2018a; He et al., 2018; Wang et al., 2018; Tan et al., 2018), where one of the objectives is non-differentiable (i.e. latency). We use three different hardware platforms, including mobile phone, GPU and CPU, in our experiments. The GPU latency is measured on V100 GPU with a batch size of 8 (single batch makes GPU severely under-utilized). The CPU latency is measured under batch size 1 on a server with two 2.40GHz Intel(R) Xeon(R)
|
| 157 |
+
|
| 158 |
+
Table 2: ProxylessNAS achieves state-of-the art accuracy $( \% )$ on ImageNet (under mobile latency constraint $\leq 8 0 m s $ ) with $2 0 0 \times$ less search cost in GPU hours. “LL” indicates latency regularization loss. Details of MnasNet’s search cost are provided in appendix C.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Model</td><td>Top-1</td><td>Top-5</td><td>Mobile Latency</td><td>Hardware -aware</td><td>No Proxy</td><td>No Repeat</td><td>Search cost (GPU hours)</td></tr><tr><td>MobileNetV1[16] MobileNetV2 [30]</td><td>70.6 72.0</td><td>89.5 91.0</td><td>113ms 75ms</td><td>1</td><td>1 1</td><td>X ×</td><td>Manual Manual</td></tr><tr><td>NASNet-A [38]</td><td>74.0</td><td>91.3</td><td>183ms</td><td>1 X</td><td>X</td><td>X</td><td>48,000</td></tr><tr><td>AmoebaNet-A [29]</td><td>74.5</td><td>92.0</td><td>190ms</td><td>X</td><td>×</td><td>×</td><td>75,600</td></tr><tr><td>MnasNet [31]</td><td>74.0</td><td>91.8</td><td>76ms</td><td>√</td><td>×</td><td>×</td><td>40,000</td></tr><tr><td>MnasNet (our impl.)</td><td>74.0</td><td>91.8</td><td>79ms</td><td>√</td><td>X</td><td>X</td><td>40,000</td></tr><tr><td>Proxyless-G (mobile)</td><td>71.8</td><td>90.3</td><td>83ms</td><td>X</td><td>?</td><td>√</td><td>200</td></tr><tr><td>Proxyless-G + LL</td><td>74.2</td><td>91.7</td><td>79ms</td><td>√</td><td></td><td>√</td><td>200</td></tr><tr><td>Proxyless-R (mobile)</td><td>74.6</td><td>92.2</td><td>78ms</td><td>√</td><td>「</td><td>√</td><td>200</td></tr></table>
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 4: ProxylessNAS consistently outperforms MobileNetV2 under various latency settings.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 5: Our mobile latency model is close to $y \ = \ x$ . The latency RMSE is $0 . 7 5 \mathrm { m s }$ .
|
| 167 |
+
|
| 168 |
+
CPU E5-2640 v4. The mobile latency is measured on Google Pixel 1 phone with a batch size of 1. For Proxyless-R, we use $A C C ( m ) ^ { \cdot } \times [ L A T ( m ) / T ] ^ { w }$ as the optimization goal, where $A C C ( m )$ denotes the accuracy of model $m$ , $L A T ( m )$ denotes the latency of $m$ , $T$ is the target latency and $w$ is a hyperparameter for controlling the trade-off between accuracy and latency.
|
| 169 |
+
|
| 170 |
+
Additionally, on mobile phone, we use the latency prediction model (Appendix B) during architecture search. As illustrated in Figure 5, we observe a strong correlation between the predicted latency and real measured latency on the test set, suggesting that the latency prediction model can be used to replace the expensive mobile farm infrastructure (Tan et al., 2018) with little error introduced.
|
| 171 |
+
|
| 172 |
+
Architecture Space. We use MobileNetV2 (Sandler et al., 2018) as the backbone to build the architecture space. Specifically, rather than repeating the same mobile inverted bottleneck convolution (MBConv), we allow a set of MBConv layers with various kernel sizes $\{ 3 , 5 , 7 \}$ and expansion ratios $\{ 3 , 6 \}$ . To enable a direct trade-off between width and depth, we initiate a deeper over-parameterized network and allow a block with the residual connection to be skipped by adding the zero operation to the candidate set of its mixed operation. In this way, with a limited latency budget, the network can either choose to be shallower and wider by skipping more blocks and using larger MBConv layers or choose to be deeper and thinner by keeping more blocks and using smaller MBConv layers.
|
| 173 |
+
|
| 174 |
+
Training Details. We randomly sample 50,000 images from the training set as a validation set during the architecture search. The settings for updating architecture parameters are the same as CIFAR-10 experiments except the initial learning rate is 0.001. The over-parameterized network is trained on the remaining training images with batch size 256.
|
| 175 |
+
|
| 176 |
+
Table 3: ImageNet Accuracy $( \% )$ and GPU latency (Tesla V100) on ImageNet.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Top-1</td><td rowspan=1 colspan=1>Top-5</td><td rowspan=1 colspan=1>GPU latency</td></tr><tr><td rowspan=1 colspan=1>MobileNetV2 (Sandler et al., 2018)ShuffleNetV2 (1.5) (Ma et al., 2018)ResNet-34 (He et al., 2016)</td><td rowspan=1 colspan=1>72.072.673.3</td><td rowspan=1 colspan=1>91.0191.4</td><td rowspan=1 colspan=1>6.1ms7.3ms8.0ms</td></tr><tr><td rowspan=1 colspan=1>NASNet-A (Zoph et al., 2018)DARTS (Liu et al., 2018c)MnasNet (Tan et al., 2018)</td><td rowspan=1 colspan=1>74.073.174.0</td><td rowspan=1 colspan=1>91.391.091.8</td><td rowspan=1 colspan=1>38.3ms16.1ms</td></tr><tr><td rowspan=1 colspan=1>Proxyless (GPU)</td><td rowspan=1 colspan=1>75.1</td><td rowspan=1 colspan=1>92.5</td><td rowspan=1 colspan=1>5.1ms</td></tr></table>
|
| 179 |
+
|
| 180 |
+
ImageNet Classification Results. We first apply our ProxylessNAS to learn specialized CNN models on the mobile phone. The summarized results are reported in Table 2. Compared to MobileNetV2, our model improves the top-1 accuracy by $2 . 6 \%$ while maintaining a similar latency on the mobile phone. Furthermore, by rescaling the width of the networks using a multiplier (Sandler et al., 2018; Tan et al., 2018), it is shown in Figure 4 that our model consistently outperforms MobileNetV2 by a significant margin under all latency settings. Specifically, to achieve the same level of top-1 accuracy performance (i.e. around $7 4 . 6 \%$ ), MobileNetV2 has 143ms latency while our model only needs 78ms $( { \bf 1 . 8 3 \times }$ faster). While compared with MnasNet (Tan et al., 2018), our model can achieve $0 . 6 \%$ higher top-1 accuracy with slightly lower mobile latency. More importantly, we are much more resource efficient: the GPU-hour is $2 0 0 \times$ fewer than MnasNet (Table 2).
|
| 181 |
+
|
| 182 |
+
Additionally, we also observe that Proxyless-G has no incentive to choose computation-cheap operations if were not for the latency regularization loss. Its resulting architecture initially has 158ms latency on Pixel 1. After rescaling the network using the multiplier, its latency reduces to $8 3 \mathrm { m s }$ . However, this model can only achieve $7 1 . 8 \%$ top-1 accuracy on ImageNet, which is $2 . 4 \%$ lower than the result given by Proxyless-G with latency regularization loss. Therefore, we conclude that it is essential to take latency as a direct objective when learning efficient neural networks.
|
| 183 |
+
|
| 184 |
+
Besides the mobile phone, we also apply our ProxylessNAS to learn specialized CNN models on GPU and CPU. Table 3 reports the results on GPU, where we find that our ProxylessNAS can still achieve superior performances compared to both human-designed and automatically searched architectures. Specifically, compared to MobileNetV2 and MnasNet, our model improves the top-1 accuracy by $3 . 1 \%$ and $1 . 1 \%$ respectively while being $1 . 2 \times$ faster. Table 4 shows the summarized results of our searched models on three different platforms. An interesting observation is that models optimized for GPU do not run fast on CPU and mobile phone, vice versa. Therefore, it is essential to learn specialized neural networks for different hardware architectures to achieve the best efficiency on different hardware.
|
| 185 |
+
|
| 186 |
+
Specialized Models for Different Hardware. Figure 6 demonstrates the detailed architectures of our searched CNN models on three hardware platforms: GPU/CPU/Mobile. We notice that the architecture shows different preferences when targeting different platforms: (i) The GPU model is shallower and wider, especially in early stages where the feature map has higher resolution; (ii) The GPU model prefers large MBConv operations (e.g. $7 \times 7$ MBConv6), while the CPU model would go for smaller MBConv operations. This is because GPU has much higher parallelism than CPU so it can take advantage of large MBConv operations. Another interesting observation is that our searched models on all platforms prefer larger MBConv operations in the first block within each stage where the feature map is downsampled. We suppose it might because larger MBConv operations are beneficial for the network to preserve more information when downsampling. Notably, such kind of patterns cannot be captured in previous NAS methods as they force the blocks to share the same structure (Zoph et al., 2018; Liu et al., 2018a).
|
| 187 |
+
|
| 188 |
+
# 5 CONCLUSION
|
| 189 |
+
|
| 190 |
+
We introduced ProxylessNAS that can directly learn neural network architectures on the target task and target hardware without any proxy. We also reduced the search cost (GPU-hours and GPU memory) of NAS to the same level of normal training using path binarization. Benefiting from the direct search, we achieve strong empirical results on CIFAR-10 and ImageNet. Furthermore,
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 6: Efficient models optimized for different hardware. “MBConv3” and “MBConv6” denote mobile inverted bottleneck convolution layer with an expansion ratio of 3 and 6 respectively. Insights: GPU prefers shallow and wide model with early pooling; CPU prefers deep and narrow model with late pooling. Pooling layers prefer large and wide kernel. Early layers prefer small kernel. Late layers prefer large kernel.
|
| 194 |
+
|
| 195 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Top-1 (%)</td><td rowspan=1 colspan=1>GPU latency</td><td rowspan=1 colspan=1>CPU latency</td><td rowspan=1 colspan=1>Mobile latency</td></tr><tr><td rowspan=1 colspan=1>Proxyless(GPU)</td><td rowspan=1 colspan=1>75.1</td><td rowspan=1 colspan=1>5.1ms</td><td rowspan=1 colspan=1>204.9ms</td><td rowspan=1 colspan=1>124ms</td></tr><tr><td rowspan=1 colspan=1>Proxyless(CPU)</td><td rowspan=1 colspan=1>75.3</td><td rowspan=1 colspan=1>7.4ms</td><td rowspan=1 colspan=1>138.7ms</td><td rowspan=1 colspan=1>116ms</td></tr><tr><td rowspan=1 colspan=1>Proxyless(mobile)</td><td rowspan=1 colspan=1>74.6</td><td rowspan=1 colspan=1>7.2ms</td><td rowspan=1 colspan=1>164.1ms</td><td rowspan=1 colspan=1>78ms</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Table 4: Hardware prefers specialized models. Models optimized for GPU does not run fast on CPU and mobile phone, vice versa. ProxylessNAS provides an efficient solution to search a specialized (3) Efficient GPU architecture found by ProxylessNAS. neural network architecture for a target hardware architecture, while cutting down the search cost by $2 0 0 \times$ compared with state-of-the-arts (Zoph & Le, 2017; Tan et al., 2018).
|
| 198 |
+
|
| 199 |
+
we allow specializing network architectures for different platforms by directly incorporating the measured hardware latency into optimization objectives. We compared the optimized models on CPU/GPU/mobile and raised the awareness of the needs of specializing neural network architecture for different hardware architectures.
|
| 200 |
+
|
| 201 |
+
# ACKNOWLEDGMENTS
|
| 202 |
+
|
| 203 |
+
We thank MIT Quest for Intelligence, MIT-IBM Watson AI lab, SenseTime, Xilinx, Snap Research for supporting this work. We also thank AWS Cloud Credits for Research Program providing us the cloud computing resources.
|
| 204 |
+
|
| 205 |
+
# REFERENCES
|
| 206 |
+
|
| 207 |
+
Gabriel Bender, Pieter-Jan Kindermans, Barret Zoph, Vijay Vasudevan, and Quoc Le. Understanding and simplifying one-shot architecture search. In ICML, 2018.
|
| 208 |
+
|
| 209 |
+
Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Smash: one-shot model architecture search through hypernetworks. In ICLR, 2018.
|
| 210 |
+
|
| 211 |
+
Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI, 2018a.
|
| 212 |
+
|
| 213 |
+
Han Cai, Jiacheng Yang, Weinan Zhang, Song Han, and Yong Yu. Path-level network transformation for efficient architecture search. In ICML, 2018b.
|
| 214 |
+
|
| 215 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In NIPS, 2015.
|
| 216 |
+
|
| 217 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 218 |
+
|
| 219 |
+
Jin-Dong Dong, An-Chieh Cheng, Da-Cheng Juan, Wei Wei, and Min Sun. Dpp-net: Device-aware progressive search for pareto-optimal neural architectures. In ECCV, 2018.
|
| 220 |
+
|
| 221 |
+
Thomas Elsken, Jan-Hendrik Metzen, and Frank Hutter. Simple and efficient architecture search for convolutional neural networks. arXiv preprint arXiv:1711.04528, 2017.
|
| 222 |
+
|
| 223 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Multi-objective architecture search for cnns. arXiv preprint arXiv:1804.09081, 2018a.
|
| 224 |
+
|
| 225 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. arXiv preprint arXiv:1808.05377, 2018b.
|
| 226 |
+
|
| 227 |
+
Dongyoon Han, Jiwhan Kim, and Junmo Kim. Deep pyramidal residual networks. In CVPR, 2017.
|
| 228 |
+
|
| 229 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NIPS, 2015.
|
| 230 |
+
|
| 231 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016.
|
| 232 |
+
|
| 233 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 234 |
+
|
| 235 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In ECCV, 2018.
|
| 236 |
+
|
| 237 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 238 |
+
|
| 239 |
+
Chi-Hung Hsu, Shu-Huan Chang, Da-Cheng Juan, Jia-Yu Pan, Yu-Ting Chen, Wei Wei, and ShihChieh Chang. Monas: Multi-objective neural architecture search using reinforcement learning. arXiv preprint arXiv:1806.10332, 2018.
|
| 240 |
+
|
| 241 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
|
| 242 |
+
|
| 243 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 244 |
+
|
| 245 |
+
Forrest N Iandola, Song Han, Matthew W Moskewicz, Khalid Ashraf, William J Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and¡ $0 . 5 \mathrm { m b }$ model size. arXiv preprint arXiv:1602.07360, 2016.
|
| 246 |
+
|
| 247 |
+
Purushotham Kamath, Abhishek Singh, and Debo Dutta. Neural architecture construction using envelopenets. arXiv preprint arXiv:1803.06744, 2018.
|
| 248 |
+
|
| 249 |
+
Chenxi Liu, Barret Zoph, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In ECCV, 2018a.
|
| 250 |
+
|
| 251 |
+
Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search. In ICLR, 2018b.
|
| 252 |
+
|
| 253 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018c.
|
| 254 |
+
|
| 255 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In ICCV, 2017.
|
| 256 |
+
Renqian Luo, Fei Tian, Tao Qin, and Tie-Yan Liu. Neural architecture optimization. arXiv preprint arXiv:1808.07233, 2018.
|
| 257 |
+
Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In ECCV, 2018.
|
| 258 |
+
Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In ICML, 2018.
|
| 259 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. arXiv preprint arXiv:1802.01548, 2018.
|
| 260 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, 2018.
|
| 261 |
+
Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, and Quoc V Le. Mnasnet: Platformaware neural architecture search for mobile. arXiv preprint arXiv:1807.11626, 2018.
|
| 262 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization. arXiv, 2018.
|
| 263 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. In Reinforcement Learning. 1992.
|
| 264 |
+
Yoshihiro Yamada, Masakazu Iwamura, and Koichi Kise. Shakedrop regularization. arXiv preprint arXiv:1802.02375, 2018.
|
| 265 |
+
Zhao Zhong, Junjie Yan, Wei Wu, Jing Shao, and Cheng-Lin Liu. Practical block-wise neural network architecture generation. In CVPR, 2018.
|
| 266 |
+
Ligeng Zhu, Ruizhi Deng, Michael Maire, Zhiwei Deng, Greg Mori, and Ping Tan. Sparsely aggregated convolutional networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 186–201, 2018.
|
| 267 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2017.
|
| 268 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In CVPR, 2018.
|
| 269 |
+
|
| 270 |
+
# A THE LIST OF CANDIDATE OPERATIONS USED ON CIFAR-10
|
| 271 |
+
|
| 272 |
+
We adopt the following 7 operations in our CIFAR-10 experiments:
|
| 273 |
+
|
| 274 |
+
• $3 \times 3$ dilated depthwise-separable convolution
|
| 275 |
+
• Identity
|
| 276 |
+
• $3 \times 3$ depthwise-separable convolution
|
| 277 |
+
• $5 \times 5$ depthwise-separable convolution
|
| 278 |
+
• $7 \times 7$ depthwise-separable convolution
|
| 279 |
+
• $3 \times 3$ average pooling
|
| 280 |
+
• $3 \times 3$ max pooling
|
| 281 |
+
|
| 282 |
+
# B MOBILE LATENCY PREDICTION
|
| 283 |
+
|
| 284 |
+
Measuring the latency on-device is accurate but not ideal for scalable neural architecture search. There are two reasons: (i) Slow. As suggested in TensorFlow-Lite, we need to average hundreds of runs to produce a precise measurement, approximately 20 seconds. This is far more slower than a single forward / backward execution. (ii) Expensive. A lot of mobile devices and software engineering work are required to build an automatic pipeline to gather the latency from a mobile farm. Instead of direct measurement, we build a model to estimate the latency. We need only 1 phone rather than a farm of phones, which has only $0 . 7 5 \mathrm { m s }$ latency RMSE. We use the latency model to search, and we use the measured latency to report the final model’s latency.
|
| 285 |
+
|
| 286 |
+
We sampled $5 \mathrm { k }$ architectures from our candidate space, where $4 \mathrm { k \Omega }$ architectures are used to build the latency model and the rest are used for test. We measured the latency on Google Pixel 1 phone using TensorFlow-Lite. The features include (i) type of the operator (ii) input and output feature map size (iii) other attributes like kernel size, stride for convolution and expansion ratio.
|
| 287 |
+
|
| 288 |
+
# C DETAILS OF MNASNET’S SEARCH COST
|
| 289 |
+
|
| 290 |
+
Mnas (Tan et al., 2018) trains 8,000 mobile-sized models on ImageNet, each of which is trained for 5 epochs for learning architectures. If these models are trained on V100 GPUs, as done in our experiments, the search cost is roughly 40,000 GPU hours.
|
| 291 |
+
|
| 292 |
+
# D IMPLEMENTAION OF THE GRADIENT-BASED ALGORITHM
|
| 293 |
+
|
| 294 |
+
A naive implementation of the gradient-based algorithm (see Eq. (4)) is calculating and storing $o _ { j } ( x )$ in the forward step to later compute $\partial L / \partial g _ { j }$ in the backward step:
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\partial L / \partial g _ { j } = \mathrm { r e d u c e \_ s u m } ( \nabla _ { y } L \circ o _ { j } ( x ) ) ,
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
where $\nabla _ { y } L$ denotes the gradient w.r.t. the output of the mixed operation $y$ , “◦” denotes the elementwise product, and “reduce $\_ \mathrm { s u m ( \cdot ) } ,$ ” denotes the sum of all elements.
|
| 301 |
+
|
| 302 |
+
Notice that $o _ { j } ( x )$ is only used for calculating $\partial L / \partial g _ { j }$ when $j ^ { t h }$ path is not active (i.e. not involved in calculating $y$ ). So we do not need to actually allocate GPU memory to store $o _ { j } ( x )$ . Instead, we can calculate $o _ { j } ( x )$ after getting $\nabla _ { y } L$ in the backward step, use $o _ { j } ( x )$ to compute $\partial L / \partial g _ { j }$ following Eq. (9), then release the occupied GPU memory. In this way, without the approximation discussed in Section 3.2.1, we can reduce the GPU memory cost to the same level of training a compact model.
|
md/train/JXAyJeYqUkZ/JXAyJeYqUkZ.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CoAtNet: Marrying Convolution and Attention for All Data Sizes
|
| 2 |
+
|
| 3 |
+
Zihang Dai, Hanxiao Liu, Quoc V. Le, Mingxing Tan Google Research, Brain Team {zihangd,hanxiaol,qvl,tanmingxing}@google.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Transformers have attracted increasing interests in computer vision, but they still fall behind state-of-the-art convolutional networks. In this work, we show that while Transformers tend to have larger model capacity, their generalization can be worse than convolutional networks due to the lack of the right inductive bias. To effectively combine the strengths from both architectures, we present CoAtNets (pronounced “coat” nets), a family of hybrid models built from two key insights: (1) depthwise Convolution and self-Attention can be naturally unified via simple relative attention; (2) vertically stacking convolution layers and attention layers in a principled way is surprisingly effective in improving generalization, capacity and efficiency. Experiments show that our CoAtNets achieve state-of-the-art performance under different resource constraints across various datasets: Without extra data, CoAtNet achieves $8 6 . 0 \%$ ImageNet top-1 accuracy; When pre-trained with 13M images from ImageNet-21K, our CoAtNet achieves $8 8 . 5 6 \%$ top-1 accuracy, matching ViT-huge pre-trained with 300M images from JFT-300M while using $2 3 \mathrm { x }$ less data; Notably, when we further scale up CoAtNet with JFT-3B, it achieves $9 0 . 8 8 \%$ top-1 accuracy on ImageNet, establishing a new state-of-the-art result.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Since the breakthrough of AlexNet [1], Convolutional Neural Networks (ConvNets) have been the dominating model architecture for computer vision [2, 3, 4, 5]. Meanwhile, with the success of self-attention models like Transformers [6] in natural language processing [7, 8], many previous works have attempted to bring in the power of attention into computer vision [9, 10, 11, 12]. More recently, Vision Transformer (ViT) [13] has shown that with almost1 only vanilla Transformer layers, one could obtain reasonable performance on ImageNet-1K [14] alone. More importantly, when pre-trained on large-scale weakly labeled JFT-300M dataset [15], ViT achieves comparable results to state-of-the-art (SOTA) ConvNets, indicating that Transformer models potentially have higher capacity at scale than ConvNets.
|
| 12 |
+
|
| 13 |
+
While ViT has shown impressive results with enormous JFT 300M training images, its performance still falls behind ConvNets in the low data regime. For example, without extra JFT-300M pre-training, the ImageNet accuracy of ViT is still significantly lower than ConvNets with comparable model size [5] (see Table 13). Subsequent works use special regularization and stronger data augmentation to improve the vanilla ViT [16, 17, 18], yet none of these ViT variants could outperform the SOTA convolution-only models on ImageNet classification given the same amount of data and computation [19, 20]. This suggests that vanilla Transformer layers may lack certain desirable inductive biases possessed by ConvNets, and thus require significant amount of data and computational resource to compensate. Not surprisingly, many recent works have been trying to incorporate the inductive biases of ConvNets into Transformer models, by imposing local receptive fields for attention layers [21, 22] or augmenting the attention and FFN layers with implicit or explicit convolutional operations [23, 24, 25]. However, these approaches are either ad-hoc or focused on injecting a particular property, lacking a systematic understanding of the respective roles of convolution and attention when combined.
|
| 14 |
+
|
| 15 |
+
In this work, we systematically study the problem of hybridizing convolution and attention from two fundamental aspects in machine learning – generalization and model capacity. Our study shows that convolutional layers tend to have better generalization with faster converging speed thanks to their strong prior of inductive bias, while attention layers have higher model capacity that can benefit from larger datasets. Combining convolutional and attention layers can achieve better generalization and capacity; however, a key challenge here is how to effectively combine them to achieve better trade-offs between accuracy and efficiency. In this paper, we investigate two key insights: First, we observe that the commonly used depthwise convolution can be effectively merged into attention layers with simple relative attention; Second, simply stacking convolutional and attention layers, in a proper way, could be surprisingly effective to achieve better generalization and capacity. Based on these insights, we propose a simple yet effective network architecture named CoAtNet, which enjoys the strengths from both ConvNets and Transformers.
|
| 16 |
+
|
| 17 |
+
Our CoAtNet achieves SOTA performances under comparable resource constraints across different data sizes. Specifically, under the low-data regime, CoAtNet inherits the great generalization property of ConvNets thanks to the favorable inductive biases. Moreover, given abundant data, CoAtNet not only enjoys the superior scalability of Transformer models, but also achieves faster convergence and thus improved efficiency. When only ImageNet-1K is used for training, CoAtNet achieves $8 6 . 0 \%$ top-1 accuracy, matching the prior art NFNet [20] under similar computation resource and training conditions. Further, when pre-trained on ImageNet-21K with about 10M images, CoAtNet reaches $8 8 . 5 6 \%$ top-1 accuracy when finetuned on ImageNet-1K, matching the ViT-Huge pre-trained on JFT-300M, a $2 3 \times$ larger dataset. Finally, when JFT-3B is used for pre-training, CoAtNet exhibits better efficiency compared to ViT, and pushes the ImageNet-1K top-1 accuracy to $9 0 . 8 8 \%$ while using $1 . 5 \mathrm { x }$ less computation of the prior art set by ViT-G/14 [26].
|
| 18 |
+
|
| 19 |
+
# 2 Model
|
| 20 |
+
|
| 21 |
+
In the section, we focus on the question of how to “optimally” combine the convolution and transformer. Roughly speaking, we decompose the question into two parts:
|
| 22 |
+
|
| 23 |
+
1. How to combine the convolution and self-attention within one basic computational block? 2. How to vertically stack different types of computational blocks together to form a complete network?
|
| 24 |
+
|
| 25 |
+
The rationale of the decomposition will become clearer as we gradually reveal our design choices.
|
| 26 |
+
|
| 27 |
+
# 2.1 Merging Convolution and Self-Attention
|
| 28 |
+
|
| 29 |
+
For convolution, we mainly focus on the MBConv block [27] which employs depthwise convolution [28] to capture the spatial interaction. A key reason of this choice is that both the FFN module in Transformer and MBConv employ the design of “inverted bottleneck”, which first expands the channel size of the input by $4 \mathbf { x }$ and later project the the $4 \mathbf { x }$ -wide hidden state back to the original channel size to enable residual connection.
|
| 30 |
+
|
| 31 |
+
Besides the similarity of inverted bottleneck, we also notice that both depthwise convolution and self-attention can be expressed as a per-dimension weighted sum of values in a pre-defined receptive field. Specifically, convolution relies on a fixed kernel to gather information from a local receptive field
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
y _ { i } = \sum _ { j \in \mathcal { L } ( i ) } w _ { i - j } \odot x _ { j } \quad \mathrm { ( d e p t h w i s e c o n v o l u t i o n ) } ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $x _ { i } , y _ { i } \in \mathbb { R } ^ { D }$ are the input and output at position $i$ respectively, and $\mathcal { L } ( i )$ denotes a local neighborhood of $i$ , e.g., a 3x3 grid centered at $i$ in image processing.
|
| 38 |
+
|
| 39 |
+
In comparison, self-attention allows the receptive field to be the entire spatial locations and computes the weights based on the re-normalized pairwise similarity between the pair $( x _ { i } , x _ { j } )$ : 2
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
y _ { i } = \sum _ { j \in \mathcal { G } } \underbrace { \frac { \exp { \left( x _ { i } ^ { \top } x _ { j } \right) } } { \sum _ { k \in \mathcal { G } } \exp { \left( x _ { i } ^ { \top } x _ { k } \right) } } } _ { A _ { i , j } } x _ { j } \quad \mathrm { ( s e l f - a t t e n t i o n ) } ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathcal { G }$ indicates the global spatial space. Before getting into the question of how to best combine them, it is worthwhile to compare their relative strengths and weaknesses, which helps to figure out the good properties we hope to retain.
|
| 46 |
+
|
| 47 |
+
• First of all, the depthwise convolution kernel $w _ { i - j }$ is an input-independent parameter of static value, while the attention weight $A _ { i , j }$ dynamically depends on the representation of the input. Hence, it is much easier for the self-attention to capture complicated relational interactions between different spatial positions, a property that we desire most when processing high-level concepts. However, the flexibility comes with a risk of easier overfitting, especially when data is limited. • Secondly, notice that given any position pair $( i , j )$ , the corresponding convolution weight $w _ { i - j }$ only cares about the relative shift between them, i.e. $i - j$ , rather than the specific values of $i$ or $j$ . This property is often referred to translation equivalence, which has been found to improve generalization under datasets of limited size [29]. Due to the usage of absolution positional embeddings, standard Transformer (ViT) lacks this property. This partially explains why ConvNets are usually better than Transformers when the dataset is not enormously large. • Finally, the size of the receptive field is one of the most crucial differences between self-attention and convolution. Generally speaking, a larger receptive field provides more contextual information, which could lead to higher model capacity. Hence, the global receptive field has been a key motivation to employ self-attention in vision. However, a large receptive field requires significantly more computation. In the case of global attention, the complexity is quadratic w.r.t. spatial size, which has been a fundamental trade-off in applying self-attention models.
|
| 48 |
+
|
| 49 |
+
Table 1: Desirable properties found in convolution or self-attention.
|
| 50 |
+
|
| 51 |
+
<table><tr><td>Properties</td><td>Convolution</td><td>Self-Attention</td></tr><tr><td>Translation Equivariance</td><td>√</td><td></td></tr><tr><td>Input-adaptive Weighting</td><td></td><td>√</td></tr><tr><td>Global Receptive Field</td><td></td><td></td></tr></table>
|
| 52 |
+
|
| 53 |
+
Given the comparison above, an ideal model should be able to combine the 3 desirable properties in Table 1. With the similar form of depthwise convolution in Eqn. (1) and self-attention in Eqn. (2), a straightforward idea that could achieve this is simply to sum a global static convolution kernel with the adaptive attention matrix, either after or before the Softmax normalization, i.e.,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
y _ { i } ^ { \mathrm { p o s t } } = \sum _ { j \in \mathcal { G } } \left( \frac { \exp \left( x _ { i } ^ { \top } x _ { j } \right) } { \sum _ { k \in \mathcal { G } } \exp \left( x _ { i } ^ { \top } x _ { k } \right) } + w _ { i - j } \right) x _ { j } \ \mathrm { ~ o r ~ } \ y _ { i } ^ { \mathrm { p e } } = \sum _ { j \in \mathcal { G } } \frac { \exp \left( x _ { i } ^ { \top } x _ { j } + w _ { i - j } \right) } { \sum _ { k \in \mathcal { G } } \exp \left( x _ { i } ^ { \top } x _ { k } + w _ { i - k } \right) } x _ { j } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Interestingly, while the idea seems overly simplified, the pre-normalization version $y ^ { \mathrm { p r e } }$ corresponds to a particular variant of relative self-attention [30, 31]. In this case, the attention weight $A _ { i , j }$ is decided jointly by the $w _ { i - j }$ of translation equivariance and the input-adaptive $x _ { i } ^ { \top } x _ { j }$ , which can enjoy both effects depending on their relative magnitudes. Importantly, note that in order to enable the global convolution kernel without blowing up the number of parameters, we have reloaded the notation of $w _ { i - j }$ as a scalar (i.e., $w \in \mathbb { R } ^ { O ( | \mathcal { G } | ) }$ ) rather than a vector in Eqn. (1). Another advantage of the scalar formulation of $w$ is that retrieving $w _ { i - j }$ for all $( i , j )$ is clearly subsumed by computing the pairwise dot-product attention, hence resulting in minimum additional cost (see Appendix A.1). Given the benefits, we will use the Transformer block with the pre-normalization relative attention variant in Eqn. (3) as the key component of the proposed CoAtNet model.
|
| 60 |
+
|
| 61 |
+
# 2.2 Vertical Layout Design
|
| 62 |
+
|
| 63 |
+
After figuring out a neat way to combine convolution and attention, we next consider how to utilize it to stack an entire network.
|
| 64 |
+
|
| 65 |
+
As we have discuss above, the global context has a quadratic complexity w.r.t. the spatial size. Hence, if we directly apply the relative attention in Eqn. (3) to the raw image input, the computation will be excessively slow due to the large number of pixels in any image of common sizes. Hence, to construct a network that is feasible in practice, we have mainly three options:
|
| 66 |
+
|
| 67 |
+
(A) Perform some down-sampling to reduce the spatial size and employ the global relative attention after the feature map reaches manageable level.
|
| 68 |
+
(B) Enforce local attention, which restricts the global receptive field $\mathcal { G }$ in attention to a local field $\mathcal { L }$ just like in convolution [22, 21].
|
| 69 |
+
(C) Replace the quadratic Softmax attention with certain linear attention variant which only has a linear complexity w.r.t. the spatial size [12, 32, 33].
|
| 70 |
+
|
| 71 |
+
We briefly experimented with option (C) without getting a reasonably good result. For option (B), we found that implementing local attention involves many non-trivial shape formatting operations that requires intensive memory access. On our accelerator of choice (TPU), such operation turns out to be extremely slow [34], which not only defeats the original purpose of speeding up global attention, but also hurts the model capacity. Hence, as some recent work has studied this variant [22, 21], we will focus on option (A) and compare our results with theirs in our empirical study (Section 4).
|
| 72 |
+
|
| 73 |
+
For option (A), the down-sampling can be achieved by either (1) a convolution stem with aggressive stride (e.g., stride 16x16) as in ViT or (2) a multi-stage network with gradual pooling as in ConvNets. With these choices, we derive a search space of 5 variants and compare them in controlled experiments.
|
| 74 |
+
|
| 75 |
+
• When the ViT Stem is used, we directly stack $L$ Transformer blocks with relative attention, which we denote as $\mathrm { V I T } _ { \mathrm { R E L } }$ .
|
| 76 |
+
• When the multi-stage layout is used, we mimic ConvNets to construct a network of 5 stages (S0, S1, S2, S3 & S4), with spatial resolution gradually decreased from S0 to S4. At the beginning of each stage, we always reduce the spatial size by $2 \mathbf { x }$ and increase the number of channels (see Appendix A.1 for the detailed down-sampling implementation). The first stage S0 is a simple 2-layer convolutional Stem and S1 always employs MBConv blocks with squeeze-excitation (SE), as the spatial size is too large for global attention. Starting from S2 through S4, we consider either the MBConv or the Transformer block, with a constraint that convolution stages must appear before Transformer stages. The constraint is based on the prior that convolution is better at processing local patterns that are more common in early stages. This leads to 4 variants with increasingly more Transformer stages, C-C-C-C, C-C-C-T, C-C-T-T and C-T-T-T, where C and T denote Convolution and Transformer respectively.
|
| 77 |
+
|
| 78 |
+
To systematically study the design choices, we consider two fundamental aspects generalization capability and model capacity: For generalization, we are interested in the gap between the training loss and the evaluation accuracy. If two models have the same training loss, then the model with higher evaluation accuracy has better generalization capability, since it can generalize better to unseen evaluation dataset. Generalization capability is particularly important to data efficiency when training data size is limited. For model capacity, we measure the ability to fit large training datasets. When training data is abundant and overfitting is not an issue, the model with higher capacity will achieve better final performance after reasonable training steps. Note that, since simply increasing the model size can lead to higher model capacity, to perform a meaningful comparison, we make sure the model sizes of the 5 variants are comparable.
|
| 79 |
+
|
| 80 |
+
To compare the generalization and model capacity, we train different variants of hybrid models on ImageNet-1K (1.3M) and JFT $\left( > 3 0 0 \mathbf { M } \right)$ dataset for 300 and 3 epochs respectively, both without any regularization or augmentation. The training loss and evaluation accuracy on both datasets are summarized in Figure 1.
|
| 81 |
+
|
| 82 |
+
• From the ImageNet-1K results, a key observation is that, in terms of generalization capability (i.e., gap between train and evaluation metrics), we have
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathrm { C \mathrm { - } C \mathrm { - } C \mathrm { - } C \approx C \mathrm { - } C \mathrm { - } C \mathrm { - } T \ge C \mathrm { - } C \mathrm { - } T \mathrm { - } T > C \mathrm { - } T \mathrm { - } T \mathrm { - } T \gg V \mathrm { I } \mathrm { T } _ { \mathrm { R E L } } . }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 1: Comparison for model generalization and capacity under different data size. For fair comparison, all models have similar parameter size and computational cost.
|
| 90 |
+
|
| 91 |
+
Particularly, $\mathrm { V I T } _ { \mathrm { R E L } }$ is significantly worse than variants by a large margin, which we conjecture is related to the lack of proper low-level information processing in its aggressive down-sampling Stem. Among the multi-stage variants, the overall trend is that the more convolution stages the model has, the smaller the generalization gap is.
|
| 92 |
+
|
| 93 |
+
• As for model capacity, from the JFT comparison, both the train and evaluation metrics at the end of the training suggest the following ranking:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathrm { C - C \mathrm { - } T \mathrm { - } T \approx C \mathrm { - } T \mathrm { - } T \mathrm { - } T > V I T _ { R E L } > C \mathrm { - } C \mathrm { - } C \mathrm { - } T > C \mathrm { - } C \mathrm { - } C \mathrm { - } C \mathrm { - } C \mathrm { . } }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Importantly, this suggests that simply having more Transformer blocks does NOT necessarily mean higher capacity for visual processing. On one hand, while initially worse, $\mathrm { V I T } _ { \mathrm { R E L } }$ ultimately catch up with the two variants with more MBConv stages, indicating the capacity advantage of Transformer blocks. On the other hand, both C-C-T-T and C-T-T-T clearly outperforming $\mathrm { V I T } _ { \mathrm { R E L } }$ suggest that the ViT stem with an aggressive stride may have lost too much information and hence limit the model capacity. More interestingly, the fact that C-C-T-T $\approx \mathbf { C }$ -T-T-T indicates the for processing low-level information, static local operations like convolution could be as capable as adaptive global attention mechanism, while saving computation and memory usage substantially.
|
| 100 |
+
|
| 101 |
+
Finally, to decide between C-C-T-T and C-T-T-T, we conduct another transferability test3 — we finetune the two JFT pre-trained models above on ImageNet-1K for 30 epochs and compare their transfer performances. From Table 2, it turns out that C-C-T-T achieves a clearly better transfer accuracy than C-T-T-T, despite the same pre-training performance.
|
| 102 |
+
|
| 103 |
+
Table 2: Transferability test results.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Metric</td><td>C-C-T-T</td><td>C-T-T-T</td></tr><tr><td>Pre-training Precision@1 (JFT)</td><td>34.40</td><td>34.36</td></tr><tr><td>Transfer Accuracy 224x224</td><td>82.39</td><td>81.78</td></tr><tr><td>Transfer Accuracy 384x384</td><td>84.23</td><td>84.02</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Taking generalization, model capacity, transferability and efficiency into consideration, we adapt the C-C-T-T multi-stage layout for CoAtNet. More model details are included in Appendix A.1.
|
| 108 |
+
|
| 109 |
+
# 3 Related Work
|
| 110 |
+
|
| 111 |
+
Convolutional network building blocks. Convolutional Networks (ConvNets) have been the dominating neural architectures for many computer vision tasks. Traditionally, regular convolutions, such as ResNet blocks [3], are popular in large-scale ConvNets; in contrast, depthwise convolutions [28] are popular in mobile platforms due to its lower computational cost and smaller parameter size [27]. Recent works show that an improved inverted residual bottlenecks (MBConv [27, 35]), which is built upon depthwise convolutions, can achieve both high accuracy and better efficiency [5, 19]. As discussed in Section 2, due to the strong connection between MBConv and Transformer blocks , this paper mostly employs MBConv as convolution building blocks.
|
| 112 |
+
|
| 113 |
+
Self-attention and Transformers. With the key ingredients of self-attention, Transformers have been widely adopted for neural language processing and speech understanding. As an early work, stand-alone self-attention network [34] shows self-attention alone can work well for different vision tasks, though with some practical difficulties. Recently, ViT [13] applies a vanilla Transformer to ImageNet classification, and achieves impressive results after pre-training on a large-scale JFT dataset. However, ViT still largely lags behind state-of-the-art ConvNets when training data is limited. Following that, many recent works have been focused on improving vision Transformers for data efficiency and model efficiency. For a more comprehensive review of vision Transformers, we refer readers to the dedicated surveys [36, 37].
|
| 114 |
+
|
| 115 |
+
Relative attention. Under the general name of relative attention, there have been various variants in literature [30, 38, 39, 34, 40, 31]. Generally speaking, we can separate them into two categories: (a) the input-dependent version where the extra relative attention score is a function of the input states $f ( \bar { x } _ { i } , x _ { j } , \bar { i } - j )$ , and (b) the input-independent version $f ( i - j )$ . The variant in CoAtNet belongs to the input-independent version, and is similar to the one used in T5 [31], but unlike T5, we neither share the relative attention parameters across layers nor use the bucketing mechanism. As a benefit of the input independence, obtaining $f ( i - j )$ for all $( i , j )$ pairs is computationally much cheaper than the input-dependent version on TPU. In addition, at inference time, this only needs to be computed once and cached for future use. A recent work [22] also utilizes such an input-independent parameterization, but it restricts the receptive field to a local window.
|
| 116 |
+
|
| 117 |
+
Combining convolution and self-attention. The idea of combining convolution and self-attention for vision recognition is not new. A common approach is to augment the ConvNet backbone with explicit self-attention or non-local modules [9, 10, 11, 12], or to replace certain convolution layers with standard self-attention [11] or a more flexible mix of linear attention and convolution [41]. While self-attention usually improves the accuracy, they often come with extra computational cost and hence are often regarded as an add-on to the ConvNets, similar to squeeze-and-excitation [42] module. In comparison, after the success of ViT and ResNet-ViT [13], another popular line of research starts with a Transformer backbone and tries to incorporate explicit convolution or some desirable properties of convolution into the Transformer backbone [25, 24, 23, 22, 21, 43, 44].
|
| 118 |
+
|
| 119 |
+
While our work also belongs to this category, we show that our relative attention instantiation is a natural mixture of depthwise convolution and content-based attention with minimum additional cost. More importantly, starting from the perspectives of generalization and model capacity, we take a systematic approach to the vertical layout design and show how and why different network stages prefer different types of layers. Therefore, compared to models that simply use an off-the-shelf ConvNet as the stem layer, such as ResNet-ViT [13], CoAtNet also scales the Convolution stage (S2) when the overall size increases. On the other hand, compared to models employing local attention [22, 21], CoAtNet consistently uses full attention for S3 & S4 to ensure the model capacity, as S3 occupies the majority of the computation and parameters.
|
| 120 |
+
|
| 121 |
+
# 4 Experiments
|
| 122 |
+
|
| 123 |
+
In this section, we compare CoAtNet with previous results under comparable settings. For completeness, all the hyper-parameters not mentioned here are included in Appendix A.2.
|
| 124 |
+
|
| 125 |
+
# 4.1 Experiment Setting
|
| 126 |
+
|
| 127 |
+
CoAtNet model family. To compare with existing models of different sizes, we also design a family of CoAtNet models as summarized in Table 3. Overall, we always double the number of channels from S1 to S4, while ensuring the width of the Stem S0 to be smaller or equal to that of S1. Also, for simplicity, when increasing the depth of the network, we only scale the number of blocks in S2 and S3.
|
| 128 |
+
|
| 129 |
+
Evaluation Protocol. Our experiments focus on image classification. To evaluate the performance of the model across different data sizes, we utilize three datasets of increasingly larger sizes, namely ImageNet-1K (1.28M images), ImageNet-21K (12.7M images) and JFT (300M images). Following previous works, we first pre-train our models on each of the three datasets at resolution 224 for 300, 90 and 14 epochs respectively. Then, we finetune the pre-trained models on ImageNet-1K at the desired resolutions for 30 epochs and obtain the corresponding evaluation accuracy. One exception is the ImageNet-1K performance at resolution 224, which can be directly obtained at the end of pre-training. Note that similar to other models utilizing Transformer blocks, directly evaluating models pre-trained on ImageNet-1K at a larger resolution without finetuning usually leads to performance drop. Hence, finetuning is always employed whenever input resolution changes.
|
| 130 |
+
|
| 131 |
+
Table 3: L denotes the number of blocks and D denotes the hidden dimension (#channels). For all Conv and MBConv blocks, we always use the kernel size 3. For all Transformer blocks, we set the size of each attention head to 32, following [22]. The expansion rate for the inverted bottleneck is always 4 and the expansion (shrink) rate for the SE is always 0.25.
|
| 132 |
+
|
| 133 |
+
<table><tr><td> Stages</td><td>Size</td><td>CoAtNet-0</td><td></td><td>CoAtNet-1</td><td>CoAtNet-2</td><td></td><td>CoAtNet-3</td><td>CoAtNet-4</td></tr><tr><td>S0-Conv</td><td>1/2</td><td>L=2 D=64</td><td>L=2</td><td>D=64</td><td>L=2</td><td>D=128 L=2</td><td>D=192</td><td>L=2 D=192</td></tr><tr><td>S1-MbConv</td><td>1/4</td><td>L=2 D=96</td><td>L=2</td><td>D=96</td><td>L=2 D=128</td><td>L=2</td><td>D=192</td><td>L=2 D=192</td></tr><tr><td>S2-MBConv</td><td>1/8</td><td>L=3 D=192</td><td>L=6</td><td>D=192</td><td>L=6 D=256</td><td>L=6</td><td>D=384</td><td>L=12 D=384</td></tr><tr><td>S3-TFMRel</td><td>1/16</td><td>L=5 D=384</td><td>L=14</td><td>D=384</td><td>L=14 D=512</td><td>L=14</td><td>D=768</td><td>L=28 D=768</td></tr><tr><td>S4-TFMRel</td><td>1/32</td><td>L=2 D=768</td><td>L=2</td><td>D=768</td><td>L=2 D=1024</td><td>L=2</td><td>D=1536</td><td>L=2 D=1536</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Data Augmentation & Regularization. In this work, we only consider two widely used data augmentations, namely RandAugment [45] and MixUp [46], and three common techniques, including stochastic depth [47], label smoothing [48] and weight decay [49], to regularize the model. Intuitively, the specific hyper-parameters of the augmentation and regularization methods depend on model size and data scale, where strong regularization is usually applied for larger models and smaller dataset.
|
| 136 |
+
|
| 137 |
+
Under the general principle, a complication under the current paradigm is how to adjust the regularization for pre-training and finetuning as data size can change. Specifically, we have an interesting observation that if a certain type of augmentation is entirely disabled during pre-training, simply turning it on during fine-tuning would most likely harm the performance rather than improving. We conjecture this could be related to data distribution shift. As a result, for certain runs of the proposed model, we deliberately apply RandAugment and stochastic depth of a small degree when pre-training on the two larger datasets, ImageNet21-K and JFT. Although such regularization can harm the pre-training metrics, this allows more versatile regularization and augmentation during finetuning, leading to improved down-stream performances.
|
| 138 |
+
|
| 139 |
+
# 4.2 Main Results
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Accuracy-to-FLOPs scaling curve under ImageNet-1K only setting at $2 2 4 \mathbf { x } 2 2 4$ .
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 3: Accuracy-to-Params scaling curve under ImageNet- $2 1 \mathrm { K } \Rightarrow$ ImageNet-1K setting.
|
| 146 |
+
|
| 147 |
+
ImageNet-1K The experiment results with only the ImageNet-1K dataset are shown in Table 4. Under similar conditions, the proposed CoAtNet models not only outperform ViT variants, but also match the best convolution-only architectures, i.e., EfficientNet-V2 and NFNets. Additionally, we also visualize the all results at resolution $2 2 4 \mathbf { x } 2 2 4$ in Fig. 2. As we can see, CoAtNet scales much better than previous model with attention modules.
|
| 148 |
+
|
| 149 |
+
Table 4: Model performance on ImageNet. 1K only denotes training on ImageNet-1K only; $2 1 \mathtt { K } + 1 \mathtt { K }$ denotes pre-training on ImageNet-21K and finetuning on ImageNet-1K; PT-RA denotes applying RandAugment during 21K pre-training, and E150 means 150 epochs of 21K pre-training, which is longer than the standard 90 epochs. More results are in Appendix A.3.
|
| 150 |
+
|
| 151 |
+
<table><tr><td colspan="2">Models</td><td>Eval Size</td><td>#Params</td><td>#FLOPs</td><td colspan="2">ImageNet Top-1 Accuracy</td></tr><tr><td rowspan="5">Conv Only</td><td></td><td></td><td></td><td></td><td>1K only</td><td>21K+1K</td></tr><tr><td>EfficientNet-B7</td><td>600²</td><td>66M</td><td>37B</td><td>84.7</td><td>-</td></tr><tr><td>EfficientNetV2-L</td><td>480²</td><td>121M</td><td>53B</td><td>85.7</td><td>86.8</td></tr><tr><td>NFNet-F3</td><td>4162²</td><td>255M</td><td>114.8B</td><td>85.7</td><td>=</td></tr><tr><td>NFNet-F5</td><td>5442</td><td>377M</td><td>289.8B</td><td>86.0</td><td>1</td></tr><tr><td rowspan="4">ViT-Stem TFM</td><td>DeiT-B</td><td>3842</td><td>86M</td><td>55.4B</td><td>83.1</td><td>-</td></tr><tr><td>ViT-L/16</td><td>384²</td><td>304M</td><td>190.7B</td><td>-</td><td>85.3</td></tr><tr><td>CaiT-S-36</td><td>384²</td><td>68M</td><td>48.0B</td><td>85.0</td><td></td></tr><tr><td>DeepViT-L</td><td>224²</td><td>55M</td><td>12.5B</td><td>83.1</td><td>-</td></tr><tr><td rowspan="2">Multi-stage TFM</td><td>Swin-B</td><td>384²</td><td>88M</td><td>47.0B</td><td>84.2</td><td>86.0</td></tr><tr><td>Swin-L</td><td>384²</td><td>197M</td><td>103.9B</td><td>-</td><td>86.4</td></tr><tr><td rowspan="5">Conv+TFM</td><td>BotNet-T7</td><td>3842</td><td>75.1M</td><td>45.8B</td><td>84.7</td><td>-</td></tr><tr><td>LambdaResNet-420</td><td>320²</td><td>-</td><td>=</td><td>84.8</td><td></td></tr><tr><td>T2T-ViT-24</td><td>224²</td><td>64.1M</td><td>15.0B</td><td>82.6</td><td>=</td></tr><tr><td>CvT-21</td><td>384²</td><td>32M</td><td>24.9B</td><td>83.3</td><td>-</td></tr><tr><td>CvT-W24</td><td>3842</td><td>277M</td><td>193.2B</td><td>-</td><td>87.7</td></tr><tr><td rowspan="19">Conv+TFM (ours)</td><td>CoAtNet-0 CoAtNet-1</td><td>224²</td><td>25M</td><td>4.2B</td><td>81.6</td><td>=</td></tr><tr><td></td><td>224²</td><td>42M</td><td>8.4B</td><td>83.3</td><td>-</td></tr><tr><td>CoAtNet-2 CoAtNet-3</td><td>224²</td><td>75M</td><td>15.7B</td><td>84.1</td><td>87.1</td></tr><tr><td></td><td>2242</td><td>168M</td><td>34.7B</td><td>84.5</td><td>87.6</td></tr><tr><td>CoAtNet-0</td><td>384²</td><td>25M</td><td>13.4B</td><td>83.9</td><td>-</td></tr><tr><td>CoAtNet-1</td><td>3842</td><td>42M</td><td>27.4B</td><td>85.1</td><td>-</td></tr><tr><td>CoAtNet-2</td><td>384²</td><td>75M</td><td>49.8B</td><td>85.7</td><td>87.1</td></tr><tr><td>CoAtNet-3</td><td>384²</td><td>168M</td><td>107.4B</td><td>85.8</td><td>87.6</td></tr><tr><td>CoAtNet-4</td><td>384²</td><td>275M</td><td>189.5B</td><td>-</td><td>87.9</td></tr><tr><td>+ PT-RA</td><td>384²</td><td>275M</td><td>189.5B</td><td></td><td>88.3</td></tr><tr><td>+ PT-RA-E150</td><td>3842</td><td>275M</td><td>189.5B</td><td></td><td>88.4</td></tr><tr><td>CoAtNet-2</td><td>5122</td><td>75M</td><td>96.7B</td><td>85.9</td><td>87.3</td></tr><tr><td>CoAtNet-3</td><td>512²</td><td>168M</td><td>203.1B</td><td>86.0</td><td>87.9</td></tr><tr><td>CoAtNet-4</td><td>512²</td><td>275M</td><td>360.9B</td><td>-</td><td>88.1</td></tr><tr><td>+ PT-RA</td><td>512²</td><td>275M</td><td>360.9B</td><td>=</td><td>88.4</td></tr><tr><td>+ PT-RA-E150</td><td>5122</td><td>275M</td><td>360.9B</td><td>=</td><td>88.56</td></tr></table>
|
| 152 |
+
|
| 153 |
+
ImageNet-21K As we can see from Table 4 and Fig. 3, when ImageNet-21K is used for pretraining, the advantage of CoAtNet becomes more obvious, substantially outperforming all previous models. Notably, the best CoAtNet variant achieves a top-1 accuracy of $8 8 . 5 6 \%$ , matching the ViTH/14 performance of $8 8 . 5 5 \%$ , which requires pre-training the $2 . 3 \mathbf { x }$ larger ViT model on a $2 3 \mathrm { x }$ larger proprietary weakly labeled dataset (JFT) for $2 . 2 \mathbf { x }$ more steps. This marks a dramatic improvement in both data efficiency and computation efficiency.
|
| 154 |
+
|
| 155 |
+
JFT Finally, in Table 5, we further evaluate CoAtNet under the large-scale data regime with JFT300M and JFT-3B. Encouragingly, our CoAtNet-4 can almost match the best previous performance with JFT-300M set by NFNet- $\mathrm { F 4 + }$ , while being $2 \mathbf { x }$ more efficient in terms of both TPU training time and parameter count. When we scale up the model to consume similar training resource as NFNet- $. \mathrm { F 4 + }$ , CoAtNet-5 reaches $8 9 . 7 7 \%$ on top-1 accuracy, outperforming previous results under comparable settings.
|
| 156 |
+
|
| 157 |
+
Moreover, as we further push the training resource towards the level used by ViT-G/14 and utilize the same JFT-3B dataset of an even larger size [26], with over $4 \mathbf { x }$ less computation, CoAtNet-6 is able to match the performance of $\mathrm { V i T - G } / 1 4$ of $9 0 . 4 5 \%$ , and with $1 . 5 \mathrm { x }$ less computation, CoAtNet-7 achieves $8 9 . 7 7 \%$ on top-1 accuracy $9 0 . 8 8 \%$ , achieving the new state-of-the-art performance.
|
| 158 |
+
|
| 159 |
+
Table 5: Performance Comparison on large-scale JFT dataset. TPUv3-core-days denotes the pretraining time, Top-1 Accuracy denotes the finetuned accuracy on ImageNet. Note that the last 3 rows use a larger dataset JFT-3B [26] for pre-training, while others use JFT-300M [15]. See Appendix A.2 for the size details of CoAtNet-5/6/7. †: Down-sampling in the MBConv block is achieved by stride-2 Depthwise Convolution. ⇧: ViT-G/14 computation consumption is read from Fig. 1 of the paper [26].
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Models</td><td>Eval Size</td><td>#Params</td><td>#FLOPs</td><td>TPUv3-core-days</td><td>Top-1 Accuracy</td></tr><tr><td>ResNet + ViT-L/16</td><td>3842</td><td>330M</td><td>=</td><td>1</td><td>87.12</td></tr><tr><td>ViT-L/16</td><td>5122</td><td>307M</td><td>364B</td><td>0.68K</td><td>87.76</td></tr><tr><td>ViT-H/14</td><td>5182</td><td>632M</td><td>1021B</td><td>2.5K</td><td>88.55</td></tr><tr><td>NFNet-F4+</td><td>5122</td><td>527M</td><td>367B</td><td>1.86K</td><td>89.2</td></tr><tr><td>CoAtNet-3t</td><td>3842</td><td>168M</td><td>114B</td><td>0.58K</td><td>88.52</td></tr><tr><td>CoAtNet-3t</td><td>5122</td><td>168M</td><td>214B</td><td>0.58K</td><td>88.81</td></tr><tr><td>CoAtNet-4</td><td>5122</td><td>275M</td><td>361B</td><td>0.95K</td><td>89.11</td></tr><tr><td>CoAtNet-5</td><td>5122</td><td>688M</td><td>812B</td><td>1.82K</td><td>89.77</td></tr><tr><td>ViT-G/14</td><td>5182</td><td>1.84B</td><td>5160B</td><td>>30K</td><td>90.45</td></tr><tr><td>CoAtNet-6</td><td>5122</td><td>1.47B</td><td>1521B</td><td>6.6K</td><td>90.45</td></tr><tr><td>CoAtNet-7</td><td>5122</td><td>2.44B</td><td>2586B</td><td>20.1K</td><td>90.88</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 4.3 Ablation Studies
|
| 164 |
+
|
| 165 |
+
In this section, we will ablate our design choices for CoAtNet.
|
| 166 |
+
|
| 167 |
+
Firstly, we study the importance of the relative attention from combining convolution and attention into a single computation unit. Specifically, we compare two models, one with the relative attention and the other without, under both the ImageNet-1K alone and ImageNet-21K transfer setting. As we can see from Table 6, when only the ImageNet-1K is used, relative attention clearly outperforms the standard attention, indicating a better generalization. In addition, under the ImageNet-21K transfer setting, the relative attention variant achieves a substantially better transfer accuracy, despite their very close pre-training performances. This suggests the main advantage of relative attention in visual processing is not in higher capacity but in better generalization.
|
| 168 |
+
|
| 169 |
+
Table 6: Ablation on relative attention.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Seting</td><td>Metric</td><td>With Rel-Attn</td><td>Without Rel-Attn</td></tr><tr><td rowspan="2">ImageNet-1K</td><td>Accuracy (2242)</td><td>84.1</td><td>83.8</td></tr><tr><td>Accuracy (3842)</td><td>85.7</td><td>85.3</td></tr><tr><td rowspan="2">ImageNet-21K →ImageNet-1K</td><td>Pre-train Precision@1 (224²)</td><td>53.0</td><td>52.8</td></tr><tr><td>Finetune Accuracy (384²)</td><td>87.9</td><td>87.4</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 7: Ablation on architecture layout.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Setting</td><td>Models</td><td>Layout</td><td>Top-1 Accuracy</td></tr><tr><td rowspan="3">ImageNet-1K</td><td>VO: CoAtNet-2</td><td>[2,2,6,14,2]</td><td>84.1</td></tr><tr><td>V1: S2← S3</td><td>[2,2, 2,18,2]</td><td>83.4</td></tr><tr><td>V2: S2→ S3</td><td>[2,2,8,12,2]</td><td>84.0</td></tr><tr><td>ImageNet-21K</td><td>VO: CoAtNet-3</td><td>[2,2,6,14,2]</td><td>53.0 -→87.6</td></tr><tr><td>⇒ImageNet-1K</td><td>V1: S2 ← S3</td><td>[2,2,2,18,2]</td><td>53.0 -→87.4</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Secondly, as S2 with MBConv blocks and S3 with relative Transformer blocks occupy most of the computation of the CoAtNet, a question to ask is how to split the computation between S2 (MBConv) and S3 (Transformer) to achieve a good performance. In practice, it boils down to deciding the number of blocks to have in each stage, which we will refer to as “layout” design. For this purpose, we compare a few different layouts that we experimented with in Table 7.
|
| 178 |
+
|
| 179 |
+
Table 8: Ablation on head size and normalization type.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Setting</td><td>Models</td><td>Image Size</td><td>Top-1 Accuracy</td></tr><tr><td rowspan="3">ImageNet-1K</td><td>CoAtNet-2</td><td>2242</td><td>84.1</td></tr><tr><td>Head size: 32 → 64</td><td>2242</td><td>83.9</td></tr><tr><td>Norm type: 1 BN →LN</td><td>2242</td><td>84.1</td></tr><tr><td rowspan="2">ImageNet-21K ⇒ ImageNet-1K</td><td>CoAtNet-3</td><td>3842</td><td>87.9</td></tr><tr><td>Norm type: BN →→ LN</td><td>384²</td><td>87.8</td></tr></table>
|
| 182 |
+
|
| 183 |
+
• If we keep the total number of blocks in S2 and S3 fixed and vary the number in each stage, we observe that V0 is a sweet spot between V1 and V2. Basically, having more Transformer blocks in S3 generally leads to better performance until the number of MBConv blocks in S2 is too small to generalize well.
|
| 184 |
+
|
| 185 |
+
• To further evaluate whether the sweet spot also holds in the transfer setting, where a higher capacity is often regarded more important, we further compare V0 and V1 under the ImageNet21K transferring to ImageNet-1K setup. Interestingly, despite that V1 and V0 have the same performance during ImageNet-21K pre-training, the transfer accuracy of V1 clearly falls behind V0. Again, this suggests the importance of convolution in achieving good transferability and generalization.
|
| 186 |
+
|
| 187 |
+
Lastly, we study two choices of model details, namely the dimension of each attention (default to 32) head as well as the type of normalization (default to BatchNorm) used in MBConv blocks. From Table 8, we can see increasing head size from 32 to 64 can slightly hurt performance, though it actually improves the TPU speed by a significant amount. In practice, this will be a quality-speed trade-off one can make. On the other hand, BatchNorm and LayerNorm have almost the same performance, while BatchNorm is $10 - 2 0 \%$ faster on TPU depending on the per-core batch size.
|
| 188 |
+
|
| 189 |
+
# 5 Conclusion
|
| 190 |
+
|
| 191 |
+
In this paper, we systematically study the properties of convolutions and Transformers, which leads to a principled way to combine them into a new family of models named CoAtNet. Extensive experiments show that CoAtNet enjoys both good generalization like ConvNets and superior model capacity like Transformers, achieving state-of-the-art performances under different data sizes and computation budgets.
|
| 192 |
+
|
| 193 |
+
Note that this paper currently focuses on ImageNet classification for model development. However, we believe our approach is applicable to broader applications like object detection and semantic segmentation. We will leave them for future work.
|
| 194 |
+
|
| 195 |
+
# References
|
| 196 |
+
|
| 197 |
+
[1] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012.
|
| 198 |
+
[2] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 199 |
+
[3] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 200 |
+
[4] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
|
| 201 |
+
[5] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. ICML, 2019.
|
| 202 |
+
[6] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 203 |
+
[7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 204 |
+
[8] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 205 |
+
[9] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 206 |
+
[10] Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3286–3295, 2019.
|
| 207 |
+
[11] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 208 |
+
[12] Zhuoran Shen, Mingyuan Zhang, Haiyu Zhao, Shuai Yi, and Hongsheng Li. Efficient attention: Attention with linear complexities. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3531–3539, 2021.
|
| 209 |
+
[13] 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.
|
| 210 |
+
[14] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 211 |
+
[15] Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017.
|
| 212 |
+
[16] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 213 |
+
[17] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
|
| 214 |
+
[18] Daquan Zhou, Bingyi Kang, Xiaojie Jin, Linjie Yang, Xiaochen Lian, Qibin Hou, and Jiashi Feng. Deepvit: Towards deeper vision transformer. arXiv preprint arXiv:2103.11886, 2021.
|
| 215 |
+
[19] Mingxing Tan and Quoc V Le. Efficientnetv2: Smaller models and faster training. ICML, 2021.
|
| 216 |
+
[20] Andrew Brock, Soham De, Samuel L Smith, and Karen Simonyan. High-performance largescale image recognition without normalization. arXiv preprint arXiv:2102.06171, 2021.
|
| 217 |
+
[21] Ashish Vaswani, Prajit Ramachandran, Aravind Srinivas, Niki Parmar, Blake Hechtman, and Jonathon Shlens. Scaling local self-attention for parameter efficient visual backbones. arXiv preprint arXiv:2103.12731, 2021.
|
| 218 |
+
[22] 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.
|
| 219 |
+
[23] Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021.
|
| 220 |
+
[24] Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: a vision transformer in convnet’s clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021.
|
| 221 |
+
[25] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 222 |
+
[26] Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. arXiv preprint arXiv:2106.04560, 2021.
|
| 223 |
+
[27] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
|
| 224 |
+
[28] Laurent Sifre. Rigid-motion scattering for image classification. Ph.D. thesis section 6.2, 2014.
|
| 225 |
+
[29] Mirgahney Mohamed, Gabriele Cesa, Taco S Cohen, and Max Welling. A data and compute efficient design for limited-resources deep learning. arXiv preprint arXiv:2004.09691, 2020.
|
| 226 |
+
[30] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 227 |
+
[31] 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. arXiv preprint arXiv:1910.10683, 2019.
|
| 228 |
+
[32] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pages 5156–5165. PMLR, 2020.
|
| 229 |
+
[33] Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020.
|
| 230 |
+
[34] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019.
|
| 231 |
+
[35] Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. Mnasnet: Platform-aware neural architecture search for mobile. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2820–2828, 2019.
|
| 232 |
+
[36] Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on visual transformer. arXiv preprint arXiv:2012.12556, 2020.
|
| 233 |
+
[37] Salman Khan, Muzammal Naseer, Munawar Hayat, Syed Waqas Zamir, Fahad Shahbaz Khan, and Mubarak Shah. Transformers in vision: A survey. arXiv preprint arXiv:2101.01169, 2021.
|
| 234 |
+
[38] Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Noam Shazeer, Ian Simon, Curtis Hawthorne, Andrew M Dai, Matthew D Hoffman, Monica Dinculescu, and Douglas Eck. Music transformer. arXiv preprint arXiv:1809.04281, 2018.
|
| 235 |
+
[39] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 236 |
+
[40] Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov. Transformer dissection: A unified understanding of transformer’s attention via the lens of kernel. arXiv preprint arXiv:1908.11775, 2019.
|
| 237 |
+
[41] Irwan Bello. Lambdanetworks: Modeling long-range interactions without attention. arXiv preprint arXiv:2102.08602, 2021.
|
| 238 |
+
[42] Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132–7141, 2018.
|
| 239 |
+
[43] Kun Yuan, Shaopeng Guo, Ziwei Liu, Aojun Zhou, Fengwei Yu, and Wei Wu. Incorporating convolution designs into visual transformers. arXiv preprint arXiv:2103.11816, 2021.
|
| 240 |
+
[44] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
|
| 241 |
+
[45] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020.
|
| 242 |
+
[46] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 243 |
+
[47] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European conference on computer vision, pages 646–661. Springer, 2016.
|
| 244 |
+
[48] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 245 |
+
[49] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 246 |
+
[50] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pages 630–645. Springer, 2016.
|
| 247 |
+
[51] Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 248 |
+
[52] Zihang Dai, Guokun Lai, Yiming Yang, and Quoc V Le. Funnel-transformer: Filtering out sequential redundancy for efficient language processing. arXiv preprint arXiv:2006.03236, 2020.
|
md/train/NJS8kp15zzH/NJS8kp15zzH.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rethinking Calibration of Deep Neural Networks: Do Not Be Afraid of Overconfidence
|
| 2 |
+
|
| 3 |
+
Deng-Bao Wang,1,2 Lei Feng,3 Min-Ling Zhang1,2∗
|
| 4 |
+
|
| 5 |
+
1School of Computer Science and Engineering, Southeast University, Nanjing 210096, China
|
| 6 |
+
2Key Laboratory of Computer Network and Information Integration (Southeast University), Ministry of Education, China 3College of Computer Science, Chongqing University, Chongqing, 400044, China wangdb@seu.edu.cn, lfeng@cqu.edu.cn, zhangml@seu.edu.cn
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Capturing accurate uncertainty quantification of the predictions from deep neural networks is important in many real-world decision-making applications. A reliable predictor is expected to be accurate when it is confident about its predictions and indicate high uncertainty when it is likely to be inaccurate. However, modern neural networks have been found to be poorly calibrated, primarily in the direction of overconfidence. In recent years, there is a surge of research on model calibration by leveraging implicit or explicit regularization techniques during training, which achieve well calibration performance by avoiding overconfident outputs. In our study, we empirically found that despite the predictions obtained from these regularized models are better calibrated, they suffer from not being as calibratable, namely, it is harder to further calibrate these predictions with post-hoc calibration methods like temperature scaling and histogram binning. We conduct a series of empirical studies showing that overconfidence may not hurt final calibration performance if post-hoc calibration is allowed, rather, the penalty of confident outputs will compress the room of potential improvement in post-hoc calibration phase. Our experimental findings point out a new direction to improve calibration of DNNs by considering main training and post-hoc calibration as a unified framework.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Modern over-parameterized deep neural networks (DNNs) have been shown to be very powerful modeling tools for many prediction tasks involving complex input patterns [37]. In addition to obtaining accurate predictions, it is also important to capture accurate quantification of prediction uncertainty from deep neural networks in many real-world decision-making applications. A reliable predictive model should be accurate when it is confident about its predictions and indicate high uncertainty when it is likely to be inaccurate. However, modern DNNs trained with cross-entropy (CE) loss, despite being highly accurate, have been recently found to predict poorly calibrated probabilities, unlike traditional models trained with the same objective [4]. The overconfident predictions of DNNs could cause undesired consequences in safety-critical applications such as medical diagnosis and autonomous driving. Bayesian DNNs, which indirectly infer prediction uncertainty through weight uncertainties, have innate abilities to represent the model uncertainty [2, 16]. But training and inferring those bayesian models are computationally more expensive and conceptually more complicated than non-bayesian models, and their performance depends on the form of approximation made due to computational constraints. Therefore, the study on uncertainty calibration of deterministic DNNs is important for both development practice and the perspective of understanding DNNs.
|
| 15 |
+
|
| 16 |
+
Post-hoc calibration addresses the miscalibration problem by equipping a given neural network with an additional parameterized calibration component, which can be tuned with a hold-out validation dataset. Guo et al. [4] experimented with several classical calibration fixes and found that simple post-hoc methods like Temperature Scaling (TS) [25] and Histogram Binning (HB) [33] are significantly effective for DNNs. The authors of [10] and [27] proposed to learn linear and non-linear transformation functions to rescale the original output logits respectively. Gupta et al. [5] proposed to obtain a calibration function by approximating the empirical cumulative distribution of output probabilities via splines. Kumar et al. [11] proposed to integrate TS with HB to achieve more stable calibration performance. Patel et al. [24] proposed a mutual information maximization-based binning strategy to solve the severe sample-inefficiency issue in HB.
|
| 17 |
+
|
| 18 |
+
Recently, there is another line of research which presents a possibility of improving the calibration quality of deterministic DNNs via regularization during training. Guo et al. [4] found that training DNNs with strong weight decay, which used to be the predominant regularization mechanism for training neural networks, has a positive impact on calibration. Müller et al. [19] showed that training models using the standard CE loss with label smoothing [28], instead of one-hot labels, has a very favourable effect on model calibration. Mukhoti et al. [18] proposed to improve uncertainty calibration by replacing the conventionally used CE loss with the focal loss proposed in [14] when training DNNs. It is important to note that CE loss with label smoothing and focal loss can be considered as standard CE with an additional maximum-entropy regularizer, which means minimizing these losses is equivalent to minimizing CE loss and maximizing the entropy of the predicted distribution simultaneously [18, 17]. Following these studies, a recent work [7] explored several explicit regularization techniques for improving the predictive uncertainty calibration directly.
|
| 19 |
+
|
| 20 |
+
In this paper, we conduct an empirical study showing that despite the predictions obtained from the regularized models are well calibrated, they suffer from worse calibratable, namely, it is harder to further improve the calibrate performance with post-hoc calibration methods like temperature scaling and histogram binning. We found that the regularization works by simply aligning the average confidence of the whole dataset to the accuracy with some specific regularization strengths, and cannot achieve fine-grained calibration. The comparison results show that when post-hoc calibration methods are allowed, the standard CE loss yields better calibration performance than those regularization methods. The extended experiments demonstrate that regularization will make DNNs lose the important information about the hardness of samples, which results in compressing the room of potential improvement by post-hoc calibration. Based on the experimental findings, we raise a natural question: can we design new loss functions in the opposite direction of these regularization methods to further improve the calibration performance? To this end, we propose inverse focal loss, and empirically found that it can learn more calibratable models in some cases compared with the CE loss, though it causes severer overconfidence problem without post-hoc calibration. Most importantly, our findings show that overconfidence of DNNs is not the nightmare in uncertainty qualification and point out a new direction to improve the calibration of DNNs by considering main training and post-hoc calibration as a unified framework.
|
| 21 |
+
|
| 22 |
+
# 2 Preliminaries
|
| 23 |
+
|
| 24 |
+
Let $\mathcal { V } = \{ { 1 , . . . , K } \}$ denote the label space and $\mathcal { X } = \mathbb { R } ^ { d }$ denote the feature space. Given a sample $( { \pmb x } , y ) \in \mathcal { X } \times \mathcal { Y }$ sampled from an unknown distribution, a learned neural network classifier $f ^ { \theta } :$ $\mathcal { X } \to \Delta ^ { K }$ can produce a probability distribution for $_ { \textbf { \em x } }$ on $K$ classes, where $\Delta ^ { K }$ denotes the $K - 1$ dimensional unit simplex. Here we assume $f ^ { \theta }$ as a composition of a non-probabilistic $K$ -way classifier $g ^ { \theta }$ and a softmax function $\sigma$ , i.e. $\dot { \pmb { f } } ^ { \theta } = \pmb { g } ^ { \theta } \circ \pmb { \sigma }$ . For a query instance $_ { \textbf { \em x } }$ , $f ^ { \theta }$ gives its probability of assigning it to label i as exp(g i P (x))Kk=1 exp(gθk(x)) , where $g _ { i } ^ { \theta } ( { \pmb x } )$ denotes the $i$ -th element of the logit vector produced by $g ^ { \theta }$ . Then, ${ \hat { y } } : = \arg \operatorname* { m a x } _ { i } f _ { i } ^ { \theta } ( { \pmb x } )$ can be returned as the predicted label and ${ \hat { p } } : = \operatorname* { m a x } _ { i } f _ { i } ^ { \theta } ( { \pmb x } )$ can be treated as the associated confidence score.
|
| 25 |
+
|
| 26 |
+
Expected Calibration Error (ECE) For a well-calibrated model, $\hat { p }$ is expected to represent the true probability of correctness. Formally, a perfectly calibrated model satisfies $\mathbb { P } ( \boldsymbol { \hat { y } } = \boldsymbol { y } | \boldsymbol { \hat { p } } = \boldsymbol { p } ) = \boldsymbol { p }$ for any $p \in [ 0 , 1 ]$ . In practice, ECE [20] is a commonly used calibration metric from finite samples. It works by firstly grouping all samples (let $n$ denote the number of samples) into $M$ equally interval bins betw $\{ \bar { B _ { m } } \} _ { m = 1 } ^ { M }$ with respect to their confideuracy and average confidence: c e. $\begin{array} { r } { \mathrm { E C E } = \sum _ { m = 1 } ^ { M } \frac { | B _ { m } | } { n } | \mathrm { a c c } ( B _ { m } ) - \mathrm { a v g } \mathrm { C o n f } ( B _ { m } ) | . } \end{array}$
|
| 27 |
+
|
| 28 |
+
Temperature Scaling By scaling the logits produced by $g ^ { \theta }$ with a temperature $T$ , the sharpness of output probabilities can be changed. Formally, after adding TS, the new prediction confidence can be expressed as: $\begin{array} { r } { \hat { p } = \operatorname* { m a x } _ { i } \frac { \exp ( g _ { i } ^ { \theta } ( \pmb { x } ) / T ) } { \sum _ { k = 1 } ^ { K } \exp ( g _ { k } ^ { \theta } ( \pmb { x } ) / T ) } } \end{array}$ . The temperature softens the output probability with and sharpens the probability with $T < 1$ . As , the output probability collapses to one-hot vector. As $T \to \infty$ , the output probability approaches to a uniform distribution. After training of the model, $T$ can be tuned on a hold-out validation set by optimization methods.
|
| 29 |
+
|
| 30 |
+
Histogram Binning is a non-parametric calibration approach. Given an uncalibrated model, all the prediction confidences of validation samples can be divided into mutually exclusive $N$ bins $\{ B _ { n } \} _ { n = 1 } ^ { N }$ according to a set of intervals $\{ I _ { n } \} _ { n = 1 } ^ { N + 1 }$ which partitions [0, 1]. Each bin is assigned a confidence score , which can be simply set to the corresponding accuracy of samples in each bin. If the uncalibrated confidence $\hat { p }$ of a query instance falls into bin $B _ { n }$ , then the calibrated confidence is $\eta _ { n }$ . The bins can be chosen by two simple schemes: equal size binning (uniformly partitioning the probability interval in $[ 0 , 1 ] \cdot$ ) and equal mass binning (uniformly distributing samples over bins). Note that although the HB scheme is simple to implement and was demonstrated to achieve good calibration results in some datasets, it makes the predictor only produce very sparse confidence distribution, and compromises the many legitimately confident predictions.
|
| 31 |
+
|
| 32 |
+
# 3 Regularization in Neural Networks for Calibration
|
| 33 |
+
|
| 34 |
+
In recent years, there is a surge of research on model calibration by leveraging implicit or explicit regularization techniques during training of DNNs, which makes better calibrated predictions by avoiding the overconfident outputs. In this section, we firstly review three representative regularization methods and then empirically show their improvements on ECE compared with the baseline.
|
| 35 |
+
|
| 36 |
+
Label Smoothing is widely used as a means to reduce overfitting of DNNs. The mechanism of LS is simple: when training with CE loss, the one-hot label vector $\textbf { { y } }$ is replaced with soft label vector $\widetilde { \pmb { y } }$ , whose elements can be formally denoted as $\widetilde { y _ { i } } = ( 1 - \epsilon ) y _ { i } + \epsilon / K , \forall i \in \{ 1 , . . . , K \}$ , where $\epsilon > 0$ e eis a strength coefficient. Müller et al. [19] demonstrated that label smoothing implicitly calibrates DNNs by preventing the networks from becoming overconfident. Let $\mathcal { L } _ { c e }$ denote the CE loss, then the following equation holds:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathcal { L } _ { c e } ( \widetilde { \pmb { y } } , \pmb { f } ^ { \theta } ) = ( 1 - \epsilon ) \mathcal { L } _ { c e } ( \pmb { y } , \pmb { f } ^ { \theta } ) + \epsilon \mathcal { L } _ { c e } ( \pmb { u } , \pmb { f } ^ { \theta } )
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
This can be simply proved. Therefore, minimizing CE loss between smoothed labels and the model outputs is equivalent to adding a confidence penalty term, i.e., a weighted CE loss between the uniform distribution $\textbf { \em u }$ and the model outputs, to the original CE loss.
|
| 43 |
+
|
| 44 |
+
$L _ { p }$ Norm in the Function Space is one of the explicit regularization methods for calibration investigated by the recent work [7]. For a real number $p \geq 1$ , the $L _ { p }$ Norm of a vector $_ { z }$ with dimension $n$ can be expressed as: $\begin{array} { r } { \| z \| _ { p } = ( \sum _ { i = 1 } ^ { n } | z _ { i } | ^ { p } ) ^ { 1 / p } } \end{array}$ . By adding $L _ { p }$ Norm of logits $g ^ { \theta }$ with a weighting coefficient $\alpha$ into final objective function, i.e. $\mathcal { L } _ { L _ { p } } ( y , f ^ { \theta } ) = \mathcal { L } _ { c e } ( y , f ^ { \theta } ) + \alpha \left\| g ^ { \theta } \right\| _ { p }$ , the function complexity of neural networks can be directly penalized during training.
|
| 45 |
+
|
| 46 |
+
Focal Loss is originally proposed to address the class imbalance problem in object detection. By reshaping the standard CE loss through weighting loss components of all samples according to how well the model fits them, focal loss focuses on fitting hard samples and prevents the easy samples from overwhelming the training procedure. Formally, for classification tasks where the target distribution is one-hot encoding, it is defined as: $\mathcal { L } _ { f } = - \dot { ( } 1 - f _ { y } ^ { \theta } ) ^ { \gamma } \log f _ { y } ^ { \theta }$ , where $\gamma$ is a predefined coefficient. Mukhoti et al. [18] found that the models learned by focal loss produce output probabilities which are already very well calibrated. Interestingly, they also showed that focal loss is an upper bound of the regularized KL-divergence, which can be expressed formally as follows:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathcal { L } _ { f } \geq \mathrm { K L } ( \pmb { y } | | \pmb { f } ^ { \theta } ) - \gamma \mathrm { H } ( \pmb { f } ^ { \theta } )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\operatorname { H } ( p )$ denotes the entropy of distribution $\pmb { p }$ . This upper bound property shows that replacing the CE loss with focal loss has the effect of adding a maximum-entropy regularizer.
|
| 53 |
+
|
| 54 |
+
# 3.1 Empirical Comparison
|
| 55 |
+
|
| 56 |
+
We conduct a comparison study of the above regularization methods on four commonly used datasets. We train ResNet-32 [6] models on SVHN [21], CIFAR-10/100 [9] and train a 8-layer 1D-CNN model on 20Newsgroups [13], using the standard CE loss and the above regularized losses respectively, with state-of-the-art learning policy settings (see implementation details in Appendix). For Norm regularization, we use $L _ { 1 }$ Norm, which has been shown effective for calibration despite its simple form [7]. Table 1 shows the comparison of these methods. Note that for each of the above three regularization methods, there is a coefficient, i.e., , $\alpha$ and $\gamma$ , controlling the strength of regularization. We conduct experiments using these methods with the following coefficient settings: $\{ 0 . 0 1 , 0 . 0 3 , 0 . 0 5 , 0 . 0 7 , 0 . 0 \bar { 9 } \}$ for label smoothing, $\{ 0 . 0 0 1 , 0 . 0 0 5 , 0 . 0 1 , 0 . 0 5 , 0 . 1 \}$ for $L _ { 1 }$ Norm and $\{ 1 , 3 , 5 , 7 , 9 \}$ for focal loss. And we choose the best coefficient for each method and dataset, according to their ECE directly on test data.
|
| 57 |
+
|
| 58 |
+
Table 1: Comparison results (mean±std) of ECE $( \% )$ with $M = 1 5$ and predictive accuracy $( \% )$ over 5 random runs. The values with underline in first row represent the chosen coefficients of each regularization method on four datasets according to the ECE on test data.
|
| 59 |
+
|
| 60 |
+
<table><tr><td></td><td></td><td>Cross-Entropy</td><td>Label Smoothing 0.01/0.05/0.09/0.09</td><td>L1Norm 0.01/0.05/0.01/0.01</td><td>Focal Loss 1/3/5/5</td></tr><tr><td rowspan="2">SVHN</td><td>ECE</td><td>3.03±0.16</td><td>1.84±0.19</td><td>1.85±0.04</td><td>1.01±0.21</td></tr><tr><td>Accuracy</td><td>95.00±0.27</td><td>95.21±0.23</td><td>95.29±0.13</td><td>94.77±0.19</td></tr><tr><td rowspan="2">CIFAR-10</td><td>ECE</td><td>6.43±0.22</td><td>2.72±0.32</td><td>2.93±0.39</td><td>3.00±0.26</td></tr><tr><td>Accuracy</td><td>90.46±0.23</td><td>90.09±0.41</td><td>90.06±0.59</td><td>87.84±0.17</td></tr><tr><td rowspan="2">CIFAR-100</td><td>ECE</td><td>19.53±0.36</td><td>2.27±0.48</td><td>8.07±0.44</td><td>2.34±0.35</td></tr><tr><td>Accuracy</td><td>64.64±0.43</td><td>63.73±0.67</td><td>63.07±0.29</td><td>60.36±0.44</td></tr><tr><td rowspan="2">20 Newsgroups</td><td>ECE</td><td>20.82±0.93</td><td>5.85±0.64</td><td>13.31±0.56</td><td>3.82±0.51</td></tr><tr><td>Accuracy</td><td>72.85±0.89</td><td>72.81±0.26</td><td>73.61±0.80</td><td>59.17±1.81</td></tr></table>
|
| 61 |
+
|
| 62 |
+
From the results of Table 1, it is obvious that the regularization methods significantly decrease the ECE on all datasets, compared with the standard CE loss. The prediction accuracy results are also reported. When the strength coefficients of $L _ { 1 }$ Norm and focal loss are large, their predictive performances are harmed. Especially, $L _ { 1 }$ Norm fails on CIFAR-100 and 20Newsgroups when $\alpha \ge 0 . 0 5$ , thus $\alpha$ is chosen from $\{ 0 . 0 0 1 , 0 . 0 0 5 , 0 . 0 1 \}$ on these two datasets.
|
| 63 |
+
|
| 64 |
+
# 4 Does Regularization Really Help Calibration?
|
| 65 |
+
|
| 66 |
+
As shown by the above empirical results, the regularization methods do help the calibration of DNNs during training, especially alleviate the overconfidence issue caused by the standard CE loss. In this section, we empirically investigate their calibration performance when integrating them with post-hoc calibration. After training, we use the post-hoc methods TS and HB to further calibrate the output probabilities. For TS, we simply search the best temperature in the temperature pool {0.01,0.02...,10} on the validation set (see data splits in Appendix). For HB, we use equal size binning scheme on the top-1 prediction of all classes with bin number set as 15. The experimental details used in this section are the same with those in Section 3.
|
| 67 |
+
|
| 68 |
+
Comparison Results Table 2 shows the comparison results of ECE with the help of TS and HB. We can see that: (1) The standard CE loss achieves the best calibration performance on most cases. (2) The searched temperatures of models trained with the CE loss are significantly higher than those of other losses, which indicates that CE loss causes higher predictive confidences. These results demonstrate that despite the regularized models can produce better calibrated predictions, it is harder to further improve them with post-hoc calibration methods after main training. In other words, the penalty of confident predictions will compress the room of potential improvement by post-hoc methods. We also conduct experiments on CIFAR-10 and CIFAR-100 using a deeper model ResNet-110 and similar comparison results are obtained (see Appendix Table A).
|
| 69 |
+
|
| 70 |
+
Coefficient Sensitivity Figure 1(a), 1(b) and 1(c) illustrate the ECEs of these three regularization methods with varied coefficient strengths. As we can see, since the complexity of the used datasets are different, the best coefficients of these methods markedly vary across the datasets, and a small change on these coefficients may cause large ECE increase. This means that we need to carefully choose the coefficient of each method when employing them on new datasets, to achieve good calibration. We can also observe that for SVHN, on which the accuracy is highest among four datasets, the regularization methods obtain lowest ECE with small coefficients. For CIFAR-100 and 20Newsgroups, on which the accuracy is relatively lower, the regularization methods need larger coefficients for better calibration. Based on this observation, we conduct another experiment for investigating the correlation between the regularization coefficients and accuracy. We learn networks on CIFAR-10 by controlling training data size, which leads to varied predictive accuracies, and choose the best coefficient for each case. Here, $\epsilon$ , $\alpha$ and $\gamma$ are chosen from $\{ 0 . 0 1 , 0 . 0 2 , . . . , 0 . 2 5 \}$ , $\{ 0 . 0 1 , 0 . 0 2 , . . . , 0 . 1 \}$ and $\{ 1 , 3 , 5 , 7 , 9 \}$ respectively. Figure 2(d) shows that with the increase of training data size, which results in increase of predictive accuracy, the best coefficients of the regularization methods keep decreasing.
|
| 71 |
+
|
| 72 |
+
Table 2: Comparison results (mean±std) of ECE $( \% )$ with $M = 1 5$ over 5 random runs. The coefficients of the regularization methods on each dataset are same with those in Table 1. N/N and $\diagup$ indicate that the average ECE of regularization methods are higher and lower than standard CE, where $\blacktriangle$ and $\boldsymbol { \vee }$ are based on two-sample t-test at 0.05 significance level.
|
| 73 |
+
|
| 74 |
+
<table><tr><td colspan="2"></td><td>Cross-Entropy</td><td>Label Smoothing 0.01/0.05/0.09/0.09</td><td>L1Norm 0.01/0.05/0.01/0.01</td><td>Focal Loss 1/3/5/5</td></tr><tr><td rowspan="3">SVHN</td><td>with TS Temperature</td><td>0.72±0.26 1.82</td><td>1.35±0.11 1.11</td><td>1.22±0.08 1.12</td><td>0.80±0.22 1.10</td></tr><tr><td>with HB</td><td>0.68±0.22</td><td>0.70±0.21</td><td>0.73±0.20</td><td>0.96±0.14</td></tr><tr><td>with TS Temperature</td><td>0.95±0.19 2.51</td><td>2.54±0.11 0.96</td><td>2.71±0.36</td><td>1.39±0.28</td></tr><tr><td rowspan="2">CIFAR-10</td><td>with HB</td><td>0.74±0.15</td><td>0.94±0.21</td><td>0.95 1.16±0.54</td><td>0.76 1.65±0.31</td></tr><tr><td>with TS Temperature</td><td>1.35±0.19 2.19</td><td>1.37±0.27 1.04</td><td>3.92±0.21</td><td>2.14±0.42</td></tr><tr><td rowspan="2">CIFAR-100</td><td>with HB</td><td>1.27±0.27</td><td>2.01±0.22</td><td>1.24 1.56±0.44</td><td>0.97 1.83±0.30</td></tr><tr><td>with TS</td><td>3.11±0.33</td><td>5.22±0.60</td><td>2.71±0.25</td><td>3.77±0.41</td></tr><tr><td rowspan="2">20 Newsgroups</td><td>Temperature</td><td>4.18</td><td>1.06</td><td>1.48</td><td>0.89</td></tr><tr><td>with HB</td><td>2.52±0.47</td><td>2.67±0.82</td><td>2.61±0.95</td><td>3.16±0.97</td></tr></table>
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 1: (a-c): ECE $( \% )$ with $M = 1 5$ of regularization methods with controlled regularization strength. (d): Best coefficients of regularization methods with respect to ECE with controlled training data size.
|
| 78 |
+
|
| 79 |
+
Reliability Diagram We use reliability diagram to visually represent the gap between predictive confidence and accuracy of each method. Due to the space limitation, here we only present the diagrams of CIFAR-10, and the rest figures are presented in Appendix. We can see that these visual results are similar with the comparison results of ECE reported in Table 2. Although the gap between confidence and accuracy is large when using the standard CE loss, it can be significantly diminished after using TS. However, the improvements of TS for the regularization methods are not obvious. Most importantly, no matter whether TS is used or not, the regularization methods suffer from overconfidence on samples which have high predictive uncertainty, especially on label smoothing and $L _ { 1 }$ Norm, which contradicts the traditional view. Combining with the observation in Figure 2(d), it is indicated that the regularization methods work by simply aligning the average predictive confidence of the whole dataset to the accuracy with some specific regularization strengths, and does not produce fine-grained calibration with respect to the difference of samples.
|
| 80 |
+
|
| 81 |
+
Impact of Validation Size We also wonder how does the validation data size impact the post-hoc calibration. Figure 3 shows the ECE results with controlled validation data size. We can see that quite low ECE can be obtained with only a small size of validation data when using TS, which offers high efficiency for practice development. Relatively, HB needs more validation samples to obtain better calibration performance. Nevertheless, the standard CE loss stably achieves better calibration across varied validation data size with both TS and HB.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 2: Reliability diagrams of each methods (after TS calibration) on CIFAR-10. The results are chosen from one of the 5 random runs of Table 1. Darker color of bars indicates that more samples are assigned with the corresponding confidence intervals.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 3: ECE $( \% )$ (after post-hoc calibration) with of regularization methods with controlled validation data size.
|
| 88 |
+
|
| 89 |
+
# 5 From Calibrated to Calibratable: A Closer Look
|
| 90 |
+
|
| 91 |
+
The results reported in above section show the degradation of regularization methods when integrating them with post-hoc calibration methods, which indicates that though regularization helps DNNs obtain well-calibrated predictions, it makes these predictions worse calibratable. In this Section, we further investigate this phenomenon by a series of illustrative experiments. We firstly attempt to empirically understand the reason of the calibration degradation from the view of information loss. Then, we propose an inverse form of focal loss to give a closer look at the correlation between the loss functions used in training and the calibration performance. The implementation details used in this section are also the same with those in Section 3.
|
| 92 |
+
|
| 93 |
+
# 5.1 Information Loss of Regularized Models
|
| 94 |
+
|
| 95 |
+
ECE among Epochs We start by investigating the ECEs of temperature-scaled outputs over epochs during model training. To avoid the impact of the bias of validation data, we directly search the best temperature on test data in each training epoch. We denote the corresponding ECE with this searched temperature as optimal ECE, which is the lower bound of ECE with temperatures searched on validation data. Figure 4 shows the curves of optimal ECE during epochs using label smoothing with different smoothing coefficients. We can observe that the optimal ECE rises after some learning epochs: On SVHN and CIFAR-10, it starts to significantly rise around the 10th epoch, and on CIFAR-100 and 20Newsgroups, it tends to rise after 100 and 50 epochs, where the learning rate drops by a factor of 10. Another observation is that larger smoothing strength $\epsilon$ results in worse calibration performance and more remarkable (also earlier) ECE rising. According to the memorization effect [35], DNNs usually learn easy samples at the early stage of training and tend to fit the hard ones later.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 4: Curves of optimal ECE $( \% )$ during learning epochs using label smoothing with different coefficients. Dark colors show the mean results of 5 random runs and light colors show the ranges between minimal and maximum results of 5 runs.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 5: Histograms of maximum logits produced from models trained with different methods. Different colors of bars represent distributions of samples with different learned epochs. The first row and second row are results of CIFAR-10 and CIFAR-100 respectively.
|
| 102 |
+
|
| 103 |
+
Therefore, a simple conjecture for the ECE rising is that after some learning epochs, DNNs start to fit hard samples, at the same time the regularizer would penalize the confidences of easy samples, which makes the predictive confidences of those easy and hard samples difficult to be distinguished. Similar phenomenon is also observed when using $L _ { 1 }$ Norm (see Appendix Figure A(a-d)) except 20Newsgroups dataset, on which large norm coefficient will hurt the calibration. For focal loss (see Appendix Figure A(e-h)), the optimal ECEs trained with large regularization strengths keep high without the remarkable rising.
|
| 104 |
+
|
| 105 |
+
Histogram of Logits We use histograms to visualize what the patterns of model outputs learned with different methods look like. Before that, we define learned epoch 2 of an individual training sample as the epoch, since which the sample can be correctly classified till the final learning epoch. As we mentioned above, DNNs usually learn hard samples after easy ones, hence the learned epoch of a sample can be used to indicate its corresponding hardness degree to be learned. Based on this, we want to investigate if the samples with different hardness degrees can be distinguished by model itself after training. To this end, we record the learned epochs of all training samples of CIFAR-10 and CIFAR-100 during training and statistic the distributions of their maximum logit outputs (i.e. $\operatorname* { m a x } _ { i } g _ { i } ^ { \theta } ( { \pmb x } ) )$ ). As shown in Figure 5, the logits of models trained with the standard CE loss cover much larger ranges, and the regularization methods compress the distributions too tight without distinction between samples with different learned epochs, especially in label smoothing and $L _ { 1 }$ Norm. This visual observation further confirms that the regularization of DNNs works by only penalizing the confidence of the whole dataset to a low level with a specific regularization strength. This will result in loss of the important information about the hardness of samples as an undesirable side effects, and compress the room of potential improvement by post-hoc calibration. On the contrary, models trained with the standard CE loss manage to preserve this information to a certain extent during training, hence achieve better results after post-hoc calibration.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 6: (a): Visual representation of focal loss, CE loss and inverse focal loss. (b): Predictive accuracies $( \% )$ of different methods. (c): ECEs $( \% )$ with $M = 1 5$ of different methods without post-hoc calibration. (d): Searched temperatures on validation data. (e-f): ECEs $( \% )$ with $M = 1 5$ of different methods with the help of post-hoc calibration.
|
| 109 |
+
|
| 110 |
+
# 5.2 Is Cross-Entropy the Best for Calibration?
|
| 111 |
+
|
| 112 |
+
Based on our experimental findings, one natural question is that can we design some loss functions in the opposite direction of these regularization methods to further improve the calibration? For label smoothing and $L _ { p }$ Norm, we can simply set the regularization coefficients of these methods as negative values. However, we empirically found this will cause extremely low predictive accuracies even failures of training using only very small weighting coefficients. Fortunately, we can design an inverse version of focal loss without prediction degradation by mimicking the original focal loss3. Recall the form of focal loss, we see that it works by assigning larger weights to the samples with smaller confidences. This makes the optimizer pay more attention to those hard samples when updating model parameters. Actually, this weighting scheme also implicitly exists in the standard CE loss, and this can be expressed by the gradients of CE loss function w.r.t. model parameters $\theta$ :
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\frac { \partial \mathcal { L } _ { c e } ( y , f ^ { \theta } ( { \pmb x } ) ) } { \partial \theta } = - \frac { 1 } { f _ { y } ^ { \theta } ( { \pmb x } ) } \nabla _ { \theta } f _ { y } ^ { \theta } ( { \pmb x } )
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where the factor term $\frac { 1 } { f _ { y } ^ { \theta } ( { \pmb x } ) }$ indicates that samples with smaller confidences are weighted larger in gradient calculation. Opposite to the principle of focal loss, we propose inverse focal loss as follows:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathcal { L } _ { \bar { f } } = - ( 1 + f _ { y } ^ { \theta } ) ^ { \bar { \gamma } } \log f _ { y } ^ { \theta }
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
By a simple modification on the weighting term of original focal loss, the inverse focal loss assigns larger weights to the samples with larger output confidences. Similar with original focal loss, the choice of coefficient $\bar { \gamma }$ has a huge impact on the property of this loss. In Figure 6(a), we plot the curves of inverse focal loss with varied $\bar { \gamma }$ and also plot the standard CE loss and focal loss for comparison. We can see that different from the original focal loss, the curves of inverse focal loss are steeper when confidence is large, and larger $\bar { \gamma }$ gives steeper curves.
|
| 125 |
+
|
| 126 |
+
We conduct another experiment to evaluate the inverse focal loss, and also investigate what will happen when we increase its coefficient $\bar { \gamma }$ . Figure 6(c) shows the ECE results without post-hoc calibration. The ECEs of inverse focal loss are larger than CE and focal loss in most cases. This is consistent to our expectation since inverse focal loss aggravates the overconfidence issue of DNNs by weighting larger on the easy samples. Figure 6(e) and 6(f) show the ECE results with the help of post-hoc calibration. When using HB, the ECEs of inverse focal loss are worse than CE on SVHN and CIFAR-10, while better than CE on CIFAR-100. Generally speaking, there is no clear trend when we increase $\bar { \gamma }$ . More interesting results appear when using TS: (1) On CIFAR-10 and CIFAR-100, the ECE results of inverse focal loss are better than that of the standard CE loss; and (2) there is a descend-then-ascend trend from focal loss with $\gamma = 3$ to inverse focal loss with $\bar { \gamma } = 3$ . From these observations, we may say that the best loss function for calibration is varied across different tasks according to the characteristics of datasets. On SVHN, which is a relatively easy dataset, standard CE loss yields pretty good results; on CIFAR-10 and CIFAR-100, which is more complex and difficult, the best results are obtained using inverse focal loss; on 20Newsgroups, which has fewest training samples among four datasets, the best result is obtained when using focal loss with $\gamma = 1$ . The searched temperatures when using TS are presented in Figure 6(d). The increasing of best temperatures indicates that the overconfidence problem is severer when using inverse focal loss with larger $\bar { \gamma }$ . The predictive accuracies are presented in Figure 6(a). As is shown that inverse focal loss yields highly competitive results compared with the standard CE loss on SVHN, CIFAR-10 and CIFAR-100. On 20Newsgroups, when using large $\bar { \gamma }$ , the predictive performance of inverse focal loss is worse than the CE loss.
|
| 127 |
+
|
| 128 |
+
# 6 Related Work
|
| 129 |
+
|
| 130 |
+
In machine learning, calibration has long been studied [25, 33, 34, 22], and many classical methods, like Platt Scaling [25] and Histogram Binning [33], have been proposed in the literature. In recent years, deep neural networks trained with commonly used CE loss, have been empirically found to predict poorly calibrated probabilities. The early researches for this problem focus on bayesian models [2, 16, 3, 1], which indirectly infer prediction uncertainty through weight uncertainties. But training and inferring the bayesian DNNs are computationally more expensive and conceptually more complicated than deterministic DNNs. Therefore, the uncertainty qualification of the nonbayesian models has always been an important topic, which also attracts a lot of researchers from the perspective of understanding DNNs.
|
| 131 |
+
|
| 132 |
+
Guo et al. [4] systematically investigated the miscalibration problem of the deterministic DNNs and empirically compared several conventional post-hoc calibration fixes. Two key findings are suggested in their paper: (1) Increasing model capacity and regularization strength negatively affect the calibration. (2) Simple post-hoc methods like TS [25] and HB [33] can reduce the calibration error to a quite low level. Following their work, there is a surge of research that proposed new post-hoc calibration methods [10, 27, 5, 11, 24, 36, 26]. Different from post-hoc calibration methods, another line of research aims to learn calibrated networks during training by modifying the training process [29, 12, 8]. Thulasidasan et al. [29] found that DNNs trained with mixup are significantly better calibrated than DNNs trained in the regular fashion. Kumar et al. [12] proposed a RKHS kernel based measure of calibration that is efficiently trainable alongside the standard CE loss, which can minimize an explicit calibration error during training. Krishnan and Tichoo [8] introduced a differentiable accuracy versus uncertainty calibration loss function that allows a model to learn to provide well-calibrated uncertainties, in addition to improved accuracy. Recently, inspired by the findings in [4], several studies were proposed to leverage the regularization of DNNs to improve calibration performance during training [19, 18, 7]. As we described in Section 3, these implicit or explicit regularization techniques can improve calibration by penalizing the predictive confidences of DNNs. It is worth nothing that besides the studies on improving calibration performance, there are also several studies that focus on the measure of calibration performance [23, 31, 32, 5].
|
| 133 |
+
|
| 134 |
+
# 7 Conclusion
|
| 135 |
+
|
| 136 |
+
In this work, we investigate the uncertainty calibration problem of DNNs by a series of experiments. The empirical study shows that despite the predictions obtained from the regularized models are better calibrated, worse results would be obtained if we employ post-hoc calibration methods on these regularized models. Extended experiments demonstrate that the regularized DNNs will lose the important information about the hardness of samples, which results in the harm of post-hoc calibration. Based on the experimental observations, we design a new loss function in the opposite direction of previous regularization methods, and empirically show the superiority of this loss in calibration with the help of post-hoc methods, even though it causes severer overconfidence issue in the main training phase. Our findings suggest that overconfidence of DNNs is not the nightmare in model calibration and point out a new direction to improve the calibration performance of DNNs by considering main training and post-hoc calibration as a unified framework. Moreover, the study of the phenomena of deep learning uncertainty under distribution shift is very interesting as one of the future work, since the behaviour with distribution shifts might be most important in practice.
|
| 137 |
+
|
| 138 |
+
# 8 Acknowledgments
|
| 139 |
+
|
| 140 |
+
The authors wish to thank the anonymous reviewers for their helpful comments and suggestions. This work was supported by the National Science Foundation of China (62176055), the Postgraduate Research & Practice Innovation Program of Jiangsu Province (KYCX21_0151) and the China University S&T Innovation Plan Guided by the Ministry of Education. We thank the Big Data Center of Southeast University for providing the facility support on the numerical calculations in this paper.
|
| 141 |
+
|
| 142 |
+
# References
|
| 143 |
+
|
| 144 |
+
[1] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pages 1613–1622, 2015.
|
| 145 |
+
[2] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In International Conference on Machine Learning, pages 1050–1059, 2016.
|
| 146 |
+
[3] Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pages 2348–2356, 2011.
|
| 147 |
+
[4] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pages 1321–1330, 2017.
|
| 148 |
+
[5] Kartik Gupta, Amir Rahimi, Thalaiyasingam Ajanthan, Thomas Mensink, Cristian Sminchisescu, and Richard Hartley. Calibration of neural networks using splines. In International Conference on Representation Learning, 2021.
|
| 149 |
+
[6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016.
|
| 150 |
+
[7] Taejong Joo and Uijung Chung. Revisiting explicit regularization in neural networks for well-calibrated predictive uncertainty. arXiv:2006.06399, 2021.
|
| 151 |
+
[8] Ranganath Krishnan and Omesh Tickoo. Improving model calibration with accuracy versus uncertainty optimization. In Advances in Neural Information Processing Systems, pages 18237– 18248, 2020.
|
| 152 |
+
[9] Alex Krizhevsky. Learning multiple layers of features from tiny images. In Tech Report, 2009.
|
| 153 |
+
[10] Meelis Kull, Miquel Perello Nieto, Markus Kängsepp, Telmo Silva Filho, Hao Song, and Peter Flach. Beyond temperature scaling: Obtaining well-calibrated multi-class probabilities with dirichlet calibration. In Advances in Neural Information Processing Systems, pages 12295–12305, 2019.
|
| 154 |
+
[11] Ananya Kumar, Percy S Liang, and Tengyu Ma. Verified uncertainty calibration. In Advances in Neural Information Processing Systems, pages 3787–3798, 2019.
|
| 155 |
+
[12] Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In International Conference on Machine Learning, pages 2805–2814, 2018.
|
| 156 |
+
[13] Ken Lang. Newsweeder: Learning to filter netnews. In International Conference on Machine Learning, pages 331–339, 1995.
|
| 157 |
+
[14] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In IEEE International Conference on Computer Vision, pages 2980–2988, 2017.
|
| 158 |
+
[15] Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. In International Conference on Neural Information Processing Systems, pages 1647–1657, 2018.
|
| 159 |
+
[16] Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. In Advances in Neural Information Processing Systems, pages 13153–13164, 2019.
|
| 160 |
+
[17] Clara Meister, Elizabeth Salesky, and Ryan Cotterell. Generalized entropy regularization or: There’s nothing special about label smoothing. In Annual Meeting of the Association for Computational Linguistics, pages 6870–6886, 2020.
|
| 161 |
+
[18] Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip Torr, and Puneet Dokania. Calibrating deep neural networks using focal loss. In Advances in Neural Information Processing Systems, pages 15288–15299, 2020.
|
| 162 |
+
[19] Rafael Müller, Simon Kornblith, and Geoffrey E Hinton. When does label smoothing help? In Advances in Neural Information Processing Systems, pages 4696–4705, 2019.
|
| 163 |
+
[20] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In AAAI Conference on Artificial Intelligence, pages 2901–2907, 2015.
|
| 164 |
+
[21] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In Advances in Neural Information Processing Systems Workshops, 2011.
|
| 165 |
+
[22] Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In International Conference on Machine learning, pages 625–632, 2005.
|
| 166 |
+
[23] Jeremy Nixon, Michael W. Dusenberry, Linchuan Zhang, Ghassen Jerfel, and Dustin Tran. Measuring calibration in deep learning. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 38–41, 2019.
|
| 167 |
+
[24] Kanil Patel, William Beluch, Bin Yang, Michael Pfeiffer, and Dan Zhang. Multi-class uncertainty calibration via mutual information maximization-based binning. In International Conference on Representation Learning, 2021.
|
| 168 |
+
[25] John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in Large Margin Classifiers, 10(3):61–74, 1999.
|
| 169 |
+
[26] Amir Rahimi, Kartik Gupta, Thalaiyasingam Ajanthan, Thomas Mensink, Cristian Sminchisescu, and Richard Hartley. Post-hoc calibration of neural networks. arXiv:2006.12807, 2020.
|
| 170 |
+
[27] Amir Rahimi, Amirreza Shaban, Ching-An Cheng, Richard Hartley, and Byron Boots. Intra order-preserving functions for calibration of multi-class neural networks. In Advances in Neural Information Processing Systems, 2020.
|
| 171 |
+
[28] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In IEEE Conference on Computer Vision and Pattern Recognition, pages 2818–2826, 2016.
|
| 172 |
+
[29] Sunil Thulasidasan, Gopinath Chennupati, Jeff A. Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. In Advances in Neural Information Processing Systems, pages 13888–13899, 2019.
|
| 173 |
+
[30] Mariya Toneva, Alessandro Sordoni, Remi Tachet des Combes, Adam Trischler, Yoshua Bengio, and Geoffrey J. Gordon. An empirical study of example forgetting during deep neural network learning. In International Conference on Representation Learning, 2019.
|
| 174 |
+
[31] Juozas Vaicenavicius, David Widmann, Carl R. Andersson, Fredrik Lindsten, Jacob Roll, and Thomas B. Schön. Evaluating model calibration in classification. In International Conference on Artificial Intelligence and Statistics, pages 3459–3467, 2019.
|
| 175 |
+
[32] David Widmann, Fredrik Lindsten, and Dave Zachariah. Calibration tests in multi-class classification: A unifying framework. In Advances in Neural Information Processing Systems, pages 12236–12246, 2019.
|
| 176 |
+
[33] Bianca Zadrozny and Charles Elkan. Obtaining calibrated probability estimates from decision trees and naive bayesian classifiers. In International Conference on Machine Learning, pages 609–616, 2001.
|
| 177 |
+
[34] Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 694–699, 2002.
|
| 178 |
+
[35] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Representation Learning, 2017.
|
| 179 |
+
[36] Jize Zhang, Bhavya Kailkhura, and T Yong-Jin Han. Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning. In International Conference on Machine Learning, pages 11117–11128, 2020.
|
| 180 |
+
[37] Zhi-Hua Zhou. Why over-parameterization of deep neural networks does not overfit? Science China Information Sciences, 64(1):1–3, 2021.
|
md/train/S1gUsoR9YX/S1gUsoR9YX.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTILINGUAL NEURAL MACHINE TRANSLATION WITH KNOWLEDGE DISTILLATION
|
| 2 |
+
|
| 3 |
+
Xu Tan1∗, Yi Ren2∗, Di $\mathbf { H e ^ { 3 } }$ , Tao ${ \bf { Q } i n } ^ { 1 }$ , Zhou Zhao2 & Tie-Yan Liu1
|
| 4 |
+
|
| 5 |
+
1Microsoft Research Asia {xuta,taoqin,tyliu}@microsoft.com
|
| 6 |
+
|
| 7 |
+
2Zhejiang University rayeren,zhaozhou@zju.edu.cn
|
| 8 |
+
|
| 9 |
+
3Key Laboratory of Machine Perception, MOE, School of EECS, Peking University di he@pku.edu.cn
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Multilingual machine translation, which translates multiple languages with a single model, has attracted much attention due to its efficiency of offline training and online serving. However, traditional multilingual translation usually yields inferior accuracy compared with the counterpart using individual models for each language pair, due to language diversity and model capacity limitations. In this paper, we propose a distillation-based approach to boost the accuracy of multilingual machine translation. Specifically, individual models are first trained and regarded as teachers, and then the multilingual model is trained to fit the training data and match the outputs of individual models simultaneously through knowledge distillation. Experiments on IWSLT, WMT and Ted talk translation datasets demonstrate the effectiveness of our method. Particularly, we show that one model is enough to handle multiple languages (up to 44 languages in our experiment), with comparable or even better accuracy than individual models.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Neural Machine Translation (NMT) has witnessed rapid development in recent years (Bahdanau et al., 2015; Luong et al., 2015b; Wu et al., 2016; Gehring et al., 2017; Vaswani et al., 2017; Wu et al., 2018; Song et al., 2018; Shen et al., 2018; Guo et al., 2018; He et al., 2018; Gong et al., 2018), including advanced model structures (Gehring et al., 2017; Vaswani et al., 2017) and human parity achievements (Hassan et al., 2018). While conventional NMT can well handle single pair translation, training a separate model for each language pair is resource consuming, considering there are thousands of languages in the world1. Therefore, multilingual NMT (Johnson et al., 2017; Firat et al., 2016; Ha et al., 2016; Lu et al., 2018) is developed which handles multiple language pairs in one model, greatly reducing the offline training and online serving cost.
|
| 18 |
+
|
| 19 |
+
Previous works on multilingual NMT mainly focus on model architecture design through parameter sharing, e.g., sharing encoder, decoder or attention module (Firat et al., 2016; Lu et al., 2018) or sharing the entire models (Johnson et al., 2017; Ha et al., 2016). They achieve comparable accuracy with individual models (each language pair with a separate model) when the languages are similar to each other and the number of language pairs is small (e.g., two or three). However, when handling more language pairs (dozens or even hundreds), the translation accuracy of multilingual model is usually inferior to individual models, due to language diversity.
|
| 20 |
+
|
| 21 |
+
It is challenging to train a multilingual translation model supporting dozens of language pairs while achieving comparable accuracy as individual models. Observing that individual models are usually of higher accuracy than the multilingual model in conventional model training, we propose to transfer the knowledge from individual models to the multilingual model with knowledge distillation, which has been studied for model compression and knowledge transfer and well matches our setting of multilingual translation. It usually starts by training a big/deep teacher model (or ensemble of multiple models), and then train a small/shallow student model to mimic the behaviors of the teacher model, such as its hidden representation (Yim et al., 2017; Romero et al., 2014), its output probabilities (Hinton et al., 2015; Freitag et al., 2017) or directly training on the sentences generated by the teacher model in neural machine translation (Kim & Rush, 2016a). The student model can (nearly) match the accuracy of the cumbersome teacher model (or the ensemble of multiple models) with knowledge distillation.
|
| 22 |
+
|
| 23 |
+
In this paper, we propose a new method based on knowledge distillation for multilingual translation to eliminate the accuracy gap between the multilingual model and individual models. In our method, multiple individual models serve as teachers, each handling a separate language pair, while the student handles all the language pairs in a single model, which is different from the conventional knowledge distillation where the teacher and student models usually handle the same task. We first train the individual models for each translation pair and then we train the multilingual model by matching with the outputs of all the individual models and the ground-truth translation simultaneously. After some iterations of training, the multilingual model may get higher translation accuracy than the individual models on some language pairs. Then we remove the distillation loss and keep training the multilingual model on these languages pairs with the original log-likelihood loss of the ground-truth translation.
|
| 24 |
+
|
| 25 |
+
We conduct experiments on three translation datasets: IWSLT with 12 language pairs, WMT with 6 language pairs and Ted talk with 44 language pairs. Our proposed method boosts the translation accuracy of the baseline multilingual model and achieve similar (or even better) accuracy as individual models for most language pairs. Specifically, the multilingual model with only $1 / 4 4$ parameters can match or surpass the accuracy of individual models on the Ted talk datasets.
|
| 26 |
+
|
| 27 |
+
# 2 BACKGROUND
|
| 28 |
+
|
| 29 |
+
# 2.1 NEURAL MACHINE TRANSLATION
|
| 30 |
+
|
| 31 |
+
Given a set of bilingual sentence pairs $D = \{ ( x , y ) \in \mathcal { X } { \times } \mathcal { Y } \}$ , an NMT model learns the parameter $\theta$ by minimizing the negative log-likelihood $\begin{array} { r } { - \sum _ { ( x , y ) \in D } \log { P ( y | x ; \theta ) } . \ P ( y | x ; \theta ) } \end{array}$ is calculated based on the chain rule $\prod _ { t = 1 } ^ { T _ { y } } P ( y _ { t } | y _ { < t } , x ; \theta )$ , where $y _ { < t }$ represents the tokens preceding position $t$ , and $T _ { y }$ is the length of sentence $y$ .
|
| 32 |
+
|
| 33 |
+
The encoder-decoder framework (Bahdanau et al., 2015; Luong et al., 2015b; Sutskever et al., 2014; Wu et al., 2016; Gehring et al., 2017; Vaswani et al., 2017) is usually adopted to model the conditional probability $P ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } )$ , where the encoder maps the input to a set of hidden representations $h$ and the decoder generates each target token $y _ { t }$ using the previous generated tokens $y _ { < t }$ as well as the representations $h$ .
|
| 34 |
+
|
| 35 |
+
# 2.2 MULTILINGUAL NMT
|
| 36 |
+
|
| 37 |
+
NMT has been extended from the translation of a single language pair to multilingual translation (Dong et al., 2015; Luong et al., $2 0 1 5 \mathrm { a }$ ; Firat et al., 2016; Lu et al., 2018; Johnson et al., 2017; Ha et al., 2016), considering the large amount of languages pairs in the world. Some of these works focus on how to share the components of the NMT model among multiple language pairs. Dong et al. (2015) use a shared encoder but different decoders to translate the same source language to multiple target languages. Luong et al. (2015a) use the combination of multiple encoders and decoders, with one encoder for each source language and one decoder for each target language respectively, to translate multiple source languages to multiple target languages. Firat et al. (2016) share the attention mechanism but use different encoders and decoders for multilingual translation. Similarly, Lu et al. (2018) design the neural interlingua, which is an attentional LSTM encoder to bridge multiple encoders and decoders for different language pairs. In Johnson et al. (2017) and Ha et al. (2016), multiple source and target languages are handled with a universal model (one encoder and decoder), with a special tag in the encoder to determine which target language to translate. In Gu et al. (2018a;b) and Neubig & Hu (2018), multilingual translation is leveraged to boost the accuracy of low-resource language pairs with better model structure or training mechanism.
|
| 38 |
+
|
| 39 |
+
It is observed that when there are dozens of language pairs, multilingual NMT usually achieves inferior accuracy compared with its counterpart which trains an individual model for each language pair. In this work we propose the multilingual distillation framework to boost the accuracy of multilingual NMT, so as to match or even surpass the accuracy of individual models.
|
| 40 |
+
|
| 41 |
+
# 2.3 KNOWLEDGE DISTILLATION
|
| 42 |
+
|
| 43 |
+
The early adoption of knowledge distillation is for model compression (Bucilu et al., 2006), where the goal is to deliver a compact student model that matches the accuracy of a large teacher model or the ensemble of multiple models. Knowledge distillation has soon been applied to a variety of tasks, including image classification (Hinton et al., 2015; Furlanello et al., 2018; Yang et al., 2018; Anil et al., 2018; Li et al., 2017), speech recognition (Hinton et al., 2015) and natural language processing (Kim & Rush, 2016a; Freitag et al., 2017). Recent works (Furlanello et al., 2018; Yang et al., 2018) even demonstrate that student model can surpass the accuracy of the teacher model, even if the teacher model is of the same capacity as the student model. Zhang et al. (2017) propose the mutual learning to enable multiple student models to learn collaboratively and teach each other by knowledge distillation, which can improve the accuracy of those individual models. Anil et al. (2018) propose online distillation to improve the scalability of distributed model training and the training accuracy.
|
| 44 |
+
|
| 45 |
+
In this paper, we develop the multilingual distillation framework for multilingual NMT. Our work differs from Zhang et al. (2017) and Anil et al. (2018) in that they collaboratively train multiple student models with codistillation, while we use multiple teacher models to train a single student model, the multilingual NMT model.
|
| 46 |
+
|
| 47 |
+
# 3 METHOD
|
| 48 |
+
|
| 49 |
+
As mentioned, when there are many language pairs and each pair has enough training data, the accuracy of individual models for those language pairs is usually higher than that of the multilingual model, given that the multilingual model has limited capacity comparing with the sum of all the individual models. Therefore, we propose to teach the multilingual model using the individual models as teachers. Here we first describe the idea of knowledge distillation in neural machine translation for the case of one teacher and one student, and then introduce our method in the multilingual setting with multiple teachers (the individual models) and one student (the multilingual model).
|
| 50 |
+
|
| 51 |
+
# 3.1 ONE TEACHER AND ONE STUDENT
|
| 52 |
+
|
| 53 |
+
Denote $D = \{ ( x , y ) \in \mathcal { X } \times \mathcal { Y } \}$ as the bilingual corpus of a language pair. The log-likelihood loss (cross-entropy with one-hot label) on corpus $D$ with regard to an NMT model $\theta$ can be formulated as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l } & { { \mathcal { L } } _ { \mathrm { N L L } } ( D ; \theta ) = - \displaystyle \sum _ { ( x , y ) \in D } \log P ( y | x ; \theta ) , } \\ & { \log P ( y | x ; \theta ) = \displaystyle \sum _ { t = 1 } ^ { T _ { y } } \sum _ { k = 1 } ^ { | V | } \mathbb { 1 } \{ y _ { t } = k \} \log P ( y _ { t } = k | y _ { < t } , x ; \theta ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $T _ { y }$ is the length of the target sentence, $| V |$ is the vocabulary size of the target language, $y _ { t }$ is the $t$ -th target token, $\mathbb { 1 } \{ \cdot \}$ is the indicator function that represents the one-hot label, and $P ( \cdot | \cdot )$ is the conditional probability with model $\theta$ .
|
| 60 |
+
|
| 61 |
+
In knowledge distillation, the student (with model parameter $\theta$ ) not only matches the outputs of the ground-truth one-hot label, but also to the probability outputs of the teacher model (with parameter $\theta _ { T }$ ). Denote the output distribution of the teacher model for token $y _ { t }$ as $Q \big ( y _ { t } | y _ { < t } , x ; \theta _ { T } \big )$ . The cross
|
| 62 |
+
|
| 63 |
+
entropy between two distributions serves as the distillation loss:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathcal { L } _ { \mathrm { K D } } ( D ; \theta , \theta _ { T } ) = - \sum _ { ( x , y ) \in D } \sum _ { t = 1 } ^ { T _ { y } } \sum _ { k = 1 } ^ { | V | } Q \{ y _ { t } = k | y _ { < t } , x ; \theta _ { T } \} \log P ( y _ { t } = k | y _ { < t } , x ; \theta ) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The difference between $\mathcal { L } _ { \mathrm { N L L } } ( D ; \theta )$ and $\mathcal { L } _ { \mathrm { K D } } ( D ; \theta , \theta _ { T } )$ is that the target distribution of $\mathcal { L } _ { \mathrm { K D } } ( D ; \theta , \theta _ { T } )$ is no longer the original one-hot label, but teacher’s output distribution which is more smooth by assigning non-zero probabilities to more than one word and yields smaller variance in gradients (Hinton et al., 2015). Then the total loss function becomes
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathcal { L } _ { \mathrm { A L L } } ( D ; \theta , \theta _ { T } ) = ( 1 - \lambda ) \mathcal { L } _ { \mathrm { N L L } } ( D ; \theta ) + \lambda \mathcal { L } _ { \mathrm { K D } } ( D ; \theta , \theta _ { T } ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\lambda$ is the coefficient to trade off the two loss terms.
|
| 76 |
+
|
| 77 |
+
# 3.2 MULTILINGUAL DISTILLATION WITH MULTIPLE TEACHERS AND ONE STUDENT
|
| 78 |
+
|
| 79 |
+
Let $L$ denote the total number of language pairs in our setting, superscript $l \in [ L ]$ denote the index of language pair, $D ^ { l }$ denote the bilingual corpus for the $l$ -th language pair, $\theta _ { M }$ denote the parameters of the (student) multilingual model, and $\theta _ { I } ^ { l }$ denote the parameters of the (teacher) individual model for $l$ -th language pair. Therefore, $\mathcal { L } _ { \mathrm { N L L } } ( \mathrm { \bar { \it D } } ; \theta _ { M } )$ denotes the log-likelihood loss on training data $D$ , and $\mathcal { L } _ { \mathrm { A L L } } ( \bar { D ^ { l } } ; \bar { \theta } _ { M } , \theta _ { I } ^ { l } )$ denotes the total loss on training data $\bar { D } ^ { l }$ , which consists of the original log-likelihood loss and the distillation loss by matching to the outputs from the teacher model $\theta _ { I } ^ { l }$ .
|
| 80 |
+
|
| 81 |
+
The multilingual distillation process is summarized in Algorithm 1. As can be seen in Line 1, our algorithm takes pretrained individual models for each language pair as inputs. Note that those models can be pretrained using the same datasets $\{ D ^ { l } \} _ { l = 1 } ^ { L }$ or different datasets, and they can share the same network structure as the multilingual model or use different architectures. For simplification, in our experiments, we use the same datasets to pretrain the individual models and they share the same architecture as the multilingual model. In Line 8-9, the multilingual model learns from both the ground-truth data and the individual models with loss ${ \mathcal { L } } _ { \mathrm { A L L } }$ when its accuracy has not surpassed the individual model for a certain threshold $\tau$ (which is checked in Line 15-19 every $\tau _ { \mathrm { c h e c k } }$ steps according to the accuracy in validation set); otherwise, the multilingual model only learns from the ground-truth data using the original log-likelihood loss ${ \mathcal { L } } _ { \mathrm { N L L } }$ (in Line 10-11).
|
| 82 |
+
|
| 83 |
+
# Algorithm 1 Knowledge Distillation for Multilingual NMT
|
| 84 |
+
|
| 85 |
+
1: Input: Training corpus $\{ D ^ { l } \} _ { l = 1 } ^ { L }$ and pretrained individual models $\{ \theta _ { I } ^ { l } \} _ { l = 1 } ^ { L }$ for $L$ language pairs,
|
| 86 |
+
learning rate $\eta$ , total training steps $\tau$ , distillation check step $\tau _ { \mathrm { c h e c k } }$ , threshold $\tau$ of distillation
|
| 87 |
+
accuracy.
|
| 88 |
+
2: Initialize: Randomly initialize multilingual model $\theta _ { M }$ . Set current training step $T = 0$ , accu
|
| 89 |
+
mulated gradient $g = \mathbf { 0 }$ , distillation flag ${ \bf { \bar { \boldsymbol { f } } } } ^ { l } = T r u e$ for $l \in [ L ]$ .
|
| 90 |
+
3: while $T < \tau$ do
|
| 91 |
+
4: $T = T { + } 1$
|
| 92 |
+
5: $g = \mathbf { 0 }$
|
| 93 |
+
6: for $l \in [ L ]$ do
|
| 94 |
+
7: Randomly sample a mini-batch of sentence pairs $( \mathbf { x } ^ { l } , \mathbf { y } ^ { l } )$ from $D ^ { l }$ .
|
| 95 |
+
8: if $f ^ { l } = = \dot { T } r u e$ do
|
| 96 |
+
9: Compute and accumulate the gradient on loss $\mathcal { L } _ { \mathrm { A L L } } ( ( \mathbf { x } ^ { l } , \mathbf { y } ^ { l } ) ; \theta _ { M } , \theta _ { I } ^ { l } )$ : $g + = \partial \mathcal { L } _ { \mathrm { A L L } } / \partial \theta _ { M }$ .
|
| 97 |
+
10: else
|
| 98 |
+
11: Compute and accumulate the gradient on loss $\mathcal { L } _ { \mathrm { N L L } } \big ( ( \mathbf { x } ^ { l } , \mathbf { y } ^ { l } ) ; \theta _ { M } \big )$ : $g + = \partial \mathcal { L } _ { \mathrm { N L L } } / \partial \theta _ { M }$ .
|
| 99 |
+
12: end if
|
| 100 |
+
13: end for
|
| 101 |
+
14: Update $\theta _ { M }$ : $\theta _ { M } = \theta _ { M } - \eta * g$
|
| 102 |
+
15: if $T \% \ T _ { \mathrm { c h e c k } } = = 0$ do
|
| 103 |
+
16: for $l \in [ L ]$ do
|
| 104 |
+
17: if Accuracy(θM ) < Accuracy $( \theta _ { I } ^ { l } ) + \tau$ do $f ^ { l } = T r u e$ else $f ^ { l } =$ False end if
|
| 105 |
+
18: end for
|
| 106 |
+
19: end if
|
| 107 |
+
20: end while
|
| 108 |
+
|
| 109 |
+
# 3.3 DISCUSSION
|
| 110 |
+
|
| 111 |
+
Selective Distillation Considering that distillation from a bad teacher model is likely to hurt the student model and thus result in inferior accuracy, we selectively use distillation in the training process, as shown in Line 15-19 in Algorithm 1. When the accuracy of multilingual model surpasses the individual model for the accuracy threshold $\tau$ on a certain language pair, we remove the distillation loss and just train the model with original negative log-likelihood loss for this pair. Note that in one iteration, one language may not uses the distillation loss; it is very likely in later iterations that this language will be distilled again since the multilingual model may become worse than the teacher model for this language. Therefore, we call this mechanism as selective distillation. We also verify the effectiveness of the selective distillation in experiment part (Section 4.3).
|
| 112 |
+
|
| 113 |
+
Top-K Distillation It is burdensome to load all the teacher models in the GPU memory for distillation considering there are dozens or even hundreds of language pairs in the multilingual setting. Alternatively, we first generate the output probability distribution of each teacher model for the sentence pairs offline, and then just load the top-K probabilities of the distribution into memory and normalize them so that they sum to 1 for distillation. This can reduce the memory cost again from the scale of $| V |$ (the vocabulary size) to K. We also study in Section 4.3 that top-K distribution can result in comparable or better distillation accuracy than the full distribution.
|
| 114 |
+
|
| 115 |
+
# 4 EXPERIMENTS
|
| 116 |
+
|
| 117 |
+
We test our proposed method on three public datasets: IWSLT, WMT, and Ted talk translation tasks.
|
| 118 |
+
We first describe experimental settings, report results, and conduct some analyses on our method.
|
| 119 |
+
|
| 120 |
+
# 4.1 SETTINGS
|
| 121 |
+
|
| 122 |
+
Datasets We use three datasets in our experiment. IWSLT: We collect 12 languages English translation pairs from IWSLT evaluation campaign2 from year 2014 to 2016. WMT: We collect 6 languages English translation pairs from WMT translation task3. Ted Talk: We use the common corpus of TED talk which contains translations between multiple languages (Ye et al., 2018). We select 44 languages in this corpus that has sufficient data for our experiments. More descriptions about the three datasets can be found in Appendix (Section 1). We also list the language code according to ISO-639-1 standard4 for the languages used in our experiments in Appendix (Section 2). All the sentences are first tokenized with moses tokenizer5 and then segmented into subword symbols using Byte Pair Encoding (BPE) (Sennrich et al., 2016). We learn the BPE merge operations across all the languages and keep the output vocabulary of the teacher and student model the same, to ensure knowledge distillation.
|
| 123 |
+
|
| 124 |
+
Model Configurations We use the Transformer (Vaswani et al., 2017) as the basic NMT model structure since it achieves state-of-the-art accuracy and becomes a popular choice for recent NMT researches. We use the same model configuration for individual models and the multilingual model. For IWSLT and Ted talk tasks, the model hidden size $d _ { \mathrm { m o d e l } }$ , feed-forward hidden size $d _ { \mathrm { f f } }$ , number of layer are 256, 1024 and 2, while for WMT task, the three parameters are 512, 2048 and 6 respectively considering its large scale of training data.
|
| 125 |
+
|
| 126 |
+
Training and Inference For the multilingual model training, we up sample the data of each language to make all languages have the same size of data. The mini batch size is set to roughly 8192 tokens. We train the individual models with 4 NVIDIA Tesla V100 GPU cards and multilingual models with 8 of them. We follow the default parameters of Adam optimizer (Kingma & Ba, 2014) and learning rate schedule in Vaswani et al. (2017). For the individual models, we use 0.2 dropout, while for multilingual models, we use 0.1 dropout according to the validation performance. For knowledge distillation, we set $\mathcal { T } _ { \mathrm { c h e c k } } = 3 0 0 0$ steps (nearly two training epochs), the accuracy threshold $\tau = 1$ BLEU score, the distillation coefficient $\lambda = 0 . 5$ and the number of teacher’s outputs $K = 8$ according to the validation performance. During inference, we decode with beam search and set beam size to 4 and length penalty $\alpha = 1 . 0$ for all the languages. We evaluate the translation quality by tokenized case sensitive BLEU (Papineni et al., 2002) with multi-bleu.pl6. Our codes are implemented based on fairseq7 and we will release the codes once the paper is published.
|
| 127 |
+
|
| 128 |
+
Table 1: BLEU scores of 12 languages English on the IWLST dataset. The BLEU scores in () represent the difference between the multilingual model and individual models. $\Delta$ represents the improvements of our multi-distillation method over the multi-baseline.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Language</td><td>Individual</td><td>Multi-Baseline</td><td>Multi-Distillation</td><td>△</td></tr><tr><td>Ar→En</td><td>31.19</td><td>29.24 (-1.95)</td><td>31.25 (+0.06)</td><td>+2.01</td></tr><tr><td>Cs-→En</td><td>28.04</td><td>26.09 (-1.95)</td><td>27.09 (-0.95)</td><td>+1.00</td></tr><tr><td>De→En</td><td>33.07</td><td>32.74 (-0.33)</td><td>34.02 (+0.95)</td><td>+1.28</td></tr><tr><td>He-→En</td><td>37.42</td><td>35.18 (-2.24)</td><td>37.33 (-0.09)</td><td>+2.15</td></tr><tr><td>N1-→En</td><td>35.94</td><td>36.54 (+0.60)</td><td>37.69 (+1.75)</td><td>+1.15</td></tr><tr><td>Pt-→En</td><td>44.30</td><td>43.49 (-0.81)</td><td>44.69 (+0.39)</td><td>+1.20</td></tr><tr><td>Ro-→En</td><td>36.92</td><td>36.41 1 (-0.51)</td><td>38.01 (+1.09)</td><td>+1.60</td></tr><tr><td>Ru→En</td><td>23.04</td><td>23.12 (+0.08)</td><td>23.76 (+0.72)</td><td>+0.64</td></tr><tr><td>Th→En</td><td>18.24</td><td>19.33 3 (+1.09)</td><td>19.90 (+1.66)</td><td>+0.57</td></tr><tr><td>Tr→En</td><td>22.74</td><td>22.42 (-0.32)</td><td>23.75 (+1.01)</td><td>+1.33</td></tr><tr><td>Vi→En</td><td>26.06</td><td>26.37 (+0.31)</td><td>27.04 4 (+0.98)</td><td>+0.67</td></tr><tr><td>Zh→En</td><td>19.44</td><td>18.82 2 (-0.62)</td><td>19.52 (+0.08)</td><td>+0.70</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 2: BLEU scores of English $ 1 2$ languages on the IWLST dataset. The BLEU scores in () represent the difference between the multilingual model and individual models. $\Delta$ represents the improvements of our multi-distillation method over the multi-baseline.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Language</td><td>Individual</td><td>Multi-Baseline</td><td>Multi-Distillation</td><td>△</td></tr><tr><td>En→Ar</td><td>13.67</td><td>12.73 (-0.94)</td><td>13.80 (+0.13)</td><td>+1.07</td></tr><tr><td>En→Cs</td><td>17.81</td><td>17.33 (-0.48)</td><td>18.69 (+0.88)</td><td>+1.37</td></tr><tr><td>En→De</td><td>26.13</td><td>25.16 (-0.97)</td><td>26.76 (+0.63)</td><td>+1.60</td></tr><tr><td>En→He</td><td>24.15</td><td>22.73 (-1.42)</td><td>24.42 (+0.27)</td><td>+1.69</td></tr><tr><td>En-→Nl</td><td>30.88</td><td>29.51 (-1.37)</td><td>30.52 (-0.36)</td><td>+1.01</td></tr><tr><td>En→Pt</td><td>37.63</td><td>35.93 (-1.70)</td><td>37.23 (-0.40)</td><td>+1.30</td></tr><tr><td>En→Ro</td><td>27.23</td><td>25.68 (-1.55)</td><td>27.11 (-0.12)</td><td>+1.42</td></tr><tr><td>En→Ru</td><td>17.40</td><td>16.26 (-1.14)</td><td>17.42 (+0.02)</td><td>+1.16</td></tr><tr><td>En→Th</td><td>26.45</td><td>27.18 (+0.73)</td><td>27.62 (+1.17)</td><td>+0.45</td></tr><tr><td>En→Tr</td><td>12.47</td><td>11.63 (-0.84)</td><td>12.84 (+0.37)</td><td>+1.21</td></tr><tr><td>En→Vi</td><td>27.88</td><td>28.04 (+0.16)</td><td>28.69 (+0.81)</td><td>+0.65</td></tr><tr><td>En→Zh</td><td>10.95</td><td>10.12 (-0.83)</td><td>10.41 (-0.54)</td><td>+0.29</td></tr></table>
|
| 135 |
+
|
| 136 |
+
# 4.2 RESULTS
|
| 137 |
+
|
| 138 |
+
Results on IWSLT Multilingual NMT usually consists of three settings: many-to-one, one-tomany and many-to-many. As many-many translation can be bridged though many-to-one and oneto-many setting, we just conduct the experiments on many-to-one and one-to-many settings. We first show the results of 12 languages English translations on the IWLST dataset are shown in Table 1. There are 3 methods for comparison: 1) Individual, each language pair with a separate model; 2) Multi-Baseline, the baseline multilingual model, simply training all the language pairs in one model; 3) Multi-Distillation, our multilingual model with knowledge distillation. We have several observations. First, the multilingual baseline performs worse than individual models on most languages. The only exception is the languages with small training data, which benefit from data augmentation in multilingual training. Second, our method outperforms the multilingual baseline for all the languages, demonstrating the effectiveness of our framework for multilingual NMT. More importantly, compared with the individual models, our method achieves similar or even better accuracy (better on 10 out of 12 languages), with only $1 / 1 2$ model parameters of the sum of all individual models.
|
| 139 |
+
|
| 140 |
+
One-to-many setting is usually considered as more difficult than many-to-one setting, as it contains different target languages which is hard to handle. Here we show how our method performs in oneto-many setting in Table 2. It can be seen that our method can maintain the accuracy (even better on most languages) compared with the individual models. We still improve over the multilingual baseline by nearly 1 BLEU score, which demonstrates the effectiveness of our method.
|
| 141 |
+
|
| 142 |
+
Table 3: BLEU scores of 6 languages English on the WMT dataset. The BLEU scores in () represent the difference between the multilingual model and individual models. $\Delta$ represents the improvements of our multi-distillation method over the multi-baseline.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Language</td><td>Individual</td><td>Multi-Baseline</td><td>Multi-Distillation</td><td>△</td></tr><tr><td>Cs-En</td><td>25.29</td><td>23.82 (-1.47)</td><td>25.37 (+0.08)</td><td>+1.55</td></tr><tr><td>De-En</td><td>34.44</td><td>34.21 (-0.23)</td><td>36.22 (+1.78)</td><td>+2.01</td></tr><tr><td>Fi-En</td><td>21.23</td><td>22.99 (+1.76)</td><td>24.32 (+3.09)</td><td>+1.33</td></tr><tr><td>Lv-En</td><td>16.26</td><td>16.25 (-0.01)</td><td>18.43 (+2.17)</td><td>+2.18</td></tr><tr><td>Ro-En</td><td>35.81</td><td>35.04 (-0.77)</td><td>36.51 (+0.70)</td><td>+1.47</td></tr><tr><td>Ru-En</td><td>29.39</td><td>28.92 (-0.47)</td><td>30.82 (+1.43)</td><td>+1.90</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 4: BLEU scores of English $ 6$ languages on the WMT dataset.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Language</td><td>Individual</td><td>Multi-Baseline</td><td>Multi-Distillation</td><td>△</td></tr><tr><td>En-Cs</td><td>22.58</td><td>21.39 (-1.19)</td><td>23.10 (+0.62)</td><td>+1.81</td></tr><tr><td>En-De</td><td>31.40</td><td>30.08 3 (-1.32)</td><td>31.42 (+0.02)</td><td>+1.34</td></tr><tr><td>En-Fi</td><td>22.08</td><td>19.52 (-2.56)</td><td>21.56 (-0.52)</td><td>+2.04</td></tr><tr><td>En-Lv</td><td>14.92</td><td>14.51 (-0.41)</td><td>15.32 (+0.40)</td><td>+0.81</td></tr><tr><td>En-Ro</td><td>31.67</td><td>29.88 (-1.79)</td><td>31.39 (-0.28)</td><td>+1.51</td></tr><tr><td>En-Ru</td><td>24.36</td><td>22.96 (-1.40)</td><td>24.02 (-0.34)</td><td>+1.06</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Results on WMT The results of 6 languages English translations on the WMT dataset are reported in Table 3. It can be seen that the multi-baseline model performs worse than the individual models on 5 out of 6 languages, while in contrast, our method performs better on all the 6 languages. Particularly, our method improves the accuracy of some languages with more than 2 BLEU scores over individual models. The results of one-to-many setting on WMT dataset are reported in Table 4. It can be seen that our method outperforms the multilingual baseline by more than 1 BLEU score on nearly all the languages.
|
| 151 |
+
|
| 152 |
+
Table 5: BLEU scores improvements of our method over the individual models $( \Delta _ { 1 } )$ and multibaseline model $\left( \Delta _ { 2 } \right)$ on the 44 languages English in the Ted talk dataset.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Language</td><td>Ar</td><td>Bg</td><td>Cs</td><td>Da</td><td>De</td><td>E1</td><td>Es</td><td>Et</td><td>Fa</td><td>Fi</td><td>Frca</td></tr><tr><td>△1</td><td>-1.50</td><td>-9.46</td><td>1.88</td><td>4.02</td><td>-0.10</td><td>0.80</td><td>0.23</td><td>8.20</td><td>0.09</td><td>6.44</td><td>15.8</td></tr><tr><td>△2</td><td>1.73</td><td>1.42</td><td>1.13</td><td>1.82</td><td>1.68</td><td>1.45</td><td>1.63</td><td>0.77</td><td>1.83</td><td>1.10</td><td>1.24</td></tr><tr><td>Language</td><td>Fr</td><td>Gl</td><td>He</td><td>Hi</td><td>Hr</td><td>Hu</td><td>Hy</td><td>Id</td><td>It</td><td>Ja</td><td>Ka</td></tr><tr><td>△1</td><td>0.13</td><td>19.26</td><td>-1.59</td><td>10.16</td><td>1.46</td><td>-0.11</td><td>8.87</td><td>1.36</td><td>-0.56</td><td>-0.03</td><td>11.20</td></tr><tr><td>△2</td><td>1.48</td><td>1.58</td><td>2.26</td><td>1.07</td><td>1.21</td><td>1.80</td><td>0.92</td><td>1.48</td><td>1.48</td><td>0.95</td><td>1.55</td></tr><tr><td>Language</td><td>Ko</td><td>Ku</td><td>Lt</td><td>Mk</td><td>My</td><td>Nb</td><td>N1</td><td>PI</td><td>Ptbr</td><td>Pt</td><td>Ro</td></tr><tr><td>△1</td><td>-0.42</td><td>7.75</td><td>4.46</td><td>10.72</td><td>7.63</td><td>14.07</td><td>-0.20</td><td>1.32</td><td>0.13</td><td>8.76</td><td>0.66</td></tr><tr><td>△2</td><td>1.43</td><td>1.55</td><td>1.69</td><td>0.80</td><td>1.31</td><td>1.47</td><td>1.68</td><td>0.80</td><td>1.45</td><td>1.98</td><td>1.70</td></tr><tr><td>Language</td><td>Ru</td><td>Sk</td><td>S1</td><td>Sq</td><td>Sr</td><td>Sv</td><td>Th</td><td>Tr</td><td>Uk</td><td>Vi</td><td>Zh</td></tr><tr><td>△1</td><td>0.65</td><td>4.23</td><td>11.87</td><td>5.03</td><td>1.58</td><td>2.39</td><td>1.17</td><td>-0.79</td><td>2.04</td><td>0.15</td><td>6.83</td></tr><tr><td>△2</td><td>0.99</td><td>0.93</td><td>1.15</td><td>1.68</td><td>1.44</td><td>1.00</td><td>0.62</td><td>1.88</td><td>0.98</td><td>0.77</td><td>0.58</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Results on Ted Talk Now we study the effectiveness of our method on a large number of languages. The experiments are conducted on the 44 languages English on the Ted talk dataset. Due to the large number of languages and space limitations, we just show the BLEU score improvements of our method over individual models and the multi-baseline for each language in Table 5, and leave the detailed experiment results to Appendix (Section 3). It can be seen that our method can improve over the multi-baseline for all the languages, mostly with more than 1 BLEU score improvements. Our method can also match or even surpass individual models for most languages, not to mention that the number of parameters of our method is only $1 / 4 4$ of that of the sum of 44 individual models. Our method achieves larger improvements on some languages, such as Da, Et, Fi, Hi and Hy, than others. We find this is correlated with the data size of the languages, which are listed in Appendix (Table 13). When a language is of smaller data size, it may get more improvement due to the benefit of multilingual training.
|
| 157 |
+
|
| 158 |
+
# 4.3 ANALYSIS
|
| 159 |
+
|
| 160 |
+
In this section, we conduct thorough analyses on our proposed method for multilingual NMT.
|
| 161 |
+
|
| 162 |
+
Selective Distillation We study the effectiveness of the selective distillation (discussed in Section 3.3) on the Ted talk dataset, as shown in Table 6. We list the 16 languages on which the two methods (selective distillation, and distillation all the time) that have difference bigger than 0.5 in terms of BLEU score. It can be seen that selective distillation performs better on 13 out of 16 languages, with large BLEU score improvements, which demonstrates the effectiveness of the selective distillation.
|
| 163 |
+
|
| 164 |
+
Table 6: BLEU scores of selective distillation (our method) and distillation all the time during the training process on the Ted talk dataset.
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td>Bg</td><td>Et</td><td>Fi</td><td>Fr</td><td>Gl</td><td>Hi</td><td>Hy</td><td>Ka</td></tr><tr><td>distillation all the time</td><td>28.07</td><td>12.64</td><td>15.13</td><td>33.69</td><td>30.28</td><td>18.86</td><td>19.88</td><td>14.04</td></tr><tr><td>selective distillation</td><td>29.18</td><td>15.63</td><td>17.23</td><td>34.32</td><td>31.90</td><td>21.00</td><td>21.17</td><td>18.27</td></tr><tr><td>△</td><td>+1.11</td><td>+2.99</td><td>+2.10</td><td>+0.63</td><td>+1.62</td><td>+2.14</td><td>+1.29</td><td>+4.23</td></tr><tr><td></td><td>Ku</td><td>Mk</td><td>My</td><td>SI</td><td>Zh</td><td>Pl</td><td>Sk</td><td>Sv</td></tr><tr><td>distillation all the time</td><td>8.50</td><td>32.10</td><td>14.02</td><td>22.10</td><td>17.22</td><td>25.05</td><td>30.45</td><td>37.88</td></tr><tr><td>selective distillation</td><td>13.38</td><td>32.65</td><td>15.17</td><td>23.68</td><td>19.39</td><td>24.30</td><td>29.91</td><td>36.92</td></tr><tr><td>△</td><td>+4.88</td><td>+0.55</td><td>+1.15</td><td>+1.58</td><td>+2.17</td><td>-0.75</td><td>-0.54</td><td>-0.96</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Top-K Distillation In our experiments, the student model just matches the top-K output distribution of the teacher model, instead of the full distribution, in order to reduce the memory cost. We analyze whether there is accuracy difference between the top- $\mathbf { \nabla } \cdot \mathbf { K }$ distribution and the full distribution. We conduct experiments on IWSLT dataset with varying $K$ (from 1 to $| V |$ , where $| V |$ is the vocabulary size), and just show the BLEU scores on the validation set of De-En translation due to space limitation, as illustrated in Table 7. It can be seen that increasing $K$ from 1 to 8 will improve the accuracy, while bigger $K$ will bring no gains, even with the full distribution $( K = | V | )$ ).
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Top-K</td><td>1</td><td>2</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td><td>128</td><td>IVI</td></tr><tr><td>BLEU</td><td>33.45</td><td>33.86</td><td>34.47</td><td>34.76</td><td>34.66</td><td>34.68</td><td>34.54</td><td>34.47</td><td>34.49</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 7: BLEU scores on De-En translation with varying Top-K distillation on the IWSLT dataset.
|
| 173 |
+
|
| 174 |
+
Back Distillation In our current distillation algorithm, we fix the individual models and use them to teach and improve the multilingual model. After such a distillation process, the multilingual model outperforms the individual models on most of the languages. Then naturally, we may wonder whether this improved multilingual model can further be used to teach and improve individual models through knowledge distillation. We call such a process back distillation. We conduct the experiments on the IWSLT dataset, and find that the accuracy of 9 out of 12 languages gets improved, as shown in Table 10. The other 3 languages (He, Pt, Zh) cannot get improvements because the improved multilingual model performs very close to individual models, as shown in Table 1.
|
| 175 |
+
|
| 176 |
+
Table 8: BLEU score improvements of the individual models with back distillation on the IWSLT dataset.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Language</td><td>Ar</td><td>Cs</td><td>De</td><td>N1</td><td>Ro</td><td>Ru</td><td>Th</td><td>Tr</td><td>Vi</td></tr><tr><td>Individual</td><td>31.19</td><td>28.04</td><td>33.07</td><td>35.94</td><td>36.92</td><td>23.04</td><td>18.24</td><td>22.74</td><td>26.06</td></tr><tr><td>+Back Distillation</td><td>31.39</td><td>29.44</td><td>33.71</td><td>36.86</td><td>37.28</td><td>23.36</td><td>19.42</td><td>23.58</td><td>27.17</td></tr><tr><td>△</td><td>+0.20</td><td>+1.40</td><td>+0.64</td><td>+0.92</td><td>+0.36</td><td>+0.32</td><td>+1.18</td><td>+0.84</td><td>+1.11</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Comparison with Sequence-Level Knowledge Distillation We conduct experiments to compare the word-level knowledge distillation (the exact method used in our paper) with sequence-level knowledge distillation(Kim & Rush, 2016b) on IWSLT dataset. As shown in Table 9, sequencelevel knowledge distillation results in consistently inferior accuracy on all languages compared with word-level knowledge distillation used in our work.
|
| 181 |
+
|
| 182 |
+
Table 9: BLEU scores of sequence-level knowledge distillation and word-level knowledge distillation on the IWSLT dataset.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Language</td><td>Sequence-level</td><td>Word-level (OurMethod)</td><td>△</td></tr><tr><td>En-Ar</td><td>12.79</td><td>13.80</td><td>1.01</td></tr><tr><td>En-Cs</td><td>17.01</td><td>18.69</td><td>1.68</td></tr><tr><td>En-De</td><td>25.89</td><td>26.76</td><td>0.87</td></tr><tr><td>En-He</td><td>22.92</td><td>24.42</td><td>1.50</td></tr><tr><td>En-N1</td><td>29.99</td><td>30.52</td><td>0.53</td></tr><tr><td>En-Pt</td><td>36.12</td><td>37.23</td><td>1.10</td></tr><tr><td>En-Ro</td><td>25.75</td><td>27.11</td><td>1.36</td></tr><tr><td>En-Ru</td><td>16.38</td><td>17.42</td><td>1.04</td></tr><tr><td>En-Th</td><td>27.52</td><td>27.62</td><td>0.10</td></tr><tr><td>En-Tr</td><td>11.11</td><td>12.84</td><td>1.73</td></tr><tr><td>En-Vi</td><td>28.08</td><td>28.69</td><td>0.61</td></tr><tr><td>En-Zh</td><td>10.25</td><td>10.41</td><td>0.16</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 10: BLEU score improvements of the individual models with back distillation on the IWSLT dataset.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Language</td><td>Ar</td><td>Cs</td><td>De</td><td>N1</td><td>Ro</td><td>Ru</td><td>Th</td><td>Tr</td><td>Vi</td></tr><tr><td>Individual</td><td>31.19</td><td>28.04</td><td>33.07</td><td>35.94</td><td>36.92</td><td>23.04</td><td>18.24</td><td>22.74</td><td>26.06</td></tr><tr><td>+Back Distillation</td><td>31.39</td><td>29.44</td><td>33.71</td><td>36.86</td><td>37.28</td><td>23.36</td><td>19.42</td><td>23.58</td><td>27.17</td></tr><tr><td>△</td><td>+0.20</td><td>+1.40</td><td>+0.64</td><td>+0.92</td><td>+0.36</td><td>+0.32</td><td>+1.18</td><td>+0.84</td><td>+1.11</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Generalization Analysis Previous works (Yang et al., 2018; Lan et al., 2018) have shown that knowledge distillation can help a model generalize well to unseen data, and thus yield better performance. We analyze how distillation in multilingual setting helps the model generalization. Previous studies (Keskar et al., 2016; Chaudhari et al., 2016) demonstrate the relationship between model generalization and the width of local minima in loss surface. Wider local minima can make the model more robust to small perturbations in testing. Therefore, we compare the generalization capability of the two multilingual models (our method and the baseline) by perturbing their parameters.
|
| 191 |
+
|
| 192 |
+
Specifically, we perturb a model $\theta$ as $\theta _ { i } ( \sigma ) = \theta _ { i } + \bar { \theta } * \mathcal { N } ( 0 , \sigma ^ { 2 } )$ , where $\theta _ { i }$ is the $i$ -th parameter of the model, $\bar { \theta }$ is the average of all the parameters in $\theta$ . We sample from the normal distribution $\mathcal { N }$ with standard variance $\sigma$ and larger $\sigma$ represents bigger perturbation on the parameter. We conduct the analyses on the IWSLT dataset and vary $\sigma \in [ 0 . 0 5 , 0 . 1 , 0 . 1 5 , 0 . 2 , 0 . 2 5 , 0 . 3$ ]. Figure 1a shows the loss curve in the test set with varying $\sigma$ . As can be seen, while both the two losses increase with the increase of $\sigma$ , the loss of the baseline model increases quicker than our method. We also show three test BLEU curves on three translation pairs (Figure 1b: Ar-En, Figure 1c: Cs-En, Figure 1d: De-En, which are randomly picked from the 12 languages pairs on the IWSLT dataset). We observe that the BLEU score of the multilingual baseline drops quicker than our method, which demonstrates that our method helps the model find wider local minima and thus generalize better.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 1: The loss (Figure a) and BLEU score (Figure b: Ar-En, Figure c: Cs-En, Figure d: De-En) changes on the test set of the IWSLT dataset, with varying perturbation parameter $\sigma$ .
|
| 196 |
+
|
| 197 |
+
# 5 CONCLUSION
|
| 198 |
+
|
| 199 |
+
In this work, we have proposed a distillation-based approach to boost the accuracy of multilingual NMT, which is usually of lower accuracy than the individual models in previous works. Experiments on three translation datasets with up to 44 languages demonstrate the multilingual model based on our proposed method can nearly match or even outperform the individual models, with just $1 / N$ model parameters (N is up to 44 in our experiments).
|
| 200 |
+
|
| 201 |
+
In the future, we will conduct more deep analyses about how distillation helps the multilingual model training. We will apply our method to larger datasets and more languages pairs (hundreds or even thousands), to study the upper limit of our proposed method.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
Rohan Anil, Gabriel Pereyra, Alexandre Passos, Robert Ormandi, George E Dahl, and Geoffrey E Hinton. Large scale distributed neural network training through online distillation. arXiv preprint arXiv:1804.03235, 2018.
|
| 206 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. ICLR 2015, 2015.
|
| 207 |
+
Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 535–541. ACM, 2006.
|
| 208 |
+
Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
|
| 209 |
+
Daxiang Dong, Hua Wu, Wei He, Dianhai Yu, and Haifeng Wang. Multi-task learning for multiple language translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pp. 1723–1732, 2015.
|
| 210 |
+
Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation with a shared attention mechanism. In NAACL HLT 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego California, USA, June 12-17, 2016, pp. 866–875, 2016.
|
| 211 |
+
|
| 212 |
+
Markus Freitag, Yaser Al-Onaizan, and Baskaran Sankaran. Ensemble distillation for neural machine translation. arXiv preprint arXiv:1702.01802, 2017.
|
| 213 |
+
|
| 214 |
+
Tommaso Furlanello, Zachary C Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. arXiv preprint arXiv:1805.04770, 2018.
|
| 215 |
+
|
| 216 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 1243–1252, 2017.
|
| 217 |
+
|
| 218 |
+
Chengyue Gong, Xu Tan, Di He, and Tao Qin. Sentence-wise smooth regularization for sequence to sequence learning. In AAAI, 2018.
|
| 219 |
+
|
| 220 |
+
Jiatao Gu, Hany Hassan, Jacob Devlin, and Victor O. K. Li. Universal neural machine translation for extremely low resource languages. In NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 344–354, 2018a.
|
| 221 |
+
|
| 222 |
+
Jiatao Gu, Yong Wang, Yun Chen, Kyunghyun Cho, and Victor OK Li. Meta-learning for lowresource neural machine translation. arXiv preprint arXiv:1808.08437, 2018b.
|
| 223 |
+
|
| 224 |
+
Junliang Guo, Xu Tan, Di He, Tao Qin, Linli Xu, and Tie-Yan Liu. Non-autoregressive neural machine translation with enhanced decoder input. In AAAI, 2018.
|
| 225 |
+
|
| 226 |
+
Thanh-Le Ha, Jan Niehues, and Alexander H. Waibel. Toward multilingual neural machine translation with universal encoder and decoder. CoRR, abs/1611.04798, 2016. URL http: //arxiv.org/abs/1611.04798.
|
| 227 |
+
|
| 228 |
+
Hany Hassan, Anthony Aue, Chang Chen, Vishal Chowdhary, Jonathan Clark, Christian Federmann, Xuedong Huang, Marcin Junczys-Dowmunt, William Lewis, Mu Li, Shujie Liu, Tie-Yan Liu, Renqian Luo, Arul Menezes, Tao Qin, Frank Seide, Xu Tan, Fei Tian, Lijun Wu, Shuangzhi Wu, Yingce Xia, Dongdong Zhang, Zhirui Zhang, and Ming Zhou. Achieving human parity on automatic chinese to english news translation. CoRR, abs/1803.05567, 2018. URL http: //arxiv.org/abs/1803.05567.
|
| 229 |
+
|
| 230 |
+
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 NIPS, pp. 7955–7965, 2018.
|
| 231 |
+
|
| 232 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 233 |
+
|
| 234 |
+
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda B. Viegas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey ´ Dean. Google’s multilingual neural machine translation system: Enabling zero-shot translation. TACL, 5:339–351, 2017. URL https://transacl.org/ojs/index.php/tacl/ article/view/1081.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
Yoon Kim and Alexander M. Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pp. 1317–1327, 2016a.
|
| 239 |
+
|
| 240 |
+
Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. arXiv preprint arXiv:1606.07947, 2016b.
|
| 241 |
+
|
| 242 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 243 |
+
|
| 244 |
+
Xu Lan, Xiatian Zhu, and Shaogang Gong. Knowledge distillation by on-the-fly native ensemble. arXiv preprint arXiv:1806.04606, 2018.
|
| 245 |
+
|
| 246 |
+
Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In ICCV, pp. 1928–1936, 2017.
|
| 247 |
+
|
| 248 |
+
Yichao Lu, Phillip Keung, Faisal Ladhak, Vikas Bhardwaj, Shaonan Zhang, and Jason Sun. A neural interlingua for multilingual machine translation. CoRR, abs/1804.08198, 2018. URL http://arxiv.org/abs/1804.08198.
|
| 249 |
+
|
| 250 |
+
Minh-Thang Luong, Quoc V. Le, Ilya Sutskever, Oriol Vinyals, and Lukasz Kaiser. Multi-task sequence to sequence learning. CoRR, abs/1511.06114, 2015a. URL http://arxiv.org/ abs/1511.06114.
|
| 251 |
+
|
| 252 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, pp. 1412– 1421, 2015b.
|
| 253 |
+
|
| 254 |
+
Graham Neubig and Junjie Hu. Rapid adaptation of neural machine translation to new languages. arXiv preprint arXiv:1808.04189, 2018.
|
| 255 |
+
|
| 256 |
+
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 of the Association for Computational Linguistics, July 6-12, 2002, Philadelphia, PA, USA., pp. 311–318, 2002. URL http://www.aclweb.org/anthology/P02-1040.pdf.
|
| 257 |
+
|
| 258 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014.
|
| 259 |
+
|
| 260 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers, 2016. URL http://aclweb.org/anthology/P/P16/P16-1162.pdf.
|
| 261 |
+
|
| 262 |
+
Yanyao Shen, Xu Tan, Di He, Tao Qin, and Tie-Yan Liu. Dense information flow for neural machine translation. In NAACL, volume 1, pp. 1294–1303, 2018.
|
| 263 |
+
|
| 264 |
+
Kaitao Song, Xu Tan, Di He, Jianfeng Lu, Tao Qin, and Tie-Yan Liu. Double path networks for sequence to sequence learning. In COLING, pp. 3064–3074, 2018.
|
| 265 |
+
|
| 266 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In NIPS 2014, December 8-13 2014, Montreal, Quebec, Canada, pp. 3104–3112, 2014.
|
| 267 |
+
|
| 268 |
+
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, 4-9 December 2017, Long Beach, CA, USA, pp. 6000–6010, 2017.
|
| 269 |
+
|
| 270 |
+
Lijun Wu, Xu Tan, Di He, Fei Tian, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. Beyond error propagation in neural machine translation: Characteristics of language also matter. In EMNLP, pp. 3602–3611, 2018.
|
| 271 |
+
|
| 272 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144, 2016. URL http://arxiv.org/abs/1609.08144.
|
| 273 |
+
|
| 274 |
+
Chenglin Yang, Lingxi Xie, Siyuan Qiao, and Alan Yuille. Knowledge distillation in generations: More tolerant teachers educate better students. arXiv preprint arXiv:1805.05551, 2018.
|
| 275 |
+
|
| 276 |
+
Qi Ye, Sachan Devendra, Felix Matthieu, Padmanabhan Sarguna, and Neubig Graham. When and why are pre-trained word embeddings useful for neural machine translation. In HLT-NAACL, 2018.
|
| 277 |
+
|
| 278 |
+
Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2017.
|
| 279 |
+
|
| 280 |
+
Ying Zhang, Tao Xiang, Timothy M Hospedales, and Huchuan Lu. Deep mutual learning. arXiv preprint arXiv:1706.00384, 6, 2017.
|
| 281 |
+
|
| 282 |
+
# APPENDIX
|
| 283 |
+
|
| 284 |
+
# 1 DATASET DESCRIPTION
|
| 285 |
+
|
| 286 |
+
We give a detailed description about the IWSLT,WMT and Ted Talk datasets used in experiments.
|
| 287 |
+
|
| 288 |
+
IWSLT: We collect 12 languages English translation pairs from IWSLT evaluation campaign8 from year 2014 to 2016. Each language pair contains roughly 80K to 200K sentence pairs. We use the official validation and test sets for each language pair. The data sizes of the training set for each language English pair are listed in Table 11.
|
| 289 |
+
|
| 290 |
+
<table><tr><td>Language</td><td>Ar</td><td>Cs</td><td>De</td><td>He</td><td>N1</td><td>Pt</td></tr><tr><td>Training Data</td><td>174K</td><td>114K</td><td>167K</td><td>180K</td><td>174K</td><td>167K</td></tr><tr><td>Language</td><td>Ro</td><td>Ru</td><td>Th</td><td>Tr</td><td>Vi</td><td>Zh</td></tr><tr><td>Training Data</td><td>177K</td><td>173K</td><td>83K</td><td>150K</td><td>131K</td><td>209K</td></tr></table>
|
| 291 |
+
|
| 292 |
+
Table 11: The training data size on the 12 languages English on the IWSLT dataset.
|
| 293 |
+
|
| 294 |
+
WMT: We collect 6 languages English translation pairs from WMT translation task9. We use 5 language English translation pairs from WMT 2016 dataset: Cs-En, De-En, Fi-En, Ro-En, RuEn and one other translation pair from WMT 2017 dataset: Lv-En. We use the official released validation and test sets for each language pair. The training data sizes of each language English pair are shown in the Table 12.
|
| 295 |
+
|
| 296 |
+
Table 12: The training data size on the 6 languages English on the WMT dataset.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Language</td><td>Cs</td><td>De</td><td>Fi</td><td>Lv</td><td>Ro</td><td>Ru</td></tr><tr><td>Training Data</td><td>1.0M</td><td>4.5M</td><td>2.5M</td><td>4.5M</td><td>2.2M</td><td>2.1M</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Ted Talk: We use the common corpus of TED talk which contains translations between multiple languages (Ye et al., 2018)10. We select 44 languages in this corpus that has sufficient data for our experiments. We use the official validation and test sets for each language pair. The data sizes of the training set for each language English pair are listed in Table 13.
|
| 301 |
+
|
| 302 |
+
Table 13: The training data size on the 44 languages English on the Ted talk dataset.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Language</td><td>Ar</td><td>Bg</td><td>Cs</td><td>Da</td><td>De</td><td>E1</td><td>Es</td><td>Et</td><td>Fa</td><td>Fi</td><td>Frca</td></tr><tr><td>Training Data</td><td>214K</td><td>174k</td><td>103k</td><td>45k</td><td>168k</td><td>134k</td><td>196k</td><td>11k</td><td>151k</td><td>24k</td><td>20k</td></tr><tr><td>Language</td><td>Fr</td><td>Gl</td><td>He</td><td>Hi</td><td>Hr</td><td>Hu</td><td>Hy</td><td>Id</td><td>It</td><td>Ja</td><td>Ka</td></tr><tr><td>Training Data</td><td>192K</td><td>10K</td><td>212K</td><td>19K</td><td>122K</td><td>147K</td><td>21K</td><td>87K</td><td>205K</td><td>204K</td><td>13K</td></tr><tr><td>Language</td><td>Ko</td><td>Ku</td><td>Lt</td><td>Mk</td><td>My</td><td>Nb</td><td>NI</td><td>Pl</td><td>Ptbr</td><td>Pt</td><td>Ro</td></tr><tr><td>Training Data</td><td>206K</td><td>10K</td><td>42K</td><td>25K</td><td>21K</td><td>16K</td><td>184K</td><td>176K</td><td>185K</td><td>52K</td><td>180K</td></tr><tr><td>Language</td><td>Ru</td><td>Sk</td><td>S1</td><td>Sq</td><td>Sr</td><td>Sv</td><td>Th</td><td>Tr</td><td>Uk</td><td>Vi</td><td>Zh</td></tr><tr><td>Training Data</td><td>208K</td><td>61K</td><td>20K</td><td>45K</td><td>137K</td><td>57K</td><td>98K</td><td>182K</td><td>108K</td><td>172K</td><td>200K</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# 2 LANGUAGE NAME AND CODE
|
| 307 |
+
|
| 308 |
+
The language names and their corresponding language codes according to ISO 639-1 standard11 are listed in Table 14.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Language</td><td>Code</td><td>Language</td><td>Code</td><td>Language</td><td>Code</td><td>Language</td><td>Code</td></tr><tr><td>Arabic</td><td>Ar</td><td>Bulgarian</td><td>Bg</td><td>Czech</td><td>Cs</td><td>Danish</td><td>Da</td></tr><tr><td>German</td><td>De</td><td>Greek</td><td>El</td><td>English</td><td>En</td><td>Spanish</td><td>Es</td></tr><tr><td>Persian</td><td>Fa</td><td>Finnish</td><td>Fi</td><td>French</td><td>Fr</td><td>Galician</td><td>Gl</td></tr><tr><td>Hebrew</td><td>He</td><td>Hindi</td><td>Hi</td><td>Croatian</td><td>Hr</td><td>Hungarian</td><td>Hu</td></tr><tr><td>Armenian</td><td>Hy</td><td>Indonesian</td><td>Id</td><td>Italian</td><td>It</td><td>Japanese</td><td>Ja</td></tr><tr><td>Georgian</td><td>Ka</td><td>Korean</td><td>Ko</td><td>Kurdish</td><td>Ku</td><td>Lithuanian</td><td>Lt</td></tr><tr><td>Latvian</td><td>Lv</td><td>Macedonian</td><td>Mk</td><td>Burmese</td><td>My</td><td>Norwegian</td><td>Nb</td></tr><tr><td>Dutch</td><td>N1</td><td>Polish</td><td>Pl</td><td>Portuguese</td><td>Pt</td><td>Romanian</td><td>Ro</td></tr><tr><td>Russian</td><td>Ru</td><td>Slovak</td><td>Sk</td><td>Slovenian</td><td>S1</td><td>Albanian</td><td>Sq</td></tr><tr><td>Serbian</td><td>Sr</td><td>Swedish</td><td>Sv</td><td>Thai</td><td>Th</td><td>Turkish</td><td>Tr</td></tr><tr><td>Ukrainian</td><td>Uk</td><td>Vietnamese</td><td>Vi</td><td>Chinese</td><td>Zh</td><td></td><td></td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 14: The ISO 639-1 code of each language in our experiments. There are two extra language codes in our datasets: Ptbr represents Portuguese spoken in Brazil, Frca represents French spoken in Canada.
|
| 313 |
+
|
| 314 |
+
# 3 RESULTS ON TED TALK DATASET
|
| 315 |
+
|
| 316 |
+
The detailed results of the 44 languages English on the Ted talk dataset are listed in Table 15. It can be seen that while multilingual baseline performs worse than the individual model, multilingual model based on our method nearly matches and even outperforms the individual model. Note that the multilingual model handles 44 languages in total, which means our method can reduce the model parameters size to $1 / 4 4$ without loss of accuracy.
|
| 317 |
+
Table 15: BLEU scores of the individual and multilingual models on the 44 languages English on the Ted talk dataset.
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Language</td><td>Ar</td><td>Bg</td><td>Cs</td><td>Da</td><td>De</td><td>E1</td><td>Es</td><td>Et</td><td>Fa</td></tr><tr><td>Individual</td><td>31.07</td><td>38.64</td><td>26.42</td><td>38.21</td><td>34.63</td><td>36.69</td><td>41.20</td><td>7.43</td><td>26.67</td></tr><tr><td>Multilingual (Baseline)</td><td>27.84</td><td>27.76</td><td>27.17</td><td>40.41</td><td>32.85</td><td>36.04</td><td>39.80</td><td>14.86</td><td>24.93</td></tr><tr><td>Multilingual (Our method)</td><td>29.57</td><td>29.18</td><td>28.30</td><td>42.23</td><td>34.53</td><td>37.49</td><td>41.43</td><td>15.63</td><td>26.76</td></tr><tr><td>Language</td><td>Fi</td><td>Frca</td><td>Fr</td><td>Gl</td><td>He</td><td>Hi</td><td>Hr</td><td>Hu</td><td>Hy</td></tr><tr><td>Individual</td><td>10.78</td><td>18.52</td><td>39.62</td><td>12.64</td><td>36.81</td><td>10.84</td><td>34.14</td><td>24.67</td><td>12.30</td></tr><tr><td>Multilingual (Baseline)</td><td>16.12</td><td>33.08</td><td>38.27</td><td>30.32</td><td>32.96</td><td>19.93</td><td>34.39</td><td>22.76</td><td>20.25</td></tr><tr><td>Multilingual (Our method)</td><td>17.22</td><td>34.32</td><td>39.75</td><td>31.9</td><td>35.22</td><td>21.00</td><td>35.6</td><td>24.56</td><td>21.17</td></tr><tr><td>Language</td><td>Id</td><td>It</td><td>Ja</td><td>Ka</td><td>Ko</td><td>Ku</td><td>Lt</td><td>Mk</td><td>My</td></tr><tr><td>Individual</td><td>29.20</td><td>38.06</td><td>13.31</td><td>7.06</td><td>18.54</td><td>5.63</td><td>18.19</td><td>21.93</td><td>7.53</td></tr><tr><td>Multilingual (Baseline)</td><td>29.08</td><td>36.02</td><td>12.33</td><td>16.71</td><td>16.71</td><td>11.83</td><td>20.96</td><td>31.85</td><td>13.85</td></tr><tr><td>Multilingual (Our method)</td><td>30.56</td><td>37.50</td><td>13.28</td><td>18.26</td><td>18.14</td><td>13.38</td><td>22.65</td><td>32.65</td><td>15.16</td></tr><tr><td>Language</td><td>Nb</td><td>NI</td><td>PI</td><td>Ptbr</td><td>Pt</td><td>Ro</td><td>Ru</td><td>Sk</td><td>SI</td></tr><tr><td>Individual</td><td>27.28</td><td>35.85</td><td>22.98</td><td>44.28</td><td>33.81</td><td>34.07</td><td>24.36</td><td>25.67</td><td>11.80</td></tr><tr><td>Multilingual (Baseline)</td><td>39.88</td><td>33.97</td><td>23.50</td><td>42.96</td><td>40.59</td><td>33.03</td><td>24.02</td><td>28.97</td><td>22.52</td></tr><tr><td>Multilingual (Our method)</td><td>41.35</td><td>35.65</td><td>24.30</td><td>44.41</td><td>42.57</td><td>34.73</td><td>25.01</td><td>29.90</td><td>23.67</td></tr><tr><td>Language</td><td>Sq</td><td>Sr</td><td>Sv</td><td>Th</td><td>Tr</td><td>Uk</td><td>Vi</td><td>Zh</td><td></td></tr><tr><td>Individual</td><td>29.70</td><td>32.13</td><td>34.53</td><td>20.95</td><td>24.46</td><td>25.76</td><td>26.38</td><td>12.56</td><td></td></tr><tr><td>Multilingual (Baseline)</td><td>33.05</td><td>32.27</td><td>35.92</td><td>21.50</td><td>21.79</td><td>26.82</td><td>25.76</td><td>18.81</td><td></td></tr><tr><td>Multilingual (Our method)</td><td>34.73</td><td>33.71</td><td>36.92</td><td>22.12</td><td>23.67</td><td>27.80</td><td>26.53</td><td>19.39</td><td></td></tr></table>
|
md/train/S1xSSTNKDB/S1xSSTNKDB.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FAIRFACE: A NOVEL FACE ATTRIBUTE DATASET FOR BIAS MEASUREMENT AND MITIGATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Existing public face image datasets are strongly biased toward Caucasian faces, and other races (e.g., Latino) are significantly underrepresented. The models trained from such datasets suffer from inconsistent classification accuracy, which limits the applicability of face analytic systems to non-White race groups. To mitigate the race bias problem in these datasets, we constructed a novel face image dataset containing 108,501 images which is balanced on race. We define 7 race groups: White, Black, Indian, East Asian, Southeast Asian, Middle Eastern, and Latino. Images were collected from the YFCC-100M Flickr dataset and labeled with race, gender, and age groups. Evaluations were performed on existing face attribute datasets as well as novel image datasets to measure the generalization performance. We find that the model trained from our dataset is substantially more accurate on novel datasets and the accuracy is consistent across race and gender groups. We also compare several commercial computer vision APIs and report their balanced accuracy across gender, race, and age groups.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
To date, numerous large scale face image datasets (Huang et al., 2007; Kumar et al., 2011; Escalera et al., 2016; Yi et al., 2014; Liu et al., 2015; Joo et al., 2015; Parkhi et al., 2015; Yang et al., 2016; Guo et al., 2016; Kemelmacher-Shlizerman et al., 2016; Rothe et al., 2016; Cao et al., 2018; Merler et al., 2019) have been proposed and fostered research and development for automated face detection (Li et al., 2015b; Hu & Ramanan, 2017), alignment (Xiong & De la Torre, 2013; Ren et al., 2014), recognition (Taigman et al., 2014; Schroff et al., 2015), generation (Yan et al., 2016; Bao et al., 2017; Karras et al., 2018; Thomas & Kovashka, 2018), modification (Antipov et al., 2017; Lample et al., 2017; He et al., 2017), and attribute classification (Kumar et al., 2011; Liu et al., 2015). These systems have been successfully translated into many areas including security, medicine, education, and social sciences.
|
| 12 |
+
|
| 13 |
+
Despite the sheer amount of available data, existing public face datasets are strongly biased toward Caucasian faces, and other races (e.g., Latino) are significantly underrepresented. A recent study shows that most existing large scale face databases are biased towards “lighter skin” faces (around $80 \%$ ), e.g. White, compared to “darker” faces, e.g. Black (Merler et al., 2019). This means the model may not apply to some subpopulations and its results may not be compared across different groups without calibration. Biased data will produce biased models trained from it. This will raise ethical concerns about fairness of automated systems, which has emerged as a critical topic of study in the recent machine learning and AI literature (Hardt et al., 2016; Corbett-Davies et al., 2017).
|
| 14 |
+
|
| 15 |
+
For example, several commercial computer vision systems (Microsoft, IBM, Face $^ { + + }$ ) have been criticized due to their asymmetric accuracy across sub-demographics in recent studies (Buolamwini & Gebru, 2018; Raji & Buolamwini, 2019). These studies found that the commercial face gender classification systems all perform better on male and on light faces. This can be caused by the biases in their training data. Various unwanted biases in image datasets can easily occur due to biased selection, capture, and negative sets (Torralba & Efros, 2011). Most public large scale face datasets have been collected from popular online media – newspapers, Wikipedia, or web search– and these platforms are more frequently used by or showing White people.
|
| 16 |
+
|
| 17 |
+
To mitigate the race bias in the existing face datasets, we propose a novel face dataset with an emphasis on balanced race composition. Our dataset contains 108,501 facial images collected primarily from the YFCC-100M Flickr dataset (Thomee et al.), which can be freely shared for a research purpose, and also includes examples from other sources such as Twitter and online newspaper outlets. We define 7 race groups: White, Black, Indian, East Asian, Southeast Asian, Middle Eastern, and Latino. Our dataset is well-balanced on these 7 groups (See Figures 1 and 2)
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Racial compositions in face datasets.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Random samples from face attribute datasets.
|
| 24 |
+
|
| 25 |
+
Our paper makes three main contributions. First, we emprically show that existing face attribute datasets and models learned from them do not generalize well to unseen data in which more nonWhite faces are present. Second, we show that our new dataset performs better on novel data, not only on average, but also across racial groups, i.e. more consistently. Third, to the best of our knowledge, our dataset is the first large scale face attribute dataset in the wild which includes Latino and Middle Eastern and differentiates East Asian and Southeast Asian. Computer vision has been rapidly transferred into other fields such as economics or social sciences, where researchers want to analyze different demographics using image data. The inclusion of major racial groups, which have been missing in existing datasets, therefore significantly enlarges the applicability of computer vision methods to these fields.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
# 2.1 FACE ATTRIBUTE RECOGNITION
|
| 30 |
+
|
| 31 |
+
The goal of face attribute recognition is to classify various human attributes such as gender, race, age, emotions, expressions or other facial traits from facial appearance (Kumar et al., 2011; Joo et al., 2013; Zhang et al., 2015; Liu et al., 2015). Table 1 summarizes the statistics of existing large scale public and in-the-wild face attribute datasets including our new dataset. As stated earlier, most of these datasets were constructed from online sources and are typically dominated by the White race.
|
| 32 |
+
|
| 33 |
+
Table 1: Statistics of Face Attribute Datasets
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>Rac</td><td rowspan=1 colspan=1>Annot</td><td rowspan=1 colspan=1>ation</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Name</td><td rowspan=2 colspan=1>Source</td><td rowspan=2 colspan=1>#offaces</td><td rowspan=2 colspan=1>In-the-wild?</td><td rowspan=2 colspan=1>Age</td><td rowspan=2 colspan=1>Gender</td><td rowspan=1 colspan=2>White*</td><td rowspan=1 colspan=2>Asian*</td><td rowspan=2 colspan=1>Bla-ck</td><td rowspan=2 colspan=1>Ind-ian</td><td rowspan=2 colspan=1>Lat-ino</td><td rowspan=2 colspan=1>Balan-ced?</td></tr><tr><td rowspan=1 colspan=2>WME</td><td rowspan=1 colspan=2>E SE</td></tr><tr><td rowspan=1 colspan=1>PPB(Buolamwini & Gebru,2018)</td><td rowspan=1 colspan=1>Gov. OfficialProfiles</td><td rowspan=1 colspan=1>1K</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=8>**Skin color prediction</td></tr><tr><td rowspan=1 colspan=1>MORPH(Ricanek & Tesafaye,2006)</td><td rowspan=1 colspan=1>Public Data</td><td rowspan=1 colspan=1>55K</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>PubFig(Kumar et al.,2011)</td><td rowspan=1 colspan=1>Celebrity</td><td rowspan=1 colspan=1>13K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=9>Model generated predictions</td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>IMDB-WIKI(Rothe et al., 2016)</td><td rowspan=1 colspan=1>IMDB,WIKI</td><td rowspan=1 colspan=1>500K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>FotW(Escalera et al., 2016)</td><td rowspan=1 colspan=1>Flickr</td><td rowspan=1 colspan=1>25K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>CACD(Chen et al.,2015)</td><td rowspan=1 colspan=1>celebrity</td><td rowspan=1 colspan=1>160K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>DiF(Merler et al., 2019)</td><td rowspan=1 colspan=1>Flickr</td><td rowspan=1 colspan=1>1M</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=8>**Skin color prediction</td></tr><tr><td rowspan=1 colspan=1>+CelebA(Liu et al., 2015)</td><td rowspan=1 colspan=1>CelebFaceLFW</td><td rowspan=1 colspan=1>200K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>LFW+(Han et al., 2018)</td><td rowspan=1 colspan=1>LFW(Newspapers)</td><td rowspan=1 colspan=1>15K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=3>merged</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>LFWA+(Liu et al., 2015)</td><td rowspan=1 colspan=1>LFW(Newspapers)</td><td rowspan=1 colspan=1>13K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>no</td></tr><tr><td rowspan=1 colspan=1>tUTKFace(Zhang et al., 2017)</td><td rowspan=1 colspan=1>MORPH,CACDWeb</td><td rowspan=1 colspan=1>20K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=2>merged</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>yes</td></tr><tr><td rowspan=1 colspan=1>FairFace(Ours)</td><td rowspan=1 colspan=1>Flickr, TwitterNewspapers, Web</td><td rowspan=1 colspan=1>108K</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>yes</td></tr></table>
|
| 36 |
+
|
| 37 |
+
\*FairFace (Ours) also defines East (E) Asian, Southeast $\overline { { ( \mathrm { S E } ) } }$ Asian, Middle Eastern (ME), and Western (W) White. \*\*PPB and DiF do not provide race annotations but skin color annotated or automatically computed as a proxy to race. †denotes datasets used in our experiments.
|
| 38 |
+
|
| 39 |
+
Face attribute recognition has been applied as a sub-component to other computer vision tasks such as face verification (Kumar et al., 2011) and person re-idenfication (Layne et al., 2012; Li et al., 2015a; Su et al., 2018). It is imperative to ensure that these systems perform evenly well on different gender and race groups. Failing to do so can be detrimental to the reputations of individual service providers and the public trust about the machine learning and computer vision research community. Most notable incidents regarding the racial bias include Google Photos recognizing African American faces as Gorilla and Nikon’s digital cameras prompting a message asking “did someone blink?” to Asian users (Zhang, 2015). These incidents, regardless of whether the models were trained improperly or how much they actually affected the users, often result in the termination of the service or features (e.g. dropping sensitive output categories). For this reason, most commercial service providers have stopped providing a race classifier.
|
| 40 |
+
|
| 41 |
+
Face attribute recognition is also used for demographic surveys performed in marketing or social science research, aimed at understanding human social behaviors and their relations to demographic backgrounds of individuals. Using off-the-shelf tools (Amos et al., 2016; Baltrusaitis et al., 2018) and commercial services, social scientists have begun to use images of people to infer their demographic attributes and analyze their behaviors. Notable examples are demographic analyses of social media users using their photographs (Chakraborty et al., 2017; Reis et al., 2017; Won et al., 2017; Xi et al., 2019; Wang et al., 2017). The cost of unfair classification is huge as it can over- or under-estimate specific sub-populations in their analysis, which may have policy implications.
|
| 42 |
+
|
| 43 |
+
# 2.2 FAIR CLASSIFICATION AND DATASET BIAS
|
| 44 |
+
|
| 45 |
+
AI and machine learning communities have increasingly paid attention to algorithmic fairness and dataset and model biases (Zemel et al., 2013; Corbett-Davies et al., 2017; Zou & Schiebinger, 2018;
|
| 46 |
+
|
| 47 |
+
Zhang et al., 2018). There exist many different definitions of fairness used in the literature (Verma & Rubin, 2018). In this paper, we focus on balanced accuracy–whether the attribute classification accuracy is independent of race and gender. More generally, research in fairness is concerned with a model’s ability to produce fair outcomes (e.g. loan approval) independent of protected or sensitive attributes such as race or gender.
|
| 48 |
+
|
| 49 |
+
Studies in algorithmic fairness have focused on either 1) discovering (auditing) existing bias in datasets or systems (Shankar et al., 2017; Buolamwini & Gebru, 2018; Kiritchenko & Mohammad, 2018; McDuff et al., 2019), 2) making a better dataset (Merler et al., 2019; Alvi et al., 2018), or 3) designing a better algorithm or model (Das et al., 2018; Alvi et al., 2018; Ryu et al., 2017; Zemel et al., 2013; Zafar et al., 2017). Our paper falls into the first two categories.
|
| 50 |
+
|
| 51 |
+
The main task of interest in our paper is (balanced) gender classification from facial images. Buolamwini & Gebru (2018) demonstrated many commercial gender classification systems are biased and least accurate on dark-skinned females. The biased results may be caused by biased datasets, such as skewed image origins ( $45 \%$ of images are from the U.S. in Imagenet) (Suresh et al., 2018) or biased underlying associations between scene and race in images (Stock & Cisse, 2018). It is, however, “infeasible to balance across all possible co-occurrences” of attributes (Hendricks et al., 2018), except in a lab-controlled setting.
|
| 52 |
+
|
| 53 |
+
Therefore, the contribution of our paper is to mitigate, not entirely solve, the current limitations and biases of existing databases by collecting more diverse face images from non-White race groups. We empirically show this significantly improves the generalization performance to novel image datasets whose racial compositions are not dominated by the White race. Furthermore, as shown in Table 1, our dataset is the first large scale in-the-wild face image dataset which includes Southeast Asian and Middle Eastern races. While their faces share similarity with East Asian and White groups, we argue that not having these major race groups in datasets is a strong form of discrimination.
|
| 54 |
+
|
| 55 |
+
# 3 DATASET CONSTRUCTION
|
| 56 |
+
|
| 57 |
+
# 3.1 RACE TAXONOMY
|
| 58 |
+
|
| 59 |
+
Our dataset defines 7 race groups: White, Black, Indian, East Asian, Southeast Asian, Middle Eastern, and Latino. Race and ethnicity are different categorizations of humans. Race is defined based on physical traits and ethnicity is based on cultural similarities (Schaefer, 2008). For example, Asian immigrants in Latin America can be of Latino ethnicity. In practice, these two terms are often used interchangeably.
|
| 60 |
+
|
| 61 |
+
We first adopted a commonly accepted race classification from the U.S. Census Bureau (White, Black, Asian, Hawaiian and Pacific Islanders, Native Americans, and Latino). Latino is often treated as an ethnicity, but we consider Latino a race, which can be judged from the facial appearance. We then further divided subgroups such as Middle Eastern, East Asian, Southeast Asian, and Indian, as they look clearly distinct. During the data collection, we found very few examples for Hawaiian and Pacific Islanders and Native Americans and discarded these categories. All the experiments conducted in this paper were therefore based on 7 race classification.
|
| 62 |
+
|
| 63 |
+
An important criterion to measure dataset bias is on which basis the bias should be measured: skin color or race? A few recent studies (Buolamwini & Gebru, 2018; Merler et al., 2019) use skin color as a proxy to racial or ethnicity grouping. While skin color can be easily computed without subjective annotations, it has limitations. First, skin color is heavily affected by illumination and light conditions. The Pilot Parliaments Benchmark (PPB) dataset (Buolamwini & Gebru, 2018) only used profile photographs of government officials taken in well controlled lighting, which makes it non-in-the-wild. Second, within-group variations of skin color are huge. Even same individuals can show different skin colors over time. Third, most importantly, race is a multidimensional concept whereas skin color (i.e. brightness) is one dimensional. Figure 5 in Appendix shows the distributions of the skin color of multiple race groups, measured by Individual Typology Angle (ITA) (Wilkes et al., 2015). As shown here, the skin color provides no information to differentiate many groups such as East Asian and White. Therefore, we explicitly use race and annotate the physical race by human annotators’ judgments. To complement the limits of race categorization, however, we also use skin color, measured by ITA, following the same procedure used by Merler et al. (2019).
|
| 64 |
+
|
| 65 |
+
# 3.2 IMAGE COLLECTION AND ANNOTATION
|
| 66 |
+
|
| 67 |
+
Many existing face datasets have been sourced from photographs of public figures such as politicians or celebrities (Kumar et al., 2011; Huang et al., 2007; Joo et al., 2015; Rothe et al., 2016; Liu et al., 2015). Despite the easiness of collecting images and ground truth attributes, the selection of these populations may be biased. For example, politicians may be older and actors may be more attractive than typical faces. Their images are usually taken by professional photographers in limited situations, leading to the quality bias. Some datasets were collected via web search using keywords such as “Asian boy” (Zhang et al., 2017). These queries may return only stereotypical faces or prioritize celebrities in those categories rather than diverse individuals among general public.
|
| 68 |
+
|
| 69 |
+
Our goal is to minimize the selection bias introduced by such filtering and maximize the diversity and coverage of the dataset. We started from a huge public image dataset, Yahoo YFCC100M dataset (Thomee et al.), and detected faces from the images without any preselection. A recent work also used the same dataset to construct a huge unfiltered face dataset (Diversity in Faces, DiF) (Merler et al., 2019). Our dataset is smaller but more balanced on race (See Figure 1).
|
| 70 |
+
|
| 71 |
+
For an efficient collection, we incrementally increased the dataset size. We first detected and annotated 7,125 faces randomly sampled from the entire YFCC100M dataset ignoring the locations of images. After obtaining annotations on this initial set, we estimated demographic compositions of each country. Based on this statistic, we adaptively adjusted the number of images for each country sampled from the dataset such that the dataset is not dominated by the White race. Consequently, we excluded the U.S. and European countries in the later stage of data collection after we sampled enough White faces from those countries. The minimum size of a detected face was set to 50 by 50 pixels. This is a relatively smaller size compared to other datasets, but we find the attributes are still recognizable and these examples can actually make the classifiers more robust against noisy data. We only used images with “Attribution” and “Share Alike” Creative Commons licenses, which allow derivative work and commercial usages.
|
| 72 |
+
|
| 73 |
+
We used Amazon Mechanical Turk to annotate the race, gender and age group for each face. We assigned three workers for each image. If two or three workers agreed on their judgements, we took the values as ground-truth. If all three workers produced different responses, we republished the image to another 3 workers and subsequently discarded the image if the new annotators did not agree. These annotations at this stage were still noisy. We further refined the annotations by training a model from the initial ground truth annotations and applying back to the dataset. We then manually re-verified the annotations for images whose annotations differed from model predictions.
|
| 74 |
+
|
| 75 |
+
# 4 EXPERIMENTS
|
| 76 |
+
|
| 77 |
+
# 4.1 MEASURING BIAS IN DATASETS
|
| 78 |
+
|
| 79 |
+
We first measure how skewed each dataset is in terms of its race composition. For the datasets with race annotations, we use the reported statistics. For the other datasets, we annotated the race labels for 3,000 random samples drawn from each dataset. See Figure 1 for the result. As expected, most existing face attribute datasets, especially the ones focusing on celebrities or politicians, are biased toward the White race. Unlike race, we find that most datasets are relatively more balanced on gender ranging from $40 \%$ - $60 \%$ male ratio.
|
| 80 |
+
|
| 81 |
+
# 4.2 MODEL AND CROSS-DATASET PERFORMANCE
|
| 82 |
+
|
| 83 |
+
To compare model performance of different datasets, we used an identical model architecture, ResNet-34 (He et al., 2016), to be trained from each dataset. We used ADAM optimization (Kingma & Ba, 2014) with a learning rate of 0.0001. Given an image, we detected faces using the dlib’s (dlib.net) CNN-based face detector (King, 2015) and ran the attribute classifier on each face. The experiment was done in PyTorch.
|
| 84 |
+
|
| 85 |
+
Throughout the evaluations, we compare our dataset with three other datasets: UTKFace (Zhang et al., 2017), LFWA+, and CelebA (Liu et al., 2015). Both UTKFace and LFWA $^ +$ have race annotations, and thus, are suitable for comparison with our dataset. CelebA does not have race annotations, so we only use it for gender classification. See Table 1 for more detailed dataset characteristics.
|
| 86 |
+
|
| 87 |
+
Table 2: Cross-Dataset Classification Accuracy on White Race.
|
| 88 |
+
|
| 89 |
+
<table><tr><td rowspan=3 colspan=1></td><td rowspan=1 colspan=10>Tested on</td></tr><tr><td rowspan=1 colspan=4>Race</td><td rowspan=1 colspan=4>Gender</td><td rowspan=1 colspan=2>Age</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>CelebA*</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td></tr><tr><td rowspan=4 colspan=1>Trained on</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.937</td><td rowspan=1 colspan=1>.936</td><td rowspan=1 colspan=1>.970</td><td rowspan=1 colspan=1>942</td><td rowspan=1 colspan=1>.940</td><td rowspan=1 colspan=1>.920</td><td rowspan=1 colspan=1>.981</td><td rowspan=1 colspan=1>.597</td><td rowspan=1 colspan=1>.565</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.800</td><td rowspan=1 colspan=1>.918</td><td rowspan=1 colspan=1>.925</td><td rowspan=1 colspan=1>.860</td><td rowspan=1 colspan=1>.935</td><td rowspan=1 colspan=1>.916</td><td rowspan=1 colspan=1>.962</td><td rowspan=1 colspan=1>.413</td><td rowspan=1 colspan=1>.576</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.879</td><td rowspan=1 colspan=1>.947</td><td rowspan=1 colspan=1>.961</td><td rowspan=1 colspan=1>.761</td><td rowspan=1 colspan=1>.842</td><td rowspan=1 colspan=1>.930</td><td rowspan=1 colspan=1>.940</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>CelebA</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>.812</td><td rowspan=1 colspan=1>.880</td><td rowspan=1 colspan=1>.905</td><td rowspan=1 colspan=1>.971</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1></td></tr></table>
|
| 90 |
+
|
| 91 |
+
\* CelebA doesn’t provide race annotations. The result was obtained from the whole set (white and non-white).
|
| 92 |
+
|
| 93 |
+
Table 3: Cross-Dataset Classification Accuracy on non-White Races.
|
| 94 |
+
|
| 95 |
+
<table><tr><td rowspan=3 colspan=1></td><td rowspan=1 colspan=10>Tested on</td></tr><tr><td rowspan=1 colspan=4>Race†</td><td rowspan=1 colspan=4>Gender</td><td rowspan=1 colspan=2>Age</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>CelebA*</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>UTKFace</td></tr><tr><td rowspan=4 colspan=1>Trained on</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.754</td><td rowspan=1 colspan=1>.801</td><td rowspan=1 colspan=1>.960</td><td rowspan=1 colspan=1>944</td><td rowspan=1 colspan=1>.939</td><td rowspan=1 colspan=1>.930</td><td rowspan=1 colspan=1>.981</td><td rowspan=1 colspan=1>.607</td><td rowspan=1 colspan=1>.616</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.693</td><td rowspan=1 colspan=1>.839</td><td rowspan=1 colspan=1>.887</td><td rowspan=1 colspan=1>.823</td><td rowspan=1 colspan=1>.925</td><td rowspan=1 colspan=1>.908</td><td rowspan=1 colspan=1>.962</td><td rowspan=1 colspan=1>.418</td><td rowspan=1 colspan=1>.617</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.541</td><td rowspan=1 colspan=1>.380</td><td rowspan=1 colspan=1>.866</td><td rowspan=1 colspan=1>.738</td><td rowspan=1 colspan=1>.833</td><td rowspan=1 colspan=1>.894</td><td rowspan=1 colspan=1>.940</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr><tr><td rowspan=1 colspan=1>CelebA</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>.781</td><td rowspan=1 colspan=1>.886</td><td rowspan=1 colspan=1>.901</td><td rowspan=1 colspan=1>.971</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr></table>
|
| 96 |
+
|
| 97 |
+
\* CelebA doesn’t provide race annotations. The result was obtained from the whole set (white and non-white). † FairFace defines 7 race categories but only 4 races (White, Black, Asian, and Indian) were used in this result to make it comparable to UTKFace.
|
| 98 |
+
|
| 99 |
+
Using models trained from these datasets, we first performed cross-dataset classifications, by alternating training sets and test sets. Note that FairFace is the only dataset with 7 races. To make it compatible with other datasets, we merged our fine racial groups when tested on other datasets. CelebA does not have race annotations but was included for gender classification.
|
| 100 |
+
|
| 101 |
+
Tables 2 and 3 show the classification results for race, gender, and age on the datasets across subpopulations. As expected, each model tends to perform better on the same dataset on which it was trained. However, the accuracy of our model was highest on some variables on the $\mathrm { L F W A + }$ dataset and also very close to the leader in other cases. This is partly because $\mathrm { L F W A + }$ is the most biased dataset and ours is the most diverse, and thus more generalizable dataset.
|
| 102 |
+
|
| 103 |
+
# 4.3 GENERALIZATION PERFORMANCE
|
| 104 |
+
|
| 105 |
+
# 4.3.1 DATASETS
|
| 106 |
+
|
| 107 |
+
To test the generalization performance of the models, we consider three novel datasets. Note that these datasets were collected from completely different sources than our data from Flickr and not used in training. Since we want to measure the effectiveness of the model on diverse races, we chose the test datasets that contain people in different locations as follows.
|
| 108 |
+
|
| 109 |
+
Geo-tagged Tweets. First we consider images uploaded by Twitter users whose locations are identified by geo-tags (longitude and latitude), provided by (Steinert-Threlkeld, 2018). From this set, we chose four countries (France, Iraq, Philippines, and Venezuela) and randomly sampled 5,000 faces.
|
| 110 |
+
|
| 111 |
+
Media Photographs. Next, we also use photographs posted by 500 online professional media outlets. Specifically, we use a public dataset of tweet IDs (Littman et al., 2017) posted by 4,000 known media accounts, e.g. @nytimes. Note that although we use Twitter to access the photographs, these tweets are simply external links to pages in the main newspaper sites. Therefore this data is considered as media photographs and different from general tweet images mostly uploaded by ordinary users. We randomly sampled 8,000 faces from the set.
|
| 112 |
+
|
| 113 |
+
Protest Dataset. Lastly, we also use a public image dataset collected for a recent protest activity study (Won et al., 2017). The authors collected the majority of data from Google Image search by using keywords such as “Venezuela protest” or “football game” (for hard negatives). The dataset exhibits a wide range of diverse race and gender groups engaging in different activities in various countries. We randomly sampled 8,000 faces from the set.
|
| 114 |
+
|
| 115 |
+
These faces were annotated for gender, race, and age by Amazon Mechanical Turk workers.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Race</td><td colspan="2">White</td><td colspan="2">Black</td><td colspan="2">East Asian</td><td colspan="2"></td><td colspan="2">SE Asian</td><td colspan="2">Latino Indian</td><td colspan="2">Middle Eastern</td><td colspan="2"></td><td colspan="4"></td></tr><tr><td>Gender</td><td>M</td><td>F</td><td>M</td><td>F</td><td>M</td><td>F</td><td>M</td><td>F</td><td>M</td><td>F</td><td>M</td><td>F</td><td>M</td><td>F</td><td>Max</td><td>Min</td><td>AVG</td><td>STDV</td><td>E</td></tr><tr><td>FairFace</td><td>.967</td><td>.954</td><td>.958</td><td>.917</td><td>.873</td><td>.939</td><td>.909</td><td>.906</td><td>.977</td><td>.960</td><td>.966</td><td>.947</td><td>.991</td><td>.946</td><td>.991</td><td>.873</td><td>.944</td><td>.032</td><td>.055</td></tr><tr><td>UTK</td><td>.926</td><td>.864</td><td>.909</td><td>.795</td><td>.841</td><td>.824</td><td>.906</td><td>.795</td><td>.939</td><td>.821</td><td>.978</td><td>.742</td><td>.949</td><td>.730</td><td>.978</td><td>.730</td><td>.859</td><td>.078</td><td>.127</td></tr><tr><td>LFWA+</td><td>.946</td><td>.680</td><td>.974</td><td>.432</td><td>.826</td><td>.684</td><td>.938</td><td>.574</td><td>.951</td><td>.613</td><td>.968</td><td>.518</td><td>.988</td><td>.635</td><td>.988</td><td>.432</td><td>.766</td><td>.196</td><td>.359</td></tr><tr><td>CelebA</td><td>.829</td><td>.958</td><td>.819</td><td>.919</td><td>.653</td><td>.939</td><td>.768</td><td>.923</td><td>.843</td><td>.955</td><td>.866</td><td>.856</td><td>.924</td><td>.874</td><td>.958</td><td>.653</td><td>.866</td><td>.083</td><td>.166</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 4: Gender classification accuracy measured on external validation datasets across gender-race groups.
|
| 120 |
+
|
| 121 |
+
# 4.3.2 RESULT
|
| 122 |
+
|
| 123 |
+
Table 7 shows the classification accuracy of different models. Because our dataset is larger than $\mathrm { L F W A + }$ and UTKFace, we report the three variants of the FairFace model by limiting the size of a training set (9k, 18k, and Full) for fair comparisons.
|
| 124 |
+
|
| 125 |
+
Improved Accuracy. As clearly shown in the result, the model trained by FairFace outperforms all the other models for race, gender, and age, on the novel datasets, which have never been used in training and also come from different data sources. The models trained with fewer training images $\operatorname { \mathrm { 9 k } }$ and 18k) still outperform other datasets including CelebA which is larger than FairFace. This suggests that the dataset size is not the only reason for the performance improvement.
|
| 126 |
+
|
| 127 |
+
Balanced Accuracy. Our model also produces more consistent results – for race, gender, age classification – across different race groups compared to other datasets. We measure the model consistency by standard deviations of classification accuracy measured on different sub-populations, as shown in Table 5. More formally, one can consider conditional use accuracy equality (Berk et al.) or equalized odds (Hardt et al., 2016) as the measure of fair classification. For gender classification:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r l r } & { } & { P ( \widehat { Y } = i | Y = i , A = j ) = P ( \widehat { Y } = i | Y = i , A = k ) , } \\ & { } & { i \in \{ \mathrm { m a l e , f e m a l e } \} , \forall j , k \in \mathrm { D } , } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\widehat { Y }$ is the predicted gender, $Y$ is the true gender, A refers to the demographic group, and D is the set of different demographic groups being considered (race). When we consider different gender groups for $A$ , this needs to be modified to measure accuracy equality Berk et al.:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
P ( \widehat { Y } = Y | A = j ) = P ( \widehat { Y } = Y | A = k ) , \forall j , k \in \mathbb { D } .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
We therefore define the maximum accuracy disparity of a classifier as follows:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\epsilon ( \widehat { Y } ) = \operatorname* { m a x } _ { \forall j , k \in \mathrm { D } } \bigg ( \log \frac { P ( \widehat { Y } = Y | A = j ) } { P ( \widehat { Y } = Y | A = k ) } \bigg ) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Table 4 shows the gender classification accuracy of different models measured on the external validation datasets for each race and gender group. The FairFace model achieves the lowest maximum accuracy disparity. The LFWA+ model yields the highest disparity, strongly biased toward the male category. The CelebA model tends to exhibit a bias toward the female category as the dataset contains more female images than male.
|
| 146 |
+
|
| 147 |
+
The FairFace model achieves less than $1 \%$ accuracy discrepancy between male female and White non-White for gender classification (Table 7). All the other models show a strong bias toward the male class, yielding much lower accuracy on the female group, and perform more inaccurately on the non-White group. The gender performance gap was the biggest in $\mathrm { L F W A + }$ $( 3 2 \% )$ , which is the smallest among the datasets used in the experiment. Recent work has also reported asymmetric gender biases in commercial computer vision services (Buolamwini & Gebru, 2018), and our result further suggests the cause is likely due to the unbalanced representation in training data.
|
| 148 |
+
|
| 149 |
+
Data Coverage and Diversity. We further investigate dataset characteristics to measure the data diversity in our dataset. We first visualize randomly sampled faces in 2D space using t-SNE (Maaten & Hinton, 2008) as shown in Figure 3. We used the facial embedding based on ResNet-34 from dlib, which was trained from the FaceScrub dataset ( $\mathrm { N g }$ & Winkler, 2014), the VGG-Face dataset (Parkhi et al., 2015) and other online sources, which are likely dominated by the White faces. The faces in FairFace are well spread in the space, and the race groups are loosely separated from each other.
|
| 150 |
+
|
| 151 |
+
This is in part because the embedding was trained from biased datasets, but it also suggests that the dataset contains many non-typical examples. $\mathrm { L F W A + }$ was derived from LFW, which was developed for face recognition, and therefore contains multiple images of the same individuals, i.e. clusters. UTKFace also tends to focus more on local clusters compared to FairFace.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: t-SNE visualizations (Maaten & Hinton, 2008) of faces in datasets.
|
| 155 |
+
|
| 156 |
+
To explicitly measure the diversity of faces in these datasets, we examine the distributions of pairwise distance between faces (Figure 4). On the random subsets, we first obtained the same 128- dimensional facial embedding from dlib and measured pair-wise distance. Figure 4 shows the CDF functions for 3 datasets. As conjectured, UTKFace had more faces that are tightly clustered together and very similar to each other, compared to our dataset. Surprisingly, the faces in $\mathrm { L F W A + }$ were shown very diverse and far from each other, even though the majority of the examples contained a white face. We believe this is mostly due to the fact that the face embedding was also trained on a very similar white-oriented dataset which will be effective in separating white faces, not because the appearance of their faces is actually diverse. (See Figure 2)
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Distribution of pairwise distances of faces in 3 datasets measured by L1 distance on face embedding.
|
| 160 |
+
|
| 161 |
+
Table 5: Gender classification accuracy on external validation datasets, across race and age groups.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>Meanacross races</td><td rowspan=1 colspan=1>SDacross races</td><td rowspan=1 colspan=1>Mean across ages</td><td rowspan=1 colspan=1>SD across ages</td></tr><tr><td rowspan=4 colspan=1>Modeltrained on</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>94.89 %</td><td rowspan=1 colspan=1>3.03%</td><td rowspan=1 colspan=1>92.95%</td><td rowspan=1 colspan=1>6.63%</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>89.54%</td><td rowspan=1 colspan=1>3.34%</td><td rowspan=1 colspan=1>84.23%</td><td rowspan=1 colspan=1>12.83%</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>82.46%</td><td rowspan=1 colspan=1>5.60%</td><td rowspan=1 colspan=1>78.50%</td><td rowspan=1 colspan=1>11.51%</td></tr><tr><td rowspan=1 colspan=1>CelebA</td><td rowspan=1 colspan=1>86.03%</td><td rowspan=1 colspan=1>4.57%</td><td rowspan=1 colspan=1>79.53%</td><td rowspan=1 colspan=1>17.96%</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 4.4 EVALUATING COMMERCIAL FACE GENDER CLASSIFIERS
|
| 166 |
+
|
| 167 |
+
Previous studies have reported that popular commercial face analytic models show inconsistent classification accuracies across different demographic groups (Buolamwini & Gebru, 2018; Raji & Buolamwini, 2019). We used the FairFace images to test several online APIs for gender classification: Microsoft Face API, Amazon Rekognition, IBM Watson Visual Recognition, and ${ \mathrm { F a c e } } + +$ . Compared to prior work using politicians’ faces, our dataset is much more diverse in terms of race, age, expressions, head orientation, and photographic conditions, and thus serves as a much better benchmark for bias measurement. We used 7,476 random samples from FairFace such that it contains an equal number of faces from each race, gender, and age group. We left out children under the age of 20, as these pictures were often ambiguous and the gender could not be determined for certain. The experiments were conducted on August 13th - 16th, 2019.
|
| 168 |
+
|
| 169 |
+
Table 6: Classification accuracy of commercial services on FairFace dataset. (\*Microsoft, \*Face++, $\bf \Phi _ { \mathrm { m } }$ indicate accuracies only on the detected faces, ignoring mis-detections.)
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>White</td><td rowspan=1 colspan=2>Black</td><td rowspan=1 colspan=2>East Asian</td><td rowspan=1 colspan=2>SE Asian</td><td rowspan=1 colspan=2>Latino</td><td rowspan=1 colspan=1>Inc</td><td rowspan=1 colspan=1>lan</td><td rowspan=1 colspan=2>Mid-Eastern</td><td rowspan=1 colspan=2></td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>F</td><td rowspan=1 colspan=1>M</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>STD</td></tr><tr><td rowspan=1 colspan=1>Amazon</td><td rowspan=1 colspan=1>.923</td><td rowspan=1 colspan=1>.966</td><td rowspan=1 colspan=1>.901</td><td rowspan=1 colspan=1>.955</td><td rowspan=1 colspan=1>.925</td><td rowspan=1 colspan=1>.949</td><td rowspan=1 colspan=1>.918</td><td rowspan=1 colspan=1>.914</td><td rowspan=1 colspan=1>.921</td><td rowspan=1 colspan=1>.987</td><td rowspan=1 colspan=1>.951</td><td rowspan=1 colspan=1>.979</td><td rowspan=1 colspan=1>.906</td><td rowspan=1 colspan=1>.983</td><td rowspan=1 colspan=1>.941</td><td rowspan=1 colspan=1>.030</td></tr><tr><td rowspan=1 colspan=1>Microsoft</td><td rowspan=1 colspan=1>.822</td><td rowspan=1 colspan=1>.777</td><td rowspan=1 colspan=1>.766</td><td rowspan=1 colspan=1>.717</td><td rowspan=1 colspan=1>.824</td><td rowspan=1 colspan=1>.775</td><td rowspan=1 colspan=1>.852</td><td rowspan=1 colspan=1>.794</td><td rowspan=1 colspan=1>.843</td><td rowspan=1 colspan=1>.848</td><td rowspan=1 colspan=1>.863</td><td rowspan=1 colspan=1>.790</td><td rowspan=1 colspan=1>.839</td><td rowspan=1 colspan=1>.772</td><td rowspan=1 colspan=1>.806</td><td rowspan=1 colspan=1>.042</td></tr><tr><td rowspan=1 colspan=1>Face++</td><td rowspan=1 colspan=1>.888</td><td rowspan=1 colspan=1>.959</td><td rowspan=1 colspan=1>.805</td><td rowspan=1 colspan=1>.944</td><td rowspan=1 colspan=1>.876</td><td rowspan=1 colspan=1>.904</td><td rowspan=1 colspan=1>.884</td><td rowspan=1 colspan=1>.897</td><td rowspan=1 colspan=1>.865</td><td rowspan=1 colspan=1>.981</td><td rowspan=1 colspan=1>.770</td><td rowspan=1 colspan=1>.968</td><td rowspan=1 colspan=1>.822</td><td rowspan=1 colspan=1>.978</td><td rowspan=1 colspan=1>.896</td><td rowspan=1 colspan=1>.066</td></tr><tr><td rowspan=1 colspan=1>IBM</td><td rowspan=1 colspan=1>.910</td><td rowspan=1 colspan=1>.966</td><td rowspan=1 colspan=1>.758</td><td rowspan=1 colspan=1>.927</td><td rowspan=1 colspan=1>.899</td><td rowspan=1 colspan=1>.910</td><td rowspan=1 colspan=1>.852</td><td rowspan=1 colspan=1>.919</td><td rowspan=1 colspan=1>.884</td><td rowspan=1 colspan=1>.972</td><td rowspan=1 colspan=1>.811</td><td rowspan=1 colspan=1>.957</td><td rowspan=1 colspan=1>.871</td><td rowspan=1 colspan=1>.959</td><td rowspan=1 colspan=1>.900</td><td rowspan=1 colspan=1>.061</td></tr><tr><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.987</td><td rowspan=1 colspan=1>.991</td><td rowspan=1 colspan=1>.964</td><td rowspan=1 colspan=1>.974</td><td rowspan=1 colspan=1>.966</td><td rowspan=1 colspan=1>.979</td><td rowspan=1 colspan=1>.978</td><td rowspan=1 colspan=1>.961</td><td rowspan=1 colspan=1>.991</td><td rowspan=1 colspan=1>.989</td><td rowspan=1 colspan=1>.991</td><td rowspan=1 colspan=1>.987</td><td rowspan=1 colspan=1>.972</td><td rowspan=1 colspan=1>.991</td><td rowspan=1 colspan=1>.980</td><td rowspan=1 colspan=1>.011</td></tr><tr><td rowspan=1 colspan=1>*Microsoft</td><td rowspan=1 colspan=1>.973</td><td rowspan=1 colspan=1>.998</td><td rowspan=1 colspan=1>.962</td><td rowspan=1 colspan=1>.967</td><td rowspan=1 colspan=1>.963</td><td rowspan=1 colspan=1>.976</td><td rowspan=1 colspan=1>.960</td><td rowspan=1 colspan=1>.957</td><td rowspan=1 colspan=1>.983</td><td rowspan=1 colspan=1>.993</td><td rowspan=1 colspan=1>.975</td><td rowspan=1 colspan=1>.991</td><td rowspan=1 colspan=1>.966</td><td rowspan=1 colspan=1>.993</td><td rowspan=1 colspan=1>.975</td><td rowspan=1 colspan=1>.014</td></tr><tr><td rowspan=1 colspan=1>*Face++</td><td rowspan=1 colspan=1>.893</td><td rowspan=1 colspan=1>.968</td><td rowspan=1 colspan=1>.810</td><td rowspan=1 colspan=1>.956</td><td rowspan=1 colspan=1>.878</td><td rowspan=1 colspan=1>.911</td><td rowspan=1 colspan=1>.886</td><td rowspan=1 colspan=1>.899</td><td rowspan=1 colspan=1>.870</td><td rowspan=1 colspan=1>.983</td><td rowspan=1 colspan=1>.773</td><td rowspan=1 colspan=1>.975</td><td rowspan=1 colspan=1>.827</td><td rowspan=1 colspan=1>.983</td><td rowspan=1 colspan=1>.901</td><td rowspan=1 colspan=1>.067</td></tr><tr><td rowspan=1 colspan=1>*IBM</td><td rowspan=1 colspan=1>.914</td><td rowspan=1 colspan=1>.981</td><td rowspan=1 colspan=1>.761</td><td rowspan=1 colspan=1>.956</td><td rowspan=1 colspan=1>.909</td><td rowspan=1 colspan=1>.920</td><td rowspan=1 colspan=1>.852</td><td rowspan=1 colspan=1>.926</td><td rowspan=1 colspan=1>.892</td><td rowspan=1 colspan=1>.977</td><td rowspan=1 colspan=1>.819</td><td rowspan=1 colspan=1>.975</td><td rowspan=1 colspan=1>.881</td><td rowspan=1 colspan=1>.979</td><td rowspan=1 colspan=1>.910</td><td rowspan=1 colspan=1>.066</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 6 shows the gender classification accuracies of the tested APIs. These APIs first detect a face from an input image and classify its gender. Not all 7,476 faces were detected by these APIs with the exception of Amazon Rekognition which detected all of them. Table 8 in Appendix reports the detection rate.1 We report two sets of accuracies: 1) treating mis-detections as mis-classifications and 2) excluding mis-detections. For comparison, we included a model trained with our dataset to provide an upper bound for classification accuracy. Following prior work (Merler et al., 2019), we also show the classification accuracy as a function of skin color in Figure 6.
|
| 174 |
+
|
| 175 |
+
The results suggest several findings. First, all tested gender classifiers still favor the male category, which is consistent with the previous report (Buolamwini & Gebru, 2018). Second, dark-skinned females tend to yield higher classification error rates, but there exist many exceptions. For example, Indians have darker skin tones (Figure 5), but some APIs (Amazon and MS) classified them more accurately than Whites. This suggests skin color alone, or any other individual phenotypic feature, is not a sufficient guideline to study model bias. Third, face detection can also introduce significant gender bias. Microsoft’s model failed to detect many male faces, an opposite direction from the gender classification bias. This was not reported in previous studies which only used clean profile images of frontal faces.
|
| 176 |
+
|
| 177 |
+
# 5 CONCLUSION
|
| 178 |
+
|
| 179 |
+
This paper proposes a novel face image dataset balanced on race, gender and age. Compared to existing large-scale in-the-wild datasets, our dataset achieves much better generalization classification performance for gender, race, and age on novel image datasets collected from Twitter, international online newspapers, and web search, which contain more non-White faces than typical face datasets. We show that the model trained from our dataset produces balanced accuracy across race, whereas other datasets often lead to asymmetric accuracy on different race groups.
|
| 180 |
+
|
| 181 |
+
This dataset was derived from the Yahoo YFCC100m dataset (Thomee et al.) for the images with Creative Common Licenses by Attribution and Share Alike, which permit both academic and commercial usage. Our dataset can be used for training a new model and verifying balanced accuracy of existing classifiers.
|
| 182 |
+
|
| 183 |
+
Algorithmic fairness is an important aspect to consider in designing and developing AI systems, especially because these systems are being translated into many areas in our society and affecting our decision making. Large scale image datasets have contributed to the recent success in computer vision by improving model accuracy; yet the public and media have doubts about its transparency. The novel dataset proposed in this paper will help us discover and mitigate race and gender bias present in computer vision systems such that such systems can be more easily accepted in society.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Mohsan Alvi, Andrew Zisserman, and Christoffer Nellaaker. Turning a blind eye: Explicit removal of biases and variation from deep neural network embeddings. In The European Conference on Computer Vision (ECCV) Workshops, September 2018.
|
| 188 |
+
|
| 189 |
+
Brandon Amos, Bartosz Ludwiczuk, Mahadev Satyanarayanan, et al. Openface: A general-purpose face recognition library with mobile applications. CMU School of Computer Science, 6, 2016.
|
| 190 |
+
|
| 191 |
+
Grigory Antipov, Moez Baccouche, and Jean-Luc Dugelay. Face aging with conditional generative adversarial networks. In 2017 IEEE International Conference on Image Processing (ICIP), pp. 2089–2093. IEEE, 2017.
|
| 192 |
+
|
| 193 |
+
Tadas Baltrusaitis, Amir Zadeh, Yao Chong Lim, and Louis-Philippe Morency. Openface 2.0: Facial behavior analysis toolkit. In 2018 13th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2018), pp. 59–66. IEEE, 2018.
|
| 194 |
+
|
| 195 |
+
Jianmin Bao, Dong Chen, Fang Wen, Houqiang Li, and Gang Hua. Cvae-gan: fine-grained image generation through asymmetric training. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2745–2754, 2017.
|
| 196 |
+
|
| 197 |
+
Richard Berk, Hoda Heidari, Shahin Jabbari, Michael Kearns, and Aaron Roth. Fairness in criminal justice risk assessments: The state of the art. Sociological Methods & Research, pp. 0049124118782533.
|
| 198 |
+
|
| 199 |
+
Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Conference on Fairness, Accountability and Transparency, pp. 77–91, 2018.
|
| 200 |
+
|
| 201 |
+
Qiong Cao, Li Shen, Weidi Xie, Omkar M Parkhi, and Andrew Zisserman. Vggface2: A dataset for recognising faces across pose and age. In 2018 13th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2018), pp. 67–74. IEEE, 2018.
|
| 202 |
+
|
| 203 |
+
Abhijnan Chakraborty, Johnnatan Messias, Fabricio Benevenuto, Saptarshi Ghosh, Niloy Ganguly, and Krishna P Gummadi. Who makes trends? understanding demographic biases in crowdsourced recommendations. In Eleventh International AAAI Conference on Web and Social Media, 2017.
|
| 204 |
+
|
| 205 |
+
Bor-Chun Chen, Chu-Song Chen, and Winston H Hsu. Face recognition and retrieval using cross-age reference coding with cross-age celebrity dataset. IEEE Transactions on Multimedia, 17(6):804–815, 2015.
|
| 206 |
+
|
| 207 |
+
Sam Corbett-Davies, Emma Pierson, Avi Feller, Sharad Goel, and Aziz Huq. Algorithmic decision making and the cost of fairness. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 797–806. ACM, 2017.
|
| 208 |
+
|
| 209 |
+
Abhijit Das, Antitza Dantcheva, and Francois Bremond. Mitigating bias in gender, age and ethnicity classification: a multi-task convolution neural network approach. In The European Conference on Computer Vision (ECCV) Workshops, September 2018.
|
| 210 |
+
|
| 211 |
+
Sergio Escalera, Mercedes Torres Torres, Brais Martinez, Xavier Baro, Hugo Jair Escalante, Isabelle Guyon, ´ Georgios Tzimiropoulos, Ciprian Corneou, Marc Oliu, Mohammad Ali Bagheri, et al. Chalearn looking at people and faces of the world: Face analysis workshop and challenge 2016. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 1–8, 2016.
|
| 212 |
+
|
| 213 |
+
Yandong Guo, Lei Zhang, Yuxiao Hu, Xiaodong He, and Jianfeng Gao. Ms-celeb-1m: A dataset and benchmark for large-scale face recognition. In European Conference on Computer Vision, pp. 87–102. Springer, 2016.
|
| 214 |
+
|
| 215 |
+
Hu Han, Anil K Jain, Fang Wang, Shiguang Shan, and Xilin Chen. Heterogeneous face attribute estimation: A deep multi-task learning approach. IEEE transactions on pattern analysis and machine intelligence, 40(11): 2597–2609, 2018.
|
| 216 |
+
|
| 217 |
+
Moritz Hardt, Eric Price, Nati Srebro, et al. Equality of opportunity in supervised learning. In Advances in neural information processing systems, pp. 3315–3323, 2016.
|
| 218 |
+
|
| 219 |
+
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.
|
| 220 |
+
|
| 221 |
+
Zhenliang He, Wangmeng Zuo, Meina Kan, Shiguang Shan, and Xilin Chen. Arbitrary facial attribute editing: Only change what you want. arXiv preprint arXiv:1711.10678, 1(3), 2017.
|
| 222 |
+
|
| 223 |
+
Lisa Anne Hendricks, Kaylee Burns, Kate Saenko, Trevor Darrell, and Anna Rohrbach. Women also snowboard: Overcoming bias in captioning models. In European Conference on Computer Vision, pp. 793–811. Springer, 2018.
|
| 224 |
+
|
| 225 |
+
Peiyun Hu and Deva Ramanan. Finding tiny faces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 951–959, 2017.
|
| 226 |
+
|
| 227 |
+
Gary B. Huang, Manu Ramesh, Tamara Berg, and Erik Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Technical Report 07-49, University of Massachusetts, Amherst, October 2007.
|
| 228 |
+
|
| 229 |
+
Jungseock Joo, Shuo Wang, and Song-Chun Zhu. Human attribute recognition by rich appearance dictionary. In Proceedings of the IEEE International Conference on Computer Vision, pp. 721–728, 2013.
|
| 230 |
+
|
| 231 |
+
Jungseock Joo, Francis F Steen, and Song-Chun Zhu. Automated facial trait judgment and election outcome prediction: Social dimensions of face. In Proceedings of the IEEE international conference on computer vision, pp. 3712–3720, 2015.
|
| 232 |
+
|
| 233 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. arXiv preprint arXiv:1812.04948, 2018.
|
| 234 |
+
|
| 235 |
+
Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The megaface benchmark: 1 million faces for recognition at scale. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4873–4882, 2016.
|
| 236 |
+
|
| 237 |
+
Davis E King. Max-margin object detection. arXiv preprint arXiv:1502.00046, 2015.
|
| 238 |
+
|
| 239 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 240 |
+
|
| 241 |
+
Svetlana Kiritchenko and Saif M Mohammad. Examining gender and race bias in two hundred sentiment analysis systems. arXiv preprint arXiv:1805.04508, 2018.
|
| 242 |
+
|
| 243 |
+
Neeraj Kumar, Alexander Berg, Peter N Belhumeur, and Shree Nayar. Describable visual attributes for face verification and image search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(10): 1962–1977, 2011.
|
| 244 |
+
|
| 245 |
+
Guillaume Lample, Neil Zeghidour, Nicolas Usunier, Antoine Bordes, Ludovic Denoyer, et al. Fader networks: Manipulating images by sliding attributes. In Advances in Neural Information Processing Systems, pp. 5967–5976, 2017.
|
| 246 |
+
|
| 247 |
+
Ryan Layne, Timothy M Hospedales, Shaogang Gong, and Q Mary. Person re-identification by attributes. In Bmvc, volume 2, pp. 8, 2012.
|
| 248 |
+
|
| 249 |
+
Annan Li, Luoqi Liu, Kang Wang, Si Liu, and Shuicheng Yan. Clothing attributes assisted person reidentification. IEEE Transactions on Circuits and Systems for Video Technology, 25(5):869–878, 2015a.
|
| 250 |
+
|
| 251 |
+
Haoxiang Li, Zhe Lin, Xiaohui Shen, Jonathan Brandt, and Gang Hua. A convolutional neural network cascade for face detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5325–5334, 2015b.
|
| 252 |
+
|
| 253 |
+
Justin Littman, Laura Wrubel, Daniel Kerchner, and Yonah Bromberg Gaber. News Outlet Tweet Ids, 2017. URL https://doi.org/10.7910/DVN/2FIFLH.
|
| 254 |
+
|
| 255 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015.
|
| 256 |
+
|
| 257 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 258 |
+
|
| 259 |
+
Daniel McDuff, Shuang Ma, Yale Song, and Ashish Kapoor. Characterizing bias in classifiers using generative models. arXiv preprint arXiv:1906.11891, 2019.
|
| 260 |
+
|
| 261 |
+
Michele Merler, Nalini Ratha, Rogerio S Feris, and John R Smith. Diversity in faces. arXiv preprint arXiv:1901.10436, 2019.
|
| 262 |
+
|
| 263 |
+
Hong-Wei Ng and Stefan Winkler. A data-driven approach to cleaning large face datasets. In 2014 IEEE International Conference on Image Processing (ICIP), pp. 343–347. IEEE, 2014.
|
| 264 |
+
|
| 265 |
+
Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, et al. Deep face recognition. In bmvc, volume 1, pp. 6, 2015.
|
| 266 |
+
|
| 267 |
+
Inioluwa Deborah Raji and Joy Buolamwini. Actionable auditing: Investigating the impact of publicly naming biased performance results of commercial ai products. In AAAI/ACM Conf. on AI Ethics and Society, volume 1, 2019.
|
| 268 |
+
|
| 269 |
+
Julio Reis, Haewoon Kwak, Jisun An, Johnnatan Messias, and Fabricio Benevenuto. Demographics of news sharing in the us twittersphere. In Proceedings of the 28th ACM Conference on Hypertext and Social Media, pp. 195–204. ACM, 2017.
|
| 270 |
+
|
| 271 |
+
Shaoqing Ren, Xudong Cao, Yichen Wei, and Jian Sun. Face alignment at 3000 fps via regressing local binary features. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1685– 1692, 2014.
|
| 272 |
+
|
| 273 |
+
Karl Ricanek and Tamirat Tesafaye. Morph: A longitudinal image database of normal adult age-progression. In 7th International Conference on Automatic Face and Gesture Recognition (FGR06), pp. 341–345. IEEE, 2006.
|
| 274 |
+
|
| 275 |
+
Rasmus Rothe, Radu Timofte, and Luc Van Gool. Deep expectation of real and apparent age from a single image without facial landmarks. International Journal of Computer Vision (IJCV), July 2016.
|
| 276 |
+
|
| 277 |
+
Hee Jung Ryu, Hartwig Adam, and Margaret Mitchell. Inclusivefacenet: Improving face attribute detection with race and gender diversity. arXiv preprint arXiv:1712.00193, 2017.
|
| 278 |
+
|
| 279 |
+
Richard T Schaefer. Encyclopedia of race, ethnicity, and society, volume 1. Sage, 2008.
|
| 280 |
+
|
| 281 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 815–823, 2015.
|
| 282 |
+
|
| 283 |
+
Shreya Shankar, Yoni Halpern, Eric Breck, James Atwood, Jimbo Wilson, and D Sculley. No classification without representation: Assessing geodiversity issues in open data sets for the developing world. arXiv preprint arXiv:1711.08536, 2017.
|
| 284 |
+
|
| 285 |
+
Zachary C Steinert-Threlkeld. Twitter as data. Cambridge University Press, 2018.
|
| 286 |
+
|
| 287 |
+
Pierre Stock and Moustapha Cisse. Convnets and imagenet beyond accuracy: Understanding mistakes and uncovering biases. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 498–512, 2018.
|
| 288 |
+
|
| 289 |
+
Chi Su, Fan Yang, Shiliang Zhang, Qi Tian, Larry Steven Davis, and Wen Gao. Multi-task learning with low rank attribute embedding for multi-camera person re-identification. IEEE transactions on pattern analysis and machine intelligence, 40(5):1167–1181, 2018.
|
| 290 |
+
|
| 291 |
+
Harini Suresh, Jen J Gong, and John V Guttag. Learning tasks for multitask learning: Heterogenous patient populations in the icu. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 802–810. ACM, 2018.
|
| 292 |
+
|
| 293 |
+
Yaniv Taigman, Ming Yang, Marc’Aurelio Ranzato, and Lior Wolf. Deepface: Closing the gap to human-level performance in face verification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1701–1708, 2014.
|
| 294 |
+
|
| 295 |
+
Christopher Thomas and Adriana Kovashka. Persuasive faces: Generating faces in advertisements. arXiv preprint arXiv:1807.09882, 2018.
|
| 296 |
+
|
| 297 |
+
Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. Yfcc100m: The new data in multimedia research. Communications of the ACM, 59(2): 64–73.
|
| 298 |
+
|
| 299 |
+
A Torralba and AA Efros. Unbiased look at dataset bias. In Proceedings of the 2011 IEEE Conference on Computer Vision and Pattern Recognition, pp. 1521–1528. IEEE Computer Society, 2011.
|
| 300 |
+
|
| 301 |
+
Sahil Verma and Julia Rubin. Fairness definitions explained. In 2018 IEEE/ACM International Workshop on Software Fairness (FairWare), pp. 1–7. IEEE, 2018.
|
| 302 |
+
|
| 303 |
+
Yu Wang, Yang Feng, Zhe Hong, Ryan Berger, and Jiebo Luo. How polarized have we become? a multimodal classification of trump followers and clinton followers. In International Conference on Social Informatics, pp. 440–456. Springer, 2017.
|
| 304 |
+
|
| 305 |
+
Marcus Wilkes, Caradee Y Wright, Johan L du Plessis, and Anthony Reeder. Fitzpatrick skin type, individual typology angle, and melanin index in an african population: steps toward universally applicable skin photosensitivity assessments. JAMA dermatology, 151(8):902–903, 2015.
|
| 306 |
+
|
| 307 |
+
Donghyeon Won, Zachary C Steinert-Threlkeld, and Jungseock Joo. Protest activity detection and perceived violence estimation from social media images. In Proceedings of the 25th ACM international conference on Multimedia, pp. 786–794. ACM, 2017.
|
| 308 |
+
Nan Xi, Di Ma, Marcus Liou, Zachary C Steinert-Threlkeld, Jason Anastasopoulos, and Jungseock Joo. Understanding the political ideology of legislators from social media images. arXiv preprint arXiv:1907.09594, 2019.
|
| 309 |
+
Xuehan Xiong and Fernando De la Torre. Supervised descent method and its applications to face alignment. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 532–539, 2013.
|
| 310 |
+
Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2image: Conditional image generation from visual attributes. In European Conference on Computer Vision, pp. 776–791. Springer, 2016.
|
| 311 |
+
Shuo Yang, Ping Luo, Chen-Change Loy, and Xiaoou Tang. Wider face: A face detection benchmark. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5525–5533, 2016.
|
| 312 |
+
Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z Li. Learning face representation from scratch. arXiv preprint arXiv:1411.7923, 2014.
|
| 313 |
+
Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rogriguez, and Krishna P Gummadi. Fairness constraints: Mechanisms for fair classification. In Artificial Intelligence and Statistics, pp. 962–970, 2017.
|
| 314 |
+
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International Conference on Machine Learning, pp. 325–333, 2013.
|
| 315 |
+
Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating unwanted biases with adversarial learning. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pp. 335–340. ACM, 2018.
|
| 316 |
+
Maggie Zhang. Google photos tags two african-americans as gorillas through facial recognition software, Jul 2015. URL https://www.forbes.com/sites/mzhang/2015/07/01/google-photostags-two-african-americans-as-gorillas-through-facial-recognitionsoftware/#55d05821713d.
|
| 317 |
+
Zhanpeng Zhang, Ping Luo, Chen-Change Loy, and Xiaoou Tang. Learning social relation traits from face images. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3631–3639, 2015.
|
| 318 |
+
Zhifei Zhang, Yang Song, and Hairong Qi. Age progression/regression by conditional adversarial autoencoder. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5810–5818, 2017.
|
| 319 |
+
James Zou and Londa Schiebinger. Ai can be sexist and racistits time to make it fair, 2018.
|
| 320 |
+
|
| 321 |
+
# A APPENDIX
|
| 322 |
+
|
| 323 |
+
Table 7: Classification accuracy on external validation datasets.
|
| 324 |
+
|
| 325 |
+
<table><tr><td rowspan=1 colspan=1>All</td><td rowspan=1 colspan=1>Female</td><td rowspan=1 colspan=1>Male</td><td rowspan=1 colspan=1>White</td><td rowspan=1 colspan=1>Non-White</td><td rowspan=1 colspan=1>Black</td><td rowspan=1 colspan=1>Asian</td><td rowspan=1 colspan=1>E Asian</td><td rowspan=1 colspan=1>SE Asian</td><td rowspan=1 colspan=1>Latino</td><td rowspan=1 colspan=1>Indian</td><td rowspan=1 colspan=1>Mid-East</td><td rowspan=1 colspan=1>0-9</td><td rowspan=1 colspan=1>10-29</td><td rowspan=1 colspan=1>30-49</td><td rowspan=1 colspan=1>50+</td></tr><tr><td rowspan=2 colspan=1>Twitter</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.733</td><td rowspan=1 colspan=1>.726</td><td rowspan=1 colspan=1>.737</td><td rowspan=1 colspan=1>.899</td><td rowspan=1 colspan=1>.548</td><td rowspan=1 colspan=1>.695</td><td rowspan=1 colspan=1>.888</td><td rowspan=1 colspan=1>.705</td><td rowspan=1 colspan=1>.465</td><td rowspan=1 colspan=1>.305</td><td rowspan=1 colspan=1>.492</td><td rowspan=1 colspan=1>.743</td><td rowspan=1 colspan=1>.756</td><td rowspan=1 colspan=1>.691</td><td rowspan=1 colspan=1>.768</td><td rowspan=1 colspan=1>.777</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.626</td><td rowspan=1 colspan=1>.596</td><td rowspan=1 colspan=1>.647</td><td rowspan=1 colspan=1>.965</td><td rowspan=1 colspan=1>.284</td><td rowspan=1 colspan=1>.283</td><td rowspan=1 colspan=1>.425</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>.639</td><td rowspan=1 colspan=1>.562</td><td rowspan=1 colspan=1>.705</td><td rowspan=1 colspan=1>.751</td></tr><tr><td rowspan=1 colspan=1>Media</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.866</td><td rowspan=1 colspan=1>.874</td><td rowspan=1 colspan=1>.863</td><td rowspan=1 colspan=1>.949</td><td rowspan=1 colspan=1>.685</td><td rowspan=1 colspan=1>.890</td><td rowspan=1 colspan=1>.918</td><td rowspan=1 colspan=1>.886</td><td rowspan=1 colspan=1>.152</td><td rowspan=1 colspan=1>.267</td><td rowspan=1 colspan=1>.691</td><td rowspan=1 colspan=1>.704</td><td rowspan=1 colspan=1>.833</td><td rowspan=1 colspan=1>.853</td><td rowspan=1 colspan=1>.852</td><td rowspan=1 colspan=1>.893</td></tr><tr><td rowspan=2 colspan=1>Protest</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.846</td><td rowspan=1 colspan=1>.849</td><td rowspan=1 colspan=1>.844</td><td rowspan=1 colspan=1>.935</td><td rowspan=1 colspan=1>.683</td><td rowspan=1 colspan=1>.859</td><td rowspan=1 colspan=1>843</td><td rowspan=1 colspan=1>.702</td><td rowspan=1 colspan=1>.510</td><td rowspan=1 colspan=1>.169</td><td rowspan=1 colspan=1>.649</td><td rowspan=1 colspan=1>.779</td><td rowspan=1 colspan=1>.839</td><td rowspan=1 colspan=1>.821</td><td rowspan=1 colspan=1>.837</td><td rowspan=1 colspan=1>.881</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.706</td><td rowspan=1 colspan=1>.723</td><td rowspan=1 colspan=1>.697</td><td rowspan=1 colspan=1>.821</td><td rowspan=1 colspan=1>.536</td><td rowspan=1 colspan=1>.714</td><td rowspan=1 colspan=1>.456</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>.591</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>.681</td><td rowspan=1 colspan=1>.658</td><td rowspan=1 colspan=1>.685</td><td rowspan=1 colspan=1>.787</td></tr><tr><td rowspan=4 colspan=1>Average</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.815</td><td rowspan=1 colspan=1>.816</td><td rowspan=1 colspan=1>.815</td><td rowspan=1 colspan=1>.928</td><td rowspan=1 colspan=1>.639</td><td rowspan=1 colspan=1>.815</td><td rowspan=1 colspan=1>.883</td><td rowspan=1 colspan=1>.764</td><td rowspan=1 colspan=1>376</td><td rowspan=1 colspan=1>.247</td><td rowspan=1 colspan=1>.611</td><td rowspan=1 colspan=1>.742</td><td rowspan=1 colspan=1>.809</td><td rowspan=1 colspan=1>.788</td><td rowspan=1 colspan=1>.819</td><td rowspan=1 colspan=1>.850</td></tr><tr><td rowspan=1 colspan=1>FairFace18K</td><td rowspan=1 colspan=1>.800</td><td rowspan=1 colspan=1>.812</td><td rowspan=1 colspan=1>.795</td><td rowspan=1 colspan=1>.917</td><td rowspan=1 colspan=1>.588</td><td rowspan=1 colspan=1>.779</td><td rowspan=1 colspan=1>.856</td><td rowspan=1 colspan=1>.685</td><td rowspan=1 colspan=1>355</td><td rowspan=1 colspan=1>.279</td><td rowspan=1 colspan=1>.502</td><td rowspan=1 colspan=1>.625</td><td rowspan=1 colspan=1>.786</td><td rowspan=1 colspan=1>.773</td><td rowspan=1 colspan=1>.809</td><td rowspan=1 colspan=1>.827</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>674</td><td rowspan=1 colspan=1>.687</td><td rowspan=1 colspan=1>.668</td><td rowspan=1 colspan=1>815</td><td rowspan=1 colspan=1>479</td><td rowspan=1 colspan=1>.702</td><td rowspan=1 colspan=1>.507</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>555</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>.644</td><td rowspan=1 colspan=1>.643</td><td rowspan=1 colspan=1>.672</td><td rowspan=1 colspan=1>719</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.684</td><td rowspan=1 colspan=1>.726</td><td rowspan=1 colspan=1>.741</td><td rowspan=1 colspan=1>.969</td><td rowspan=1 colspan=1>.348</td><td rowspan=1 colspan=1>.395</td><td rowspan=1 colspan=1>.497</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>:</td><td rowspan=1 colspan=1>.670</td><td rowspan=1 colspan=1>.621</td><td rowspan=1 colspan=1>.675</td><td rowspan=1 colspan=1>.758</td></tr><tr><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>AlI</td><td rowspan=1 colspan=1>Female</td><td rowspan=1 colspan=1>Male</td><td rowspan=1 colspan=1>White</td><td rowspan=1 colspan=1>Non-White</td><td rowspan=1 colspan=1>Black</td><td rowspan=1 colspan=1>Asian</td><td rowspan=1 colspan=1>E Asian</td><td rowspan=1 colspan=1>SE Asian</td><td rowspan=1 colspan=1>Latino</td><td rowspan=1 colspan=1>Indian</td><td rowspan=1 colspan=1>Mid-East</td><td rowspan=1 colspan=1>0-9</td><td rowspan=1 colspan=1>10-29</td><td rowspan=1 colspan=1>30-49</td><td rowspan=1 colspan=1>50+</td></tr><tr><td rowspan=1 colspan=1>Twitter</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.940</td><td rowspan=1 colspan=1>.948</td><td rowspan=1 colspan=1>.935</td><td rowspan=1 colspan=1>.949</td><td rowspan=1 colspan=1>.932</td><td rowspan=1 colspan=1>.932</td><td rowspan=1 colspan=1>.894</td><td rowspan=1 colspan=1>.864</td><td rowspan=1 colspan=1>.942</td><td rowspan=1 colspan=1>.963</td><td rowspan=1 colspan=1>.932</td><td rowspan=1 colspan=1>976</td><td rowspan=1 colspan=1>.817</td><td rowspan=1 colspan=1>.932</td><td rowspan=1 colspan=1>973</td><td rowspan=1 colspan=1>.959</td></tr><tr><td></td><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.797</td><td rowspan=1 colspan=1>.637</td><td rowspan=1 colspan=1>.899</td><td rowspan=1 colspan=1>.815</td><td rowspan=1 colspan=1>.773</td><td rowspan=1 colspan=1>.789</td><td rowspan=1 colspan=1>.724</td><td rowspan=1 colspan=1>.716</td><td rowspan=1 colspan=1>.736</td><td rowspan=1 colspan=1>.804</td><td rowspan=1 colspan=1>.728</td><td rowspan=1 colspan=1>.911</td><td rowspan=1 colspan=1>.634</td><td rowspan=1 colspan=1>.769</td><td rowspan=1 colspan=1>.857</td><td rowspan=1 colspan=1>.859</td></tr><tr><td rowspan=3 colspan=1>Media</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.927</td><td rowspan=1 colspan=1>.841</td><td rowspan=1 colspan=1>.961</td><td rowspan=1 colspan=1>.928</td><td rowspan=1 colspan=1>.915</td><td rowspan=1 colspan=1>.907</td><td rowspan=1 colspan=1>.908</td><td rowspan=1 colspan=1>.915</td><td rowspan=1 colspan=1>.869</td><td rowspan=1 colspan=1>.928</td><td rowspan=1 colspan=1>.945</td><td rowspan=1 colspan=1>.932</td><td rowspan=1 colspan=1>.679</td><td rowspan=1 colspan=1>.917</td><td rowspan=1 colspan=1>.931</td><td rowspan=1 colspan=1>.924</td></tr><tr><td rowspan=1 colspan=1>LFWA+</td><td rowspan=1 colspan=1>.887</td><td rowspan=1 colspan=1>.656</td><td rowspan=1 colspan=1>.976</td><td rowspan=1 colspan=1>.893</td><td rowspan=1 colspan=1>.871</td><td rowspan=1 colspan=1>.851</td><td rowspan=1 colspan=1>.864</td><td rowspan=1 colspan=1>.875</td><td rowspan=1 colspan=1>.804</td><td rowspan=1 colspan=1>.859</td><td rowspan=1 colspan=1>.897</td><td rowspan=1 colspan=1>.944</td><td rowspan=1 colspan=1>.688</td><td rowspan=1 colspan=1>.835</td><td rowspan=1 colspan=1>.832</td><td rowspan=1 colspan=1>.911</td></tr><tr><td rowspan=2 colspan=1>Protest</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.901</td><td rowspan=1 colspan=1>.829</td><td rowspan=1 colspan=1>.934</td><td rowspan=1 colspan=1>.905</td><td rowspan=1 colspan=1>.873</td><td rowspan=1 colspan=1>.911</td><td rowspan=1 colspan=1>.814</td><td rowspan=1 colspan=1>.802</td><td rowspan=1 colspan=1>.843</td><td rowspan=1 colspan=1>.902</td><td rowspan=1 colspan=1>.918</td><td rowspan=1 colspan=1>.921</td><td rowspan=1 colspan=1>.611</td><td rowspan=1 colspan=1>.812</td><td rowspan=1 colspan=1>.924</td><td rowspan=1 colspan=1>.919</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.957</td><td rowspan=1 colspan=1>.950</td><td rowspan=1 colspan=1>959</td><td rowspan=1 colspan=1>.962</td><td rowspan=1 colspan=1>951</td><td rowspan=1 colspan=1>.947</td><td rowspan=1 colspan=1>.912</td><td rowspan=1 colspan=1>.903</td><td rowspan=1 colspan=1>.913</td><td rowspan=1 colspan=1>971</td><td rowspan=1 colspan=1>.961</td><td rowspan=1 colspan=1>.985</td><td rowspan=1 colspan=1>.833</td><td rowspan=1 colspan=1>.939</td><td rowspan=1 colspan=1>975</td><td rowspan=1 colspan=1>.971</td></tr><tr><td rowspan=1 colspan=1>Average</td><td rowspan=1 colspan=1>FairFace9K</td><td rowspan=1 colspan=1>.926</td><td rowspan=1 colspan=1>.921</td><td rowspan=1 colspan=1>.927</td><td rowspan=1 colspan=1>929</td><td rowspan=1 colspan=1>.921</td><td rowspan=1 colspan=1>.922</td><td rowspan=1 colspan=1>.864</td><td rowspan=1 colspan=1>.851</td><td rowspan=1 colspan=1>.883</td><td rowspan=1 colspan=1>.942</td><td rowspan=1 colspan=1>.951</td><td rowspan=1 colspan=1>.974</td><td rowspan=1 colspan=1>.760</td><td rowspan=1 colspan=1>.901</td><td rowspan=1 colspan=1>.949</td><td rowspan=1 colspan=1>.943</td></tr><tr><td rowspan=2 colspan=1></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>CelebA</td><td rowspan=1 colspan=1>.870</td><td rowspan=1 colspan=1>.947</td><td rowspan=1 colspan=1>.829</td><td rowspan=1 colspan=1>.884</td><td rowspan=1 colspan=1>.853</td><td rowspan=1 colspan=1>.847</td><td rowspan=1 colspan=1>.838</td><td rowspan=1 colspan=1>.774</td><td rowspan=1 colspan=1>.847</td><td rowspan=1 colspan=1>.887</td><td rowspan=1 colspan=1>.864</td><td rowspan=1 colspan=1>.919</td><td rowspan=1 colspan=1>.530</td><td rowspan=1 colspan=1>.840</td><td rowspan=1 colspan=1>.900</td><td rowspan=1 colspan=1>.911</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=2 colspan=1>Twitter</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.578</td><td rowspan=1 colspan=1>.586</td><td rowspan=1 colspan=1>573</td><td rowspan=1 colspan=1>.563</td><td rowspan=1 colspan=1>.590</td><td rowspan=1 colspan=1>.557</td><td rowspan=1 colspan=1>.620</td><td rowspan=1 colspan=1>.629</td><td rowspan=1 colspan=1>.606</td><td rowspan=1 colspan=1>.581</td><td rowspan=1 colspan=1>.576</td><td rowspan=1 colspan=1>.555</td><td rowspan=1 colspan=1>.805</td><td rowspan=1 colspan=1>.666</td><td rowspan=1 colspan=1>.439</td><td rowspan=1 colspan=1>.408</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.366</td><td rowspan=1 colspan=1>.355</td><td rowspan=1 colspan=1>.384</td><td rowspan=1 colspan=1>.343</td><td rowspan=1 colspan=1>.385</td><td rowspan=1 colspan=1>338</td><td rowspan=1 colspan=1>.397</td><td rowspan=1 colspan=1>.382</td><td rowspan=1 colspan=1>.419</td><td rowspan=1 colspan=1>.411</td><td rowspan=1 colspan=1>.356</td><td rowspan=1 colspan=1>.345</td><td rowspan=1 colspan=1>.585</td><td rowspan=1 colspan=1>.499</td><td rowspan=1 colspan=1>.104</td><td rowspan=1 colspan=1>.307</td></tr><tr><td rowspan=1 colspan=1>Media</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.516</td><td rowspan=1 colspan=1>.511</td><td rowspan=1 colspan=1>.517</td><td rowspan=1 colspan=1>.513</td><td rowspan=1 colspan=1>.520</td><td rowspan=1 colspan=1>.483</td><td rowspan=1 colspan=1>.557</td><td rowspan=1 colspan=1>.559</td><td rowspan=1 colspan=1>.543</td><td rowspan=1 colspan=1>.537</td><td rowspan=1 colspan=1>.532</td><td rowspan=1 colspan=1>475</td><td rowspan=1 colspan=1>.714</td><td rowspan=1 colspan=1>.686</td><td rowspan=1 colspan=1>447</td><td rowspan=1 colspan=1>.501</td></tr><tr><td rowspan=2 colspan=1>Protest</td><td rowspan=1 colspan=1>FairFace</td><td rowspan=1 colspan=1>.515</td><td rowspan=1 colspan=1>.543</td><td rowspan=1 colspan=1>.502</td><td rowspan=1 colspan=1>.498</td><td rowspan=1 colspan=1>.539</td><td rowspan=1 colspan=1>.527</td><td rowspan=1 colspan=1>.584</td><td rowspan=1 colspan=1>.605</td><td rowspan=1 colspan=1>.531</td><td rowspan=1 colspan=1>.507</td><td rowspan=1 colspan=1>.581</td><td rowspan=1 colspan=1>.469</td><td rowspan=1 colspan=1>.885</td><td rowspan=1 colspan=1>.687</td><td rowspan=1 colspan=1>.395</td><td rowspan=1 colspan=1>.478</td></tr><tr><td rowspan=1 colspan=1>UTKFace</td><td rowspan=1 colspan=1>.302</td><td rowspan=1 colspan=1>.306</td><td rowspan=1 colspan=1>.294</td><td rowspan=1 colspan=1>.291</td><td rowspan=1 colspan=1>.319</td><td rowspan=1 colspan=1>.305</td><td rowspan=1 colspan=1>.316</td><td rowspan=1 colspan=1>.318</td><td rowspan=1 colspan=1>.312</td><td rowspan=1 colspan=1>.314</td><td rowspan=1 colspan=1>.371</td><td rowspan=1 colspan=1>.318</td><td rowspan=1 colspan=1>.516</td><td rowspan=1 colspan=1>.503</td><td rowspan=1 colspan=1>.114</td><td rowspan=1 colspan=1>.349</td></tr><tr><td rowspan=2 colspan=1>Average</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>FairFace9K</td><td rowspan=1 colspan=1>470</td><td rowspan=1 colspan=1>.493</td><td rowspan=1 colspan=1>459</td><td rowspan=1 colspan=1>.462</td><td rowspan=1 colspan=1>478</td><td rowspan=1 colspan=1>.449</td><td rowspan=1 colspan=1>.506</td><td rowspan=1 colspan=1>.515</td><td rowspan=1 colspan=1>.483</td><td rowspan=1 colspan=1>.473</td><td rowspan=1 colspan=1>458</td><td rowspan=1 colspan=1>.463</td><td rowspan=1 colspan=1>.662</td><td rowspan=1 colspan=1>.611</td><td rowspan=1 colspan=1>.361</td><td rowspan=1 colspan=1>.394</td></tr></table>
|
| 326 |
+
|
| 327 |
+
# Table 8: Face detection rate of commercial services on FairFace dataset.
|
| 328 |
+
|
| 329 |
+
<table><tr><td></td><td colspan="2">White</td><td colspan="2">Black</td><td colspan="2">East Asian</td><td colspan="2">Southeast Asian</td><td colspan="2">Latino Hispanic</td><td colspan="2">Indian</td><td colspan="2">Middle Eastern</td><td colspan="2"></td></tr><tr><td></td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Female</td><td>Male</td><td>Mean</td><td>STD</td></tr><tr><td>Amazon</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>1.000</td><td>.000</td></tr><tr><td>Microsoft</td><td>.845</td><td>.779</td><td>.796</td><td>.742</td><td>.856</td><td>.794</td><td>888</td><td>.830</td><td>.858</td><td>.854</td><td>.886</td><td>.798</td><td>.869</td><td>.777</td><td>.812</td><td>047</td></tr><tr><td>Face++</td><td>.994</td><td>.991</td><td>.994</td><td>.987</td><td>.998</td><td>.993</td><td>.998</td><td>.998</td><td>.994</td><td>.998</td><td>.996</td><td>.993</td><td>.994</td><td>.994</td><td>.993</td><td>.003</td></tr><tr><td>IBM</td><td>.996</td><td>.985</td><td>.996</td><td>.970</td><td>.989</td><td>989</td><td>1.000</td><td>.993</td><td>.991</td><td>.994</td><td>.991</td><td>.981</td><td>989</td><td>.979</td><td>.991</td><td>.008</td></tr></table>
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 5: Individual Typology Angle (ITA), i.e. skin color, distribution of different races measured in our dataset.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 6: Classification accuracy based on Individual Typology Angle (ITA), i.e. skin color.
|
md/train/SJQO7UJCW/SJQO7UJCW.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVERSARIAL LEARNING FORSEMI-SUPERVISED SEMANTIC SEGMENTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a method for semi-supervised semantic segmentation using the adversarial network. While most existing discriminators are trained to classify input images as real or fake on the image level, we design a discriminator in a fully convolutional manner to differentiate the predicted probability maps from the ground truth segmentation distribution with the consideration of the spatial resolution. We show that the proposed discriminator can be used to improve the performance on semantic segmentation by coupling the adversarial loss with the standard cross entropy loss on the segmentation network. In addition, the fully convolutional discriminator enables the semi-supervised learning through discovering the trustworthy regions in prediction results of unlabeled images, providing additional supervisory signals. In contrast to existing methods that utilize weakly-labeled images, our method leverages unlabeled images without any annotation to enhance the segmentation model. Experimental results on both the PASCAL VOC 2012 dataset and the Cityscapes dataset demonstrate the effectiveness of our algorithm.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Semantic segmentation is the task to assign a semantic label, e.g., person, dog, or road, to each pixel in images. It is essential to a wide range of applications, such as autonomous driving and image editing. For decades, many methods have been proposed to tackle this task (Long et al., 2015; Zheng et al., 2015; Liu et al., 2015; Yu & Koltun, 2016; Lin et al., 2016), and abundant standard benchmark datasets have been constructed (Everingham et al., 2010; Mottaghi et al., 2014; Cordts et al., 2016; Zhou et al., 2017), targeting different sets of scene/object categories as well as various real-world applications. However, this task remains challenging because of the object/scene appearance variations, occlusions, and the lack of context understanding. Recently, Convolutional Neural Network (CNN) based methods such as fully convolutional neural network (FCN) (Long et al., 2015) have achieved significant improvement on the task of semantic segmentation, and most state-of-the-art algorithms are based on FCN with advanced modifications and additional modules.
|
| 12 |
+
|
| 13 |
+
Although CNN-based approaches have achieved astonishing performance, they require an enormous amount of training data. Different from image classification and object detection, semantic segmentation requires accurate per-pixel annotations for each training image, which can cost considerable expense and time. To ease the effort of acquiring high-quality data, semi/weakly-supervised methods have been applied to the task of semantic segmentation. These methods often assume that there is limited or none per-pixel annotations available, such as additional annotations on the image-level (Pinheiro & Collobert, 2015; Papandreou et al., 2015; Hong et al., 2015; Qi et al., 2016; Pathak et al., 2015a), box-level (Dai et al., 2015), or point-level (Bearman et al., 2016).
|
| 14 |
+
|
| 15 |
+
In this paper, we propose a semi-supervised semantic segmentation algorithm via adversarial learning. The recent success of Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) enables many possibilities for unsupervised and semi-supervised learning. A typical GAN consists of two sub-networks, i.e., generator and discriminator, in which these two sub-networks play a min-max game in the training process. The generator takes a sample vector and outputs a sample of the target data distribution, e.g., human faces, while the discriminator aims to differentiate generated samples from target ones. Then the generator is trained to confuse the discriminator through back-propagation and therefore generates samples that are similar to the target distribution. In this paper, we apply a similar methodology and treat the segmentation network as the generator in a GAN framework.
|
| 16 |
+
|
| 17 |
+
Different from the typical generators that are trained to generate images given noise vectors, our segmentation network outputs the probability maps of the semantic labels given an input image. Under this setting, we wish to push the outputs of the segmentation network as close as the ground truth label maps spatially.
|
| 18 |
+
|
| 19 |
+
To this end, we adopt an adversarial learning scheme and propose a fully convolutional discriminator that learns to differentiate ground truth label maps from probability maps of segmentation predictions. Combined with the spatial cross-entropy loss, our method use an adversarial loss that encourages the segmentation network to produce predicted probability maps close to the ground truth label maps in a high-order structure. The idea is similar to the use of probabilistic graphical models such as Conditional Random Fields (CRFs) (Zheng et al., 2015; Chen et al., 2017; Lin et al., 2016), but without the extra post-processing module during the testing phase. In addition, the discriminator is not required during inference, and hence our proposed framework does not increase any computational power for testing. By employing the adversarial learning, we further take advantage of the proposed fully convolutional discriminator under the semi-supervised setting.
|
| 20 |
+
|
| 21 |
+
One way to allow the discriminator exploiting unlabeled data is to train the segmentation network using the adversarial learning without the cross-entropy loss. However, this approach does not improve the performance according to our experiments because the adversarial loss will aggressively encourage the predictions to be close to the ground truth distribution and neglects the correctness of segmentation. Instead, we utilize the confidence maps generated by our discriminator network as the supervisory signal to guide the cross-entropy loss in a “self-taught” manner. The confidence maps indicate which regions of the prediction distribution are close to the ground truth label distribution, so that the segmentation network can trust these predictions and hence can be trained via a masked cross-entropy loss. By adopting the proposed framework, we show that the segmentation accuracy can be further improved by adding images without any annotations in the domain of labeled images.
|
| 22 |
+
|
| 23 |
+
The contributions of this work are as follows. First, we develop an adversarial framework that improves semantic segmentation accuracy without requiring additional computation loads during inference. Second, we facilitate the semi-supervised learning by leveraging the discriminator network response of unlabeled images to aid the training of the segmentation network. Experimental results validate the proposed adversarial framework for semi-supervised semantic segmentation on the PASCAL VOC 2012 (Everingham et al., 2010) and Cityscapes (Cordts et al., 2016) datasets.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Semantic segmentation. Recent state-of-the-art methods for semantic segmentation are based on the rapid development of CNN. As proposed by Long et al. (2015), one can transform a classification CNN, e.g. AlexNet (Krizhevsky et al., 2012), VGG (Simonyan & Zisserman, 2015), or ResNet (He et al., 2016), to a fully-convolutional network (FCN) that tackles the task of semantic segmentation. However, pixel-level annotations are usually expensive and difficult to collect. To reduce the heavy effort of labeling segmentation ground truth, many weakly-supervised approaches are proposed in recent years. In the weakly-supervised setting, the segmentation network is not trained at the pixel level with fully annotated ground truth. Instead, the network is trained with various weak-supervisory signals that are more easily to obtain. Image-level labels are exploited as the supervisory signal in most methods. Pinheiro & Collobert (2015) and Pathak et al. (2015b) use Multiple Instance Learning (MIL) to generate latent segmentation label maps for supervised training. On the other hand, Papandreou et al. (2015) refer to the image-level labels to penalize the prediction of non-existent object classes, while similarly Qi et al. (2016) use object localization to refine the segmentation. Hong et al. (2015) refer to the labeled images to train a classification network as the feature extractor for deconvolution. In addition to image-level supervisions, the segmentation network can also be trained with bounding boxes (Dai et al., 2015; Khoreva et al., 2017), point supervision (Bearman et al., 2016), or web videos (Hong et al., 2017).
|
| 28 |
+
|
| 29 |
+
However, these weakly supervised approaches still fall behind the fully-supervised ones, especially because the detailed boundary information is difficult to infer from these weak-supervisory signals. Hence semi-supervised learning is also considered in some methods to enhance the prediction performance. In such setting, partial fully-annotated data and optional weakly-labeled data are used for the segmentation network training. Hong et al. (2015) jointly train their network with image-level supervised images and few fully-annotated images in the encoder-decoder framework.
|
| 30 |
+
|
| 31 |
+
Dai et al. (2015) and Papandreou et al. (2015) also expand their weakly-supervised approaches to the semi-supervised setting for utilizing extra strongly-annotated data.
|
| 32 |
+
|
| 33 |
+
Different from the aforementioned methods, our method can leverage unlabeled images in model training, hence greatly saving the cost of manual annotation. In fact, we treat the output of our fully convolutional discriminator as the supervisory signals, which compensate for the absence of image annotations and enable semi-supervised semantic segmentation. Our self-taught learning framework for segmentation is related to Pathak et al. (2015a) where the prediction maps of unlabeled images are used as ground truth. However, in Pathak et al. (2015a), the prediction maps are refined by several hand-designed constraints before training, while we learn the confidence map through the discriminator network as the selection criterion for self-taught learning.
|
| 34 |
+
|
| 35 |
+
Generative adversarial networks. After Goodfellow et al. (2014) propose the GAN framework and its theoretical foundation, the GAN draws great attention with several improvements in implementation (Radford et al., 2016; Denton et al., 2015; Arjovsky et al., 2017; Mao et al., 2016; Berthelot et al., 2017). The methodology of adversarial training has been applied to a wide range of applications, including image genration (Radford et al., 2016), image completion (Li et al., 2017), super-resolution (Ledig et al., 2016), object detection (Wang et al., 2017), domain adaptation (Hoffman et al., 2016) and semantic segmentation (Luc et al., 2016; Souly et al., 2017).
|
| 36 |
+
|
| 37 |
+
The work closest in scope to ours is the one proposed by Luc et al. (2016), where the adversarial network is used to aid the training for semantic segmentation. However, it does not show substantial improvement over the baseline. On the other hand, Souly et al. (2017) propose to generate adversarial examples using GAN for semi-supervised semantic segmentation, but these generated examples may not be sufficiently close to real images to help the segmentation network.
|
| 38 |
+
|
| 39 |
+
# 3 ALGORITHM OVERVIEW
|
| 40 |
+
|
| 41 |
+
Figure 1 shows the overview of the proposed algorithm. Our system is composed of two networks: the segmentation network and the discriminator network. The former can be any network designed for semantic segmentation, e.g., FCN (Long et al., 2015), DeepLab (Chen et al., 2017), DilatedNet (Yu & Koltun, 2016). Given an input image with dimension $H \times W \times 3$ , the segmentation network outputs the class probability maps of size $H \times W \times C$ , where $C$ is the number of semantic categories of the target dataset.
|
| 42 |
+
|
| 43 |
+
Our discriminator network is an FCN-based network, which takes class probability maps as the input, either from the segmentation network or ground truth label maps, and then outputs spatial probability maps with a size of $H \times W \times 1$ . Each pixel of the discriminator outputs map represents whether that pixel is sampled from the ground truth label $( p = 1 )$ ) or from the segmentation network $( p = 0$ ). In contrast to the typical GAN discriminators which take fix-sized input images ( $6 4 \times 6 4$ in most cases) and output a single probability value, we transform our discriminator to a fully-convolutional network that can take inputs of arbitrary sizes. Importantly, we find this transformation is essential to enable the proposed adversarial learning scheme.
|
| 44 |
+
|
| 45 |
+
During the training process, we use both labeled and unlabeled images under the semi-supervised setting. When using the labeled data, the segmentation network is supervised by both the standard cross-entropy loss with the ground truth label map and the adversarial loss with the discriminator network. Note that we train the discriminator network only with the labeled data.
|
| 46 |
+
|
| 47 |
+
For the unlabeled data, we train the segmentation network with the proposed semi-supervised method. After obtaining the initial segmentation prediction of the unlabeled image from the segmentation network, we obtain a confidence map by passing the segmentation prediction through the discriminator network. We in turn treat this confidence map as the supervisory signal using a “self-taught” scheme to train the segmentation network with a masked cross-entropy loss. The intuition is that this confidence map indicates the local quality of the predicted segmentation, so that the segmentation network knows which regions to trust during training.
|
| 48 |
+
|
| 49 |
+
# 4 SEMI-SUPERVISED TRAINING WITH ADVERSARIAL NETWORK
|
| 50 |
+
|
| 51 |
+
In this section, we address the detailed learning scheme of the segmentation and discriminator networks, as well as the designed network architectures.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 1: Overview of the proposed system for semi-supervised semantic segmentation. With a fully-convolution discriminator network trained using the loss $\mathcal { L } _ { D }$ , we optimize the segmentation netwrok using three loss functions during the training process: cross-entropy loss $\mathcal { L } _ { c e }$ , adversarial loss $\mathcal { L } _ { a d v }$ , and semi-supervised loss $\mathcal { L } _ { s e m i }$ .
|
| 55 |
+
|
| 56 |
+
# 4.1 TRAINING OBJECTIVE
|
| 57 |
+
|
| 58 |
+
Given an input image $\mathbf { X } _ { n }$ of size $H \times W \times 3$ , we denote the segmentation network as $S ( \cdot )$ and the predicted probability map as $S ( \mathbf { X } _ { n } )$ of size $H \times W \times C$ , where $\textrm { C }$ is the category number. For our fully convolutional discriminator, we denote it as $D ( \cdot )$ which outputs a two-class confidence map $D ( \mathbf { P } _ { n } )$ with the size of $H \times W \times 1$ , where $\mathbf { P } _ { n }$ is the class probability map of size $H \times W \times C$ , from either the ground truth label $Y _ { n }$ or the segmentation network as $S ( \mathbf { X } _ { n } )$ .
|
| 59 |
+
|
| 60 |
+
Discriminator network training. To train the discriminator network, we minimize the spatial cross-entropy loss $\mathcal { L } _ { D }$ with respect to two classes. The loss can be formally written as:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathcal { L } _ { D } = - \sum _ { h , w } \left( 1 - y _ { n } \right) \log ( D ( \mathbf { P } _ { n } ) ^ { ( h , w , 0 ) } ) + y _ { n } \log ( D ( \mathbf { P } _ { n } ) ^ { ( h , w , 1 ) } ) ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $y _ { n } = 0$ if the sample is drawn from the segmentation network, and $y _ { n } = 1$ if the sample is from the ground truth label. Note that, the discriminator network takes a C-channel probability map as input. In order to convert the ground truth label map $Y _ { n }$ of size $H \times W \times 1$ to $\textrm { C }$ channels, we simply employ one-hot encoding scheme by constructing the probability maps $P _ { n }$ , where $P _ { n } ^ { ( h , w , c ) }$ takes value 1 if Y (h,w)n , and 0 otherwise.
|
| 67 |
+
|
| 68 |
+
One concern raised by (Luc et al., 2016) is that the discriminator network may easily distinguish whether the probability maps come from the ground truth by detecting the one-hot probability. However, we do not observe this phenomenon during the training phase. One reason is that we use a fully-convolutional scheme to predict spatial confidence, which increases the difficulty to learn the discriminator. In addition, we try the Scale scheme proposed in (Luc et al., 2016), where the ground truth probability channel is slightly diffused to other channels according to the distribution of segmentation network output. However, the results show no difference, and thus we do not adopt this scheme in the experiments.
|
| 69 |
+
|
| 70 |
+
Segmentation network training. We propose to train the segmentation network via minimizing a multi-task loss function:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathcal { L } _ { s e g } = \mathcal { L } _ { c e } + \lambda _ { a d v } \mathcal { L } _ { a d v } + \lambda _ { s e m i } \mathcal { L } _ { s e m i } ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\mathcal { L } _ { c e }$ , $\mathcal { L } _ { a d v }$ , and $\mathcal { L } _ { s e m i }$ denote the spatial multi-class cross entropy loss, the adversarial loss, and the semi-supervised loss, respectively. $\lambda _ { a d v }$ and $\lambda _ { s e m i }$ are two constants for balancing the multi-task training.
|
| 77 |
+
|
| 78 |
+
We first consider the scenario of using annotated data. Given an input image ${ \bf X } _ { n }$ , ground truth ${ \bf Y } _ { n }$ and prediction results ${ \bf P } _ { n } = S ( { \bf X } _ { n } )$ , the cross-entropy loss is obtained by:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal { L } _ { c e } = - \sum _ { h , w } \sum _ { c \in C } \mathbf { Y } _ { n } ^ { ( h , w , c ) } \log ( \mathbf { P } _ { n } ^ { ( h , w , c ) } ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
We adopt the adversarial learning through the adversarial loss $\mathcal { L } _ { a d v }$ given a fully convolutional discriminator network $D ( \cdot )$ :
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { L } _ { a d v } = - \sum _ { h , w } \log ( D ( \mathbf { P } _ { n } ) ^ { ( h , w , 1 ) } ) .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
With this adversarial loss, we seek to train the segmentation network to fool the discriminator by maximizing the probability of the segmentation prediction being considered as the ground truth distribution.
|
| 91 |
+
|
| 92 |
+
Training with unlabeled data. Now we consider the adversarial training under the semi-supervised setting. For unlabeled data, it is obvious that we cannot apply $\mathcal { L } _ { c e }$ since there is no ground truth annotation available. The adversarial loss $\mathcal { L } _ { a d v }$ is still applicable as it only requires the discriminator network. However, we find that the performance degenerates when only applying the adversarial loss on unlabeled data without $\mathcal { L } _ { c e }$ . This is reasonable because the discriminator serves as a regularization and may over-correct the prediction to fit the ground truth distribution.
|
| 93 |
+
|
| 94 |
+
Thus, we propose to utilize the trained discriminator with unlabeled data using a “self-taught” strategy. The main idea is that the trained discriminator can generate a confidence map, i.e. $D ( \mathbf { P } _ { n } ) ^ { ( h , w , 1 ) }$ , which infers the regions where the prediction results are close enough to the ground truth distribution. We then binarize this confidence map with a threshold to highlight the trustworthy region. As a result, we define the self-taught ground truth as the masked segmentation prediction $\hat { { \mathbf Y } } _ { n } = a r g m a x ( { \mathbf P } _ { n } )$ using this binarized confidence map. The resulting semi-supervised loss is defined by:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { s e m i } = - \sum _ { h , w } \sum _ { c \in C } I ( D ( \mathbf { P } _ { n } ) ^ { ( h , w , 1 ) } > T _ { s e m i } ) \cdot \hat { \mathbf { Y } } _ { n } ^ { ( h , w , c ) } \log ( \mathbf { P } _ { n } ^ { ( h , w , c ) } ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $I ( \cdot )$ is the indicator function, and $T _ { s e m i }$ is the threshold to control the sensitivity of the self-taught process. Note that during training we treat both the self-taught target $\hat { { \mathbf Y } } _ { n }$ and the value of indicator function as constant, and thus (5) can be simply viewed as a masked spatial cross entropy loss. In practice, we find that this strategy works robustly with $T _ { s e m i }$ ranging between 0.1 and 0.3.
|
| 101 |
+
|
| 102 |
+
# 4.2 NETWORK ARCHITECTURE
|
| 103 |
+
|
| 104 |
+
Segmentation network. We adopt the DeepLab-v2 (Chen et al., 2017) framework with ResNet101 (He et al., 2016) model pre-trained on the ImageNet dataset (Deng et al., 2009) as our segmentation baseline network. However, we do not employ the multi-scale fusion proposed in Chen et al. (2017) due to the memory concern. Following the practice of recent work on semantic segmentation (Chen et al., 2017; Yu & Koltun, 2016), we remove the last classification layer and modify the stride of the last two convolution layers from 2 to 1, making the resolution of the output feature maps effectively $1 / 8$ times the input image size. To enlarge the receptive fields, we apply the dilated convolution (Yu & Koltun, 2016) in conv4 and conv5 layers with a stride of 2 and 4, respectively. After the last layer, we employ the Atrous Spatial Pyramid Pooling (ASPP) proposed in Chen et al. (2017) as the final classifier. Finally, we apply an up-sampling layer along with the softmax output to match the size of the input image.
|
| 105 |
+
|
| 106 |
+
Discriminator network. For the discriminator network, we follow the structure used in Radford et al. (2016). It consists of 5 convolution layers with kernel $4 \times 4$ with channel numbers {64, 128, 256, 512, 1} and stride of 2. Each convolution layer is followed by a Leaky-ReLU (Maas et al., 2013) parameterized by 0.2 except the last layer. To transform the network to a fully convolutional network, an up-sampling layer is added to the last layer to rescale the output to the size of the input map. Note that we do not employ the batch-normalization layers. We find that the batch-normalization layer (Ioffe & Szegedy, 2015) is highly unstable since the system can be only trained with a small batch size.
|
| 107 |
+
|
| 108 |
+
# 5 EXPERIMENTAL RESULTS
|
| 109 |
+
|
| 110 |
+
Implementation details. We implement our network using the PyTorch framework. We train our system on a single TitanX GPU with 12 GB memory. To train the segmentation network, we use
|
| 111 |
+
|
| 112 |
+
Table 1: Results on the VOC 2012 validation set.
|
| 113 |
+
|
| 114 |
+
<table><tr><td></td><td colspan="4">Data Amount</td></tr><tr><td>Methods</td><td>1/8</td><td>1/4</td><td>1/2</td><td>Full</td></tr><tr><td>FCN-8s (Long et al.,2015)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>67.2</td></tr><tr><td>Dilationl0(Yu& Koltun,2016)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>73.9</td></tr><tr><td>DeepLab-v2 (Chen et al.,2017)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>77.7</td></tr><tr><td>our baseline</td><td>66.0</td><td>68.3</td><td>69.8</td><td>73.6</td></tr><tr><td>baseline+Ladu</td><td>67.6</td><td>71.0</td><td>72.6</td><td>74.9</td></tr><tr><td>baseline+Ladu +Lsemi</td><td>68.8</td><td>71.6</td><td>73.2</td><td>N/A</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 2: Results on the Cityscapes validation set.
|
| 117 |
+
|
| 118 |
+
<table><tr><td></td><td colspan="4">Data Amount</td></tr><tr><td>Methods</td><td>1/8</td><td>1/4</td><td>1/2</td><td>Full</td></tr><tr><td>FCN-8s (Long et al., 2015)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>65.3</td></tr><tr><td>Dilationi0 (Yu & Koltun,2016)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>67.1</td></tr><tr><td>DeepLab-v2 (Chen et al.,2017)</td><td>N/A</td><td>N/A</td><td>N/A</td><td>70.4</td></tr><tr><td>our baseline</td><td>52.4</td><td>58.3</td><td>62.6</td><td>66.4</td></tr><tr><td>baseline+Ladu</td><td>53.8</td><td>59.1</td><td>63.7</td><td>67.7</td></tr><tr><td>baseline+Ladu +Lsemi</td><td>54.2</td><td>59.7</td><td>64.5</td><td>N/A</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Stochastic Gradient Descent (SGD) with Nesterov acceleration as the optimizer, where the momentum is 0.9 and the weight decay is $1 0 ^ { - 4 }$ . The initial learning rate is set as $2 . 5 \times 1 0 ^ { - 4 }$ and is decreased with polynomial decay with power of 0.9 as mentioned in Chen et al. (2017). For training the discriminator, we adopt Adam optimizer (Kingma & Ba, 2014) with the learning rate as $1 0 ^ { - 4 }$ and the same polynomial decay as the segmentation network. The momentum is set as 0.9 and 0.999.
|
| 121 |
+
|
| 122 |
+
For semi-supervised training, we randomly interleave the labeled data and unlabeled data iteratively and apply the training scheme described in section 4.1 accordingly. We update both the segmentation network and discriminator network jointly. In each iteration, only the batch containing the ground truth data are used for training the discriminator. When randomly sampling partial labeled and unlabeled data from the datasets, we average several experiment results with different random seeds to ensure the evaluation robustness.
|
| 123 |
+
|
| 124 |
+
Evaluation datasets and metric. In this work, we conduct experiments on two semantic segmentation datasets: PASCAL VOC 2012 (Everingham et al., 2010) and Cityscapes (Cordts et al., 2016). While the PASCAL VOC dataset contains common objects in photos captured in daily activities, the Cityscapes dataset mainly targets urban street scenes. On both datasets, we use the mean intersection-over-union (mean IU) as the evaluation metric.
|
| 125 |
+
|
| 126 |
+
The PASCAL VOC 2012 dataset is a commonly used evaluation dataset for semantic segmentation. It comprises 20 common objects with annotations on daily captured photos. We use the extra annotation set in SBD (Hariharan et al., 2011), resulting in 10,582 training images. We evaluate our models on the standard validation set with 1449 images. During training, we employ the random scaling and cropping with size $3 2 1 \times 3 2 1$ . We train each model on the PASCAL VOC dataset for 20k iterations with batch size 10.
|
| 127 |
+
|
| 128 |
+
The Cityscapes dataset has 50 videos with driving scenes, and 2975, 500, 1525 images are extracted and annotated with 19 classes for training, validation, and testing, respectively. Each annotated frame is the $2 0 ^ { t h }$ frame in a 30-frames snippet, where only these images with annotations are considered in the training process. We resize the input image to $5 1 2 \times 1 0 2 4$ without any random cropping/scaling. We train each model on the Cityscapes dataset for $4 0 \mathrm { k }$ iterations with batch size 2.
|
| 129 |
+
|
| 130 |
+
Results on the PASCAL VOC 2012 dataset. Table 1 shows the evaluation results on the PASCAL VOC 2012 dataset. To validate the semi-supervising scheme, we randomly sample 1/8, 1/4, 1/2 images as labeled, and used the rest of training images as the unlabeled data. We show the performance comparisons with FCN (Long et al., 2015), Dilation10 (Yu & Koltun, 2016), and DeepLab-v2 (Chen et al., 2017) to demonstrate that our baseline model is comparable with other state-of-the-art methods. Note that our baseline model is equivalent to the DeepLab-v2 model without multi-scale fusion. The adversarial loss brings consistent performance improvement $( 1 . 6 \% - 2 . 8 \% )$ over different amounts of training data. Incorporating the proposed semi-supervised learning scheme brings overall $2 . 8 \% - 3 . 4 \%$ improvement. Figure 2 shows visual comparisons of the segmentation results generated by the proposed method. We observe that the segmentation boundary has significant improvement when compared to the baseline model.
|
| 131 |
+
|
| 132 |
+
Results on the Cityscapes dataset. Table 2 shows evaluation results on the Cityscapes dataset. By applying the adversarial loss $\mathcal { L } _ { a d v }$ , the model achieves $0 . 8 \% - 1 . 4 \%$ gain over the baseline model under the semi-supervised setting. This shows that our adversarial training scheme can encourage the segmentation network to learn the structural information from the ground truth distribution. Combining the adversarial learning and proposed semi-supervised learning, the performance further improves with overall $1 . 4 \% - 1 . 9 \%$ mean IU gain.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: Comparisons on the PASCAL VOC 2012 dataset using 1/2 labeled data.
|
| 136 |
+
|
| 137 |
+
Table 3: Adversarial learning comparison with Luc et al. (2016) on VOC 2012 validation set.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td>Baseline</td><td>Adversarial</td></tr><tr><td>Luc et al. (2016)</td><td>71.8</td><td>72.0</td></tr><tr><td>ours</td><td>73.6</td><td>74.9</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 4: Semi-supervised learning comparisons on VOC 2012 validation set without using additional labels of SBD.
|
| 142 |
+
|
| 143 |
+
<table><tr><td></td><td>Data Amount</td><td>Fully- supervised</td><td>Semi- supervised</td></tr><tr><td>Papandreou et al. (2015)</td><td>Full</td><td>62.5</td><td>64.6</td></tr><tr><td>Souly et al. (2017)</td><td>Full</td><td>59.5</td><td>64.1</td></tr><tr><td>ours</td><td>Full</td><td>66.3</td><td>68.4</td></tr><tr><td>Souly et al. (2017)</td><td>30%</td><td>38.9</td><td>42.2</td></tr><tr><td>ours</td><td>30%</td><td>57.4</td><td>60.6</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Comparisons with state-of-the-art methods Table 3 shows comparisons with Luc et al. (2016) that utilizes adversarial learning. There are major design differences of the adversarial learning step between Luc et al. (2016) and our method. First, we design a universal discriminator for various datasets, while Luc et al. (2016) utilizes different network structures for different datasets. Second, our discriminator is not required to take the RGB image as an additional input but directly work on the prediction map from the segmentation network. In Table 3, our method achieves $1 . 2 \%$ gain in mean IU, which is significantly better then the gain in Luc et al. (2016).
|
| 146 |
+
|
| 147 |
+
We show comparisons for the semi-supervised setting in Table 4. To compare with Papandreou et al. (2015) and Souly et al. (2017), we train our model on the original PASCAL VOC 2012 train set (1464 images) and use the SBD (Hariharan et al., 2011) set as unlabeled data. It is worth noting that in Papandreou et al. (2015), image-level labels are available for the SBD (Hariharan et al., 2011) set, and in Souly et al. (2017), additional unlabeled images are generated through their generator during the training stage.
|
| 148 |
+
|
| 149 |
+
Hyper-parameter analysis. The proposed algorithm is parametrized by three hyper parameters: $\lambda _ { a d v }$ and $\lambda _ { s e m i }$ are two parameters for balancing the multi-task learning in (2), and $T _ { s e m i }$ is used to control the sensitivity in the semi-supervised learning described in (5). We evaluate these hyper parameters using the PASCAL VOC dataset under the fully/semi-supervised setting. We show comparison results of different parameter settings in Table 5. We first evaluate the effect on $\lambda _ { a d v }$ using fully-supervised setting. Note that we do not use any unlabeled data, i.e. $\lambda _ { s e m i } = 0$ . The baseline model without adversarial learning $\begin{array} { r } { { } ^ { \prime } \lambda _ { a d v } = 0 } \end{array}$ ) achieves $7 3 . 6 \%$ mean IU. When $\lambda _ { a d v } = 0 . 0 1$ , the model achieves $7 4 . 9 \%$ mean IU with $1 . 3 \%$ improvement. When $\lambda _ { a d v } = 0 . 0 5$ , the performance deprecates to $7 3 . 0 \%$ mean IU, which indicates that the adversarial loss is too large.
|
| 150 |
+
|
| 151 |
+
Second, we show comparisons of different values of $\lambda _ { s e m i }$ with 1/8 amount of data under the semisupervised setting. We set $\lambda _ { a d v } = 0 . 0 1$ and $T _ { s e m i } = 0 . 2$ for the comparisons. Overall, $\lambda _ { s e m i } = 0 . 1$ achieves the best performance of $6 8 . 8 \%$ mean IU with $1 . 2 \%$ gain.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Visualization of the confidence maps. Given the probability maps generated by the segmentation network, the confidence maps is then obtained from the discriminator. In the confidence maps, the brighter regions indicate that they are close to the ground truth distribution.
|
| 155 |
+
|
| 156 |
+
Lastly, we perform the experiments with different value of $T _ { s e m i }$ , where we set $\lambda _ { a d v } = 0 . 0 1$ and $\lambda _ { s e m i } = 0 . 1$ . High $T _ { s e m i }$ suggests that we only trust regions of high structural similarity as the ground truth distribution. We find that our proposed strategy performs well for a wide range of values $T _ { s e m i }$ (0.1 to 0.3). The method performs the best when $T _ { s e m i } = 0 . 2$ . When $T _ { s e m i } = 0$ , we trust all the pixel predictions in unlabeled images, resulting in performance degradation. In Figure 3, we show the visualization of generated confidence maps given the predicted probability maps.
|
| 157 |
+
|
| 158 |
+
Ablation study. We present the ablation study of our proposed system in Table 6 on the PASCAL VOC dataset. First, we examine the impact of using fully convolutional discriminator (FCD). To construct a discriminator that is not fully-convolutional, we replace the last convolution layer of the discriminator with a fully-connected layer that outputs a single neuron as in typical GAN models. Without using FCD, the performance drops $1 . 0 \%$ using full data and $0 . 9 \%$ with 1/8 data. This shows that the use of FCD is essential to the adversarial learning. Second, we apply the semi-supervised learning method without the adversarial loss. The results show that the adversarial training on the labeled data is important to our semi-supervised scheme. If the segmentation network does not seek to fool the discriminator, the confidence maps generated by the discriminator would be meaningless, providing weaker supervisory signals.
|
| 159 |
+
|
| 160 |
+
Table 5: Hyper parameter analysis.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Data Amount</td><td>Xadu</td><td>Xsemi</td><td>Tsemi</td><td>Mean IU</td></tr><tr><td>Full</td><td>0</td><td>0</td><td>N/A</td><td>73.6</td></tr><tr><td>Full</td><td>0.005</td><td>0</td><td>N/A</td><td>74.0</td></tr><tr><td>Full</td><td>0.01</td><td>0</td><td>N/A</td><td>74.9</td></tr><tr><td>Full</td><td>0.02</td><td>0</td><td>N/A</td><td>74.6</td></tr><tr><td>Full</td><td>0.04</td><td>0</td><td>N/A</td><td>74.1</td></tr><tr><td>Full</td><td>0.05</td><td>0</td><td>N/A</td><td>73.0</td></tr><tr><td>1/8</td><td>0.01</td><td>0</td><td>N/A</td><td>67.6</td></tr><tr><td>1/8</td><td>0.01</td><td>0.05</td><td>0.2</td><td>68.6</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>0.2</td><td>68.8</td></tr><tr><td>1/8</td><td>0.01</td><td>0.2</td><td>0.2</td><td>68.5</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>0</td><td>66.5</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>0.1</td><td>68.0</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>0.2</td><td>68.8</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>0.3</td><td>68.7</td></tr><tr><td>1/8</td><td>0.01</td><td>0.1</td><td>1.0</td><td>67.6</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 6: Ablation study of the proposed method on the PASCAL VOC dataset.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Ladu</td><td>Lsemi</td><td>FCD</td><td>Data Amount 1/8</td><td>Full</td></tr><tr><td></td><td></td><td></td><td>66.0</td><td>73.6</td></tr><tr><td>√</td><td></td><td>1</td><td>67.6</td><td>74.9</td></tr><tr><td></td><td></td><td></td><td>66.6</td><td>74.0</td></tr><tr><td></td><td>V</td><td>?</td><td>65.7</td><td>N/A</td></tr><tr><td>√</td><td></td><td></td><td>68.8</td><td>N/A</td></tr></table>
|
| 167 |
+
|
| 168 |
+
# 6 CONCLUSIONS
|
| 169 |
+
|
| 170 |
+
In this work, we propose an adversarial learning scheme for semi-supervised semantic segmentation. We train a fully convolutional discriminator network to enhance the segmentation network with both labeled and unlabeled data. With labeled data, the adversarial loss for the segmentation network is designed to learn higher order structural information without post-processing. For unlabeled data, the confidence maps generated by the discriminator network act as the self-taught signal for refining the segmentation network. Extensive experiments on the PASCAL VOC 2012 dataset and on the Cityscapes dataset are performed to validate the effectiveness of the proposed algorithm.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
|
| 175 |
+
|
| 176 |
+
Amy Bearman, Olga Russakovsky, Vittorio Ferrari, and Li Fei-Fei. What’s the point: Semantic segmentation with point supervision. In ECCV, 2016.
|
| 177 |
+
|
| 178 |
+
David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
|
| 179 |
+
|
| 180 |
+
Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. In TPAMI, 2017.
|
| 181 |
+
|
| 182 |
+
Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016.
|
| 183 |
+
|
| 184 |
+
Jifeng Dai, Kaiming He, and Jian Sun. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In ICCV, 2015.
|
| 185 |
+
|
| 186 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 187 |
+
|
| 188 |
+
Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, 2015.
|
| 189 |
+
|
| 190 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. In IJCV, 2010.
|
| 191 |
+
|
| 192 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
|
| 193 |
+
|
| 194 |
+
Bharath Hariharan, Pablo Arbeláez, Lubomir Bourdev, Subhransu Maji, and Jitendra Malik. Semantic contours from inverse detectors. In ICCV, 2011.
|
| 195 |
+
|
| 196 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 197 |
+
|
| 198 |
+
Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial and constraint-based adaptation. In arXiv preprint arXiv:1612.02649, 2016.
|
| 199 |
+
|
| 200 |
+
Seunghoon Hong, Hyeonwoo Noh, and Bohyung Han. Decoupled deep neural network for semisupervised semantic segmentation. In NIPS, 2015.
|
| 201 |
+
|
| 202 |
+
Seunghoon Hong, Donghun Yeo, Suha Kwak, Honglak Lee, and Bohyung Han. Weakly supervised semantic segmentation using web-crawled videos. In CVPR, 2017.
|
| 203 |
+
|
| 204 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 205 |
+
|
| 206 |
+
A. Khoreva, R. Benenson, J. Hosang, M. Hein, and B. Schiele. Simple does it: Weakly supervised instance and semantic segmentation. In CVPR, 2017.
|
| 207 |
+
|
| 208 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In arXiv preprint arXiv:1412.6980, 2014.
|
| 209 |
+
|
| 210 |
+
Mateusz Kozinski, Loïc Simon, and Frédéric Jurie. An adversarial regularisation for semi-supervised ´ training of structured output neural networks. In arXiv preprint arXiv:1702.02382, 2017.
|
| 211 |
+
|
| 212 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 213 |
+
|
| 214 |
+
Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. In arXiv preprint arXiv:1609.04802, 2016.
|
| 215 |
+
|
| 216 |
+
Yijun Li, Sifei Liu, Jimei Yang, and Ming-Hsuan Yang. Generative face completion. In CVPR, 2017.
|
| 217 |
+
|
| 218 |
+
Guosheng Lin, Chunhua Shen, Anton van dan Hengel, and Ian Reid. Efficient piecewise training of deep structured models for semantic segmentation. In CVPR, 2016.
|
| 219 |
+
|
| 220 |
+
Ziwei Liu, Xiaoxiao Li, Ping Luo, Chen Change Loy, and Xiaoou Tang. Semantic Image Segmentation via Deep Parsing Network. In ICCV, 2015.
|
| 221 |
+
|
| 222 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015.
|
| 223 |
+
|
| 224 |
+
Pauline Luc, Camille Couprie, Soumith Chintala, and Jakob Verbeek. Semantic segmentation using adversarial networks. In NIPS Workshop on Adversarial Training, 2016.
|
| 225 |
+
|
| 226 |
+
Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In ICML, 2013.
|
| 227 |
+
|
| 228 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, and Zhen Wang. Multi-class generative adversarial networks with the l2 loss function. arXiv preprint arXiv:1611.04076, 2016.
|
| 229 |
+
|
| 230 |
+
Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille. The Role of Context for Object Detection and Semantic Segmentation in the Wild. In CVPR, 2014.
|
| 231 |
+
|
| 232 |
+
George Papandreou, Liang-Chieh Chen, Kevin Murphy, and Alan L Yuille. Weakly-and semisupervised learning of a dcnn for semantic image segmentation. In ICCV, 2015.
|
| 233 |
+
|
| 234 |
+
Deepak Pathak, Philipp Krahenbuhl, and Trevor Darrell. Constrained convolutional neural networks for weakly supervised segmentation. In ICCV, 2015a.
|
| 235 |
+
|
| 236 |
+
Deepak Pathak, Evan Shelhamer, Jonathan Long, and Trevor Darrell. Fully convolutional multi-class multiple instance learning. In ICLR, 2015b.
|
| 237 |
+
|
| 238 |
+
Pedro O Pinheiro and Ronan Collobert. Weakly supervised semantic segmentation with convolutional networks. In CVPR, 2015.
|
| 239 |
+
|
| 240 |
+
Xiaojuan Qi, Zhengzhe Liu, Jianping Shi, Hengshuang Zhao, and Jiaya Jia. Augmented feedback in semantic segmentation under image level supervision. In ECCV, 2016.
|
| 241 |
+
|
| 242 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
|
| 243 |
+
|
| 244 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 245 |
+
|
| 246 |
+
Nasim Souly, Concetto Spampinato, and Mubarak Shah. Semi and weakly supervised semantic segmentation using generative adversarial network. In ICCV, 2017.
|
| 247 |
+
|
| 248 |
+
Xiaolong Wang, Abhinav Shrivastava, and Abhinav Gupta. A-fast-rcnn: Hard positive generation via adversary for object detection. In CVPR, 2017.
|
| 249 |
+
|
| 250 |
+
Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. In ICLR, 2016.
|
| 251 |
+
|
| 252 |
+
Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In CVPR, 2017.
|
| 253 |
+
|
| 254 |
+
Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In ICCV, 2015.
|
| 255 |
+
|
| 256 |
+
Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. In CVPR, 2017.
|
| 257 |
+
|
| 258 |
+
# A OVERVIEW
|
| 259 |
+
|
| 260 |
+
In this appendix, we present additional results of the proposed method. First, we provide the detailed training parameters for both evaluation datasets. Second, we show more qualitative comparisons of our proposed method on both the PASCAL VOC dataset (Everingham et al., 2010) and on the Cityscapes dataset (Cordts et al., 2016).
|
| 261 |
+
|
| 262 |
+
# B TRAINING PARAMETERS
|
| 263 |
+
|
| 264 |
+
Table 7: Training parameters.
|
| 265 |
+
|
| 266 |
+
<table><tr><td>Parameter</td><td>Cityscaps</td><td>PASCAL VOC</td></tr><tr><td>Trained iterations</td><td>40,000</td><td>20.000</td></tr><tr><td>Learning rate</td><td>2.5e-4</td><td>2.5e-4</td></tr><tr><td>Learning rate (D)</td><td>1e-4</td><td>1e-4</td></tr><tr><td>Polynomial decay</td><td>0.9</td><td>0.9</td></tr><tr><td>Momentum</td><td>0.9</td><td>0.9</td></tr><tr><td>Optimizer</td><td>SGD</td><td>SGD</td></tr><tr><td>Optimizer (D)</td><td>Adam</td><td>Adam</td></tr><tr><td>Nesterov</td><td>True</td><td>True</td></tr><tr><td>Batch size</td><td>2</td><td>10</td></tr><tr><td>Weight decay</td><td>0.0001</td><td>0.0001</td></tr><tr><td>Crop size</td><td>512x1024</td><td>321x321</td></tr><tr><td>Random scale</td><td>No</td><td>Yes</td></tr></table>
|
| 267 |
+
|
| 268 |
+
# C ADDITIONAL QUALITATIVE RESULTS
|
| 269 |
+
|
| 270 |
+
In Figure 4-5, we show the additional qualitative comparisons with the models using half training data of the PSCAL VOC dataset. In Figure 6, we also show the additional qualitative comparisons with the models using half training data of the Cityscapes dataset. The results show that both the adversarial learning and the semi-supervised training scheme can improve the performance of the semantic segmentation.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 4: Comparisons on the PASCAL VOC dataset using 1/2 training data.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 5: Comparisons on the PASCAL VOC dataset using $1 / 2$ training data.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 6: Comparisons on the Cityscapes dataset using 1/2 training data.
|
md/train/SJky6Ry0W/SJky6Ry0W.md
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING INDEPENDENT CAUSAL MECHANISMS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Independent causal mechanisms are a central concept in the study of causality with implications for machine learning tasks. In this work we develop an algorithm to recover a set of (inverse) independent mechanisms relating a distribution transformed by the mechanisms to a reference distribution. The approach is fully unsupervised and based on a set of experts that compete for data to specialize and extract the mechanisms. We test and analyze the proposed method on a series of experiments based on image transformations. Each expert successfully maps a subset of the transformed data to the original domain, and the learned mechanisms generalize to other domains. We discuss implications for domain transfer and links to recent trends in generative modeling.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Humans are able to recognize objects such as handwritten digits based on distorted inputs. When presented with digits which are translated, corrupted, or inverted, we can usually correctly label them without the need of re-learning them from scratch. The same applies for new objects, essentially after having seen them once. This may be due to the fact that human intelligence utilizes mechanisms (such as translation) that are generic and generalize across object classes. These mechanisms are modular, re-usable and broadly applicable, and the problem of learning them from data is fundamental for the study of transfer.
|
| 12 |
+
|
| 13 |
+
In the field of causality, the concept of independent mechanisms plays a central role both on the conceptual level and, more recently, in applications to inference. The independent mechanism (IM) assumption states that the causal generative process of a system’s variables is composed of autonomous modules that do not inform or influence each other (Scholkopf et al., 2012; Peters et al., ¨ 2017).
|
| 14 |
+
|
| 15 |
+
If a joint density is Markovian with respect to a directed graph $\mathcal { G }$ , we can write it as
|
| 16 |
+
|
| 17 |
+
$$
|
| 18 |
+
p ( \mathbf { x } ) = p ( x _ { 1 } , \ldots , x _ { d } ) = \prod _ { j = 1 } ^ { d } p ( x _ { j } | \mathbf { p } \mathbf { a } _ { \mathcal { G } } ^ { j } ) ,
|
| 19 |
+
$$
|
| 20 |
+
|
| 21 |
+
where $\mathrm { p a } _ { \mathcal { G } } ^ { j }$ denotes the parents of variable $x _ { j }$ in the graph.
|
| 22 |
+
|
| 23 |
+
For a given joint density, there are usually many decompositions of the form (1), with respect to different graphs. If $\mathcal { G }$ is a causal graph, i.e., if its edges denote direct causation (Pearl, 2000), then the conditional $\bar { p } ( x _ { j } | \mathrm { p a } _ { \mathcal { G } } ^ { j } )$ can be thought of as physical mechanism generating $x _ { j }$ from its parents, and we refer to it as a causal conditional. In this case, we consider (1) a generative model where the term “generative” truly refers to a physical generative process. As an aside, we note that in the alternative view of causal models as structural equation models, each of the causal conditionals corresponds to a functional mapping and a noise variable (Pearl, 2000).
|
| 24 |
+
|
| 25 |
+
By the IM assumption, the causal conditionals are autonomous modules that do not influence or inform each other. This has multiple consequences. First, knowledge of one mechanism does not contain information about another one (Appendix D). Second, if one mechanism changes (e.g., due to distribution shift), there is no reason that other mechanisms should also change, i.e., they tend to remain invariant. As a special case, it is (in principle) possible to locally intervene on one mechanism (for instance, by setting it to a constant) without affecting any of the other modules. In all these cases, most of (1) will remain unchanged. However, since the overall density will change, in the generic case the (non-causal) conditionals would change.
|
| 26 |
+
|
| 27 |
+
The IM assumption can be exploited when performing causal structure inference (Peters et al., 2017). However, it also has implications for machine learning more broadly. A model which is expressed in terms of causal conditionals (rather than conditionals with respect to some other factorization) is likely to have components that better transfer or generalize to other settings (Scholkopf et al., ¨ 2012), and its modules are better suited for building complex models from simpler ones. Independent modules as sub-components can be trained independently, from multiple domains, are more likely to be re-usable. They can also be easier to interpret since they correspond to physical mechanisms. Animate intelligence cannot afford to learn new models from scratch for every new task. Rather, it is likely to rely on robust local components that can flexibly be re-used and re-purposed. It also requires local mechanisms for adapting and training modules rather than re-training the whole brain every time a new task is learned.
|
| 28 |
+
|
| 29 |
+
In the present paper, we focus on a class of such modules, and on algorithms to learn them from data. We describe an architecture using competing experts specializing on different transformations. The resulting model permits a form of lifelong learning, with the possibility of easily adding, removing, retraining, and exporting its components independently.
|
| 30 |
+
|
| 31 |
+
In line with the intuition given above, we illustrate our approach on MNIST digits which have undergone different transformations such as contrast inversion, noise addition and translation. Information about the nature and number of such transformations need not be known at the beginning of training. Our goal is to identify the independent mechanisms linking a reference distribution to a distribution of modified digits, and learn to invert them without supervision. The inverse mechanisms can be used to transform modified digits and classify them using a standard MNIST classifier, thus exhibiting a form of robustness that animate intelligence excels at.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Our work mainly draws from mixtures of experts, domain adaptation, and causality.
|
| 36 |
+
|
| 37 |
+
Early works on mixture of experts date back to the early nineties (Jacobs et al. (1991), Jordan & Jacobs (1994)), and since then the topic has been subject of extensive research. Recent work include Shazeer et al. (2017), where the authors train a mixture of 1000 experts using a gating mechanism that selects only a very small number of experts for each example, and propose several technical solutions to deal with model and data parallelism. Aljundi et al. (2016) train a network of experts on multiple tasks, with a focus on lifelong learning; autoencoders are trained for each task and used as gating mechanisms.
|
| 38 |
+
|
| 39 |
+
Another research direction that is relevant to our work is unsupervised domain adaptation (Bousmalis et al., 2016). These methods often use some supervision from labeled data and/or match the two distributions in a learned feature space (Tzeng et al., 2017, e.g.).
|
| 40 |
+
|
| 41 |
+
The novelty of our work lies in the following aspects: (1) we automatically identify and invert a set of independent (inverse) causal mechanisms; (2) we do so using only data from an original distribution and from the mixture of transformed data, without labels; (3) the architecture is modular, can be easily expanded, and its trained modules can be reused; and (4) the method relies on competition of experts.
|
| 42 |
+
|
| 43 |
+
Ideas from the field of causal inference inspire the present work. Understanding the data generating mechanisms plays a key role in causal inference, and goes beyond the statistical assumptions usually exploited in machine learning. Causality provides a framework for understanding how a system responds to interventions, and causal graphical models as well as structural equation models (SEM) are common ways of describing causal systems (Pearl, 2000; Peters et al., 2017). The IM assumption discussed in the introduction can be used for identification of causal models (Daniusis ˇ et al., 2010; Zhang et al., 2015), but causality has also proven a useful tool for discussing and understanding machine learning in the non-i.i.d. regime. Recent applications include semi-supervised learning (Scholkopf et al., 2012) and transfer learning (Rojas-Carulla et al., 2015), in which the ¨ authors focus only on linear regression models. We seek to extend applications of causal inference to more complex settings and aim to learn causal mechanisms and ultimately causal SEMs without supervision.
|
| 44 |
+
|
| 45 |
+
There are close relations between our setting and recent work on deep learning for disentangling factors of variation (Chen et al., 2016; Higgins et al., 2016) as well as non-linear ICA (Hyvarinen & Morioka, 2016). In our work, causal mechanisms play the role of factors of variation. The main difference is that we currently recover inverse mechanisms as independent modular parts, instead of indentifying a joint low dimensional representation of the data without explicit separate paths for each factor.
|
| 46 |
+
|
| 47 |
+
# 3 LEARNING CAUSAL MECHANISMS AS INDEPENDENT MODULES
|
| 48 |
+
|
| 49 |
+
The aim of this section is twofold. First, we describe the generative process of our data. We start with a distribution $P$ that we will call “canonical” and an a priori unknown number of independent mechanisms which act on (examples drawn from) $P$ . At training time, a sample from the canonical distribution is available, as well as a dataset obtained by applying the mechanisms to (unseen) examples drawn from $P$ . Second, we propose an algorithm which recovers and learns to invert the mechanisms in an unsupervised fashion.
|
| 50 |
+
|
| 51 |
+
# 3.1 FORMAL SETTING
|
| 52 |
+
|
| 53 |
+
Consider a canonical distribution $P$ on $\mathbb { R } ^ { d }$ , e.g., the empirical distribution defined by MNIST digits on pixel space. We further consider $N$ measurable functions $M _ { 1 } , \dots , M _ { N } : \mathbb { R } ^ { \tilde { d } } \to \mathbb { R } ^ { d }$ , called mechanisms. We think of these as independent causal mechanisms in nature, and their number is a priori unknown. A more formal definition of independence between mechanisms is relegated to Appendix D. The mechanisms give rise to $N$ distributions $Q _ { 1 } , \ldots , Q _ { N }$ where $Q _ { j } = M _ { j } ( P )$ .1 In the MNIST example, we consider translations or adding noise as mechanisms, i.e., the corresponding $Q$ distributions are translated and noisy MNIST digits.
|
| 54 |
+
|
| 55 |
+
At training time, we receive a dataset $\mathcal { D } _ { Q } = ( x _ { i } ) _ { i = 1 } ^ { n }$ drawn i.i.d. from a mixture of $Q _ { 1 } , \ldots , Q _ { N }$ , and an independent sample $\mathcal { D } _ { P }$ from the canonical distribution $P$ . Our goal is to identify the underlying mechanisms $M _ { 1 } , \dots , M _ { N }$ and learn approximate inverse mappings which allow us to map the examples from $\mathcal { D } _ { Q }$ back to their counterpart drawn from $P$ .
|
| 56 |
+
|
| 57 |
+
If we were given distinct datasets $\mathcal { D } _ { Q _ { j } }$ each drawn from $Q _ { j }$ , we could individually learn each mechanism, resulting in independent approximations regardless of the properties of the training procedure. This is due to the fact that the datasets are drawn from independent mechanisms and the separate training procedure cannot generate a dependence between them. This property is independent of properties of training, and does not require that the procedure is successful, i.e., that the obtained mechanisms approximate the true $M _ { j }$ in some metric. In our case, we do not have access to the distinct datasets. Instead we construct a larger set $\mathcal { D } _ { Q }$ by first taking the union of the sets $D _ { Q _ { j } }$ , and then applying a random permutation. This corresponds to a dataset where each element has been generated by one of the (independent) mechanisms, but we don’t know by which one. Clearly, it should be harder to identify and learn independent mechanisms from such a dataset. This is the setting we address below, and the crucial idea will be that of competition.
|
| 58 |
+
|
| 59 |
+
# .2 COMPETITIVE LEARNING OF INDEPENDENT MECHANISMS
|
| 60 |
+
|
| 61 |
+
In this section, we introduce our training protocol to address the problem defined above.
|
| 62 |
+
|
| 63 |
+
The training machine is composed of $N ^ { \prime }$ parametric functions $E _ { 1 } , \ldots , E _ { N ^ { \prime } }$ with distinct trainable parameters $\theta _ { 1 } , \ldots , \theta _ { N ^ { \prime } }$ . We refer to these functions as the experts. Note that we do not require $N ^ { \prime } = N$ , since the real number of mechanisms is unknown a priori. The goal is to maximize an objective function $c : \mathbb { R } ^ { d } \mathbb { R }$ with the key property that $c$ takes high values on the support of the canonical distribution $P$ , and low values outside. Note that it is possible for $c$ to be a parametric function, and for these parameters to be jointly optimized with the experts during training. Below, we specify the details of this rather general definition.
|
| 64 |
+
|
| 65 |
+
During training, the experts compete for the data points. Each example $x ^ { \prime }$ from $\mathcal { D } _ { Q }$ is fed to all experts independently and in parallel. Depending on the output of each expert $c _ { j } \ = \ c ( E _ { j } ( x ^ { \prime } ) )$ , we select the winning expert $E _ { j ^ { * } }$ , where $j ^ { * } = \arg \operatorname* { m a x } _ { j } ( c _ { j } )$ . $E _ { j ^ { * } }$ wins the example $x ^ { \prime }$ , and its parameters $\theta _ { j ^ { * } }$ are updated as to maximize $c ( E _ { j ^ { * } } ( x ^ { \prime } ) )$ , while the other experts remain unchanged. The motivation behind competitively updating only the winning expert is to enforce specialization; the best performing expert becomes even better at mapping $x ^ { \prime }$ back to the corresponding sample from the canonical distribution. Figure 1 depicts this procedure. Overall, our optimization problem reads
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 1: We show how a transformed example, here a noisy digit, is processed by a competition of experts. Only Expert 3 is specializing on denoising, it wins the example and gets trained on it, whereas the others perform translations and are not updated.
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\theta _ { 1 } ^ { * } , \ldots , \theta _ { N ^ { \prime } } ^ { * } = \underset { \theta _ { 1 } , \ldots , \theta _ { N ^ { \prime } } } { \arg \operatorname* { m a x } } \mathbb { E } _ { x ^ { \prime } \sim Q } \left( \operatorname* { m a x } _ { j \in \{ 1 , \ldots , N ^ { \prime } \} } c ( E _ { \theta _ { j } } ( x ^ { \prime } ) ) \right) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The training described above raises a number of questions, which we address next.
|
| 75 |
+
|
| 76 |
+
1. Convergence criterion. Since the problem is fully unsupervised, there is no straightforward way of measuring convergence, which raises the question of how to choose a stopping time for the competitive procedure. As an example, one may act according to one of the following: $a$ ) fix a maximum number of iterations or $^ b$ ) stop if each example is assigned to the same experts for a pre-defined number of iterations (i.e., each expert consistently wins the same data points).
|
| 77 |
+
|
| 78 |
+
2. Selecting the appropriate number of experts. Generally, the number of mechanisms $N$ which generated the dataset $\mathcal { D } _ { Q }$ is not available a priori. Therefore, it is important to develop an adaptive procedure for setting up the number of experts $N ^ { \prime }$ . This is a common problem shared with most clustering techniques. Given the modular behavior of the procedure, experts may be added or removed during or after training, making the framework very flexible. Assuming however that the number of experts is fixed, we speculate that the following behaviors are likely.
|
| 79 |
+
|
| 80 |
+
If $N ^ { \prime } > N$ (too many experts): a) some of the experts do not specialize and do not win any example in the dataset; or b) some tasks are divided between experts (for instance, each expert can specialize in a mode of the distribution of the same task). In a), the inactive experts can be removed, and in b) experts sharing the same task can be merged into a wider expert.2
|
| 81 |
+
|
| 82 |
+
If $N ^ { \prime } < N$ (too few experts): a) some of the experts specialize in multiple tasks or b) some of the tasks are not learned by the experts, so that data points from such tasks lead to a poor score across all experts.
|
| 83 |
+
|
| 84 |
+
While these questions are relevant, we do not develop them in detail and leave them for further research. Some experiments substantiating these claims can be found in Appendix A.2.
|
| 85 |
+
|
| 86 |
+
3. Time and space complexity. Each example has to be evaluated by all experts in order to assign it to the winning expert. While this results in a computational cost that depends linearly on the number of experts, these evaluations can be done in parallel and therefore the time complexity of a single iteration can be bounded by the complexity to compute the output of a single expert. Moreover, as each expert will in principle have a smaller architecture than a single large network, the committee of experts will typically be faster to execute.
|
| 87 |
+
|
| 88 |
+
Concrete protocol for neural networks. One possible model class for the experts are deep neural networks. Training using backpropagation is particularly well suited for the online nature of the training proposed: after an expert wins a data point $x ^ { \prime }$ , its parameters are updated by backpropagation, while other experts remain untouched. Moreover, recent advances in generative modeling give rise to natural choices for the loss function $c$ . For instance, given a variational autoencoder (VAE) (Kingma & Welling, 2013) trained on the canonical distribution $P$ , one may define $c ( x ^ { \prime } )$ as the opposite of the VAE loss. The assumption is that the loss will only be low for examples drawn from $P$ . Another possibility is to use adversarial training (Goodfellow et al., 2014), and use as an objective function the output of a discriminator network trained on the canonical sample $\mathcal { D } _ { P }$ and against the outputs of the experts. In the next section we introduce a formal description of a training procedure based on adversarial training in Algorithm 1, and present experimental evidence of its good performance.
|
| 89 |
+
|
| 90 |
+
# 4 EXPERIMENTS
|
| 91 |
+
|
| 92 |
+
In this set of experiments we test the method presented in Section 3 on the MNIST dataset transformed with the set of mechanisms described in detail in the Appendix C, i.e. eight directions of translations by 4 pixels (up, down, left, right, and the four diagonals), contrast inversion, addition of noise, for a total of 10 transformations. We split the training partition of MNIST in half, and transform all and only the examples in the first half: this ensures that there is no matching ground truth for the experts to learn the mechanisms, and that learning is fully unsupervised. As a preprocessing step, the digits are zero-padded so that they have size $3 2 \times 3 2$ pixels, and the pixel intensities are scaled between 0 and 1. This is done even before any mechanism is applied. We use deep neural networks for both the experts and the selection mechanism, and use an adversarial training scheme.
|
| 93 |
+
|
| 94 |
+
Each expert $E _ { i }$ can be seen as a generator from a GAN, that is conditioned on an input image instead of (or in addition to) a noise vector. A discriminator $D$ provides gradients for training the experts and acts also as a selection mechanism $c$ : only the expert whose output obtains the higher score from $D$ wins the example, and is trained on it to maximize the output of $D$ . We describe the exact algorithm used to train the networks in these experiments in Algorithm 1. The discriminator is trained to maximize the following cross-entropy loss:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\operatorname* { m a x } _ { \theta _ { D } } \left( \mathbb { E } _ { x \sim P } \log ( D _ { \theta _ { D } } ( x ) ) + \frac { 1 } { N ^ { \prime } } \sum _ { j = 1 } ^ { N ^ { \prime } } \mathbb { E } _ { x ^ { \prime } \sim Q } \left( \log ( 1 - D _ { \theta _ { D } } ( E _ { \theta _ { j } } ( x ^ { \prime } ) ) ) \right) \right)
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
For simplicity, we assume for the rest of this section that the number of experts $N ^ { \prime }$ equals the number of true mechanisms $N$ . Results where $N \neq N ^ { \prime }$ are relegated to Appendix A.2.
|
| 101 |
+
|
| 102 |
+
Neural nets details. Each expert is a CNN with five convolutional layers, 32 filters per layer of size $3 \times 3$ , ELU (Clevert et al. (2015)) as activation function, batch normalization (Ioffe & Szegedy (2015)), and zero padding. The discriminator is also a CNN, with average pooling every two convolutional layers, growing number of filters, and a fully connected layer with 1024 neurons as last hidden layer. Both networks are trained using Adam as optimizer (Kingma & Ba (2014)), with the default hyper-parameters.3
|
| 103 |
+
|
| 104 |
+
Unless specified otherwise, after a random weight initialization we first train the experts to approximate the identity mapping on our data, by pretraining them for up to 200 iterations on predicting identical input-output pairs randomly selected from the transformed dataset. This makes the experts start from similar grounds, and we found that this improved the speed and robustness of convergence. We will refer to this as approximate identity initialization for the rest of the paper.
|
| 105 |
+
|
| 106 |
+
<table><tr><td>Algorithm1 Learning independent mechanisms using competition of experts and adversarial training</td></tr><tr><td>Precondition: X: data sampled from P; X': data sampled from DQ; D discriminator; N': number of experts; T: maximum number of iterations;</td></tr><tr><td>(p) highlights that the steps in the instruction can be executed in parallel</td></tr><tr><td>1{E←TrainNewAutoencoderOn(X)}1 > Init set of experts as approx identity (p)</td></tr><tr><td>2 fort←1toTdo x,x' ← Sample(X), Sample(X') > Sample minibatches</td></tr><tr><td>{cj←D(Ej(x)}1 > Scores from D for all outputs from the experts (p)</td></tr><tr><td></td></tr><tr><td>{B←Adam(axjg))</td></tr></table>
|
| 107 |
+
|
| 108 |
+
A minibatch of 32 transformed MNIST digits, each transformed by a randomly chosen mechanism, is fed to all experts $E _ { i }$ . The outputs are fed to the discriminator $D$ , which computes a score for each of them. For each example the cross entropy loss in Equation (3) and the resulting gradients are computed only for the output of the highest scoring expert, and they are used to update both the discriminator (when 0 is the target in the cross entropy) and the winning expert (when using 1 as the target). In order to encourage the expert to specialize, the discriminator is also explicitly trained against the outputs of the losing experts. Then, a minibatch of canonical MNIST digit is used in order to update the discriminator with ‘real’ data.
|
| 109 |
+
|
| 110 |
+
We ran the experiments 10 times with different random seeds for the initializations. Each experiment is run for 2000 iterations.
|
| 111 |
+
|
| 112 |
+
# 5 RESULTS
|
| 113 |
+
|
| 114 |
+
The experts correctly specialized on inverting exactly one mechanism each in 7 out of the 10 runs; in the remaining 3 runs the results were only slightly suboptimal: one expert specialized on two tasks, one expert did not specialize on any, and the remaining experts still specialized on one task each, thus still covering all the existing tasks. In Figure 2 we show a randomly selected batch of inputs and corresponding outputs from the model. Each independent mechanism was inverted by a different expert.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: The top row contains 16 random inputs to the networks, and the bottom row the corresponding outputs from the highest scoring experts against the discriminator after 1000 iterations.
|
| 118 |
+
|
| 119 |
+
First, we discuss the three major aspects of our results followed by additional experiments.
|
| 120 |
+
|
| 121 |
+
1. The experts specialize w.r.t. $c$ . We encourage the reader to look at Figure 6 in Appendix A.1, where we plot the scores assigned by the discriminator for each expert on each task in a typical successful run. The figure shows that after an initial chaotic phase of heavy competition, the experts exhibit the desired behavior and obtain a high score on $D$ on one mechanism each. Figure 3 provides further evidence, by visualising that the clusters induced by $c$ are meaningful. We report the proportion of examples from each task assigned to each expert at the beginning and at the end of training. At first, a couple of experts win most examples from all tasks. By the end of the training, each expert wins almost all examples coming from one transformation, and no other.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 3: The proportion of data won by each expert for each transformation on the digits from the test set.
|
| 125 |
+
|
| 126 |
+
2. The transformed outputs improve a classifier. In order to test if the committee of experts can overall recover a good approximation of the original digits, we test the output of our experts against a pretrained MNIST classifier. For this, we use the test partition of the data. We compute the accuracy for three inputs: $a$ ) the transformed test digits, $b$ ) the transformed digits after being processed by the highest scoring experts, $c$ ) the original test digits. The latter can be seen as an upper bound to the accuracy that can be achieved.
|
| 127 |
+
|
| 128 |
+
As shown by the two dashed horizontal lines in Figure 4, the transformed test digits achieve a $40 \%$ accuracy when tested directly on the classifier, while the untransformed digits would achieve $\approx 9 9 \%$ accuracy. The accuracy for the output digits also starts at $40 \%$ — due to the identity initialization — and quickly matches the performance of the original digits as it is trained. Note also that after about 600 iterations — i.e. as the networks have seen overall about one third of the whole dataset, and once only — the accuracy is already almost at the upper bound.
|
| 129 |
+
|
| 130 |
+
3. The experts learn mechanisms. Finally, we test the networks on inputs that were not transformed with the mechanisms that each of them has learned to invert. As shown in Figure 5, each network consistently applies the same transformation also on inputs outside of its training distribution, and therefore the experts not only recovered the correct digits for the domain they have specialized on, but indeed learned the independent mechanisms. Since the experts are fully convolutional networks in this experiment, they could be even be ported to other domains with images of different sizes.
|
| 131 |
+
|
| 132 |
+
Effect of the approximate identity initialization. When running the same experiments without the approximate identity initialization, we found that often several experts fail to specialize. Out of 10 new runs with random initialization, only one experiment had arguably good results, with eight experts specializing on one task each, one expert on two tasks, and the last expert on none. The performance was worse in the remaining runs. We tested whether the problem was that the algorithm takes longer to converge following a random initialization, and ran one additional experiment for 10 000 iterations. The results did not improve.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 4: Accuracy on the transformed test digits $\mathcal { D } _ { Q }$ of a pretrained CNN MNIST classifier, on the same digits after going through our model, and on the original digits before transformation $\mathcal { D } _ { P }$ (here $\mathcal { D } _ { P }$ corresponds to the ground truth images in $\mathcal { D } _ { Q }$ for the true applied mechanisms).
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Each column shows how each expert transforms the input presented on top. We arrange the tasks such that on the diagonal there is the highest scoring expert for the input given at the top of the column. It is evident that the experts have learned the mechanisms, as they consistently apply them to digits outside of their training domain.
|
| 139 |
+
|
| 140 |
+
A simple single-net baseline. Training a single network instead of a committee of experts makes the problem more difficult to solve. Using identical training settings, we trained a single network once with 32, once with 64, and once with 128 filters per layer, and none of them managed to correctly learn more than one inverse mechanism.4 Note that a single network with 128 filters per layer has about twice as many parameters overall than the committee of 10 experts with 32 filters per layer each. We also tried random initialization instead of the approximate identity, to reduce the learning rate of the discriminator by a factor of 10, and to increase the receptive field by adding two pooling and two upsampling layers, without any improvement. While we do not exclude that careful hyperparameter tuning may enable a single net to learn multiple mechanisms, it is not entirely straightforward in our experiment.
|
| 141 |
+
|
| 142 |
+
Specialization occurs also with higher capacity experts. While in principle with infinite capacity and data a single expert could solve all tasks simultaneously, in practice limited resources and the proposed training procedure favor specialization in independent modules. Increasing the size of the experts from 32 filters per layer to 64 or 128 filters5 or enlarging the overall receptive field by using two pooling and two upsampling layers, still results in good specialization of the experts, with no more than two experts specializing on up to two tasks at once.
|
| 143 |
+
|
| 144 |
+
Fewer examples from the canonical distribution. In many applications, we might only have a small sample from the original distribution. Interestingly, we found that all experts still specialize to different tasks and recover good approximations of the inverse mechanisms when we reduce the number of examples from the original distribution from 30 000 down to $6 4 ^ { 6 }$ . Even though the output digits are not as clean and sharp, we still achieve $96 \%$ accuracy on the pretrained classifier before the discriminator starts to overfit.
|
| 145 |
+
|
| 146 |
+
# 6 CONCLUSIONS
|
| 147 |
+
|
| 148 |
+
We have developed a method to identify and learn a set of independent causal mechanisms. In the present work, these are inverse mechanisms, but an extension to forward mechanisms appears feasible and worthwhile. We reported promising results in an experiment based on image transformations; future work could study more complex settings and diverse domains.
|
| 149 |
+
|
| 150 |
+
A natural extension of our work is to consider independent mechanisms that simultaneously affect the data (e.g. lighting and position in a portrait), and to allow multiple passes through our committee of experts to identify local mechanisms (akin to Lie derivatives) from more complex datasets — for instance, using recurrent neural network that allow the application of multiple mechanisms by iteration.
|
| 151 |
+
|
| 152 |
+
Note that for large numbers of experts, the computational cost might become unnecessarily high. This could be mitigated by hybrid approaches incorporating gated mixture of experts — which may exhibit lower computational complexity — or a hierarchical selection of competing experts.
|
| 153 |
+
|
| 154 |
+
We believe our work constitutes a relevant connection between causal modeling and deep learning. As discussed in the introduction, causality has a lot to offer for crucial machine learning problems such as transfer or compositional modeling. Our systems illustrates some of these properties. Independent modules as sub-components could be trained independently and/or from multiple domains, added subsequently, and transferred to other problems. This may constitute a step towards causally motivated life-long learning.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. arXiv preprint arXiv:1611.06194, 2016.
|
| 159 |
+
|
| 160 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. arXiv preprint arXiv:1612.05424, 2016.
|
| 161 |
+
|
| 162 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2172–2180, 2016.
|
| 163 |
+
|
| 164 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 165 |
+
|
| 166 |
+
P. Daniusis, D. Janzing, J. Mooij, J. Zscheischler, B. Steudel, K. Zhang, and B. Sch ˇ olkopf. Inferring ¨ deterministic causal relations. In P. Grunwald and P. Spirtes (eds.), ¨ 26th Conference on Uncertainty in Artificial Intelligence, pp. 143–150, Corvallis, OR, 2010. AUAI Press.
|
| 167 |
+
|
| 168 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 169 |
+
|
| 170 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
|
| 171 |
+
|
| 172 |
+
Aapo Hyvarinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ica. In Advances in Neural Information Processing Systems, pp. 3765–3773, 2016.
|
| 173 |
+
|
| 174 |
+
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.
|
| 175 |
+
|
| 176 |
+
Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 177 |
+
|
| 178 |
+
D. Janzing and B. Scholkopf. Causal inference using the algorithmic Markov condition. ¨ IEEE Transactions on Information Theory, 56(10):5168–5194, 2010.
|
| 179 |
+
Michael I Jordan and Robert A Jacobs. Hierarchical mixtures of experts and the em algorithm. Neural computation, 6(2):181–214, 1994.
|
| 180 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 181 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 182 |
+
Judea. Pearl. Causality. Cambridge University Press, 2000.
|
| 183 |
+
Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. ¨ Elements of Causal Inference. The MIT Press, 2017.
|
| 184 |
+
Mateo Rojas-Carulla, Bernhard Scholkopf, Richard Turner, and Jonas Peters. Causal transfer in ¨ machine learning. arXiv preprint arXiv:1507.05333, 2015.
|
| 185 |
+
B. Scholkopf, D. Janzing, J. Peters, E. Sgouritsa, K. Zhang, and J. M. Mooij. On causal and anticausal ¨ learning. In J Langford and J Pineau (eds.), Proceedings of the 29th International Conference on Machine Learning (ICML), pp. 1255–1262, New York, NY, USA, 2012. Omnipress.
|
| 186 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 187 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. arXiv preprint arXiv:1702.05464, 2017.
|
| 188 |
+
Kun Zhang, Jiji Zhang, and Bernhard Scholkopf. Distinguishing cause from effect based on exogene- ¨ ity. arXiv preprint arXiv:1504.05651, 2015.
|
| 189 |
+
|
| 190 |
+
# A ADDITIONAL RESULTS.
|
| 191 |
+
|
| 192 |
+
# A.1 PLOT OF COMPETING EXPERTS.
|
| 193 |
+
|
| 194 |
+
Each expert in Figure 6 is represented with the same color and linestyle across all tasks. Note how the red expert tries to learn two similar tasks until iteration 500 (i.e. left and up-left translation), when the green expert takes over one of the task and they can then both quickly specialize.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 6: Each line style is associated to the score that an expert obtains on the discriminator when being fed transformed digits using one of the mechanisms. Each expert learns to specialize on a different mechanism. Each curve is smoothed with an average of the last 50 iterations for ease of visualization.
|
| 198 |
+
|
| 199 |
+
# A.2 TOO MANY OR TOO FEW EXPERTS.
|
| 200 |
+
|
| 201 |
+
Too many experts When there are too many experts, for most tasks only one wins all the examples, as shown in Figure 7 where the model has 16 experts for 10 tasks. The remaining experts either do not specialize at all — and therefore can be removed from the architecture — or specialize on the same task, and could therefore be combined if after inspection they are considered to perform the same task. Since the accuracy on the transformed data tested on the pretrained classifier reaches again the upperbound of the untransformed data, and since the progress is very similar to that illustrated in Figure 4, we omit this plot.
|
| 202 |
+
|
| 203 |
+
Too few experts For a committee of 6 experts, the networks do not reconstruct properly most of the digits, which is reflected by an overall low objective function value on the data. Also, the score against the classifier that does not exceed $72 \%$ . A few experts are inevitably assigned to multiple tasks, and by looking at Figure 7 it is interesting to see that the clustering result is still meaningful (e.g. expert 5 is assigned to left, down-left, and up-left translation).
|
| 204 |
+
|
| 205 |
+
# B DETAILS OF NEURAL NETWORKS
|
| 206 |
+
|
| 207 |
+
In Table 1 we report the configuration of the neural networks used in these experiments.
|
| 208 |
+
|
| 209 |
+
# C TRANSFORMATIONS
|
| 210 |
+
|
| 211 |
+
In our experiments we use the following transformations
|
| 212 |
+
|
| 213 |
+
• Translations: the image is shifted by 4 pixels in one of the eight directions up, down, left, right and the four diagonals.
|
| 214 |
+
• contrast (or color) inversion: the value of each pixel — originally in the range $[ 0 , 1 ]$ — is recomputed as $1 -$ the original value.
|
| 215 |
+
• Noise addition: random Gaussian noise with zero mean and variance 0.25 is added to the original image, which is then clamped again to the [0, 1] interval.
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Figure 7: The proportion of data won by each expert for each transformation on the digits from the 0.0 test set, for the case of 10 mechanisms and more experts (16 on left) or too few (6 on the right).
|
| 219 |
+
|
| 220 |
+
Table 1: Architectures of the neural networks used in the experiment section. BN stands for Batch normalization, FC for fully connected. All convolutions are preceded by a 1 pixel zero padding.
|
| 221 |
+
|
| 222 |
+
<table><tr><td colspan="2">Expert</td></tr><tr><td>Layers</td><td></td></tr><tr><td>3 × 3,32,BN,ELU 3 × 3,32, BN,ELU</td><td></td></tr><tr><td>3 × 3,32, BN, ELU 3 × 3,32, BN, ELU</td><td></td></tr><tr><td>3 × 3,1, sigmoid</td><td></td></tr></table>
|
| 223 |
+
|
| 224 |
+
<table><tr><td rowspan=1 colspan=1>Discriminator</td></tr><tr><td rowspan=1 colspan=1>Layers</td></tr><tr><td rowspan=1 colspan=1>3 × 3,16,ELU</td></tr><tr><td rowspan=1 colspan=1>3 × 3,16,ELU3 × 3,16, ELU</td></tr><tr><td rowspan=1 colspan=1> 2 × 2, avg pooling</td></tr><tr><td rowspan=1 colspan=1>3 × 3,32, ELU3 × 3,32, ELU</td></tr><tr><td rowspan=1 colspan=1> 2 × 2, avg pooling</td></tr><tr><td rowspan=1 colspan=1>3 × 3,64, ELU3 × 3,64, ELU</td></tr><tr><td rowspan=1 colspan=1> 2 × 2, avg pooling</td></tr><tr><td rowspan=1 colspan=1>1024, FC, ELU1, FC, sigmoid</td></tr></table>
|
| 225 |
+
|
| 226 |
+
# D NOTES ON THE FORMALIZATION OF INDEPENDENCE OF MECHANISMS
|
| 227 |
+
|
| 228 |
+
In this section we briefly discuss the notion of independence of mechanisms as in (Janzing & Scholkopf, 2010), where the independence principle is formalized in terms of algorithmic complexity ¨ (also known as Kolmogorov complexity). We summarize the main points needed in the present context. We parametrize each mechanism by a bit string $x$ . The Kolmogorov complexity $K ( \bar { x } )$ of $x$ is the length of the shortest program generating $x$ on an a priori chosen universal Turing machine.
|
| 229 |
+
|
| 230 |
+
The algorithmic mutual information can be defined as $I ( x : y ) : = K ( x ) + K ( y ) - K ( x , y )$ , and it can be shown to equal
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
I ( x : y ) = K ( y ) - K ( y | x ^ { * } ) ,
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
where for technical reasons we need to work with $x ^ { * }$ , the shortest description of $x$ (which is in general uncomputable). Here, the conditional Kolmogorov complexity $K ( y | x )$ is defined as the length of the shortest program that generates $y$ from $x$ . The algorithmic mutual information measures the algorithmic information two objects have in common. We define two mechanisms to be (algorithmically) independent whenever the length of the shortest description of the two bit strings together is not shorter than the sum of the shortest individual descriptions (note it cannot be longer), i.e., if their algorithmic mutual information vanishes.7 In view of (4), this means that
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
K ( y ) = K ( y | x ^ { * } ) .
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
We will say that two mechanisms $x$ and $y$ are independent whenever the complexity of the conditional mechanism $y | x$ is comparable to the complexity of the unconditional one $y$ . If, in contrast, the two mechanisms were closely related, then we would expect that we can mimic one of the mechanisms by applying the other one followed by a low complexity conditional mechanism.
|
| 243 |
+
|
| 244 |
+
This can be implemented by having a complexity measure for, say, neural networks, and comparing the complexities of neural nets that are trained to perform certain tasks. Inspired by regularization theory, we could measure complexity by inverse regularization strength or weight vector norm. An alternative way to regularize neural nets consists of early stopping. If we fix the number of training epochs to a constant, and find that network 1 reaches a lower error than network 2, we conclude that the network 2 would take longer to reach the same low error, and thus network 2 requires higher effective complexity to solve its task than network 1. We have run preliminary experiments with this measure and found that (1) indeed our training procedure did increase independence, and (2) the independence between two different mechanism was larger than the independence between one mechanism and the identity.
|
md/train/SJzwb2RcK7/SJzwb2RcK7.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVERSARIAL DECOMPOSITION OF TEXT REPRESENTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we present a method for adversarial decomposition of text representation. This method can be used to decompose a representation of an input sentence into several independent vectors, where each vector is responsible for a specific aspect of the input sentence. We evaluate the proposed method on two case studies: the conversion between different social registers and diachronic language change. We show that the proposed method is capable of fine-grained controlled change of these aspects of the input sentence. For example, our model is capable of learning a continuous (rather than categorical) representation of the style of the sentence, in line with the reality of language use. The model uses adversarial-motivational training and includes a special motivational loss, which acts opposite to the discriminator and encourages a better decomposition. Finally, we evaluate the obtained meaning embeddings on a downstream task of paraphrase detection and show that they are significantly better than embeddings of a regular autoencoder.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Despite the recent successes in using neural models for representation learning for natural language text, learning a meaningful representation of input sentences remains an open research problem. A variety of approaches, from sequence-to-sequence models that followed the work of Sutskever et al. (2014) to the more recent proposals (Arora et al., 2017; Nangia et al., 2017; Conneau et al., 2017; Logeswaran & Lee, 2018; Subramanian et al., 2018; Cer et al., 2018) share one common drawback. Namely, all of them encode the input sentence into just one single vector of a fixed size. One way to bypass the limitations of a single vector representation is to use an attention mechanism (Bahdanau et al., 2014; Vaswani et al., 2017). We propose to approach this problem differently and design a method for adversarial decomposition of the learned input representation into multiple components. Our method encodes the input sentence into several vectors, where each vector is responsible for a specific aspect of the sentence.
|
| 12 |
+
|
| 13 |
+
In terms of learning different separable components of input representation, our work most closely relates to the style transfer work, which has been applied to a variety of different aspects of language, from diachronic language differences (Xu et al., 2012) to authors’ personalities (Lipton et al., 2015) and even sentiment (Hu et al., 2017; Fu et al., 2017). The style transfer work effectively relies on the more classical distinction between meaning and form (de Saussure, 1959), which accounts for the fact that multiple surface realizations are possible for the same meaning. For simplicity, we will use this terminology throughout the rest of the paper.
|
| 14 |
+
|
| 15 |
+
Consider the case when we encode an input sentence into a meaning vector and a form vector. We are then able to perform a controllable change of meaning or form by a simple change applied to these vectors. For example, we can encode two sentences written in two different styles, then swap the form vectors while leaving the meaning vectors intact. We can then generate new unique sentences with the original meaning, but written in a different style.
|
| 16 |
+
|
| 17 |
+
In the present work, we propose a novel model for this type of decomposition based on adversarialmotivational training and design an architecture inspired by the GANs (Goodfellow et al., 2014) and adversarial autoencoders (Makhzani et al., 2015). In addition to the adversarial loss, we use a special motivator (Albanie et al., 2017), which, in contrast to the discriminator, is used to provide a motivational loss to encourage the model to better decomposition of the meaning and the form, as well as specific aspects of meaning. We make all the code publicly available on GitHub 1.
|
| 18 |
+
|
| 19 |
+
We evaluate the proposed methods for learning separate aspects of input representation on the following case studies:
|
| 20 |
+
|
| 21 |
+
1. Learning to separate out a representation of the specific diachronic slice of language. One may express the same meaning using the Early Modern English (e.g. What would she have?) and the contemporary English ( What does she want?)
|
| 22 |
+
2. Learning a representation for a social register (Halliday et al., 1968) – that is, subsets of language appropriate in a given context or characteristic of a certain group of speakers. These include formal and informal language, the language used in different genres (e.g., fiction vs. newspapers vs. academic texts), different dialects, and even literary idiostyles. We experiment with the registers corresponding to the titles of scientific papers vs. newspaper articles.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
As mentioned above, the most relevant previous work comes from the style transfer research, and it can be divided into two groups:
|
| 27 |
+
|
| 28 |
+
1. Approaches that aim to generate text in a given form. For example, the task may be to produce just any verse as long as it is in the “style” of the target poet. 2. Approaches that aim to induce a change in either the “form” or the “meaning” of an existing utterance. For example, “Good bye, Mr. Anderson.” can be transformed to “Fare you well, good Master Anderson” (Xu et al., 2012)).
|
| 29 |
+
|
| 30 |
+
An example of the first group is the work by Potash et al. (2015), who trained several separate networks on verses by different hip-hip artists. An LSTM network successfully generated verses that were stylistically similar to the verses of the target artist (as measured by cosine distance on TfIdf vectors). More complicated approaches use language models that are conditioned in some way. For example, Lipton et al. (2015) produced product reviews with a target rating by passing the rating as an additional input at each timestep of an LSTM model. Tang et al. (2016) generated reviews not only with a given rating but also for a specific product. At each timestep a special context vector was provided as input, gated so as to enable the model to decide how much attention to pay to that vector and the current hidden state. Li et al. (2016) used “speaker” vectors as an additional input to a conversational model, improving consistency of dialog responses. Finally, Ficler & Goldberg (2017) performed an extensive evaluation of conditioned language models based on “content” (theme and sentiment) and “style” (professional, personal, length, descriptiveness). Importantly, they showed that it is possible to control both “content” and “style” simultaneously.
|
| 31 |
+
|
| 32 |
+
Work from the second group can further be divided into two clusters by the nature of the training data: parallel aligned corpora, or non-aligned datasets. The aligned corpora enable approaching the problem of form shift as a paraphrasing or machine translation problem. Xu et al. (2012) used statistical and dictionary-based systems on a dataset of original plays by Shakespeare and their contemporary translations. Carlson et al. (2017) trained an LSTM network on 33 versions of the Bible. Jhamtani et al. (2017) used a Pointer Network (Vinyals et al., 2015), an architecture that was successfully applied to a wide variety of tasks (Merity et al., 2016; Gulcehre et al., 2016; Potash et al., 2017), to enable direct copying of the input tokens to the output. Note that these works use BLEU (Papineni et al., 2002) as the main, or even the only evaluation measure. This is only possible in cases where a parallel corpus is available.
|
| 33 |
+
|
| 34 |
+
Recently, new approaches that do not require a parallel corpora were developed in both CV (Zhu et al., 2017) and NLP. Hu et al. (2017) succeeded in changing tense and sentiment of sentences with a two steps procedure based on a variational auto-encoder (VAE) (Kingma & Welling, 2013). After training a VAE, a discriminator and a generator are trained in an alternate manner, where the discriminator tries to correctly classify the target sentence attributes. A special loss component forces the hidden representation of the encoded sentence to not have any information about the target sentence attributes. Mueller et al. (2017) used a VAE to produce a hidden representation of a sentence, and then modify it to match the desired form. Unlike Hu et al. (2017), they do not separate the form and meaning embeddings. Shen et al. (2017) applied a GAN to align the hidden representation of sentences from two corpora and force them to do not have any information about the form via adversarial loss. During the decoding, similarly the work by Lipton et al. (2015), special “style” vectors are passed to the decoder at every timestep to produce a sentence with the desired properties. The model is trained using the Professor-Forcing algorithm (Lamb et al., 2016). Kim et al. (2017) worked directly on hidden space vectors that are constrained with the same adversarial loss instead of outputs of the generator, and use two different generators for two different “styles”. Finally, Fu et al. (2017) proposed two models for generating sentences with the target properties using an adversarial loss, similarly to Shen et al. (2017) and Kim et al. (2017).
|
| 35 |
+
|
| 36 |
+
Comparison with previous work In contrast to the proposals of $\mathrm { X u }$ et al. (2012), Carlson et al. (2017), Jhamtani et al. (2017), our solution does not require a parallel corpus. Furthermore, unlike the model by Shen et al. (2017), our model works directly on representation of sentences in the hidden space.
|
| 37 |
+
|
| 38 |
+
Most importantly, in contrast to the proposals by Mueller et al. (2017), Hu et al. (2017), Kim et al. (2017), Fu et al. (2017), our model produces a representation for both meaning and form and does not treat the form as a categorical (in the vast majority of works, binary) variable. Although the form was represented as dense vectors in previous work, it is still just a binary feature, as they use a single pre-defined vector for each form, with all sentences of the same form assigned the same form vector. In contrast, our work treats form as a truly continuous variable, where each sentence has its own, unique, form vector.
|
| 39 |
+
|
| 40 |
+
Treating meaning and form not as binary/categorical, but as continuous is more consistent with the reality of language use, since there are different degrees of overlap between the language used by different registers or in different diachronic slices. Indeed, language change is gradual, and the acceptability of expressions in a given register also forms a continuum, so one expects a substantial overlap between the grammar and vocabulary used, for example, on Twitter and by New York Times. To the best of our knowledge, this is the first model that considers linguistic form in the task of text generation as a continuous variable.
|
| 41 |
+
|
| 42 |
+
One significant consequence of learning a continuous representation for form is that it allows the model to work with a large, and potentially infinite, number of forms. Note that in this case the locations of areas of specific forms in the vector style space would reflect the similarity between these forms. For example, the proposed model could be directly applied to the authorship attribution problem. In this case, each author would have their own area in the form space, and the more similar the authors are in terms of writing style, the closer these areas would be to each other. We performed preliminary experiments on this and report the results in Appendix A.
|
| 43 |
+
|
| 44 |
+
# 3 FORMULATION
|
| 45 |
+
|
| 46 |
+
Let us formulate the problem of decomposition of text representation on an example of controlled change of linguistic form and conversion of Shakespeare plays in the original Early Modern to contemporary English. Let $X ^ { a }$ be a corpus of texts $\pmb { x } _ { i } ^ { a } \in \mathcal { X } ^ { a }$ in Early Middle English $\mathbf { f } ^ { a } \in \mathcal { F }$ , and $X ^ { b }$ be a corpus of texts $\pmb { x } _ { i } ^ { b } \in \mathcal { X } ^ { b }$ in modern English $\mathbf { f } ^ { b } \in \mathcal { F }$ . We assume that the texts in both $X ^ { a }$ and $X ^ { b }$ has the same distribution of meaning $\mathbf { m } \in \mathcal { M }$ . The form f , however, is different and generated from a mixture of two distributions:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathbf { f } _ { i } = \alpha _ { i } ^ { a } p ( \mathbf { f } ^ { a } ) + \alpha _ { i } ^ { b } p ( \mathbf { f } ^ { b } )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\mathbf { f } ^ { a }$ and $\mathbf { f } ^ { b }$ are two different languages (Early Modern and contemporary English). Intuitively, we say that a sample $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ has the form $\mathbf { f } ^ { a }$ if $\alpha _ { i } ^ { a } > \alpha _ { i } ^ { b }$ , and it has the form $\mathbf { f } ^ { b }$ if $\alpha _ { i } ^ { b } > \alpha _ { i } ^ { a }$ .
|
| 53 |
+
|
| 54 |
+
The goal of dissociation meaning and form is to learn two encoders $E _ { \mathbf { m } } : \mathcal { X } \mathcal { M }$ and $E _ { \mathbf { f } } : \mathcal { X } \mathcal { F }$ for the meaning and form correspondingly, and the generator $G : { \mathcal { M } } , { \mathcal { F } } \to { \mathcal { X } }$ such that
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\forall j \in \{ a , b \} , \forall k \in \{ a , b \} : G ( E _ { \mathbf { m } } ( x ^ { k } ) , E _ { \mathbf { f } } ( x ^ { j } ) ) \mathcal { X } ^ { j }
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
That is, the form of a generated sample depends exclusively on the provided $\mathbf { f } _ { j }$ and can be the in the same domain for two different ${ \bf m } _ { u }$ and $\mathbf { m } _ { v }$ from two samples from different domains $\mathcal { X } ^ { a }$ and $\mathcal { X } ^ { b }$ .
|
| 61 |
+
|
| 62 |
+
Note that, in contrast to the previously proposals, the form f is not a categorical variable but a continuous vector. This enables fine-grained controllable change of form: the original form $\mathbf { f } _ { i }$ is changed to reflect the form of the specific target sentence $\mathbf { f } _ { j }$ with its own unique $\alpha ^ { a }$ and $\alpha ^ { b }$ while preserving the original meaning $\mathbf { m } _ { i }$ .
|
| 63 |
+
|
| 64 |
+
An important caveat concerns the core assumption of the similar meaning distribution in the two corpora, which is also made in all other works reviewed in Section 2. It limits the possible use of this approach to cases where the distributions are in fact similar (i.e. parallel or at least comparable corpora are available). It does not apply to many cases that could be analyzed in terms of meaning and form. For example, books for children and scholarly papers are both registers, they have their own form (i.e. specific subsets of linguistic means and structure conventions) – but there is little overlap in the content. This would make it hard even for a professional writer to turn a research paper into a fairy tale.
|
| 65 |
+
|
| 66 |
+
# 4 METHOD DESCRIPTION
|
| 67 |
+
|
| 68 |
+
Inspired by Makhzani et al. (2015), Kim et al. (2017), and Albanie et al. (2017), we propose ADNet, a new model for adversarial decomposition of text representation (Figure 1).
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 1: Overview of ADNet. Encoder encodes the inputs sentences into two latent vectors m and f. The Generator takes them as the input and produces the output sentence. During the training, the Discriminator is used for an adversarial loss that forces m to do not carry any information about the form, and the M otivator is used for a motivational loss that encourages f to carry the needed information about the form.
|
| 72 |
+
|
| 73 |
+
Our solution is based on a widely used sequence-to-sequence framework (Sutskever et al., 2014) and consists of four main parts. The encoder $E$ encodes the inputs sequence $_ { \textbf { \em x } }$ into two latent vectors $\mathbf { m }$ and f which capture the meaning and the form of the sentence correspondingly. The generator $G$ then takes these two vectors as the input and produces a reconstruction of the original input sequence $\hat { \pmb x }$ .
|
| 74 |
+
|
| 75 |
+
The encoder and generator by themselves will likely not achieve the dissociation of the meaning and form. We encourage this behavior in a way similar to Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), which had an overwhelming success the past few years and have been proven to be a good way of enforcing a specific distribution and characteristics on the output of a model.
|
| 76 |
+
|
| 77 |
+
Inspired by the work of Albanie et al. (2017) and the principle of ”carrot and stick” (Safire, 1995), in contrast to the majority of work that promotes pure adversarial approach (Goodfel
|
| 78 |
+
|
| 79 |
+
low et al., 2014; Shen et al., 2017; Fu et al., 2017; Zhu et al., 2017), we propose two additional components, the discriminator $D$ and the motivator $M$ to force and motivate the model to learn the dissociation of the meaning and the form. Similarly to a regular GAN model, the adversarial discriminator $D$ tries to classify the form f based on the latent meaning vector $\mathbf { m }$ , and the encoder $E$ is penalized to make this task as hard as possible.
|
| 80 |
+
|
| 81 |
+
Opposed to such vicious behaviour, the motivator $M$ tries to classify the form based on the latent form vector f, as it should be done, and encourages the encoder $E$ to make this task as simple as possible. We could apply the adversarial approach here as well and force the distribution of the form vectors to fit a mixture of Gaussians (in this particular case, a mixture of two Guassians) with another discriminator, as it is done by Makhzani et al. (2015), but we opted for the “dualistic” path of two complimentary forces.
|
| 82 |
+
|
| 83 |
+
# 4.1 ENCODER-DECODER
|
| 84 |
+
|
| 85 |
+
Both the encoder $E$ and the generator $G$ are modeled with a neural network. Gated Recurrent Unit (GRU) (Chung et al., 2014) is used for $E$ to encode the input sentence $_ { \textbf { \em x } }$ into a hidden vector $\pmb { h } = \mathbf { G } \mathbf { R } \mathbf { U } ( \pmb { x } )$ .
|
| 86 |
+
|
| 87 |
+
The vector $^ { h }$ is then passed through two different fully connected layers to produce the latent vectors of the form and the meaning of the input sentence:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
{ \bf m } = \operatorname { t a n h } ( W _ { m } h + b _ { m } ) { \bf f } = \operatorname { t a n h } ( W _ { f } h + b _ { f } )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We use $\theta _ { E }$ to denote the parameters of the encoder $E \colon W _ { m } , b _ { m } , W _ { f } , b _ { f }$ , and the parameters of the GRU unit.
|
| 94 |
+
|
| 95 |
+
The generator $G$ is also modelled with a GRU unit. The generator takes as input the meaning vector $\mathbf { m }$ and the form vector f, concatenates them, and passes trough a fully-connected layer to obtain a hidden vector $_ z$ that represents both meaning and form of the original input sentence:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
z = \operatorname { t a n h } ( W _ { z } [ \mathbf { m } ; \mathbf { f } ] + b _ { m } )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
After that, we use a GRU unit to generate the output sentence as a probability distribution over the vocabulary tokens:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
p ( \hat { \pmb x } ) = \prod _ { t = 1 } ^ { T } p ( \hat { \pmb x } _ { t } | \boldsymbol z , \hat { \pmb x } _ { 1 } , \dots , \hat { \pmb x } _ { t - 1 } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
We use $\theta _ { G }$ to denote the parameters of the generator $G$ : $W _ { z }$ , $b _ { m }$ , and the parameters of the used GRU. The encoder and generator are trained using the standard reconstruction loss:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { r e c } } ( \pmb { \theta } _ { E } , \pmb { \theta } _ { G } ) = \mathbb { E } _ { \pmb { x } \sim \pmb { X } ^ { a } } [ - \log p ( \hat { \pmb x } | \pmb { x } ) ] + \mathbb { E } _ { \pmb { x } \sim \pmb { X } ^ { b } } [ - \log p ( \hat { \pmb x } | \pmb { x } ) ] } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
# 4.2 DISCRIMINATOR
|
| 114 |
+
|
| 115 |
+
The representation of the meaning m produced by the encoder $E$ should not contain any information about the form f . We achieve this by using an adversarial approach. First, we train a discriminator $D$ , consisting of several fully connected layers with ELU activation function (Clevert et al., 2015) between them, to predict the form f of a sentence by its meaning vector: $\hat { f } _ { D } = D ( { \bf m } )$ , where $\hat { f }$ is the score (logit) reflecting the probability of the sentence $_ { \textbf { \em x } }$ to belong to one of the form domains.
|
| 116 |
+
|
| 117 |
+
Motivated by the Wasserstein GAN (Arjovsky et al., 2017), we use the following loss function instead of the standard cross-entropy:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathcal { L } _ { D } ( \pmb { \theta } _ { D } ) = \mathbb { E } _ { \pmb { x } \sim \pmb { X } ^ { a } } [ D ( E _ { \mathbf { m } } ( \pmb { x } ) ) ] - \mathbb { E } _ { \pmb { x } \sim \pmb { X } ^ { b } } [ D ( E _ { \mathbf { m } } ( \pmb { x } ) ) ]
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Thus, a successful discriminator will produce negative scores $\hat { f }$ for sentences from $X ^ { a }$ and positive scores for sentences from $X ^ { b }$ . This discriminator is then used in an adversarial manner to provide a learning signal for the encoder and force dissociation of the meaning and form by maximizing $\mathcal { L } _ { D }$ $: \mathcal { L } _ { \mathrm { a d v } } ( \pmb { \theta } _ { E } ) = - \lambda _ { \mathrm { a d v } } \mathcal { L } _ { D }$ , where $\lambda _ { \mathrm { a d v } }$ is a hyperparameter reflecting the strength of the adversarial loss. Note that this loss applies to the parameters of the encoder.
|
| 124 |
+
|
| 125 |
+
# 4.3 MOTIVATOR
|
| 126 |
+
|
| 127 |
+
Our experiments showed that it is enough to have just the discriminator $D$ and the adversarial loss $\mathcal { L } _ { \mathrm { a d v } }$ to force the model to dissociate the form and the meaning. However, in order to achieve a better dissociation, we propose to use a motivator $M$ (Albanie et al., 2017) and the corresponding motivational loss. Conceptually, this is the opposite of the adversarial loss, hence the name. As the discriminator $D$ , the motivator $M$ learns to classify the form f of the input sentence. However, its input is not not the meaning vector but the form vector: ${ \hat { f } } _ { M } = M ( \mathbf { f } )$ .
|
| 128 |
+
|
| 129 |
+
The motivator has the same architecture as the discriminator, and the same loss function. While the adversarial loss forces the encoder $E$ to produce a meaning vector m with no information about the form f , the motivational loss encourages $E$ to encode this information in the form vector by minimizing ${ \mathcal { L } } _ { M }$ ${ \bf \chi } _ { \ / t } \colon \mathcal { L } _ { \mathrm { m o t i v } } ( \pmb { \theta } _ { E } ) = \lambda _ { \mathrm { m o t i v } } \mathcal { L } _ { \ / M }$ .
|
| 130 |
+
|
| 131 |
+
# 4.4 TRAINING PROCEDURE
|
| 132 |
+
|
| 133 |
+
The overall training procedure follows the methods for training GANs (Goodfellow et al., 2014; Arjovsky et al., 2017) and consists of two stages: training the discriminator $D$ and the motivator $M$ , and training the encoder $E$ and the generator $G$ .
|
| 134 |
+
|
| 135 |
+
In contrast to Arjovsky et al. (2017), we do not train the $D$ and $M$ more than the $E$ and the $G$ . In our experiments we found that simple training in two stages is enough to achieve dissociation of the meaning and the form. Encoder and generator are trained with the following loss function that combines reconstruction loss with the losses from the discriminator and the motivator:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\mathcal { L } _ { \mathrm { t o t a l } } ( \theta _ { E } , \theta _ { G } ) = \mathcal { L } _ { \mathrm { r e c } } + \mathcal { L } _ { \mathrm { a d v } } + \mathcal { L } _ { \mathrm { m o t i v } }
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
# 5 EXPERIMENTAL SETUP
|
| 142 |
+
|
| 143 |
+
# 5.1 EVALUATION
|
| 144 |
+
|
| 145 |
+
Similarly to the evaluation of style transfer in CV (Isola et al., 2017), evaluation of this task is difficult. We follow the approach of Isola et al. (2017); Shen et al. (2017) and recently proposed by Fu et al. (2017) methods of evaluation of “transfer strength” and “content preservation”. The authors showed the proposed automatic metrics to a large degree correlate with human judgment and can serve as a proxy. Below we give an overview of these metrics.
|
| 146 |
+
|
| 147 |
+
Transfer Strength. The goal of this metric is to capture whether the form has been changed successfully. To do that, a classifier $C$ is trained on the two corpora, $X ^ { a }$ and $X ^ { b }$ to recognize the linguistic “form” typical of each of them. After that, a sentence the form/meaning of which was changed is passed to the classifier. The overall accuracy reflects the degree of success of changing the form/meaning. This approach is widely used in CV (Isola et al., 2017), and was applied in NLP as well (Shen et al., 2017).
|
| 148 |
+
|
| 149 |
+
In our experiments we used a GRU unit followed by four fully-connected layers with ELU activation functions between them as the classifier.
|
| 150 |
+
|
| 151 |
+
Content preservation Note that transfer strength by itself does not capture the overall quality of a changed sentence. A extremely overfitted model that produces the same, the most characteristic sentence of one corpus all the time would have a high score according to this metric. Thus, we need to measure how much of the meaning was preserved while changing the form. To do that, Fu et al. (2017) proposed to use a cosine similarity based metric using pretrained word embeddings. First, a sentence embedding is computed by concatenation of max, mean, and average pooling over the timesteps:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\pmb { v } = [ \operatorname* { m a x } ( \pmb { v } _ { 1 } , \dots , \pmb { v } _ { T } ) ; \operatorname* { m i n } ( \pmb { v } _ { 1 } , \dots , \pmb { v } _ { T } ) ; \operatorname* { m e a n } ( \pmb { v } _ { 1 } , \dots , \pmb { v } _ { T } ) ]
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Next, the cosine similarity score $s _ { i }$ between the embedding $\pmb { v } _ { i } ^ { s }$ of the original source sentence and the target sentence with the changed form $\mathbf { \Delta } \mathbf { \vec { v } } _ { i } ^ { t }$ is computed, and the scores across the dataset are averaged to obtain the total score:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathbf { s } = \frac { 1 } { 2 } \left[ \frac { 1 } { | X ^ { a } | } \sum _ { i = 1 } ^ { | X ^ { a } | } \mathrm { s } _ { i } + \frac { 1 } { | X ^ { b } | } \sum _ { i = 1 } ^ { | X ^ { b } | } \mathrm { s } _ { i } \right]
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
# 5.1.1 CONTINUOUS FORM
|
| 164 |
+
|
| 165 |
+
The metrics described above treat the form as a categorical (in most cases, even binary) variable. This was not a problem in previous work since the change of form could be done by just inverting the form vector. Our work, in contrast, treats the form as a continuous variable, and, therefore, we cannot just use the proposed metrics directly. To enable a fair comparison, we propose the following procedure.
|
| 166 |
+
|
| 167 |
+
For each sentence $s _ { s } ^ { a }$ in the test set from the corpus $X ^ { a }$ we sample $k = 1 0$ random sentence from the corpus $X ^ { b }$ of the opposite form. After that, we encode them into the meaning $m _ { i }$ and form $f _ { i }$ vectors, and average the form vectors to obtain a single form vector $\begin{array} { r } { { f } _ { \mathrm { a v g } } = \frac { 1 } { k } \sum _ { i = 1 } ^ { k } { f } _ { i } } \end{array}$ . We then generate a new sentence with its original meaning vector $m _ { s }$ and the resulting form vector $\pmb { f } _ { \mathrm { a v g } }$ , and use it for evalation. This process enables a fair comparison with the previous works that treat form as a binary variable.
|
| 168 |
+
|
| 169 |
+
# 5.2 DATASETS
|
| 170 |
+
|
| 171 |
+
We performed an extensive evaluation of the proposed method on several dataset that reflect different changes of meaning, form, or specific aspects of meaning, such as sentiment polarity.
|
| 172 |
+
|
| 173 |
+
Changing form: register This experiment is conducted with a dataset of titles of scientific papers and news articles published by Fu et al. (2017). This dataset (referred to as “Headlines”) contains titles of scientific articles crawled from online digital libraries, such as “ACM Digital Library” and “arXiv”. The titles of the news articles are taken from the “News Aggregator Data Set” from UCI Machine Learning Repository (Dheeru & Karra Taniskidou, 2017)
|
| 174 |
+
|
| 175 |
+
Changing form: language diachrony Diachronic language change is explored with the dataset composed by Xu et al. (2012). It includes the texts of 17 plays by William Shakespeare in the original Early Modern English, and their translations into contemporary English. We randomly permuted all sentences from all plays and sampled the training, validation, and test sets. Note that this is the smallest dataset in our experiments.
|
| 176 |
+
|
| 177 |
+
Previous work on style transfer for text also included the experiments with changing sentiment polarity (Shen et al., 2017; Fu et al., 2017). We do not report the experiments with sentiment data, since the change in sentiment polarity corresponds to a change in a specific aspect of meaning, rather than form. We therefore believe the comparison with these data would not be instructive.
|
| 178 |
+
|
| 179 |
+
# 6 RESULTS AND DISCUSSION
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 2: Transfer strength vs Content preservation (see subsection 5.1) for different combination of the size of the meaning and form vectors. Each point is labeled with ”¡meaning vector size¿, ¡form vector size¿”.
|
| 183 |
+
|
| 184 |
+
Probably, the most recent and similar to our work is the model proposed by Fu et al. (2017), in particular the “style-embedding” model. We implemented this model to provide a baseline for comparison.
|
| 185 |
+
|
| 186 |
+
The classifier used in the transfer strength metric achieves very high accuracy (0.832 and 0.99 for the Shakespeare and Headlines datasets correspondingly). These results concur with the results of Shen et al. (2017) and Fu et al. (2017), and show that the two forms in the corpora are significantly different.
|
| 187 |
+
|
| 188 |
+
Following Fu et al. (2017), we show the result of different configuration of the size of the form and meaning vectors on Figure 2. Namely, we report combinations of 64 and 256-dimensional vectors. Note that the sizes of the form vector are important. The larger is the form vector, the higher is the transfer strength, but smaller is content preservation. This is consistent with Fu et al. (2017), where they observed a similar behaviour.
|
| 189 |
+
|
| 190 |
+
It is clear that the proposed method achieves significantly better transfer strength then the previously proposed model. It also has a lower content preservation score, which means that it repeats fewer exact words from the source sentence. Note that a low transfer strength and very high (0.9) content ˜ preservation score means that the model was not able to successfully learn to transfer the form and the target sentence is almost identical to the source sentence. The Shakespeare dataset is the hardest for the model in terms of transfer strength, probably because it is the smallest dataset, but the proposed method performs consistently well in transfer of both form and meaning and, in contrast to the baseline.
|
| 191 |
+
|
| 192 |
+
Fluency of generated sentences Note that there is no guarantee that the generated sentences would be coherent after switching the form vector. In order to estimate how this switch affects the fluency of generated sentences, we trained a language model on the Shakespeare dataset and calculated the perplexity of the generated sentences using the original form vector and the average of form vectors of $k$ random sentences from the opposite style (see subsubsection 5.1.1). While the perplexity of such sentences does go up, this change is not big (6.89 vs 9.74).
|
| 193 |
+
|
| 194 |
+
# 6.1 IMPACT OF THE MOTIVATIONAL TRAINING
|
| 195 |
+
|
| 196 |
+
To investigate the impact of the motivator, we visualized form and meaning embeddings of 1000 random samples from the Headlines dataset using t-SNE algorithm (Van Der Maaten, 2014) with the Multicore-TSNE library (Ulyanov, 2016). The result is presented in Figure 3.
|
| 197 |
+
|
| 198 |
+
There are three important observations. First, there is no clear separation in the meaning embeddings, which means that any accurate form transfer is due to the form embeddings, and the dissociation of form and meaning was successful.
|
| 199 |
+
|
| 200 |
+
Second, even without the motivator the model is able to produce the form embeddings that are clustered into two group. Recall from section 4 that without the motivational loss there are no forces that influence the form embeddings, but nevertheless the model learns to separate them.
|
| 201 |
+
|
| 202 |
+
However, the separation effect is much more pronounced in the presence of motivator. This explains why the motivator consistently improved transfer strength of ADNet, as shown in Figure 2.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 3: t-SNE visualization of the form and meaning embeddings of 1000 random sentences. Green point represent sentences form news headlines, and red points represent titles of scientific articles.
|
| 206 |
+
|
| 207 |
+
# 6.2 QUALITATIVE EVALUATION
|
| 208 |
+
|
| 209 |
+
Table 1 and Table 2 show several examples of the successful form/meaning transfer achieved by ADNet. Table 1 presentes the results of an experiment that to some extent replicates the approach taken by the authors who treat linguistic form as a binary variable (Shen et al., 2017; Fu et al., 2017). The sentences the original Shakespeare plays were averaged to get the “typical” Early Modern English form vector. This averaged vector was used to decode a sentence from the modern English translation back into the original. The same was done in the opposite direction.
|
| 210 |
+
|
| 211 |
+
Table 1: Decoding of the source sentence from Early Modern English (EME) into contemporary English (CE), and vice versa.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Aye,sir. (EME)</td><td>→ Yes,sir. (CE)</td></tr><tr><td>Fare thee well, my lord (EME)</td><td>Fare you well, my lord (CE)</td></tr><tr><td>This guy will tell us everything. (CE)</td><td>This man will tell us everything. (EME)</td></tr><tr><td>Ive done no more to caesar than you will do to me.(CE)</td><td>Ihave done no more to caesar than,you shall do to me.(EME)</td></tr></table>
|
| 214 |
+
|
| 215 |
+
Table 2 illustrates the possibilities of ADNet on fine-grained transfer applied to the change of register. We encoded two sentences in different registers from the Headlines dataset to produce form and meaning embeddings, and then we decoded the first sentence with the meaning embedding of the second, and vice versa. As can be seen from Table 2, the model correctly captures the meaning of sentences and decodes them using the form of the source sentences. Note how the model preserves specific words and the structure of the source sentence. In particular, note how in the first example, the model decided to put the colon after the “crisis management”, as the source form sentence has this syntactic structure (“A review:”). This is not possible in the previously proposed models, as they treat form as just a binary variable.
|
| 216 |
+
|
| 217 |
+
<table><tr><td>A review: detection techniques for LTE system Situation management knowledge from social media</td><td>→Crisis management: media practices in telecommunication management →Areview study against intelligence internet</td></tr><tr><td>Security flaw could notaffect digital devices,experts say Semantic approach to event processing</td><td>→Semantic approach approach: current multimedia networks as modeling processes →Security flaw to verifyleaks</td></tr></table>
|
| 218 |
+
|
| 219 |
+
Table 2: Flipping the meaning and the form embeddings of two sentence from different registers. Note the use of the colon in the first example, and the use of the “to”-constructions in the second example, consistent with the form of the source sentences.
|
| 220 |
+
|
| 221 |
+
# 6.3 PERFORMANCE OF MEANING EMBEDDINGS ON DOWNSTREAM TASKS
|
| 222 |
+
|
| 223 |
+
We conducted some experiments to test the assumption that the derived meaning embeddings should improve performance on downstream tasks that require understanding of the meaning of the sentences regardless of their form. We evaluated embeddings produced by the ADNet, trained in the Headlines dataset, on a task of paraphrase detection. We used the SentEval toolkit (Conneau et al., 2017) and the Microsoft Research Paraphrase Corpus (Dolan et al., 2004). The F1 scores on this task for different models are presented in Table 3. Note that all models, except InferSent, are unsupervised. The InferSent model was trained on a big SNLI dataset, consisting of more than 500,000 manually annotated pairs. ADNet achieves the the highest score among the unsupervised systems and outperforms the regular sequence-to-sequence autoencoder with a large gap.
|
| 224 |
+
|
| 225 |
+
Table 3: F1 scores on the task of paraphrase detection using the SentEval toolkit (Conneau et al., 2017)
|
| 226 |
+
|
| 227 |
+
<table><tr><td>BoW</td><td>Seq2Seq</td><td>InferSent</td><td>Fu et al. (2017)</td><td>ADNet</td></tr><tr><td>80.82</td><td>74.68</td><td>83.17</td><td>78.88</td><td>81.38</td></tr></table>
|
| 228 |
+
|
| 229 |
+
# 7 CONCLUSION
|
| 230 |
+
|
| 231 |
+
In this paper, we presented ADNet, a new model that performs adversarial decomposition of text representation. In contrast to previous work, it does not require a parallel training corpus and works directly on hidden representations of sentences. Most importantly, is does not treat the form as a binary variable (as done in most previously proposed models), enabling a fine-grained change of the form of sentences or specific aspects of meaning. We evaluate ADNet on two tasks: the shift of language register and diachronic language change. Our solution achieves superior results, and t-SNE visualizations of the learned meaning and style embeddings illustrate that the proposed motivational loss leads to significantly better separation of the form embeddings.
|
| 232 |
+
|
| 233 |
+
# REFERENCES
|
| 234 |
+
|
| 235 |
+
Samuel Albanie, Sebastien Ehrhardt, and Jo ´ ao F Henriques. Stopping gan violence: Generative ˜ unadversarial networks. arXiv preprint arXiv:1703.02528, 2017.
|
| 236 |
+
|
| 237 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 238 |
+
|
| 239 |
+
Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. In International Conference on Learning Representation, 2017.
|
| 240 |
+
|
| 241 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 242 |
+
|
| 243 |
+
Keith Carlson, Allen Riddell, and Daniel Rockmore. Zero-shot style transfer in text using recurrent neural networks. arXiv preprint arXiv:1711.04731, 2017.
|
| 244 |
+
|
| 245 |
+
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, et al. Universal sentence encoder. arXiv preprint arXiv:1803.11175, 2018.
|
| 246 |
+
|
| 247 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 248 |
+
|
| 249 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 250 |
+
|
| 251 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 670–680, 2017.
|
| 252 |
+
|
| 253 |
+
Ferdinand de Saussure. Course in General Linguistics. New York : Philosophical Library, 1959. URL http://archive.org/details/courseingenerall00saus.
|
| 254 |
+
|
| 255 |
+
Dua Dheeru and Efi Karra Taniskidou. UCI machine learning repository, 2017. URL http: //archive.ics.uci.edu/ml.
|
| 256 |
+
|
| 257 |
+
Bill Dolan, Chris Quirk, and Chris Brockett. Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources. In Proceedings of the 20th international conference on Computational Linguistics, pp. 350. Association for Computational Linguistics, 2004.
|
| 258 |
+
|
| 259 |
+
Jessica Ficler and Yoav Goldberg. Controlling linguistic style aspects in neural language generation. In Proceedings of the Workshop on Stylistic Variation, pp. 94–104, 2017.
|
| 260 |
+
|
| 261 |
+
Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. Style transfer in text: Exploration and evaluation. arXiv preprint arXiv:1711.06861, 2017.
|
| 262 |
+
|
| 263 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 264 |
+
|
| 265 |
+
Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. Pointing the unknown words. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 140–149, 2016.
|
| 266 |
+
|
| 267 |
+
M. A. K. Halliday, A. McIntosh, and P. Stevens. The Linguistic Sciences and Language Teaching. Longmans, Green and Co., London, 1968.
|
| 268 |
+
|
| 269 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In International Conference on Machine Learning, pp. 1587–1596, 2017.
|
| 270 |
+
|
| 271 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1125–1134, 2017.
|
| 272 |
+
|
| 273 |
+
Harsh Jhamtani, Varun Gangal, Eduard Hovy, and Eric Nyberg. Shakespearizing modern language using copy-enriched sequence-to-sequence models. arXiv preprint arXiv:1707.01161, 2017.
|
| 274 |
+
|
| 275 |
+
Yoon Kim, Kelly Zhang, Alexander M Rush, Yann LeCun, et al. Adversarially regularized autoencoders for generating discrete structures. arXiv preprint arXiv:1706.04223, 2017.
|
| 276 |
+
|
| 277 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 278 |
+
|
| 279 |
+
Alex M Lamb, Anirudh Goyal ALIAS PARTH GOYAL, Ying Zhang, Saizheng Zhang, Aaron C Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In Advances In Neural Information Processing Systems, pp. 4601–4609, 2016.
|
| 280 |
+
|
| 281 |
+
Jiwei Li, Michel Galley, Chris Brockett, Georgios Spithourakis, Jianfeng Gao, and Bill Dolan. A persona-based neural conversation model. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 994–1003, 2016.
|
| 282 |
+
|
| 283 |
+
Zachary C Lipton, Sharad Vikram, and Julian McAuley. Generative concatenative nets jointly learn to write and classify reviews. arXiv preprint arXiv:1511.03683, 2015.
|
| 284 |
+
|
| 285 |
+
Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. arXiv preprint arXiv:1803.02893, 2018.
|
| 286 |
+
|
| 287 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 288 |
+
|
| 289 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 290 |
+
|
| 291 |
+
Jonas Mueller, David Gifford, and Tommi Jaakkola. Sequence to better sequence: continuous revision of combinatorial structures. In International Conference on Machine Learning, pp. 2536– 2544, 2017.
|
| 292 |
+
|
| 293 |
+
Nikita Nangia, Adina Williams, Angeliki Lazaridou, and Samuel R Bowman. The repeval 2017 shared task: Multi-genre natural language inference with sentence representations. arXiv preprint arXiv:1707.08172, 2017.
|
| 294 |
+
|
| 295 |
+
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.
|
| 296 |
+
|
| 297 |
+
Peter Potash, Alexey Romanov, and Anna Rumshisky. Ghostwriter: using an lstm for automatic rap lyric generation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1919–1924, 2015.
|
| 298 |
+
|
| 299 |
+
Peter Potash, Alexey Romanov, and Anna Rumshisky. Here’s my point: Joint pointer architecture for argument mining. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1364–1373, 2017.
|
| 300 |
+
|
| 301 |
+
William Safire. On Language Gotcha! Gang Strikes Again, 1995. URL https://www.nytimes.com/1995/12/31/magazine/ on-language-gotcha-gang-strikes-again.html.
|
| 302 |
+
|
| 303 |
+
Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems, pp. 6833–6844, 2017.
|
| 304 |
+
|
| 305 |
+
Efstathios Stamatatos. Authorship attribution using text distortion. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, volume 1, pp. 1138–1149, 2017.
|
| 306 |
+
|
| 307 |
+
Sandeep Subramanian, Adam Trischler, Yoshua Bengio, and Christopher J Pal. Learning general purpose distributed sentence representations via large scale multi-task learning. arXiv preprint arXiv:1804.00079, 2018.
|
| 308 |
+
|
| 309 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 310 |
+
Jian Tang, Yifan Yang, Sam Carton, Ming Zhang, and Qiaozhu Mei. Context-aware natural language generation with recurrent neural networks. arXiv preprint arXiv:1611.09900, 2016.
|
| 311 |
+
Dmitry Ulyanov. Multicore-tsne. https://github.com/DmitryUlyanov/ Multicore-TSNE, 2016.
|
| 312 |
+
Laurens Van Der Maaten. Accelerating t-sne using tree-based algorithms. Journal of machine learning research, 15(1):3221–3245, 2014.
|
| 313 |
+
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. 6000–6010, 2017.
|
| 314 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015.
|
| 315 |
+
Wei Xu, Alan Ritter, Bill Dolan, Ralph Grishman, and Colin Cherry. Paraphrasing for style. Proceedings of COLING 2012, pp. 2899–2914, 2012.
|
| 316 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2223–2232, 2017.
|
| 317 |
+
|
| 318 |
+
# A MULTIPLE FORMS AND STYLISTIC SIMILARITIES
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 4: t-SNE visualization of the form and meaning embeddings. Each color corresponds to a different author.
|
| 322 |
+
|
| 323 |
+
In order to go beyond just two different forms, we experimented with training the model on a set of literature novels from six different authors from Project Gutenberg2 written in two different time periods. A t-SNE visualization of the resulting meaning and form embeddings is presented in Figure 4. Note how form embeddings create a six-pointed star. After further examination, we observed that common phrases (for example, “Good morning” or “Hello!”) were embedded into the center of the star, whereas the most specific sentences from a given author were placed into the rays of the star. In particular, some sentences included character names, thus further research is required to mitigate this problem. Stamatatos (2017) provides a promising direction for solving this.
|
md/train/SkgewU5ll/SkgewU5ll.md
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAM: GRAPH-BASED ATTENTION MODEL FOR HEALTHCARE REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Edward Choi1, Mohammad Taha Bahadori1, Le Song1, Walter F. Stewart2 & Jimeng Sun1 1Georgia Institute of Technology, 2Sutter Health
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep learning methods exhibit promising performance for predictive modeling in healthcare, but two important challenges remain:
|
| 8 |
+
|
| 9 |
+
• Data insufficiency: Often in healthcare predictive modeling, the sample size is insufficient for deep learning methods to achieve satisfactory results. • Interpretation: The representations learned by deep learning models should align with medical knowledge.
|
| 10 |
+
|
| 11 |
+
To address these challenges, we propose a GRaph-based Attention Model, GRAM that supplements electronic health records (EHR) with hierarchical information inherent to medical ontologies. Based on the data volume and the ontology structure, GRAM represents a medical concept as a combination of its ancestors in the ontology via an attention mechanism.
|
| 12 |
+
|
| 13 |
+
We compared predictive performance (i.e. accuracy, data needs, interpretability) of GRAM to various methods including the recurrent neural network (RNN) in two sequential diagnoses prediction tasks and one heart failure prediction task. Compared to the basic RNN, GRAM achieved $10 \%$ higher accuracy for predicting diseases rarely observed in the training data and $3 \%$ improved area under the ROC curve for predicting heart failure using an order of magnitude less training data. Additionally, unlike other methods, the medical concept representations learned by GRAM are well aligned with the medical ontology. Finally, GRAM exhibits intuitive attention behaviors by adaptively generalizing to higher level concepts when facing data insufficiency at the lower level concepts.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
The rapid growth in volume and diversity of health care data from electronic health records (EHR) and other sources is motivating the use of predictive modeling to improve care for individual patients. In particular, novel applications are emerging that use deep learning methods such as word embedding (Choi et al., 2016c;e), recurrent neural networks (RNN) (Che et al., 2016; Choi et al., 2016a;b; Lipton et al., 2016), convolutional neural networks (CNN) (Nguyen et al., 2016) or stacked denoising autoencoders (SDA) (Che et al., 2015; Miotto et al., 2016), demonstrating significant performance enhancement for diverse prediction tasks. Deep learning models appear to perform significantly better than logistic regression or multilayer perceptron (MLP) models that depend, to some degree, on expert feature construction (Lipton et al., 2015; Razavian et al., 2016).
|
| 18 |
+
|
| 19 |
+
Training deep learning models typically requires large amounts of data that often cannot be met by a single health system or provider organization. Sub-optimal model performance can be particularly challenging when the focus of interest is predicting onset of a specific disease (e.g. heart failure) or related events such as accelerated disease progression. For example, using Doctor AI (Choi et al., 2016a), we discovered that RNN alone was ineffective to predict the onset of diseases such as cerebral degenerations (e.g. Leukodystrophy, Cerebral lipidoses) or developmental disorders (e.g. autistic disorder, Heller’s syndrome), partly because their rare occurrence in the training data provided little learning opportunity to the flexible models like RNN.
|
| 20 |
+
|
| 21 |
+
The data requirement of deep learning models comes from having to assess exponential number of combinations of input features. This can be alleviated by exploiting medical ontologies that encodes hierarchical clinical constructs and relationships among medical concepts. Fortunately, there are many well-organized ontologies in healthcare such as the International Classification of Diseases (ICD), Clinical Classifications Software (CCS) (Stearns et al., 2001) or Systematized Nomenclature of Medicine-Clinical Terms (SNOMED-CT) (Project et al., 2010). Nodes (i.e. medical concepts) close to one another in medical ontologies are likely to be associated with similar patients, allowing us to transfer knowledge among them. Therefore, proper use of medical ontologies will be helpful when we lack enough data for the nodes in the ontology to train deep learning models.
|
| 22 |
+
|
| 23 |
+
In this work, we propose GRAM, a method that infuses information from medical ontologies into deep learning models via neural attention. Considering the frequency of a medical concept in the EHR data and its ancestors in the ontology, GRAM decides the representation of the medical concept by adaptively combining its ancestors via attention mechanism. This will not only support deep learning models to learn robust representations without large amount of data, but also learn interpretable representations that align well with the knowledge from the ontology. The attention mechanism is trained in an end-to-end fashion with the neural network model that predicts the onset of disease(s). We also propose an effective initialization technique in addition to the ontological knowledge to better guide the representation learning process.
|
| 24 |
+
|
| 25 |
+
We compared predictive performance (i.e. accuracy, data needs, interpretability) of GRAM to various models including the recurrent neural network (RNN) in two sequential diagnoses prediction tasks and one heart failure (HF) prediction task. We demonstrate that GRAM is up to $10 \%$ more accurate than the basic RNN for predicting diseases less observed in the training data. After discussing GRAM’s scalability, we visualize the representations learned from various models where GRAM provides more intuitive representations by grouping similar medical concepts close to one another. Finally, we show GRAM’s attention mechanism can be interpreted to understand how it assigns the right amount of attention to the ancestors of each medical concept by considering the data availability and the ontology structure.
|
| 26 |
+
|
| 27 |
+
# 2 METHODOLOGY
|
| 28 |
+
|
| 29 |
+
We first define the notations describing EHR data and medical ontologies, followed by a description of GRAM (Section 2.2), the end-to-end training of the attention generation and predictive modeling (Section 2.3), and the efficient initialization scheme (Section 2.4).
|
| 30 |
+
|
| 31 |
+
# 2.1 BASIC NOTATION
|
| 32 |
+
|
| 33 |
+
We denote the set of entire medical codes from the EHR as $c _ { 1 } , c _ { 2 } , \ldots , c _ { | { \mathcal { C } } | } \in { \mathcal { C } }$ with the vocabulary size $| { \mathcal { C } } |$ . The clinical record of each patient can be viewed as a sequence of visits $V _ { 1 } , \dots , V _ { T }$ where each visit contains a subset of medical codes $V _ { t } \subseteq \mathcal { C }$ . $V _ { t }$ can be represented as a binary vector $\mathbf { x } _ { t } \in \{ 0 , 1 \} ^ { | c | }$ where the $i \cdot$ -th element is 1 only if $V _ { t }$ contains the code $c _ { i }$ . To avoid clutter, all algorithms will be presented for a single patient.
|
| 34 |
+
|
| 35 |
+
We assume that a given medical ontology $\mathcal { G }$ typically expresses the hierarchy of various medical concepts in the form of a parent-child relationship, where the medical codes $\mathcal { C }$ form the leaf nodes. Ontology $\mathcal { G }$ is represented as a directed acyclic graph (DAG) whose nodes form a set $\mathcal { D } = \mathcal { C } + \mathcal { C } ^ { \prime }$ . $\mathcal { C } ^ { \prime } = \{ c _ { | \mathcal { C } | + 1 } , c _ { | \mathcal { C } | + 2 } , \ldots , c _ { | \mathcal { C } | + | \mathcal { C } ^ { \prime } | } \}$ defines the set of all non-leaf nodes (i.e. ancestors of the leaf nodes), where $| { \mathcal { C } } ^ { \prime } |$ represents the number of all non-leaf nodes. We use knowledge $D A G$ to refer to $\mathcal { G }$ . A parent in the knowledge DAG $\mathcal { G }$ represents a related but more general concept over its children. Therefore, $\mathcal { G }$ provides a multi-resolution view of medical concepts with different degrees of specificity. While some ontologies are exclusively expressed as parent-child hierarchies (e.g. ICD-9, CCS), others are not. For example, in some instances SNOMED-CT also links medical concepts to causal or treatment relationships, but the majority relationships in SNOMED-CT are still parent-child. Therefore, we focus on the parent-child relationships in this work.
|
| 36 |
+
|
| 37 |
+
# 2.2 KNOWLEDGE DAG AND THE ATTENTION MECHANISM
|
| 38 |
+
|
| 39 |
+
GRAM leverages the parent-child relationship of $\mathcal { G }$ to learn robust representations when data volume is constrained. GRAM balances the use of ontology information in relation to data volume in determining the level of specificity for a medical concept. When a medical concept is less observed in the data, more weight is given to its ancestors as they can be learned more accurately and offer general (coarse-grained) information about their children. The process of resorting to the parent concepts can be automated via the attention mechanism and the end-to-end training as described in Figure 1.
|
| 40 |
+
|
| 41 |
+
In the knowledge DAG, each node $c _ { i }$ is assigned a basic embedding vector $\mathbf { e } _ { i } \in \mathbb { R } ^ { m }$ , where $m$ represents the dimensionality. Then $\mathbf { e } _ { 1 } , \ldots , \mathbf { e } _ { | { \mathcal { C } } | }$ are the basic embeddings of the codes $c _ { 1 } , \ldots , c _ { | { \mathcal { C } } | }$ while ${ \bf e } _ { | \mathcal { C } | + 1 } , \dots , { \bf e } _ { | \mathcal { C } | + | \mathcal { C } ^ { \prime } | }$ represent the basic embeddings of the internal nodes $c _ { | \mathcal { C } | + 1 } , \ldots , c _ { | \mathcal { C } | + | \mathcal { C } _ { \bullet } ^ { \prime } | }$ The initialization of these basic embeddings is described in Section 2.4. We formulate a leaf node’s final representation as a convex combination of the basic embeddings of itself and its ancestors:
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: The illustration of GRAM. Leaf nodes (solid circles) represents a medical concept in the EHR, while the non-leaf nodes (dotted circles) represent more general concepts. The final representation $\mathbf { g } _ { i }$ of the leaf concept $c _ { i }$ is computed by combining the basic embeddings $\mathbf { e } _ { i }$ of $c _ { i }$ and $\mathbf { e } _ { g } , \mathbf { e } _ { c }$ and $\mathbf { e } _ { a }$ of its ancestors $c _ { g } , c _ { c }$ and $c _ { a }$ via an attention mechanism. The final representations form the embedding matrix $\mathbf { G }$ for all leaf concepts. After that, we use $\mathbf { G }$ to embed patient visit vector $\mathbf { x } _ { t }$ to a visit representation $\mathbf { v } _ { t }$ , which is then fed to a neural network model to make the final prediction $\hat { \mathbf { y } } _ { t }$ .
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\mathbf { g } _ { i } = \sum _ { j \in A ( i ) } \alpha _ { i j } \mathbf { e } _ { j } , \qquad \sum _ { j \in A ( i ) } \alpha _ { i j } = 1 , \alpha _ { i j } \geq 0 \mathrm { ~ f o r ~ } j \in A ( i ) ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $\mathbf { g } _ { i } \in \mathbb { R } ^ { m }$ denotes the final representation of the code $c _ { i }$ , $\boldsymbol { \mathscr { A } } ( i )$ the indices of the code $c _ { i }$ and $c _ { i }$ ’s ancestors, $\mathbf { e } _ { j }$ the basic embedding of the code $c _ { j }$ and $\alpha _ { i j } \in \mathbb { R }$ the attention weight on the embedding $\mathbf { e } _ { j }$ when calculating $\mathbf { g } _ { i }$ . The attention weight $\alpha _ { i j }$ in Eq. (1) is calculated by the following Softmax function,
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\alpha _ { i j } = { \frac { \exp ( f ( \mathbf { e } _ { i } , \mathbf { e } _ { j } ) ) } { \sum _ { k \in { \mathcal { A } } ( i ) } \exp ( f ( \mathbf { e } _ { i } , \mathbf { e } _ { k } ) ) } }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
$f ( \mathbf { e } _ { i } , \mathbf { e } _ { j } )$ is a scalar value representing the compatibility between the basic embeddings of $\mathbf { e } _ { i }$ and $\mathbf { e } _ { k }$ We compute $f ( \mathbf { e } _ { i } , \mathbf { e } _ { j } )$ via the following feed-forward network with a single hidden layer (MLP),
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
f ( \mathbf { e } _ { i } , \mathbf { e } _ { j } ) = \mathbf { u } _ { a } ^ { \top } \operatorname { t a n h } ( \mathbf { W } _ { a } \left[ \begin{array} { l } { \mathbf { e } _ { i } } \\ { \mathbf { e } _ { j } } \end{array} \right] + \mathbf { b } _ { a } )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\mathbf { W } _ { a } \in \mathbb { R } ^ { l \times { 2 m } }$ is the weight matrix for the concatenation of $\mathbf { e } _ { i }$ and $\mathbf { e } _ { j }$ , $\textbf { b } \in \mathbb { R } ^ { l }$ the bias vector, and $\mathbf { u } _ { a } \in \mathbb { R } ^ { l }$ the weight vector for generating the scalar value. The constant $l$ represents the dimension size of the hidden layer of $f ( \cdot , \cdot )$ . Note that we always concatenate $\mathbf { e } _ { i }$ and $\mathbf { e } _ { j }$ in the child-ancestor order.
|
| 63 |
+
|
| 64 |
+
Remarks: The example in Figure 1 is derived based on a single path from $c _ { i }$ to $c _ { a }$ . However, the same mechanism can be applicable to multiple paths as well. For example, code $c _ { k }$ has two paths to the root $c _ { a }$ , containing five ancestors in total. Another scenario is where the EHR data contain both leaf codes and some ancestor codes. We can move those ancestors present in EHR data from the set $\scriptstyle { \mathcal { C } } ^ { \prime }$ to $\mathcal { C }$ and apply the same process as Eq. (1) to obtain the final representations for them.
|
| 65 |
+
|
| 66 |
+
# 2.3 END-TO-END TRAINING WITH A PREDICTIVE MODEL
|
| 67 |
+
|
| 68 |
+
We train the attention mechanism together with a predictive model such that the attention mechanism improves the predictive performance. Once the final representations $\mathbf { g } _ { 1 } , \mathbf { g } _ { 2 } , \ldots , \mathbf { g } _ { | { \mathcal { C } } | }$ of all medical codes are obtained, we can convert visit $V _ { t }$ to a visit representation $\mathbf { v } _ { t }$ by using the embedding matrix $\mathbf { G } \in \mathcal { R } ^ { m \times | c | }$ where $\mathbf { g } _ { i }$ is its $i$ -th column as in Figure 1. We continue the mathematical formulation under the assumption that we are using the RNN to perform sequential diagnoses prediction (Choi et al., 2016a;b) with the objective of predicting the disease codes of the next visit $\bar { V _ { t + 1 } }$ given the visit records up to the current timestep $V _ { 1 } , V _ { 2 } , \dots , V _ { t }$ , which can be expressed as follows,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r } { \widehat { \mathbf { y } } _ { t } = \widehat { \mathbf { x } } _ { t + 1 } = \operatorname { S o f t m a x } ( \mathbf { W } \mathbf { h } _ { t } + \mathbf { b } ) , \quad \mathrm { w h e r e } } \\ { \mathbf { h } _ { 1 } , \mathbf { h } _ { 2 } , \ldots , \mathbf { h } _ { t } = \mathbf { R N N } ( \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \ldots , \mathbf { v } _ { t } ) , \quad \mathrm { w h e r e } } \\ { \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \ldots , \mathbf { v } _ { t } = \operatorname { t a n h } ( \mathbf { G } [ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { t } ] ) } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Table 1: Basic statistics of Sutter PAMF, MIMIC-III and Sutter heart failure (HF) cohort.
|
| 75 |
+
|
| 76 |
+
<table><tr><td>Dataset</td><td>Sutter PAMF</td><td>MIMIC-III</td><td>SutterHFcohort</td></tr><tr><td># of patients</td><td>258,555†</td><td>7,499t</td><td>30,727† (3,408 cases)</td></tr><tr><td>#of visits</td><td>13,920,759</td><td>19,911</td><td>572,551</td></tr><tr><td>Avg.# of visits per patient</td><td>53.8</td><td>2.66</td><td>38.38</td></tr><tr><td># of unique ICD9 codes</td><td>10,437</td><td>4,893</td><td>5,689</td></tr><tr><td>Avg.# of codes per visit</td><td>1.98</td><td>13.1</td><td>2.06</td></tr><tr><td>Max # of codes per visit</td><td>54</td><td>39</td><td>29</td></tr></table>
|
| 77 |
+
|
| 78 |
+
† Note that for all datasets, we selected patients who made at least two hospital visits.
|
| 79 |
+
|
| 80 |
+
where $\mathbf { x } _ { t } \in \mathbb { R } ^ { | \mathcal { C } | }$ denotes the $t$ -th visit; $\mathbf { v } _ { t } \in \mathbb { R } ^ { m }$ the $t { \cdot }$ -th visit representation; $\mathbf { h } _ { t } \in \mathbb { R } ^ { r }$ the RNN’s hidden layer at $t { \cdot }$ -th time step (i.e. $t$ -th visit); $\textbf { W } \in \mathbb { R } ^ { | \mathcal { C } | \times r }$ and $\textbf { b } \in \mathbb { R } ^ { | \mathcal { C } | }$ the weight matrices and the bias vector of the Softmax function; $r$ denotes the dimension size of the hidden layer. We use “RNN” to denote any recurrent neural network variants that can cope with the vanishing gradient problem (Bengio et al., 1994), such as LSTM (Hochreiter $\&$ Schmidhuber, 1997), GRU (Cho et al., 2014), and IRNN (Le et al., 2015), with any varying numbers of hidden layers. The prediction loss for all time steps is calculated using the cross entropy as follows, $\mathcal { L } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } \ldots , \mathbf { x } _ { T } ) =$ $\begin{array} { r } { - \frac { 1 } { T - 1 } \sum _ { t = 1 } ^ { T - 1 } \bigg ( \mathbf { y } _ { t } { } ^ { \top } \log ( \widehat { \mathbf { y } } _ { t } ) + ( \mathbf { 1 } - \mathbf { y } _ { t } ) ^ { \top } \log ( \mathbf { 1 } - \widehat { \mathbf { y } } _ { t } ) \bigg ) } \end{array}$ where we sum the cross entropy errors from all dimensions of $\widehat { \mathbf { y } } _ { t }$ , $T$ denotes the length of the visit sequence. Note that the above loss is defined bfor a single patient. But we can take the average of the individual loss for multiple patients.
|
| 81 |
+
|
| 82 |
+
# 2.4 INITIALIZING BASIC EMBEDDINGS
|
| 83 |
+
|
| 84 |
+
The attention generation mechanism in Section 2.2 requires basic embeddings $\mathbf { e } _ { i }$ of each node in the knowledge DAG. The basic embeddings of ancestors, however, pose a difficulty because they are often not observed in the data.To better initialize them, we use co-occurrence information to learn the basic embeddings of medical codes and their ancestors. Co-occurrence has proven to be an important source of information when learning representations of words or medical concepts (Mikolov et al., 2013; Choi et al., 2016c;e). To train the basic embeddings, we employ GloVe (Pennington et al., 2014), which uses the global co-occurrence matrix of words to learn their representations. In our case, the co-occurrence matrix of the codes and the ancestors was generated by counting the co-occurrences within each visit $V _ { t }$ , where we augment each visit with the ancestors of the codes in the visit. Details of training the basic embeddings are described in the Appendix A. Note that, with or without the initialization, the basic embeddings $\mathbf { e } _ { i }$ ’s of both leaf nodes (i.e. medical codes) and non-leaf nodes (i.e. ancestors) are fine-tuned when training our model, since the error signal flows from the output $\widehat { \mathbf { y } } _ { t }$ to the final representations $\mathbf { g } _ { i }$ ’s which are convex combinations of $\mathbf { e } _ { i }$ ’s.
|
| 85 |
+
|
| 86 |
+
# 3 EXPERIMENTS
|
| 87 |
+
|
| 88 |
+
We conduct three experiments to determine if GRAM offered superior prediction performance when facing data insufficiency. We first describe the experimental setup followed by results comparing predictive performance of GRAM with various baseline models. After discussing GRAM’s scalability, we qualitatively evaluate the interpretability of the resulting representation. The source code of GRAM is publicly available at https://github.com/mp2893/gram.
|
| 89 |
+
|
| 90 |
+
# 3.1 EXPERIMENT SETUP
|
| 91 |
+
|
| 92 |
+
Prediction tasks and source of data: We conduct two sequential diagnoses prediction tasks, which aim at predicting all diagnosis categories in the next visit, and one heart failure (HF) prediction task, which is a binary prediction task for predicting a future HF onset where the prediction is made only once at the last visit $\mathbf { x } _ { T }$ .
|
| 93 |
+
|
| 94 |
+
Two sequential diagnoses predictions are respectively conducted using 1) Sutter Palo Alto Medical Foundation (PAMF) dataset, which consists of 18-years longitudinal medical records of 258K patients between age 50 and 90. This will determine GRAM’s performance for general adult population with long visit records. 2) MIMIC-III dataset (Johnson et al., 2016; Goldberger et al., 2000), which is a publicly available dataset consisting of medical records of $7 . 5 \mathrm { K }$ intensive care unit (ICU) patients over 11 years. This will determine GRAM’s performance for high-risk patients with very short visit records. We utilize all the patients with at least 2 visits. We prepared the true labels $\mathbf { y } _ { t }$ by grouping the ICD9 codes into 283 groups using CCS single-level diagnosis grouper1. This is to improve the training speed and predictive performance for easier analysis, while preserving sufficient granularity for each diagnosis. Each diagnosis code’s varying frequency in the training data can be viewed as different degrees of data insufficiency. We calculate Accuracy $@ k$ for each of CCS single-level diagnosis codes such that, given a visit $V _ { t }$ , we get 1 if the target diagnosis is in the top $k$ guesses and 0 otherwise.
|
| 95 |
+
|
| 96 |
+
We conduct HF prediction on Sutter heart failure (HF) cohort, which is a subset of Sutter PAMF data for a heart failure onset prediction study with 3.4K HF cases and 27K controls chosen by a set of criteria (see Appendix B). This will determine GRAM’s performance for a different prediction task where we predict the onset of one specific condition. We randomly downsample the training data to create different degrees of data insufficiency. We use area under the ROC curve (AUC) to measure the performance.
|
| 97 |
+
|
| 98 |
+
A summary of the datasets are provided in Table 1.We used CCS multi-level diagnoses hierarchy2 as our knowledge DAG $\mathcal { G }$ . We also tested the ICD9 code hierarchy3, but the performance was similar to using CCS multi-level hierarchy. For all three tasks, we randomly divide the dataset into the training, validation and test set by .75:.10:.15 ratio, and use the validation set to tune the hyper-parameters. Further details regarding the hyper-parameter tuning are provided in Appendix C. The test set performance is reported in the paper.
|
| 99 |
+
|
| 100 |
+
Implementation details: We implemented GRAM with Theano 0.8.2 (Team, 2016). For training models, we used Adadelta (Zeiler, 2012) with a mini-batch of 100 patients, on a machine equipped with Intel Xeon E5-2640, 256GB RAM, four Nvidia Titan X’s and CUDA 7.5.
|
| 101 |
+
|
| 102 |
+
Models for comparison are the following. The first two $\mathrm { G R A M + }$ and GRAM are the proposed methods and the rest are baselines. Hyper-parameter tuning is configured so that the number of parameters for the baselines would be comparable to GRAM’s. Further details are provided in Appendix C.
|
| 103 |
+
|
| 104 |
+
• GRAM: Input sequence $\mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { T }$ is first transformed by the embedding matrix G, then fed to the GRU with a single hidden layer, which in turn makes the prediction, as described by Eq. (4). The basic embeddings $\mathbf { e } _ { i }$ ’s are randomly initialized.
|
| 105 |
+
• GRAM+: We use the same setup as GRAM, but the basic embeddings $\mathbf { e } _ { i }$ ’s are initialized according to Section 2.4.
|
| 106 |
+
• RandomDAG: We use the same setup as GRAM, but each leaf concept has five randomly assigned ancestors from the CCS multi-level hierarchy to test the effect of correct domain knowledge.
|
| 107 |
+
• RNN: Input $\mathbf { x } _ { t }$ is transformed by an embedding matrix $\mathbf { W } _ { e m b } \in \mathbb { R } ^ { k \times | \mathcal { C } | }$ , then fed to the GRU with a single hidden layer. The embedding size $k$ is a hyper-parameter. $\mathbf { W } _ { e m b }$ is randomly initialized and trained together with the GRU.
|
| 108 |
+
• $\mathbf { R N N + }$ : We use the same setup as RNN, but we initialize the embedding matrix $\mathbf { W } _ { e m b }$ with GloVe vectors trained only with the co-occurrence of leaf concepts. This is to compare GRAM with a similar weight initialization technique.
|
| 109 |
+
• SimpleRollUp: We use the same setup as RNN. But for input $\mathbf { x } _ { t }$ , we replace all diagnosis codes with their direct parent codes in the CCS multi-level hierarchy, giving us 578, 526 and 517 input codes respectively for Sutter data, MIMIC-III and Sutter HF cohort. This is to compare the performance of GRAM with a common grouping technique.
|
| 110 |
+
RollUpRare: We use the same setup as RNN, but we replace any diagnosis code whose frequency is less than a certain threshold in the dataset with its direct parent. We set the threshold to 100 for Sutter data and Sutter HF cohort, and 10 for MIMIC-III, giving us 4,408, 935 and 1,538 input codes respectively for Sutter data, MIMIC-III and Sutter HF cohort. This is an intuitive way of dealing with infrequent medical codes.
|
| 111 |
+
|
| 112 |
+
# 3.2 PREDICTION PERFORMANCE AND SCALABILITY
|
| 113 |
+
|
| 114 |
+
Tables 2a and 2b show the sequential diagnoses prediction performance on Sutter data and MIMIC-III. Both figures show that ${ \mathrm { G R A M } } +$ outperforms other models when predicting labels with significant data insufficiency (i.e. less observed in the training data).The performance gain is greater for MIMIC-III, where GRAM+ outperforms the basic RNN by $10 \%$ in the 20th-40th percentile range. This seems to come from the fact that MIMIC patients on average have significantly shorter visit history than Sutter patients, with much more codes received per visit. Such short sequences make it difficult for the RNN to learn and predict diagnoses sequence. The performance difference between GRAM+ and
|
| 115 |
+
|
| 116 |
+
Table 2: Performance of three prediction tasks. The $\mathbf { X }$ -axis of (a) and (b) represents the labels grouped by the percentile of their frequencies in the training data in non-decreasing order. For (c), we vary the size of the training data to train the models. (b) uses Accuracy $\textcircled{ a} 20$ because MIMIC-III has a large average number of codes per visit (see Table 1).
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp</td><td>0.0150 0.0042 0.0050 0.0069 0.0080 0.2691</td><td>0.3242 0.2987 0.2700 0.2742</td><td>0.4325 0.4224 0.4010 0.4140</td><td>0.4238 0.4193 0.4059 0.4212</td><td>0.4903 0.4895 0.4853 0.4959</td></tr></table>
|
| 119 |
+
|
| 120 |
+
(a) Accuracy@5 of sequential diagnoses prediction on Sutter data
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp</td><td>0.0672 0.0556 0.0329 0.0454 0.0454 0.0578 0.1328</td><td>0.1787 0.1016 0.0708 0.0843 0.0731</td><td>0.2644 0.1935 0.1346 0.2080 0.1804 0.2455 0.2667</td><td>0.2490 0.2296 0.1512 0.2494 0.2371</td><td>0.6267 0.6363 0.4494 0.6239 0.6243</td></tr></table>
|
| 123 |
+
|
| 124 |
+
(b) Accuracy@20 of sequential diagnoses prediction on MIMIC-III
|
| 125 |
+
|
| 126 |
+
<table><tr><td>Model</td><td>10%</td><td>20%</td><td>30%</td><td>40%</td><td>50%</td><td>60%</td><td>70%</td><td>80%</td><td>90%</td><td>100%</td></tr><tr><td>GRAM+</td><td>0.7970</td><td>0.8223</td><td>0.8307</td><td>0.8332</td><td>0.8389</td><td>0.8404</td><td>0.8452</td><td>0.8456</td><td>0.8447</td><td>0.8448</td></tr><tr><td>GRAM</td><td>0.7981</td><td>0.8217</td><td>0.8340</td><td>0.8332</td><td>0.8372</td><td>0.8377</td><td>0.8440</td><td>0.8431</td><td>0.8430</td><td>0.8447</td></tr><tr><td>RandomDAG</td><td>0.7644</td><td>0.7882</td><td>0.7986</td><td>0.8070</td><td>0.8143</td><td>0.8185</td><td>0.8274</td><td>0.8312</td><td>0.8254</td><td>0.8226</td></tr><tr><td>RNN+</td><td>0.7930</td><td>0.8117</td><td>0.8162</td><td>0.8215</td><td>0.8261</td><td>0.8333</td><td>0.8343</td><td>0.8353</td><td>0.8345</td><td>0.8335</td></tr><tr><td>RNN</td><td>0.7811</td><td>0.7942</td><td>0.8066</td><td>0.8111</td><td>0.8156</td><td>0.8207</td><td>0.8258</td><td>0.8278</td><td>0.8297</td><td>0.8314</td></tr><tr><td>SimpleRollUp</td><td>0.7799</td><td>0.8022</td><td>0.8108</td><td>0.8133</td><td>0.8177</td><td>0.8207</td><td>0.8223</td><td>0.8272</td><td>0.8269</td><td>0.8258</td></tr><tr><td>RollUpRare</td><td>0.7830</td><td>0.8067</td><td>0.8064</td><td>0.8119</td><td>0.8211</td><td>0.8202</td><td>0.8262</td><td>0.8296</td><td>0.8307</td><td>0.8291</td></tr></table>
|
| 127 |
+
|
| 128 |
+
(c) AUC of HF onset prediction on Sutter HF cohort
|
| 129 |
+
|
| 130 |
+
Table 3: Scalablity result in per epoch training time in second (the number of epochs needed).
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Model</td><td>Sequential diagnosis prediction (Sutter data)</td><td>Sequential diagnosis prediction (MIMIC-III)</td><td>HF prediction (Sutter HF cohort)</td></tr><tr><td>GRAM</td><td>525s (39 epochs)</td><td>2s (11 epochs)</td><td>12s (7 epochs)</td></tr><tr><td>RNN</td><td>352s (24 epochs)</td><td>1s (6 epochs)</td><td>8s (5 epochs)</td></tr></table>
|
| 133 |
+
|
| 134 |
+
GRAM suggests that our proposed initialization scheme of the basic embeddings $\mathbf { e } _ { i }$ is important for sequential diagnosis prediction.
|
| 135 |
+
|
| 136 |
+
Table 2c shows the HF prediction performance on Sutter HF cohort. GRAM and $\mathrm { G R A M + }$ consistently outperforms other baselines (except ${ \mathrm { R N N } } +$ ) by $3sim \mathrm { { } } 4 \%$ AUC, and $\mathrm { R N N } +$ by maximum $1 . 8 \%$ AUC. These differences are quite significant given that the AUC is already in the mid-80s, a high value for HF prediction, cf. (Choi et al., 2016d). Note that, for $\mathbf { G R A M + }$ and $\mathrm { R N N } +$ , we used the downsampled training data to initialize the basic embeddings $\mathbf { e } _ { i }$ ’s and the embedding matrix $\mathbf { W } _ { e m b }$ with GloVe, respectively. The result shows that the initialization scheme of the basic embeddings in $\mathrm { G R A M + }$ gives limited improvement over GRAM. This stems from the different natures of the two prediction tasks. While the goal of HF prediction is to predict a binary label for the entire visit sequence, the goal of sequential diagnosis prediction is to predict the co-occurring diagnosis codes at every visit. Therefore the co-occurrence information infused by the initialized embedding scheme is more beneficial to sequential diagnosis prediction. Additionally, this benefit is associated with the natures of the two prediction tasks than the datasets used for the prediction tasks. Because the initialized embedding shows different degrees of improvement as shown by Tables 2a and 2c, when Sutter HF cohort is a subset of Sutter PAMF, thus having similar characteristics. Additional prediction results when varying the $k$ of Accuracy $@ k$ are discussed in the Appendix D.
|
| 137 |
+
|
| 138 |
+
Overall, GRAM showed superior predictive performance under data insufficiency in three different experiments, demonstrating its general applicability in predictive healthcare modeling. Now we briefly discuss the scalability of GRAM by comparing its training time to RNN’s. Table 3 shows the number of seconds taken for the two models to train for a single epoch for each predictive modeling task. $\mathrm { G R A M + }$ and $\mathrm { R N N } +$ showed the same behavior as GRAM and RNN. GRAM takes approximately $50 \%$ more time to train for a single epoch for all prediction tasks. This stems from calculating attention weights and the final representations $\mathbf { g } _ { i }$ for all medical codes. GRAM also generally takes about $50 \%$ more epochs to reach to the model with the lowest validation loss. This is due to optimizing an extra MLP model that generates the attention weights. Overall, use of GRAM adds a manageable amount of overhead in training time to the plain RNN.
|
| 139 |
+
|
| 140 |
+
# 3.3 QUALITATIVE EVALUATION OF INTERPRETABLE REPRESENTATIONS
|
| 141 |
+
|
| 142 |
+
To qualitatively assess the interpretability of the learned representations of the medical codes, we plot on a 2-D space using t-SNE (Maaten & Hinton, 2008) the final representations $\mathbf { g } _ { i }$ of 2,000
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
(a) Scatterplot of the final representations ${ \bf g } _ { i }$ ’s of $\mathrm { G R A M + }$
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
(c) Scatterplot of the disease representations trained by GloVe
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 2: t-SNE scatterplots of medical concepts trained by $\mathrm { G R A M + }$ , $\mathrm { R N N } +$ and GloVe
|
| 152 |
+
|
| 153 |
+
(b) Scatterplot of the trained embedding matrix $\mathbf { W } _ { e m b }$ of $\mathrm { R N N } +$
|
| 154 |
+
|
| 155 |
+
randomly chosen diseases learned by $\mathrm { G R A M + }$ for sequential diagnoses prediction on Sutter data4 (Figure 2a). The colors represent the highest disease categories and the text annotations represent the detailed disease categories in CCS multi-level hierarchy. For comparison, we also show the t-SNE plots on the strongest results from $\mathrm { R N N } +$ (Figure 2b), and GloVe (Figure 2c), the same embedding technique in initializing the basic embeddings $\mathbf { e } _ { i }$ . Figures 2b and 2c confirm that interpretable representations cannot simply be learned only by co-occurrence or supervised prediction without medical knowledge. GRAM+ learns disease representations that are significantly more consistent with the given knowledge DAG $\mathcal { G }$ . Therefore the neural network predictive model that accepts $\mathbf { g } _ { i }$ is using accurate representations that lead to higher predictive performance. Additional scatterplots of other models are provided in Appendix E for comparison. An interactive visualization tool can be accessed at http://www.sunlab.org/research/gram-graph-based-attention-model/.
|
| 156 |
+
|
| 157 |
+
# 3.4 ANALYSIS OF THE ATTENTION BEHAVIOR
|
| 158 |
+
|
| 159 |
+
Next we show that GRAM’s attention can be interpreted to understand how it considers data availability and knowledge DAG’s structure when performing a prediction task. Using Eq. (1), we can calculate the attention weights of individual disease. Figure 3 shows the attention behaviors of four representative diseases when performing HF prediction on Sutter HF cohort.
|
| 160 |
+
|
| 161 |
+
Other pneumothorax (ICD9 512.89) in Figure 3a is rarely observed in the data and has only five siblings. In this case, most information is derived from the highest ancestor. Temporomandibular joint disorders & articular disc disorder (ICD9 524.63) in Figure 3b is rarely observed but has 139 siblings. In this case, its parent receives a stronger attention because it aggregates sufficient samples from all of its children to learn a more accurate representation. Note that the disease itself also receives a stronger attention to facilitate easier distinction from its large number of siblings.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3: GRAM’s attention behavior during HF prediction for four representative diseases (each column). In each figure, the leaf node represents the disease and upper nodes are its ancestors. The size of the node shows the amount of attention it receives, which is also shown by the bar charts. The number in the parenthesis next to the disease is its frequency in the training data. We exclude the root of the knowledge DAG $\mathcal { G }$ from all figures as it did not play a significant role.
|
| 165 |
+
|
| 166 |
+
Unspecified essential hypertension (ICD9 401.9) in Figure 3c is very frequently observed but has only two siblings. In this case, GRAM assigns a very strong attention to the leaf, which is logical because the more you observe a disease, the stronger your confidence becomes. Need for prophylactic vaccination and inoculation against influenza (ICD9 V04.81) in Figure 3d is quite frequently observed and also has 103 siblings. The attention behavior in this case is quite similar to the case with fewer siblings (Figure 3b) with a slight attention shift towards the leaf concept as more observations lead to higher confidence.
|
| 167 |
+
|
| 168 |
+
# 4 RELATED WORK
|
| 169 |
+
|
| 170 |
+
We introduce recent studies related to GRAM that learn the representations of graphs and discuss their relationship with GRAM. Several studies focused on learning the representations of graph vertices by using the neighbor information. DeepWalk (Perozzi et al., 2014) and node2vec (Grover & Leskovec, 2016) use random walk while LINE (Tang et al., 2015) uses breadth-first search to find the neighbors of a vertex and learn its representation based on the neighbor information. Graph convolutional approaches (Yang et al., 2016; Kipf & Welling, 2016) also focus on learning the vertex representations to mainly perform vertex classification. These works focus on solving the graph data problems whereas GRAM focuses on solving EHR data problems using the knowledge DAG as supplementary information.
|
| 171 |
+
|
| 172 |
+
Several researchers tried to model the knowledge DAG such as WordNet (Miller, 1995) or Freebase (Bollacker et al., 2008) where two entities are connected with various types of relation, forming a set of triples. They aim to project entities and relations (Bordes et al., 2013; Socher et al., 2013; Wang et al., 2014; Lin et al., 2015) to the latent space based on the triples or additional information such as hierarchy of entities (Xie et al., 2016). These works demonstrated tasks such as link prediction, triple classification or entity classification using the learned representations. More recently, Li et al. (2016) learned the representations of words and Wikipedia categories by utilizing the hierarchy of Wikipedia categories. GRAM is fundamentally different from the above studies in that it aims to design intuitive attention mechanism on the knowledge DAG as a knowledge prior to cope with data insufficiency and learn medically interpretable representations to make accurate predictions.
|
| 173 |
+
|
| 174 |
+
A classical approach for incorporating side information in the predictive models is to use graph Laplacian regularization (Weinberger et al., 2006; Che et al., 2015). However, using this approach is not straightforward as it relies on the appropriate definition of distance on graphs which is often unavailable.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION
|
| 177 |
+
|
| 178 |
+
Data insufficiency, either due to less common diseases or small datasets, is one of the key hurdles in healthcare analytics, especially when we apply deep neural networks models. To overcome this hurdle, we leverage the knowledge DAG, which provides a multi-resolution view of medical concepts. We propose GRAM, a graph-based attention model using both a knowledge DAG and EHR to learn an accurate and interpretable representations for medical concepts. GRAM chooses a weighted average of ancestors of a medical concept and train the entire process with a predictive model in an end-to-end fashion. We conducted three predictive modeling experiments on real EHR datasets and showed significant improvement in the prediction performance, especially on low-frequency diseases and small datasets. Analysis of the attention behavior provided intuitive insight of GRAM.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2), 1994.
|
| 183 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In SIGMOD, 2008.
|
| 184 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS, 2013.
|
| 185 |
+
Zhengping Che, David Kale, Wenzhe Li, Mohammad Taha Bahadori, and Yan Liu. Deep computational phenotyping. In SIGKDD, 2015.
|
| 186 |
+
Zhengping Che, Sanjay Purushotham, Kyunghyun Cho, David Sontag, and Yan Liu. Recurrent neural networks for multivariate time series with missing values. arXiv:1606.01865, 2016.
|
| 187 |
+
Kyunghyun Cho, Bart Van Merriënboer, 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.
|
| 188 |
+
Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F. Stewart, and Jimeng Sun. Doctor ai: Predicting clinical events via recurrent neural networks. In MLHC, 2016a.
|
| 189 |
+
Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F. Stewart, and Jimeng Sun. Retain: Interpretable predictive model in healthcare using reverse time attention mechanism. In NIPS, 2016b.
|
| 190 |
+
Edward Choi, Mohammad Taha Bahadori, Elizabeth Searles, Catherine Coffey, Michael Thompson, James Bost, Javier T Sojo, and Jimeng Sun. Multi-layer representation learning for medical concepts. In SIGKDD, 2016c.
|
| 191 |
+
Edward Choi, Andy Schuetz, Walter F Stewart, and Jimeng Sun. Using recurrent neural network models for early detection of heart failure onset. JAMIA, 2016d.
|
| 192 |
+
Youngduck Choi, Chill Yi-I Chiu, and David Sontag. Learning low-dimensional representations of medical concepts. 2016e. AMIA CRI.
|
| 193 |
+
Ary Goldberger et al. Physiobank, physiotoolkit, and physionet components of a new research resource for complex physiologic signals. Circulation, 2000.
|
| 194 |
+
Aditya Grover and Jure Leskovec. Node2vec: Scalable feature learning for networks. In SIGKDD, 2016.
|
| 195 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9(8), 1997.
|
| 196 |
+
Alistair Johnson et al. Mimic-iii, a freely accessible critical care database. Scientific Data, 3, 2016.
|
| 197 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv:1609.02907, 2016.
|
| 198 |
+
Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv:1504.00941, 2015.
|
| 199 |
+
Yuezhang Li, Ronghuo Zheng, Tian Tian, Zhiting Hu, Rahul Iyer, and Katia Sycara. Joint embedding of hierarchical categories and entities for concept categorization and dataless classification. 2016.
|
| 200 |
+
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI, 2015.
|
| 201 |
+
Zachary C Lipton, David C Kale, Charles Elkan, and Randall Wetzell. Learning to diagnose with lstm recurrent neural networks. arXiv:1511.03677, 2015.
|
| 202 |
+
Zachary C Lipton, David C Kale, and Randall Wetzel. Modeling missing data in clinical time series with rnns. In MLHC, 2016.
|
| 203 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. JMLR, 9(Nov), 2008.
|
| 204 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS, 2013.
|
| 205 |
+
George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11), 1995.
|
| 206 |
+
Riccardo Miotto, Li Li, Brian A Kidd, and Joel T Dudley. Deep patient: An unsupervised representation to predict the future of patients from the electronic health records. Scientific Reports, 6, 2016.
|
| 207 |
+
Phuoc Nguyen, Truyen Tran, Nilmini Wickramasinghe, and Svetha Venkatesh. Deepr: A convolutional net for medical records. arXiv:1607.07519, 2016.
|
| 208 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 209 |
+
Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In SIGKDD, 2014.
|
| 210 |
+
Healthcare Cost & Utilization Project et al. Clinical classifications software (ccs) for icd-9-cm. Rockville, MD:
|
| 211 |
+
Agency for Healthcare Research and Quality, 2010.
|
| 212 |
+
Narges Razavian, Jake Marcus, and David Sontag. Multi-task prediction of disease onsets from longitudinal lab tests. In MLHC, 2016.
|
| 213 |
+
Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In NIPS, 2013.
|
| 214 |
+
Michael Q Stearns, Colin Price, Kent A Spackman, and Amy Y Wang. Snomed clinical terms: overview of the development process and project status. In AMIA, 2001.
|
| 215 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In WWW, 2015.
|
| 216 |
+
The Theano Development Team. Theano: A python framework for fast computation of mathematical expressions. arXiv:1605.02688, 2016.
|
| 217 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI, 2014.
|
| 218 |
+
Kilian Q Weinberger, Fei Sha, Qihui Zhu, and Lawrence K Saul. Graph Laplacian Regularization for Large-Scale Semidefinite Programming. In NIPS, 2006.
|
| 219 |
+
Ruobing Xie, Zhiyuan Liu, and Maosong Sun. Representation learning of knowledge graphs with hierarchical types. In IJCAI, 2016.
|
| 220 |
+
Zhilin Yang, William Cohen, and Ruslan Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. arXiv:1603.08861, 2016.
|
| 221 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv:1212.5701, 2012.
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 4: Creating the co-occurrence matrix together with the ancestors. Here we exclude the root node, which will be just a single row (column). We first create an augmented dataset by adding the ancestors of the code to the dataset. Then, we count the co-occurrence of the codes. Performing GloVe on this matrix produces the embedding vectors $\mathbf { e } _ { i }$ .
|
| 225 |
+
|
| 226 |
+
# A GENERATING GLOVE EMBEDDINGS
|
| 227 |
+
|
| 228 |
+
We learn the basic embeddings $\mathbf { e } _ { i }$ ’s of medical codes and their ancestors using GloVe (Pennington et al., 2014), which uses global co-occurrence matrix of words to learn their representations. We generate the co-occurrence matrix of the codes and the ancestors by counting the co-occurrence within each visit $V _ { t }$ . However, since visits only contain the leaf codes $c \in { \mathcal { C } }$ , we augment each visit with the ancestors of the codes in each visit, then count the co-occurrence of codes and ancestors altogether.
|
| 229 |
+
|
| 230 |
+
We describe the details of the algorithm with an example. We borrow the parent-child relationships from the knowledge DAG of Figure 1. Given a visit $V _ { t }$ ,
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
V _ { t } = \{ c _ { d } , c _ { i } , c _ { k } \}
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
we augment it with the ancestors of all the codes to obtain the augmented visit $V _ { t } ^ { \prime }$ ,
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
V _ { t } ^ { \prime } = \{ c _ { d } , \underline { { { c _ { b } } } } , \underline { { { c _ { a } } } } , c _ { i } , \underline { { { c _ { g } } } } , \underline { { { c _ { c } } } } , \underline { { { c _ { a } } } } , c _ { k } , \underline { { { c _ { j } } } } , \underline { { { c _ { f } } } } , \underline { { { c _ { c } } } } , \underline { { { c _ { b } } } } , \underline { { { c _ { a } } } } \}
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
where the added ancestors are underlined. Note that a single ancestor can appear multiple times in $V _ { t } ^ { \prime }$ . In fact, the higher the ancestor is in the knowledge DAG, the more times it is likely to appear in $V _ { t } ^ { \prime }$ . We count the co-occurrence of two codes in $V _ { t } ^ { \prime }$ as follows,
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
c o \mathrm { - } o c c u r r e n c e ( c _ { i } , c _ { j } , V _ { t } ^ { \prime } ) = c o u n t ( c _ { i } , V _ { t } ^ { \prime } ) \times c o u n t ( c _ { j } , V _ { t } ^ { \prime } ) _ { l }
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
where $c o u n t ( c _ { i } , V _ { t } ^ { \prime } )$ is the number of times the code $c _ { i }$ appears in the augmented visit $V _ { t } ^ { \prime }$ . For example, the co-occurrence between the leaf code $c _ { i }$ and the root $c _ { a }$ is 3. However, the co-occurrence between the ancestor $c _ { c }$ and the root $c _ { a }$ is 6. Therefore our algorithm will naturally make the ancestor codes have higher co-occurrence with other codes compared to leaf medical codes. We repeat this calculation for all pairs of codes in all augmented visits of all patients to obtain the co-occurrence matrix depicted by Figure 4. For training the embedding vectors using the co-occurrence matrix, we use the same procedure and hyper-parameter as described in Pennington et al. (2014).
|
| 249 |
+
|
| 250 |
+
# B HEART FAILURE COHORT CONSTRUCTION
|
| 251 |
+
|
| 252 |
+
For the heart failure (HF) case patients, we select patients between 40 to 85 years of age at the time of HF diagnosis. HF diagnosis (HFDx) criteria are defined as: 1) Qualifying ICD-9 codes for HF appeared in the encounter records or medication orders. Qualifying ICD-9 codes are listed in Table 4. 2) at least three clinical encounters with qualifying ICD-9 codes had to occur within 12 months of each other, where the date of HFDx was assigned to the earliest of the three dates. If the time span between the first and second appearances of the HF diagnosis code was greater than 12 months, the date of the second encounter was used as the first qualifying encounter. Up to ten eligible controls (in terms of sex, age, location) were selected for each case, yielding average 9 controls per case. Each control was also assigned an index date, which is the HFDx date of the matched case. Controls are selected such that they did not meet the HF diagnosis criteria prior to the HFDx date plus 182 days of their corresponding case. Control subjects were required to have their first office encounter within one year of the matching HF case patient’s first office visit, and have at least one office encounter 30 days before or any time after the case’s HFDx date to ensure similar duration of observations among cases and controls.
|
| 253 |
+
|
| 254 |
+
Table 4: Qualifying ICD-9 codes for heart failure
|
| 255 |
+
|
| 256 |
+
<table><tr><td rowspan=1 colspan=1>ICD-9 Code</td><td rowspan=1 colspan=1>Description</td></tr><tr><td rowspan=1 colspan=1>398.91</td><td rowspan=1 colspan=1>Rheumatic heart failure (congestive)</td></tr><tr><td rowspan=1 colspan=1>402.01</td><td rowspan=1 colspan=1>Malignant hypertensive heart disease with heart failure</td></tr><tr><td rowspan=1 colspan=1>402.11</td><td rowspan=1 colspan=1>Benign hypertensive heart disease with heart failure</td></tr><tr><td rowspan=1 colspan=1>402.91</td><td rowspan=1 colspan=1>Unspecified hypertensive heart disease with heart failure</td></tr><tr><td rowspan=1 colspan=1>404.01</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, malignant, with heart failure and withchronic kidney disease stage I through stage IV, or unspecified</td></tr><tr><td rowspan=1 colspan=1>404.03</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, malignant, with heart failure and with chronic kidney disease stage V or end stage renal disease</td></tr><tr><td rowspan=1 colspan=1>404.11</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, benign, with heart failure and withchronic kidney disease stage I through stage IV, or unspecified</td></tr><tr><td rowspan=1 colspan=1>404.13</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, benign, with heart failure and chronickidney disease stage V or end stage renal disease</td></tr><tr><td rowspan=1 colspan=1>404.91</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, unspecified, with heart failure and with chronic kidney disease stage I through stage IV, or unspecified</td></tr><tr><td rowspan=1 colspan=1>404.93</td><td rowspan=1 colspan=1>Hypertensive heart and chronic kidney disease, unspecified, with heart failure andchronic kidney disease stage V or end stage renal disease</td></tr><tr><td rowspan=1 colspan=1>428.0</td><td rowspan=1 colspan=1>Congestive heart failure, unspecified</td></tr><tr><td rowspan=1 colspan=1>428.1</td><td rowspan=1 colspan=1>Leftheart failure</td></tr><tr><td rowspan=1 colspan=1>428.20</td><td rowspan=1 colspan=1>Systolic heart failure, unspecified</td></tr><tr><td rowspan=1 colspan=1>428.21</td><td rowspan=1 colspan=1> Acute systolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.22</td><td rowspan=1 colspan=1>Chronic systolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.23</td><td rowspan=1 colspan=1>Acute on chronic systolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.30</td><td rowspan=1 colspan=1>Diastolic heart failure, unspecified</td></tr><tr><td rowspan=1 colspan=1>428.31</td><td rowspan=1 colspan=1>Acute diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.32</td><td rowspan=1 colspan=1>Chronic diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.33</td><td rowspan=1 colspan=1>Acute on chronic diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.40</td><td rowspan=1 colspan=1>Combined systolic and diastolic heart failure, unspecified</td></tr><tr><td rowspan=1 colspan=1>428.41</td><td rowspan=1 colspan=1>Acute combined systolic and diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.42</td><td rowspan=1 colspan=1>Chronic combined systolic and diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.43</td><td rowspan=1 colspan=1> Acute on chronic combined systolic and diastolic heart failure</td></tr><tr><td rowspan=1 colspan=1>428.9</td><td rowspan=1 colspan=1>Heart failure, unspecified</td></tr></table>
|
| 257 |
+
|
| 258 |
+
# C HYPER-PARAMETER TUNING
|
| 259 |
+
|
| 260 |
+
We define five hyper-parameters for GRAM:
|
| 261 |
+
|
| 262 |
+
• dimensionality $m$ of the basic embedding $\mathbf { e } _ { i }$ : [100, 200, 300, 400, 500] • dimensionality $r$ of the RNN hidden layer $\mathbf { h } _ { t }$ from Eq. (4): [100, 200, 300, 400, 500] • dimensionality $l$ of $\mathbf { W } _ { a }$ and $ { \mathbf { b } } _ { a }$ from Eq. (3): [100, 200, 300, 400, 500] • $L _ { 2 }$ regularization coefficient for all weights except RNN weights: [0.1, 0.01, 0.001, 0.0001] • dropout rate for the dropout on the RNN hidden layer: [0.0, 0.2, 0.4, 0.6, 0.8]
|
| 263 |
+
|
| 264 |
+
We performed 100 iterations of the random search by using the above ranges for each of the three prediction experiments. For sequential diagnoses prediction on Sutter data, we used $10 \%$ of the training data to tune the hyper-parameters to balance the time and search space. To match the baselines’ number of parameters to GRAM’s, we add 550 to the list of $m$ ’s possible values. This will make the baseline’s largest possible number of parameters comparable to the GRAM’s largest possible number of parameters.
|
| 265 |
+
|
| 266 |
+
For SimpleRollUp and RollUpRare, the number of input codes is smaller than other models due to the grouping. Therefore, to match their largest possible number of parameters to GRAM’s, we need to add much larger values to $m$ . However, after preliminary experiments, as expected, setting $m$ to too large a value degraded the performance due to overfitting. Since the number of input codes decreased due to the grouping, increasing the dimensionality of $\mathbf { e } _ { i }$ is not a logical thing to do. Therefore, for SimpleRollUp and RollUpRare, we use the same list of values for $m$ as other baselines.
|
| 267 |
+
|
| 268 |
+
Table 5: Hyper-parameters used by the models in each predictive modeling experiments
|
| 269 |
+
|
| 270 |
+
<table><tr><td>Experiment</td><td>Model</td><td>m</td><td>r</td><td>1</td><td>L2</td><td>Dropout rate</td></tr><tr><td rowspan="6">Disease progression modeling (Sutter data)</td><td>GRAM+ GRAM</td><td>500 500</td><td>500 500</td><td>100 100</td><td>0.0001 0.0001</td><td>0.6 0.6</td></tr><tr><td>RandomDAG</td><td>500</td><td>500</td><td>100</td><td>0.0001</td><td>0.6</td></tr><tr><td>RNN+</td><td>550</td><td>500</td><td></td><td>0.0001</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>0.6</td></tr><tr><td>RNN</td><td>550</td><td>500</td><td></td><td>0.0001</td><td>0.6</td></tr><tr><td>SimpleRollUp RollUpRare</td><td>500 500</td><td>500 500</td><td></td><td>0.0001 0.0001</td><td>0.4 0.2</td></tr><tr><td rowspan="6">Disease progression modeling (MIMIC-III)</td><td>GRAM+ GRAM</td><td>400 400</td><td>400 400</td><td>100 100</td><td>0.0001</td><td>0.6</td></tr><tr><td>RandomDAG</td><td>400</td><td>400</td><td>100</td><td>0.001 0.001</td><td>0.6</td></tr><tr><td>RNN+</td><td>550</td><td>400</td><td></td><td>0.001</td><td>0.6</td></tr><tr><td></td><td></td><td>400</td><td></td><td></td><td>0.8</td></tr><tr><td>RNN SimpleRollUp</td><td>550 400</td><td>400</td><td></td><td>0.001 0.001</td><td>0.8 0.6</td></tr><tr><td></td><td>RollUpRare</td><td>400</td><td>400</td><td></td><td></td><td></td></tr><tr><td rowspan="6">HF prediction (Sutter HF cohort)</td><td></td><td></td><td></td><td></td><td>0.0001</td><td>0.0</td></tr><tr><td>GRAM+</td><td>200</td><td>100</td><td>100</td><td>0.001</td><td></td></tr><tr><td>GRAM</td><td>200</td><td>100</td><td>100</td><td></td><td>0.6</td></tr><tr><td>RandomDAG</td><td>300</td><td>100</td><td>200</td><td>0.001</td><td>0.6</td></tr><tr><td>RNN+</td><td>200</td><td>100</td><td></td><td>0.001</td><td>0.6</td></tr><tr><td></td><td></td><td></td><td></td><td>0.0001</td><td>0.6</td></tr><tr><td>RNN</td><td>200</td><td>100</td><td></td><td>0.001</td><td>0.6</td></tr><tr><td>SimpleRollUp</td><td>300</td><td>200</td><td></td><td>0.001</td><td>0.4</td></tr><tr><td>RollUpRare</td><td>100</td><td>100</td><td></td><td>0.001</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>0.6</td></tr></table>
|
| 271 |
+
|
| 272 |
+
Table 5 describes the final hyper-parameter settings we used for all models for each prediction experiments.
|
| 273 |
+
|
| 274 |
+
# D PREDICTION RESULTS USING DIFFERENT $k$ ’S IN ACCURACY@K
|
| 275 |
+
|
| 276 |
+
We show Accuracy@k using $k = 5 , 1 0 , 2 0 , 3 0$ for sequential diagnoses prediction on Sutter data (Tables 6a, 6b, 6c and 6d) and MIMIC-III (Tables 7a, 7b, 7c and 7d). We can see from the tables that $\mathrm { G R A M + }$ consistently outperforms other models under 40th percentile range, except when $k = 2 0 , 3 0$ for sequential diagnoses prediction on Sutter data where SimpleRollUp shows similar performance. We can also see that $\mathrm { G R A M + }$ performs significantly better than other models for all $k = 5$ , 10, 20, 30 when predicting infrequently observed diseases on MIMIC-III. As discussed in Section 3.2, this seems to come from the short visit sequences of MIMIC patients.
|
| 277 |
+
|
| 278 |
+
# E T-SNE 2-D PLOTS OF VARIOUS MODELS
|
| 279 |
+
|
| 280 |
+
For further comparison, we display t-SNE scatterplots of GRAM (Figure 5a) RandomDAG (Figure 5b, RNN (Figure 5c), and Skip-gram (Figure 5d). GRAM, RandomDAG and RNN were trained for sequential diagnoses prediction on Sutter data, and Skip-gram (Mikolov et al., 2013) was trained on Sutter data as it is an unsupervised method. For Skip-gram, we used each visit $V _ { t }$ as the context window. As we do not distinguish between the target concept and the neighbor concepts, we calculated the Skip-gram objective function using all possible pairs of codes within a single visit.
|
| 281 |
+
|
| 282 |
+
We can see from Figure 5a that the quality of the final representations $\mathbf { g } _ { i }$ of GRAM is quite similar to $\mathrm { G R A M + }$ (Figure 2a). Compared to other baselines, GRAM demonstrates significantly more structured representations that align well with the given knowledge DAG. It is interesting that Skip-gram shows the most structured representation among all baselines. We used GloVe to initialize the basic embeddings $\mathbf { e } _ { i }$ in this work because it uses global co-occurrence information and its training time is dependent only on the total number of unique concepts $| { \mathcal { C } } |$ . Skip-gram’s training time, on the other hand, depends on both the number of patients and the number of visits each patient made, which makes the algorithm generally slower than GloVe. However, considering both Figures $2 \mathrm { c }$ and 5d, initializing $\mathbf { e } _ { i }$ ’s with Skip-gram vectors might give us additional performance boost.
|
| 283 |
+
|
| 284 |
+
Table 6: Accuracy at various $k$ ’s (a to d) for sequential diagnoses prediction on Sutter data. The columns represent the labels grouped by the percentile of their frequencies in the training data in non-decreasing order.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RoliUpRare</td><td>0.0150 0.0042 0.0050 0.0069 0.0080 0.0085 0.0062</td><td>0.3242 0.2987 0.2700 0.2742 0.2691 0.3078 0.2768</td><td>0.4325 0.4224 0.4010 0.4140 0.4134 0.4369 0.4176</td><td>0.4238 0.4193 0.4059 0.4212 0.4227 0.4330 0.4226</td><td>0.4903 0.4895 0.4853 0.4959 0.4951 0.4924 0.4956</td></tr></table>
|
| 287 |
+
|
| 288 |
+
(a) Accuracy@5 of sequential diagnoses prediction on Sutter data
|
| 289 |
+
|
| 290 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RolUpRare</td><td>0.0319 0.0163 0.0142 0.0183 0.0196 0.0164 0.0204</td><td>0.3882 0.3645 0.3285 0.3412 0.3290 0.3768 0.3450</td><td>0.5054 0.4944 0.4691 0.4884 0.4871 0.5132 0.4917</td><td>0.5215 0.5173 0.5025 0.5233 0.5230 0.5326</td><td>0.6459 0.6445 0.6401 0.6538 0.6531 0.6521</td></tr></table>
|
| 291 |
+
|
| 292 |
+
(b) Accuracy@10 of sequential diagnoses prediction on Sutter data
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RoliUpRare</td><td>0.0630 0.0442 0.0397 0.0483 0.0481 0.0418 0.0517</td><td>0.4486 0.4276 0.3933 0.4132 0.4025 0.4496 0.4170</td><td>0.5764 0.5669 0.5389 0.5654 0.5630 0.5877 0.5672</td><td>0.6153 0.6125 0.5997 0.6235 0.6232 0.6262 0.6214</td><td>0.7973 0.7963 0.7919 0.8003 0.7995 0.8013</td></tr></table>
|
| 295 |
+
|
| 296 |
+
(c) Accuracy@20 of sequential diagnoses prediction on Sutter data
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RollUpRare</td><td>0.0946 0.0662 0.0672 0.0736 0.0733 0.0662 0.0759</td><td>0.4879 0.4693 0.4313 0.4604 0.4478 0.4924 0.4657</td><td>0.6186 0.6107 0.5843 0.6136 0.6103 0.6312 0.6146</td><td>0.6792 0.6766 0.6667 0.6930 0.6921 0.6907 0.6908</td><td>0.8800 0.8798 0.8760 0.8785 0.8767 0.8795 0.8778</td></tr></table>
|
| 299 |
+
|
| 300 |
+
(d) Accuracy@30 of sequential diagnoses prediction on Sutter data
|
| 301 |
+
|
| 302 |
+
Table 7: Accuracy at various $k$ ’s (a to d) for sequential diagnoses prediction on MIMIC-III. The columns represent the labels grouped by the percentile of their frequencies in the training data in non-decreasing order.
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RollUpRare</td><td>0.0086 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000</td><td>0.1089 0.0468 0.0327 0.0435 0.0376 0.0671 0.0423</td><td>0.1665 0.1093 0.0778 0.1266 0.1105 0.1501 0.1085</td><td>0.1029 0.0918 0.0612 0.0973 0.0923 0.1191 0.0874</td><td>0.2597 0.2665 0.1634 0.2594 0.2601 0.2635 0.2604</td></tr></table>
|
| 305 |
+
|
| 306 |
+
(a) Accuracy@5 of sequential diagnoses prediction on MIMIC-III
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RolUpRare</td><td>0.0380 0.0045 0.0023 0.0227 0.0023 0.0249 0.0227</td><td>0.1310 0.0682 0.0470 0.0587 0.0518 0.1038 0.0530</td><td>0.2095 0.1494 0.1025 0.1591 0.1389 0.1997 0.1412</td><td>0.1627 0.1487 0.0938 0.1616 0.1521 0.1769 0.1519</td><td>0.4175 0.4235 0.2692 0.4193 0.4142 0.4260</td></tr></table>
|
| 309 |
+
|
| 310 |
+
(b) Accuracy@10 of sequential diagnoses prediction on MIMIC-III
|
| 311 |
+
|
| 312 |
+
(c) Accuracy@20 of sequential diagnoses prediction on MIMIC-III
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RoliUpRare</td><td>0.0672 0.0556 0.0329 0.0454 0.0454 0.0578 0.0454</td><td>0.1787 0.1016 0.0708 0.0843 0.0731 0.1328 0.0653</td><td>0.2644 0.1935 0.1346 0.2080 0.1804 0.2455 0.1843</td><td>0.2490 0.2296 0.1512 0.2494 0.2371 0.2667</td><td>0.6267 0.6363 0.4494 0.6239 0.6243 0.6387</td></tr></table>
|
| 315 |
+
|
| 316 |
+
<table><tr><td>Model</td><td>0-20</td><td>20-40</td><td>40-60</td><td>60-80</td><td>80-100</td></tr><tr><td>GRAM+ GRAM RandomDAG RNN+ RNN SimpleRollUp RollUpRare</td><td>0.0744 0.0578 0.0351 0.0578 0.0578 0.0578 0.0556</td><td>0.2065 0.1157 0.0932 0.1103 0.0775 0.1556 0.0910</td><td>0.3180 0.2257 0.1635 0.2571 0.2237 0.2865 0.2235</td><td>0.3363 0.3074 0.2200 0.3409 0.3160 0.3488 0.3255</td><td>0.7726 0.7802 0.5977 0.7656 0.7643 0.7800</td></tr></table>
|
| 317 |
+
|
| 318 |
+
(d) Accuracy@30 of sequential diagnoses prediction on MIMIC-III
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
(a) Scatterplot of the final representations ${ \bf g } _ { i }$ ’s of GRAM
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
(b) Scatterplot of the final representations $\mathbf { g } _ { i }$ ’s of RandomDAG
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
(d) Scatterplot of the basic embeddings $\mathbf { e } _ { i }$ ’s trained by Skip-gram
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 5: Scatterplot of medical concepts trained by various models. We used t-SNE to reduce the dimension to 2-D.
|
| 331 |
+
|
| 332 |
+
(c) Scatterplot of the trained embedding matrix $\mathbf { W } _ { e m b }$ of RNN
|
md/train/Sy3fJXbA-/Sy3fJXbA-.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONNECTIVITY LEARNING IN MULTI-BRANCH NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While much of the work in the design of convolutional networks over the last five years has revolved around the empirical investigation of the importance of depth, filter sizes, and number of feature channels, recent studies have shown that branching, i.e., splitting the computation along parallel but distinct threads and then aggregating their outputs, represents a new promising dimension for significant improvements in performance. To combat the complexity of design choices in multi-branch architectures, prior work has adopted simple strategies, such as a fixed branching factor, the same input being fed to all parallel branches, and an additive combination of the outputs produced by all branches at aggregation points. In this work we remove these predefined choices and propose an algorithm to learn the connections between branches in the network. Instead of being chosen a priori by the human designer, the multi-branch connectivity is learned simultaneously with the weights of the network by optimizing a single loss function defined with respect to the end task. We demonstrate our approach on the problem of multi-class image classification using four different datasets where it yields consistently higher accuracy compared to the state-of-the-art “ResNeXt” multi-branch network given the same learning capacity.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks have emerged as one of the most prominent models for problems that require the learning of complex functions and that involve large amounts of training data. While deep learning has recently enabled dramatic performance improvements in many application domains, the design of deep architectures is still a challenging and time-consuming endeavor. The difficulty lies in the many architecture choices that impact—often significantly—the performance of the system. In the specific domain of image categorization, which is the focus of this paper, significant research effort has been invested in the empirical study of how depth, filter sizes, number of feature maps, and choice of nonlinearities affect performance (Glorot et al., 2011; Krizhevsky et al., 2012; Sermanet et al., 2013; Maas et al., 2013; Zeiler & Fergus, 2014; Szegedy et al., 2015). Recently, several authors have proposed to simplify the architecture design by defining convolutional neural networks (CNNs) in terms of combinations of basic building blocks. This strategy was arguably first popularized by the VGG networks (Simonyan & Zisserman, 2015) which were built by stacking a series of convolutional layers having identical filter size $\left( 3 \times 3 \right)$ . The idea of modularized CNN design was made even more explicit in residual networks (ResNets) (He et al., 2016), which are constructed by combining residual blocks of fixed topology. While in ResNets residual blocks are stacked one on top of each other to form very deep networks, the recently introduced ResNeXt models (Xie et al., 2017) have shown that it is also beneficial to arrange these building blocks in parallel to build multi-branch convolutional networks. The modular component of ResNeXt then consists of $C$ parallel branches, corresponding to residual blocks with identical topology but distinct parameters. Network built by stacking these multi-branch components have been shown to lead to better results than single-thread ResNets of the same capacity.
|
| 12 |
+
|
| 13 |
+
While the principle of modularized design has greatly simplified the challenge of building effective architectures for image analysis, the choice of how to combine and aggregate the computations of these building blocks still rests on the shoulders of the human designer. In order to avoid a combinatorial explosion of options, prior work has relied on simple, uniform rules of aggregation and composition. For example, ResNeXt models (Xie et al., 2017) are based on the following set of simplifying assumptions: the branching factor $C$ (also referred to as cardinality) is fixed to the mitted to 31st Conference on Neural Information Processing Systems (NIPS 2017). Do not distribute.same constant in all layers of the network, all branches of a module are fed the same input, and the outputs of parallel branches are aggregated by a simple additive operation that provides the input to the next module. In this paper we remove these predefined choices and propose an algorithm that Submitted to 31st Conference on Neural Information Processing Systems (NIPS 2017). Do not distlearns to combine and aggregate building blocks of a neural network. In this new regime, the network Submitted to 31st Conference on Neural Information Prconnectivity naturally arises as a result of the training optimization rather than being hand-defined by the human designer.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
y = x + F (x; ✓ j ) (1)21 F (x; ✓2) 1Figure 1: Different types of building blocks for modular network design: (a) a prototypical residual j=1 1block with bottleneck convolutional layers (He et al., 2016); (b) the multi-branch RexNeXt module consisting of $C$ Cparallel residual blocks (Xie et al., 2017); (c) our approach replaces the fixed y = x + F(aggregation points of RexNeXt with learnable masks $\mathbf { m }$ ✓j ) (1)defining the input connections for each individual residual block.
|
| 17 |
+
|
| 18 |
+
itted to 31st Conference on Neural Information Processing Systems (NIPS 2017). Do noWe demonstrate our approach using residual blocks as our modular components, but we take inspiration from ResNeXt by arranging these modules in a multi-branch architecture. Rather than Submitted to 31st Conference on Neural Information Processing Systems (NIPS 2017). Do not distribute.predefining the input connections and aggregation pathways of each branch, we let the algorithm discover the optimal way to combine and connect residual blocks with respect to the end learning objective. This is achieved by means of masks, i.e., learned binary parameters that act as “switches” determining the final connectivity in our network. The masks are learned together with the convolutional weights of the network, as part of a joint optimization via backpropagation with respect to a traditional multi-class classification objective. We demonstrate that, given the same budget of residual blocks (and parameters), our learned architecture consistently outperforms the predefined ResNeXt network in all our experiments. An interesting byproduct of our approach is that it can automatically identify residual blocks that are superfluous, i.e., unnecessary or detrimental for the end objective. At the end of the optimization, these unused residual blocks can be pruned away without any impact on the learned hypothesis while yielding substantial savings in number of parameters to store and in test-time computation.
|
| 19 |
+
|
| 20 |
+
# 2 TECHNICAL APPROACH
|
| 21 |
+
|
| 22 |
+
# 2.1 MODULAR MULTI-BRANCH ARCHITECTURE
|
| 23 |
+
|
| 24 |
+
We begin by providing a brief review of residual blocks (He et al., 2016), which represent the modular components of our architecture. We then discuss ResNeXt (Xie et al., 2017), which inspired the multi-branch structure of our networks. Finally, we present our approach to learning the connectivity of multi-branch architectures using binary masks.
|
| 25 |
+
|
| 26 |
+
Residual Learning. The framework of residual learning was introduced by He et al. (He et al., 2016) as a strategy to cope with the challenging optimization of deep models. The approach was inspired by the observation that deeper neural networks, despite having larger learning capacity than shallower models, often yield higher training error, due to the difficulty of optimization posed by increasing depth. Yet, given any arbitrary shallow network, it is trivially possible to reproduce its function using a deeper model, e.g., by copying the shallow network into the top portion of the deep model and by setting the remaining layers to implement identity functions. This simple yet revealing intuition inspired the authors to introduce residual blocks, which learn residual functions with reference to the layer input. Figure 1(a) illustrates an example of these modular components where the 3 layers in the block implement a residual function $\mathcal F ( \mathbf x )$ . A shortcut connections aggregates the residual block output $\mathcal { F } ( \mathbf { x } )$ with its input $\mathbf { x }$ , thus computing $\mathcal { F } ( \mathbf { x } ) + \mathbf { x } .$ , which becomes the input to the next block. The point of this module is that if at any depth in the network the representation $\mathbf { x }$ is already optimal, then $\mathcal { F } ( \mathbf { x } )$ can be trivially set to be the zero function, which is easier to learn than an identity mapping. In fact, it was shown (He et al., 2016) that reformulating the layers as learning residuals eases optimization and enables the effective training of networks that are substantially deeper than previously possible. Since we are interested in applying our approach to image categorization, in this paper we use convolutional residual blocks using the bottleneck (He et al., 2016) shown in Figure 1(a). The first $1 \times 1$ layer projects the input feature maps onto a lower dimensional embedding, the second applies $3 \times 3$ filters, and the third restores the original feature map dimensionality. As in (He et al., 2016), Batch Normalization (Ioffe & Szegedy, 2015) and ReLU (Krizhevsky et al., 2012) are applied after each layer, and a ReLU is used after each aggregation.
|
| 27 |
+
|
| 28 |
+
The multi-branch architecture of ResNeXt. Recent work (Xie et al., 2017) has shown that it is beneficial to arrange residual blocks not only along the depth dimension but also to implement parallel multiple threads of computation feeding from the same input layer. The outputs of the parallel residual blocks are then summed up together with the original input and passed on to the next module. The resulting multi-branch module is illustrated in Figure 1(b). More formally, let $\mathcal { F } ( \mathbf { x } ; \theta _ { j } ^ { ( i ) } )$ be the transformation implemented by the $j$ -th residual block in module $i$ -th of the network, where $j = 1 , \ldots , C$ and $i = 1 , \ldots , L$ , with $L$ denoting the total number of modules stacked on top of each other to form the complete network. The hyperparameter $C$ is called the cardinality of the module and defines the number of parallel branches within each module. The hyperparameter $L$ controls the total depth of the network: under the assumption of 3 layers per residual block (as shown in the figure), the total depth of the network is given by $D = 2 + 3 L$ (an initial convolutional layer and an output fully-connected layers add 2 layers). Note that in ResNeXt all residual blocks in a module have the same topology $( \mathcal { F } )$ but each block has its own parameters $\cdot \theta _ { j } ^ { ( i ) }$ denotes the parameters of residual block $j$ in module $i$ ). Then, the output of the $i$ -th module is computed as:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\mathbf { y } = \mathbf { x } + \sum _ { j = 1 } ^ { C } \mathcal { F } ( \mathbf { x } ; \boldsymbol { \theta } _ { j } ^ { ( i ) } )
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
Tensor $\mathbf { y }$ represents the input to the $( i + 1 )$ -th module. Note that the ResNeXt module effectively implements a split-transform-merge strategy that perfoms a projection of the input into separate lower-dimensional embeddings (via bottlenecks), a separate transformation within each embedding, a projection back to the high-dimensional space and a final aggregation via addition. It can be shown that the solutions that can be implemented by such module are a strict subspace of the solutions of a single layer operating on the high-dimensional embedding but at a considerably lower cost in terms of computational complexity and number of parameters. In (Xie et al., 2017) it was experimentally shown that increasing the cardinality $C$ is a more effective way of improving accuracy compared to increasing depth or the number of filters. In other words, given a fixed budget of parameters, ResNeXt multi-branch networks were shown to consistently outperform single-branch ResNets of the same learning capacity.
|
| 35 |
+
|
| 36 |
+
We note, however, that in an attempt to ease network design, several restrictive limitations were embedded in the architecture of ResNeXt modules: each ResNeXt module implements $C$ parallel feature extractors that operate on the same input; furthermore, the number of active branches is constant at all depth levels of the network. In the next subsection we present an approach that removes these restrictions without adding any significant burden on the process of manual network design (with the exception of a single additional integer hyperparameter for the entire network).
|
| 37 |
+
|
| 38 |
+
Our masked multi-branch architecture. As in ResNeXt, our proposed architecture consists of a stack of $L$ multi-branch modules, each containing $C$ parallel feature extractors. However, differently from ResNeXt, each branch in a module can take a different input. The input pathway of each
|
| 39 |
+
|
| 40 |
+
branch is controlled by a binary mask vector that is learned jointly with the weights of the network.
|
| 41 |
+
Let con m(ij $\mathbf { m } _ { j } ^ { ( i ) } = [ m _ { j , 1 } ^ { ( i ) } , m _ { j , 2 } ^ { ( i ) } , \ldots , m _ { j , C } ^ { ( i ) } ] ^ { \top } \in \{ 0 , 1 \} ^ { C }$ be the binin module ry . If tor defining the active input, then the activation volume $j$ $i$ $m _ { j , k } ^ { ( i ) } = 1$
|
| 42 |
+
produced by the $k$ -th branch in module $( i - 1 )$ is fed as input to the $j$ -th residual block of module . If
|
| 43 |
+
$\mathbf { \dot { \rho } } _ { m _ { j , k } ^ { ( i ) } } = 0$ , then the output from the $k$ -th branch in the previous module is ignored by the $j$ -th residual
|
| 44 |
+
j,blothe of the current modul-th branch in module , if we den, the input with to t $\mathbf { \hat { y } } _ { k } ^ { ( i - 1 ) }$ the output activation tens residual block in module computed bywill be given $k$ $( i - 1 )$ $\mathbf { x } _ { j } ^ { ( i ) }$ $j$ $i$
|
| 45 |
+
by the following equation:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathbf { x } _ { j } ^ { ( i ) } = \sum _ { k = 1 } ^ { C } m _ { j , k } ^ { ( i ) } \cdot \mathbf { y } _ { k } ^ { ( i - 1 ) }
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Then, the output of this block will be obtained through the usual residual computation, i.e., $\mathbf { y } _ { j } ^ { ( i ) } = \mathbf { x } _ { j } ^ { ( i ) } + \bar { \mathcal { F } } ( \mathbf { x } _ { j } ^ { ( i ) } ; \boldsymbol { \theta } _ { j } ^ { ( i ) } )$ . We note that under this model we no longer have fixed aggregation nodes summing up all outputs computed from a module. Instead, the mask $\mathbf { m } _ { j } ^ { ( i ) }$ now determines selectively for each block which branches from the previous module will be aggregated and provided as input to the block. Under this scheme, the parallel branches in a module receive different inputs and as such are likely to yield more diverse features.
|
| 52 |
+
|
| 53 |
+
We point out that depending on the constraints posed over $\mathbf { m } _ { i } ^ { ( i ) }$ , different interesting models can be realized. For example, by introducing the constraint that Pk m(i)j,k for all blocks $j$ , then each residual block will receive input from only one branch (since each m(i)j,k must be either 0 or 1). It can be noted that at the other end of the spectrum, if we set $\begin{array} { r } { \dot { m } _ { j , k } ^ { ( i ) } = 1 } \end{array}$ for all blocks $j , k$ in each module $i$ , then all connections would be active and we would obtain again the fixed ResNeXt architecture. In our experiments we will demonstrate that the best results are achieved for a middle ground between these two extremes, i.e., by connecting each block to $K$ branches where $K$ is an integer-valued hyperparameter such that $1 < K < C$ . We refer to this hyperparameter as the fan-in of a block. As discussed in the next section, the mask vector $\mathbf { m } _ { j } ^ { \left( i \right) }$ for each block is learned simultaneously with all the other weights in the network via backpropagation. Finally, we note that it may be possible for a residual block in the network to become unused. This happens when, as a result of the optimization, block k in module (i − 1) is such that m(i)jk $m _ { j k } ^ { ( i ) } = 0$ for all $j = 1 , \ldots , C$ . In this case, at the end of the optimization, we prune the block in order to reduce the number of parameters to store and to speed up inference (note that this does not affect the function computed by the network). Thus, at any point in the network the total number of active parallel threads can be any number smaller than or equal to $C$ . This implies that a variable branching factor is learned adaptively for the different depths in the network.
|
| 54 |
+
|
| 55 |
+
# 2.2 MASKCONNECT: LEARNING TO CONNECT BRANCHES
|
| 56 |
+
|
| 57 |
+
We refer to our learning algorithm as MASKCONNECT. It performs joint optimization of a given learning objective $\ell$ with respect to both the weights of the network $\mathbf { \eta } ^ { ( \theta ) }$ as well as the masks $\mathbf { \Pi } ^ { ( \mathbf { m } ) }$ . Since in this paper we apply our method to the problem of image categorization, we use the traditional multi-class cross-entropy objective for the loss $\ell$ . However, our approach can be applied without change to other loss functions as well as to other tasks benefitting from a multi-branch architecture.
|
| 58 |
+
|
| 59 |
+
In MASKCONNECT the weights have real values, as in traditional networks, while the branch masks have binary values. This renders the optimization more challenging. To learn these binary parameters, we adopt a modified version of backpropagation, inspired by the algorithm proposed by Courbariaux et al. (Courbariaux et al., 2015) to train neural networks with binary weights. During training we store and update a real-valued version $\tilde { \mathbf { m } } _ { j } ^ { ( i ) } \in [ 0 , 1 ] ^ { C }$ of the branch masks, with entries clipped to lie in the continuous interval from 0 to 1.
|
| 60 |
+
|
| 61 |
+
In general, the training via backpropagation consists of three steps: 1) forward propagation, 2) backward propagation, and 3) parameters update. At each iteration, we stochastically binarize the real-valued branch masks into binary-valued vectors $\mathbf { m } _ { j } ^ { ( i ) } \in \{ 0 , 1 \} ^ { \dot { C } }$ which are then used for the forward propagation and backward propagation (steps 1 and 2). Instead, during the parameters update (step 3), the method updates the real-valued branch masks $\tilde { \mathbf { m } } _ { j } ^ { ( i ) }$ . The weights $\theta$ of the convolutional and fully connected layers are optimized using standard backpropagation. We discuss below the details of our mask training procedure, under the constraint that at any time there can be only $K$ active entries in the binary branch mask $\mathbf { m } _ { j } ^ { ( i ) }$ , where $K$ is a predefined integer hyperparameter with
|
| 62 |
+
|
| 63 |
+
$1 \leq K \leq C$ . In other words, we impose the following constraints:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
m _ { j , k } ^ { ( i ) } \in \{ 0 , 1 \} , \quad \sum _ { k = 1 } ^ { C } m _ { j , k } ^ { ( i ) } = K \forall j \in \{ 1 , \ldots , C \} \mathrm { ~ a n d } \forall i \in \{ 1 , \ldots , L \} .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
These constraints imply that each residual block receives input from exactly $K$ branches of the previous module.
|
| 70 |
+
|
| 71 |
+
Forward Propagation. During the forreal-valued branch masks for each block (i) (i) (i) $j$ ard propagation, our algorithmto sum up to 1, i.e., such that $\begin{array} { r } { \sum _ { k = 1 } ^ { C } \tilde { m } _ { j , k } ^ { ( i ) } = 1 } \end{array}$ es the . This $C$ done so that Mult( ˜m j,1, m˜ j,2, . . , m˜ j,C ) defines a proper multinomial distribution over the $C$ branch connections feeding into block $j$ . Then, the binary branch mask $\mathbf { m } _ { j } ^ { ( i ) }$ is stochastically generated by drawing $K$ distinct samples $a _ { 1 } , a _ { 2 } , \ldots , a _ { K } \in \{ 1 , \ldots , C \}$ from the multinomial distribution over the branch connections. Finally, the entries corresponding to the $K$ samples are activated in the binary branch mask vector, i.e., m(i)j,ak $\dot { m } _ { j , a _ { k } } ^ { ( i ) } \gets 1$ , for $k = 1 , . . . , K$ . The input activation volume to the residual block sampl $j$ is then computed according to Eq. 2 from the sampled binary branch masks.g from the Multinomial distribution ensures that the connections with largest ote that thevalues will $\tilde { m } _ { j , k } ^ { ( i ) }$ be more likely to be chosen, while at the same time the stochasticity of this process allows different connectivities to be explored, particularly during early stages of the learning when the real-valued masks have still fairly uniform values.
|
| 72 |
+
|
| 73 |
+
Backward Propagation. In the backward propagation steto each branch output is obtained via back-propagation from adient and t $\partial \ell / \partial y _ { k } ^ { ( i - 1 ) }$ withasks ect. $\partial \ell / \partial x _ { j } ^ { \overline { { ( i ) } } }$ $m _ { j , k } ^ { ( i ) }$
|
| 74 |
+
|
| 75 |
+
Mask Update. In the parameter update step our algorithm computes the gradient with respect to the binary branch masks for each branch. Then, using these computed gradients and the given learning rate, it updates the real-valued branch masks via gradient descent. At this time we clip the updated real-valued branch masks to constrain them to remain within the valid interval $[ 0 , 1 ]$ . The same clipping strategy was adopted for the binary weights in the work of Courbariaux et al. (2015).
|
| 76 |
+
|
| 77 |
+
As discussed in the supplementary material, after joint training over $\theta$ and $\mathbf { m }$ , we have found beneficial to fine-tune the weights $\theta$ of the network with fixed binary masks (connectivity), by setting as active connections for each block $j$ in module $i$ those corresponding to the $K$ largest values in $\tilde { \mathbf { m } } _ { j } ^ { ( i ) }$ . Pseudocode for our training procedure is given in the supplementary material.
|
| 78 |
+
|
| 79 |
+
# 3 EXPERIMENTS
|
| 80 |
+
|
| 81 |
+
We tested our approach on the task of image categorization using several benchmarks: CIFAR10 (Krizhesvsky, 2009), CIFAR-100 (Krizhesvsky, 2009), Mini-ImageNet (Vinyals et al., 2016), as well as the full ImageNet (Deng et al., 2009). In this section we discuss results achieved on CIFAR-100 and ImageNet (Deng et al., 2009), while the results for CIFAR-10 (Krizhesvsky, 2009) and Mini-ImageNet (Vinyals et al., 2016) can be found in the Appendix.
|
| 82 |
+
|
| 83 |
+
# 3.1 CIFAR-100
|
| 84 |
+
|
| 85 |
+
CIFAR-100 is a dataset of color images of size $3 2 \mathbf { x } 3 2$ . It consists of 50,000 training images and 10,000 test images. Each image in CIFAR-100 is categorized into one of 100 possible classes.
|
| 86 |
+
|
| 87 |
+
Effect of fan-in $( K )$ . We start by studying the effect of the fan-in hyperparameter $( K )$ on the performance of models built and trained using our proposed approach. The fan-in defines the number of active branches feeding each residual block. For this experiment we use a model obtained by stacking $L = 6$ multi-branch residual modules, each having cardinality $C = 8$ (number of branches in each module). We use residual blocks consisting of 3 convolutional layers with a bottleneck implementing dimensionality reduction on the number of feature channels, as shown in Figure 1. The bottleneck for this experiment was set to $w = 4$ . Since each residual block consists of 3 layers, the total depth of the network in terms of learnable layers is $D = 2 + 3 L = 2 0$ .
|
| 88 |
+
|
| 89 |
+
We trained and tested this architecture using different fan-in values: $K = 1 , . . , 8$ . Note that varying $K$ does not affect the number of parameters. Thus, all these models have the same learning capacity.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 2: Varying the fan-in $( K )$ of our model, i.e., the number of active branches provided as input to each residual block. The plot reports accuracy achieved on CIFAR-100 using a network stack of $L = 6$ ResNeXt modules having cardinality $C \ = \ 8$ and bottleneck width $w = 4$ . All models have the same number of parameters (0.28M). The best accuracy is obtained for $K = 4$ .
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: A visualization of the fixed branch connectivity of ResNext (left) versus the connectivity learned by our method (right) using $K = 1$ ). Each green square is a residual block, each row of $C \ = \ 8$ square is a multibranch module. The network consists of a stack of $L = 9$ modules. Arrows indicate pathways connecting residual blocks of adjacent modules. In each net, the top red circle is a convolutional layer, the bottom circle is the final fully-connected layer. It can be noticed that MASKCONNECT learns sparse connections. The squares without $_ \mathrm { i n / o u t }$ edges are those deemed superfluous by our algorithm and can be pruned at the end of learning. This gives rise to a branching factor that varies along the depth of the net.
|
| 96 |
+
|
| 97 |
+
The results are shown in Figure 2. We can see that the best accuracy is achieved by connecting each residual block to $K = 4$ branches out of the total $C = 8$ in each module. Using a very low or very high fan-in yields lower accuracy. Note that when setting $K = C$ , there is no need to learn the masks. In this case each mask is simply replaced by an element-wise addition of the outputs from all the branches. This renders the model equivalent to ResNeXt (Xie et al., 2017), which has fixed connectivity. Based on the results of Figure 2, in all our experiments below we use $K = 4$ , since it gives the best accuracy, but also $K = 1$ , since it gives high sparsity which, as we will see shortly, implies savings in number of parameters.
|
| 98 |
+
|
| 99 |
+
Varying the architectures. In Table 1 we show the classification accuracy achieved with different architectures (the details of each architecture are listed in the Appendix). For each architecture we report results obtained using MASKCONNECT with fan-in $K = 1$ and $K = 4$ . We also include the accuracy achieved with full (as opposed to learned) connectivity, which corresponds to ResNeXt. These results show that learning the connectivity produces consistently higher accuracy than using fixed connectivity, with accuracy gains of up $2 . 2 \%$ compared to the state-of-the-art ResNeXt model.
|
| 100 |
+
|
| 101 |
+
We note that these improvements in accuracy come at little computational training cost: the average training time overhead for learning masks and weights is about $3 9 \%$ using our unoptimized implementation compared to learning only the weights given a fixed connectivity. Additionally, for each architecture we include models trained using sparse random connectivity (Fixed-Random). For these models, each mask is set to have $K = 4$ randomly-chosen active connections, and the connectivity is kept fixed during learning of the parameters. We can notice that the accuracy of these nets is considerably lower compared to our models, despite having the same connectivity density $X = 4$ ). This shows that the improvements of our approach over ResNeXt are not due to sparser connectivity but they are rather due to learned connectivity.
|
| 102 |
+
|
| 103 |
+
Parameter savings. Our proposed approach provides the benefit of automatically identifying during training residual blocks that are unnecessary. At the end of the training, the unused residual blocks can be pruned away. This yields savings in the number of parameters to store and in testtime computation. In Table 1, columns Train and Test under Params show the original number of parameters (used during training) and the number of parameters after pruning (used at test-time). Note that for the biggest architecture, our approach using $K = 1$ yields a parameter saving of $40 \%$ compared to ResNeXt with full connectivity (20.5M vs 34.4M), while achieving the same accuracy. Thus, in summary, using fan-in $K = 4$ gives models that have the same number of parameters as ResNeXt but they yield higher accuracy; using fan-in $K = 1$ gives a significant saving in number of parameters and accuracy on par with ResNeXt.
|
| 104 |
+
|
| 105 |
+
Model with real-valued masks. We have also attempted to learn our models using real-valued masks by computing tensors in the forward and backward propagation with respect to masks $\tilde { \mathbf { m } } _ { j } ^ { ( i ) } \in [ \tilde { 0 , 1 } ] ^ { C }$ rather than the binary vectors $\mathbf { m } _ { j } ^ { ( i ) } \in \{ 0 , 1 \} ^ { C }$ . However, we found this variant to
|
| 106 |
+
|
| 107 |
+
Table 1: CIFAR-100 accuracies (single crop) achieved by different architectures trained using the predefined full connectivity of ResNeXt (Fixed-Full) versus the connectivity learned by our algorithm (Learned). We also include models trained using random, fixed connectivity (Fixed-Random) defined by setting $K = 4$ random active connections per branch. Each model was trained 4 times, using different random initializations. For each model we report the best test performance as well as the mean test performance computed from the 4 runs. For our method, we report performance using $K = 1$ as well as $K = 4$ . We also list the number of parameters used during training (Params-Train) and the number of parameters obtained after pruning the unused blocks (Params-Test). Our learned connectivity using $K = 4$ produces accuracy gains of up $2 . 2 \%$ compared to the strong ResNeXt model, while using $K = 1$ yields results equivalent to ResNeXt but it induces a significant reduction in number of parameters at test time (a saving of $40 \%$ for model $\{ 2 9 , 6 4 , 8 \} ,$ ).
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Architecture {Depth (D), Bottleneck width (w),Cardinality (C)}</td><td rowspan="2">Connectivity</td><td colspan="2">Params</td><td>Accuracy (%)</td></tr><tr><td>Train</td><td>Test</td><td>Top-1 best (mean±std)</td></tr><tr><td rowspan="4">{29,8,8}</td><td>Fixed-Full, K=8 (Xie et al.,2017)</td><td>0.86M</td><td>0.86M</td><td>73.52 (73.37±0.13)</td></tr><tr><td>Learned, K=1</td><td>0.86M</td><td>0.65M</td><td>73.91 (73.76±0.14)</td></tr><tr><td>Learned, K=4</td><td>0.86M</td><td>0.81M</td><td>75.89 (75.77±0.12)</td></tr><tr><td>Fixed-Random, K=4</td><td>0.86M</td><td>0.85M</td><td>72.85 (72.66±0.24)</td></tr><tr><td rowspan="4">{29,64,8}</td><td>Fixed-Full, K=8 (Xie et al.,2017)</td><td>34.4M</td><td>34.4M</td><td>82.23 (82.12±0.12)</td></tr><tr><td>Learned, K=1</td><td>34.4M</td><td>20.5M</td><td>82.31 (82.15±0.15)</td></tr><tr><td>Learned, K=4</td><td>34.4M</td><td>32.1M</td><td>84.05 (83.94±0.11)</td></tr><tr><td>Fixed-Random, K=4</td><td>34.4M</td><td>34.3M</td><td>81.96 (81.73±0.20)</td></tr></table>
|
| 110 |
+
|
| 111 |
+
yield consistently lower results compared to our models using binary masks. For example, for model $\{ D = 2 9 , \stackrel { \cdot } { w } = 8 , C = 8 \}$ the best accuracy achieved with real-valued masks is $1 . 9 3 \%$ worse compared to that obtained with binary masks. In particular we observed that for this variant, the real-valued masks change little over training even when using large learning rates. Conversely, performing the forward and backward propagation using stochastically-sampled binary masks yields a larger exploration of connectivities and results in bigger changes of the auxiliary real-valued masks leading to better connectivity learning.
|
| 112 |
+
|
| 113 |
+
Visualization of the learned connectivity. Figure 3 provides an illustration of the connectivity learned by MASKCONNECT for $K = 1$ versus the fixed connectivity of ResNeXt for model $\{ D =$ 2 $9 , w = 8 , C = 8 \}$ . While ResNeXt feeds the same input to all blocks of a module, our algorithm learns different input pathways for each block and yields a branching factor that varies along depth.
|
| 114 |
+
|
| 115 |
+
# 3.2 IMAGENET
|
| 116 |
+
|
| 117 |
+
Finally, we evaluate our approach on the large-scale ImageNet 2012 dataset (Deng et al., 2009), which includes images of 1000 classes. We train our approach on the training set (1.28M images) and evaluate it on the validation set (50K images). In Table 2, we report the Top-1 and Top-5 accuracies for three different architectures. For these experiments we set $\bar { K } = C / 2$ . We can observe that for all three architectures, our learned connectivity yields an improvement in accuracy over the fixed connectivity of ResNeXt (Xie et al., 2017).
|
| 118 |
+
|
| 119 |
+
# 3.3 CIFAR-10 & MINI-IMAGENET
|
| 120 |
+
|
| 121 |
+
We invite the reader to review results achieved on CIFAR-10 & Mini-ImageNet in the Appendix. Also on these datasets our algorithm consistently outperforms the ResNeXt models based on fixed connectivity, with accuracy gains of up to $3 . 8 \%$ .
|
| 122 |
+
|
| 123 |
+
# 4 RELATED WORK
|
| 124 |
+
|
| 125 |
+
Despite their wide adoption, deep networks often require laborious model search in order to yield good results. As a result, significant research effort has been devoted to the design of algorithms for automatic model selection. However, most of this prior work falls within the genre of hyperparameter optimization (Bergstra & Bengio, 2012; Snoek et al., 2012; 2015) rather than architecture or connectivity learning. Evolutionary search has been proposed as an interesting framework to learn both the structure as well as the connections in a neural network (Wierstra et al., 2005; Floreano et al., 2008; Real et al., 2017). Architecture search has also been recently formulated as a reinforcement learning problem with impressive results (Zoph & Le, 2017). Unlike these approaches, our method is limited to learning the connectivity within a predefined architecture but it does so efficiently by gradient descent optimization of the learning objective as opposed to more costly procedures such as evolutionary search or reinforcement learning. Several authors have proposed learning connectivity by pruning unimportant weights from the network (LeCun et al., 1989; Han et al., 2015a;b; Guo et al., 2016; Han et al., 2016). However, these prior methods operate in stages where initially the network with full connectivity is learned and then connections are greedily removed according to an importance criterion. In PathNet (Fernando et al., 2017), the connectivity within a given architecture was searched via evolution. Compare to these prior approaches, our work provides the advantage of learning the connectivity by direct global optimization of the loss function of the problem at hand rather than by greedy optimization of a proxy criterion or by evolution. Our technical approach shares similarities with the “Shake-Shake” regularization recently introduced in unpublished work (Gastaldi, 2017). This procedure was demonstrated on two-branch ResNeXt models and consists in randomly scaling tensors produced by parallel branches during each training iteration while at test time the network uses uniform weighting of tensors. Conversely, our algorithm learns an optimal binary scaling of the parallel tensors with respect to the training objective and uses the resulting network with sparse connectivity at test time. Our work is also related to approaches that learn a hierarchical structure in the last one or two layers of a network in order to obtain distinct features for different categories (Murdock et al., 2016; Ahmed & Torresani, 2017). Differently from these methods, our algorithm learns efficiently connections at all depths in the network, thus optimizing over a much larger family of connectivity models. While our algorithm is limited to optimizing the connectivity structure within a predefined architecture, Adams et al. (Adams et al., 2010) proposed a nonparametric Bayesian approach that searches over an infinite network using MCMC. Saxena and Verbeek (Saxena & Verbeek, 2016) introduced convolutional neural fabric which are learnable 3D trellises that locally connect response maps at different layers of a CNN. Similarly to our work, they enable optimization over an exponentially large family of connectivities, albeit different from those considered here.
|
| 126 |
+
|
| 127 |
+
Table 2: ImageNet accuracies (single crop) achieved by different architectures using the predefined connectivity of ResNeXt (Fixed-Full) versus the connectivity learned by our algorithm (Learned).
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Architecture</td><td>Connectivity</td><td colspan="2">Accuracy</td></tr><tr><td>{Depth (D), Bottleneck width (w), Cardinality (C}</td><td></td><td>Top-1</td><td>Top-5</td></tr><tr><td rowspan="2">{50,4,32}</td><td>Fixed-Full, K=32 (Xie et al., 2017)</td><td>77.8</td><td>93.3</td></tr><tr><td>Learned, K=16</td><td>79.1</td><td>94.1</td></tr><tr><td rowspan="2">{101,4,32}</td><td>Fixed-Full, K=32 (Xie et al.,2017)</td><td>78.8</td><td>94.1</td></tr><tr><td>Learned, K=16</td><td>79.5</td><td>94.5</td></tr><tr><td rowspan="2">{101,4,64}</td><td>Fixed-Full, K=64 (Xie et al., 2017)</td><td>79.6</td><td>94.7</td></tr><tr><td>Learned, K=32</td><td>79.8</td><td>94.8</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 5 CONCLUSIONS
|
| 132 |
+
|
| 133 |
+
In this paper we introduced an algorithm to learn the connectivity of deep multi-branch networks. The problem is formulated as a single joint optimization over the weights and the branch connections of the model. We tested our approach on challenging image categorization benchmarks where it led to significant accuracy improvements over the state-of-the-art ResNeXt model. An added benefit of our approach is that it can automatically identify superfluous blocks, which can be pruned without impact on accuracy for more efficient testing and for reducing the number of parameters to store.
|
| 134 |
+
|
| 135 |
+
While our experiments were focused on a particular multi-branch architecture (ResNeXt) and a specific form of building block (residual block), we expect the benefits of our approach to extend to other modules and network structures. For example, it could be applied to learn the connectivity of skip-connections in DenseNets (Huang et al., 2017), which are currently based on predefined connectivity rules. In this paper, our masks perform non-parametric additive aggregation of the branch outputs. It would be interesting to experiment with learnable (parametric) aggregations of the outputs from the individual branches. Our approach is limited to learning connectivity within a given, fixed architecture. Future work will explore the use of learnable masks for architecture discovery.
|
| 136 |
+
|
| 137 |
+
# REFERENCES
|
| 138 |
+
|
| 139 |
+
Ryan Prescott Adams, Hanna M. Wallach, and Zoubin Ghahramani. Learning the structure of deep sparse graphical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2010, Chia Laguna Resort, Sardinia, Italy, May 13-15, 2010, pp. 1–8, 2010.
|
| 140 |
+
|
| 141 |
+
Karim Ahmed and Lorenzo Torresani. Branchconnect: Large-scale visual recognition with learned branch connections. CoRR, abs/1704.06010, 2017. URL http://arxiv.org/abs/1704. 06010.
|
| 142 |
+
|
| 143 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13:281–305, 2012.
|
| 144 |
+
|
| 145 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems 28, Montreal, Quebec, Canada, pp. 3123–3131, 2015.
|
| 146 |
+
|
| 147 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei Li. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2009), 20-25 June 2009, Miami, Florida, USA, pp. 248–255, 2009.
|
| 148 |
+
|
| 149 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A. Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. CoRR, abs/1701.08734, 2017. URL http://arxiv.org/abs/1701.08734.
|
| 150 |
+
|
| 151 |
+
Dario Floreano, Peter Durr, and Claudio Mattiussi. Neuroevolution: from architectures to learning. ¨ Evolutionary Intelligence, 1(1):47–62, 2008.
|
| 152 |
+
|
| 153 |
+
Xavier Gastaldi. Shake-shake regularization. CoRR, abs/1705.07485, 2017. URL http://arxiv. org/abs/1705.07485.
|
| 154 |
+
|
| 155 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2011, Fort Lauderdale, USA, April 11-13, 2011, pp. 315–323, 2011.
|
| 156 |
+
|
| 157 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 1379–1387, 2016.
|
| 158 |
+
|
| 159 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. In International Conference on Learning Representations (ICLR), 2015a.
|
| 160 |
+
|
| 161 |
+
Song Han, Jeff Pool, John Tran, and William J. Dally. Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems 28, Montreal, Quebec, Canada, pp. 1135–1143, 2015b.
|
| 162 |
+
|
| 163 |
+
Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Shijian Tang, Erich Elsen, Bryan Catanzaro, John Tran, and William J. Dally. DSD: regularizing deep neural networks with dense-sparse-dense training flow. In International Conference on Learning Representations (ICLR), 2016.
|
| 164 |
+
|
| 165 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, 2016.
|
| 166 |
+
|
| 167 |
+
Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2017.
|
| 168 |
+
|
| 169 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015.
|
| 170 |
+
|
| 171 |
+
Alex Krizhesvsky. Learning multiple layers of features from tiny images, 2009. Technical Report https://www.cs.toronto.edu/˜kriz/learning-features-2009-TR.pdf.
|
| 172 |
+
|
| 173 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25, Lake Tahoe, Nevada, United States., pp. 1106–1114, 2012.
|
| 174 |
+
|
| 175 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In Advances in Neural Information Processing Systems 2, [NIPS Conference, Denver, Colorado, USA, November 27-30, 1989], pp. 598–605, 1989.
|
| 176 |
+
|
| 177 |
+
Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. Proc. ICML, 30:1, 2013.
|
| 178 |
+
|
| 179 |
+
Calvin Murdock, Zhen Li, Howard Zhou, and Tom Duerig. Blockout: Dynamic model selection for hierarchical deep networks. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 2583–2591, 2016.
|
| 180 |
+
|
| 181 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 182 |
+
|
| 183 |
+
Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Quoc V. Le, and Alex Kurakin. Large-scale evolution of image classifiers. CoRR, abs/1703.01041, 2017.
|
| 184 |
+
|
| 185 |
+
Shreyas Saxena and Jakob Verbeek. Convolutional neural fabrics. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 4053–4061, 2016.
|
| 186 |
+
|
| 187 |
+
Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus, and Yann LeCun. ¨ Overfeat: Integrated recognition, localization and detection using convolutional networks. In International Conference on Learning Representations (ICLR), 2013.
|
| 188 |
+
|
| 189 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 190 |
+
|
| 191 |
+
Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical bayesian optimization of machine learning algorithms. In Advances in Neural Information Processing Systems 25, Lake Tahoe, Nevada, United States., pp. 2960–2968, 2012.
|
| 192 |
+
|
| 193 |
+
Jasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Md. Mostofa Ali Patwary, Prabhat, and Ryan P. Adams. Scalable bayesian optimization using deep neural networks. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 2171–2180, 2015.
|
| 194 |
+
|
| 195 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pp. 1–9, 2015.
|
| 196 |
+
|
| 197 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29, Barcelona, Spain, pp. 3630–3638, 2016.
|
| 198 |
+
|
| 199 |
+
Daan Wierstra, Faustino J. Gomez, and Jurgen Schmidhuber. Modeling systems with internal state ¨ using evolino. In Genetic and Evolutionary Computation Conference, GECCO 2005, Proceedings, Washington DC, USA, June 25-29, 2005, pp. 1795–1802, 2005.
|
| 200 |
+
|
| 201 |
+
Saining Xie, Ross B. Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual ´ transformations for deep neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, 2017.
|
| 202 |
+
|
| 203 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part I, pp. 818–833, 2014.
|
| 204 |
+
|
| 205 |
+
Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 206 |
+
|
| 207 |
+
# A PSEUDOCODE OF THE ALGORITHM
|
| 208 |
+
|
| 209 |
+
# Algorithm 1 MASKCONNECT training algorithm.
|
| 210 |
+
|
| 211 |
+
Input: a minibatch of labeled examples $( x ^ { i } , y ^ { i } )$ , $C$ : cardinality (number of branches), $K$ : fan-in (number of active branch connections), $\eta$ : learning rate, $\ell$ : the loss over the minibatch, $\tilde { \mathbf { m } } _ { j } ^ { ( i ) } \in [ 0 , 1 ] ^ { C }$ : real-valued branch masks for block $j$ in module $_ { i }$ from previous training iteration.
|
| 212 |
+
Output: updated $\tilde { \mathbf { m } } _ { j } ^ { ( i ) }$
|
| 213 |
+
1. Forward Propagation:
|
| 214 |
+
Normalize the real-valued mask to sum up to 1: m˜ (i)j,k $\begin{array} { r } { \tilde { m } _ { j , k } ^ { ( i ) } \gets \frac { \tilde { m } _ { j , k } ^ { ( i ) } } { \sum _ { k ^ { \prime } = 1 } ^ { C } \tilde { m } _ { j , k ^ { \prime } } ^ { ( i ) } } } \end{array}$ , for $j = 1 , \ldots , C$
|
| 215 |
+
Reset binary mask: $\mathbf { m } _ { j } ^ { ( i ) } \gets \mathbf { 0 }$
|
| 216 |
+
Draw $K$ distinct samples from multinomial mask distribution:
|
| 217 |
+
$a _ { 1 } , a _ { 2 } , \ldots , a _ { K } \gets \hat { \mathbf { M u l t } } ( \tilde { m } _ { j , 1 } ^ { ( i ) } , \tilde { m } _ { j , 2 } ^ { ( i ) } , \ldots , \tilde { m } _ { j , C } ^ { ( i ) } )$
|
| 218 |
+
Set active binary mask based on drawn samples:
|
| 219 |
+
$m _ { j , a _ { k } } ^ { ( i ) } \gets 1$ for $k = 1 , . . . , K$
|
| 220 |
+
Compute output $\mathbf { x } _ { j } ^ { ( i ) }$ of the mask, given branch activations $\begin{array} { r } { \mathbf { y } _ { k } ^ { ( i - 1 ) } \colon \mathbf { x } _ { j } ^ { ( i ) } \sum _ { k = 1 } ^ { C } m _ { j , k } ^ { ( i ) } \cdot \mathbf { y } _ { k } ^ { ( i - 1 ) } } \end{array}$
|
| 221 |
+
j2. Backward Propagation:
|
| 222 |
+
Compute Compute $\frac { \partial \ell } { \partial \mathbf { x } _ { j } ^ { ( i ) } }$ om fro ∂ y(i)j \`
|
| 223 |
+
$\frac { \partial \ell } { \partial \mathbf { y } _ { k } ^ { ( i - 1 ) } }$ ∂x(i)j and m(i)j,k
|
| 224 |
+
3. Parameter Update:
|
| 225 |
+
Compute m˜ (i) ← c $\frac { \partial \ell } { \partial m _ { j , k } ^ { ( i ) } }$ given (i) − η ∂ x(i)j d y(ik an\` ) $\mathbf { y } _ { k } ^ { ( i - 1 ) }$
|
| 226 |
+
$\begin{array} { r } { \tilde { m } _ { j , k } ^ { ( i ) } \mathrm { c l i p } ( \tilde { m } _ { j , k } ^ { ( i ) } - \eta \cdot \frac { \partial \ell } { \partial m _ { j , k } ^ { ( i ) } } ) } \end{array}$
|
| 227 |
+
|
| 228 |
+
# B EXPERIMENTS ON CIFAR-10
|
| 229 |
+
|
| 230 |
+
The CIFAR-10 dataset consists of color images of size $3 2 \mathrm { x } 3 2$ . The training set contains 50,000 images, the testing set 10,000 images. Each image in CIFAR-10 is categorized into one of 10 possible classes. In Table 3, we report the performance of different models trained on CIFAR-10. From these results we can observe that our models using learned connectivity achieve consistently better performance over the equivalent models trained with the fixed connectivity (Xie et al., 2017).
|
| 231 |
+
|
| 232 |
+
Table 3: CIFAR-10 accuracies (single crop) achieved by different multi-branch architectures trained using the predefined connectivity of ResNeXt (Fixed-Full) versus the connectivity learned by our algorithm (Learned). Each model was trained 4 times, using different random initializations. For each model we report the best test performance as well as the mean test performance computed from the 4 runs.
|
| 233 |
+
|
| 234 |
+
<table><tr><td>Architecture</td><td>Connectivity</td><td>Accuracy (%)</td></tr><tr><td>{Depth (D), Bottleneck width (w), Cardinality (C)}</td><td></td><td>Top-1 best (mean±std)</td></tr><tr><td>{20,4,8}</td><td>Fixed-Full K=8 (Xie et al., 2017) Learned K=4</td><td>91.39 (91.13±0.11) 92.85 (92.76±0.10)</td></tr><tr><td>{29,4,8}</td><td>Fixed-Full K=8 (Xie et al.,2017) Learned K=4</td><td>92.77 (92.65±0.09) 93.88 (93.76±0.12)</td></tr><tr><td>{29,8.8}</td><td>Fixed-Full K=8 (Xie et al.,2017) Learned K=4</td><td>93.26 (93.14±0.11) 95.11 (94.96±0.12)</td></tr><tr><td>{29,64,8}</td><td>Fixed-Full K=8 (Xie et al.,2017) Learned K=4</td><td>96.35 (96.23±0.12) 96.83 (96.73±0.11)</td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 4: Mini-ImageNet accuracies achieved by different multi-branch networks trained using the predefined full connectivity of ResNeXt (Fixed-Full) versus the connectivity learned by our algorithm (Learned). Additionally, we include models trained using random fixed connectivity (Fixed-Random) for $K = 4$ . For each model we report the best and the mean test performance computed from 4 different training runs. Our method for joint learning of weights and connectivity yields a gain of over $3 \%$ in Top-1 accuracy over ResNeXt, which uses the same architectures but a fixed branch connectivity.
|
| 237 |
+
|
| 238 |
+
<table><tr><td>Architecture</td><td>Connectivity</td><td>Accuracy</td></tr><tr><td>{Depth (D), Bottleneck width (w), Cardinality (C}</td><td></td><td>Top-1 best (mean±std)</td></tr><tr><td rowspan="3">{20,4,8}</td><td>Fixed-Full K=8 (Xie et al., 2017)</td><td>62.12 (61.86±0.15)</td></tr><tr><td>Learned K=4</td><td>66.09 (65.94±0.16)</td></tr><tr><td>Fixed-Random K=4</td><td>62.42 (61.81±0.32)</td></tr><tr><td rowspan="3">{29,8,8}</td><td>Fixed-Full K=8 (Xie et al., 2017)</td><td>68.11 (67.89±0.19)</td></tr><tr><td>Learned K=4</td><td>71.36 (71.18±0.19)</td></tr><tr><td>Fixed-Random K=4</td><td>67.97 (67.53±0.20)</td></tr></table>
|
| 239 |
+
|
| 240 |
+
# C EXPERIMENTS ON MINI-IMAGENET
|
| 241 |
+
|
| 242 |
+
Mini-ImageNet is a subset of the full ImageNet (Deng et al., 2009) dataset. It was used in (Vinyals et al., 2016; Ravi & Larochelle, 2017). It is created by randomly selecting 100 classes from the full ImageNet (Deng et al., 2009). For each class, 600 images are randomly selected. We use 500 examples per class for training, and the other 100 examples per class for testing. The selected images are resized to size 84x84 pixels as in (Vinyals et al., 2016; Ravi & Larochelle, 2017). The advantage of this dataset is that it poses the recognition challenges typical of the ImageNet photos but at the same time it does not need require the powerful resources needed to train on the full ImageNet dataset. This allows to include the additional baselines involving random fixed connectivity (Fixed-Random).
|
| 243 |
+
|
| 244 |
+
We report the performance of different models trained on Mini-ImageNet in Table 4. From these results, we see that our models using learned connectivity with fan-in $K { = } 4$ yield a nice accuracy gain over the same models trained with the fixed full connectivity of ResNeXt (Xie et al., 2017). The absolute improvement (in Top-1 accuracy) is $3 . 8 7 \%$ for the 20-layer network and $3 . 1 7 \%$ for the 29-layer network. We can notice that the accuracy of the models with fixed random connectivity (Fixed-Random) is considerably lower compared to our nets with learned connectivity, despite having the same connectivity density $K = 4$ ). This shows that the improvement of our approach over ResNeXt is not due to sparser connectivity but it is rather due to learned connectivity.
|
| 245 |
+
|
| 246 |
+
# D VISUALIZATIONS OF LEARNED CONNECTIVITY
|
| 247 |
+
|
| 248 |
+
The plot in Figure 4 shows how the number of active branches varies as a function of the module depth for model $\{ D = 2 9 , w = 4 , C = 8 \}$ trained on CIFAR-100. For $K = 1$ , we can observe that the number of active branches tends to be larger for deep modules (closer to the output layer) compared to early modules (closer to the input). We observed this phenomenon consistently for all architectures. This suggests that having many parallel threads of computation is particularly important in deep layers of the network. Conversely, the setting $K = 4$ tends to produce a fairly uniform number of active branches across the modules and the number is quite close to the maximum value $C$ . For this reason, there is little saving in terms of number of parameters when using $K = 4$ , as there are rarely unused blocks.
|
| 249 |
+
|
| 250 |
+
The plot in Figure 5 shows the number of active branches as a function of module depth for model $\{ D \stackrel { - } { = } 5 0 , w \stackrel { - } { = } 4 , C = 3 2 \}$ trained on ImageNet, using $K = 1 6$ .
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 4: Number of active branches as a function of module depth for model $\{ D = 2 9 , w = 4 , C =$ $8 \}$ trained on CIFAR-100. We report how the number of active branches varies for model trained with fan-in $K = 1$ as well as for the net trained with $K = 4$ . The setting $K = 1$ tends to leave many blocks unused, especially in the early modules of the network.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: Number of active branches as a function of module depth for model $\{ D = 5 0 , w = 4 , C =$ $\mathrm { 3 2 } \bar \}$ trained on ImageNet, using fan-in $K = 1 6$ .
|
| 257 |
+
|
| 258 |
+
Table 5: Specifications of the architectures used in our experiments on the CIFAR-10 and CIFAR-100 datasets. The architectures differ in terms of depth $( D )$ , bottleneck width $( w )$ , and cardinality $( C )$ . Inside the brackets we specify the residual block used in each multi-branch module by listing the number of input channels, the size of the convolutional filters, as well as the number of filters (number of output channels). To the right of each bracket we list the cardinality (i.e., the number of parallel branches in the module). $\times 2$ means that the same multi-branch module is stacked twice. The first layer for all models is a convolutional layer with 16 filters of size $3 \times 3$ . The last layer performs global average pooling followed by a softmax.
|
| 259 |
+
|
| 260 |
+
<table><tr><td colspan="3">{D=20,w=4,C=8}</td><td colspan="3">{D=29,w=4,C=8}</td><td colspan="3">{D=29,w=8,C=8}</td><td colspan="2">{D=29,w=64,C=8}</td></tr><tr><td colspan="3">3,3×3,16</td><td colspan="2">3,3×3,16</td><td colspan="3">3,3×3,16</td><td colspan="3">3,3×3,64</td></tr><tr><td>16,1×1,4 4,3×3,4 [4,1×1,64 [64,1×1,4] 4,3×3,4</td><td>(C=8) (C=8)</td><td></td><td>[16,1×1,4 4,3×3,4 [4,1×1,64 [64,1×1,4]</td><td>(C=8)</td><td>16,1×1,8 8,3×3,8 8,1×1,64 [64,1×1,8]</td><td>(C=8)</td><td></td><td>64,1×1,64 64,3×3,64 64,1×1,256 [256,1×1,64</td><td>(C=8)</td></tr><tr><td>[4,1×1,64 [64,1×1,8 8,3×3,8 [8,1×1,128 [128,1×1,8 8,3×3,8</td><td></td><td>(C=8)</td><td>4,3×3,4 [4,1×1,64 [64,1×1,8 8,3×3,8 [8,1×1,128</td><td>(C=8),×2 (C=8)</td><td>8,3×3,8 [8,1×1,64] [64,1×1,16 16,3×3,16 16,1×1,128</td><td>(C=8),×2 (C=8)</td><td>64,3×3,64</td><td>64,1×1,256 256,1×1,128 128,3×3,128 128,1×1,512</td><td>(C=8),×2 (C=8)</td></tr><tr><td>8,1×1,128 128,1×1,16</td><td></td><td>(C=8)</td><td>[128,1×1,8 8,3×3,8 [8,1×1,128 128,1×1,16</td><td>(C=8),×2</td><td>[128,1×1,16 16,3×3,16 16,1×1,128 128,1×1,32</td><td>(C=8),×2</td><td></td><td>[512,1×1,128] 128,3×3,128 128,1×1,512] 512,1×1,256</td><td>(C=8), ×2</td></tr><tr><td colspan="2">16,3×3,16 [16,1×1,256 [256,1×1,16] 16,3×3,16 16,1×1,256</td><td>(C=8) (C=8)</td><td colspan="2">16,3×3,16 (C=8) [16,1×1,256 [256,1×1,16] 16,3×3,16 (C=8),×2</td><td>32,3×3,32 32,1×1,256 256,1×1,32 32,3×3,32</td><td>(C=8)</td><td></td><td>256,3×3,256 [256,1×1,1024 [1024,1×1,256 256,3×3,256</td><td>(C=8)</td></tr><tr><td colspan="2">Average Pool 100 fc, softmax</td><td></td><td colspan="2">[16,1×1,256 Average Pool 100 fc,softmax</td><td>32,1×1,256 100 fc, softmax</td><td>Average Pool</td><td>(C=8),×2</td><td colspan="2">(C=8),×2 256,1×1,1024 Average Pool</td></tr></table>
|
| 261 |
+
|
| 262 |
+
# E IMPLEMENTATION DETAILS
|
| 263 |
+
|
| 264 |
+
E.1 ARCHITECTURES AND SETTINGS FOR EXPERIMENTS ON CIFAR-100 AND CIFAR-10
|
| 265 |
+
|
| 266 |
+
The specifications of the architectures used in all our experiments on CIFAR-10 and CIFAR-100 are given in Table 5.
|
| 267 |
+
|
| 268 |
+
Several of these architectures are those presented in the original ResNeXt paper (Xie et al., 2017) and are trained using the same setup, including the data augmentation strategy.Four pixels are padded on each side of the input image, and a $3 2 \mathbf { x } 3 2$ crop is randomly sampled from the padded image or its horizontal flip, with per-pixel mean subtracted (Krizhevsky et al., 2012). For testing, we use the original $3 2 \mathbf { x } 3 2$ image. The stacks have output feature map of size 32, 16, and 8 respectively. The models are trained on 8 GPUs with a mini-batch size of 128 (16 per GPU), with a weight decay of 0.0005 and momentum of 0.9. We adopt four incremental training phases with a total of 320 epochs. In phase 1 we train the model for 120 epochs with a learning rate of 0.1 for the convolutional and fully-connected layers, and a learning rate of 0.2 for the masks. In phase 2 we freeze the connectivity by setting as active connections for each block those corresponding to its top- $K$ values in the masks. With these fixed learned connectivity, we finetune the model from phase $^ { l }$ for 100 epochs with a learning rate of 0.1 for the weights. Then, in phase 3 we finetune the weights of the model from phase 2 for 50 epochs with a learning rate of 0.01 using again the fixed learned connectivity from phase 1. Finally, in phase 4 we finetune the weights of the model from phase 3 for 50 epochs with a learning rate of 0.001.
|
| 269 |
+
|
| 270 |
+
# E.2 ARCHITECTURES AND SETTINGS FOR EXPERIMENTS ON IMAGENET
|
| 271 |
+
|
| 272 |
+
The architectures for our ImageNet experiments are those specified in the original ResNeXt paper (Xie et al., 2017).
|
| 273 |
+
|
| 274 |
+
Table 6: Mini-ImageNet architectures with varying depth $( D )$ , and bottleneck width $( w )$ . Inside the brackets we specify the residual block used in each multi-branch module by listing the number of input channels, the size of the convolutional filters, as well as the number of filters (number of output channels). To the right of each bracket we list the cardinality $( C )$ (i.e., the number of parallel branches in the module). $\times 2$ means that the same multi-branch module is stacked twice.
|
| 275 |
+
|
| 276 |
+
<table><tr><td colspan="2">{D=20,w=4,C=8}</td><td colspan="2">{D=29,=8,C=8}</td></tr><tr><td colspan="2">3,3×3,16</td><td colspan="2">3,3×3,16</td></tr><tr><td colspan="2">Max Pool,3×3,stride=2</td><td colspan="2">Max Pool,3×3,stride=2</td></tr><tr><td colspan="2">[16,1×1,4 4,3×3,4 (C=8) [4,1×1,64 [64,1×1,4 4,3×3,4 (C=8) [4,1×1,64</td><td colspan="2">[16,1×1,8 8,3×3,8 (C=8) [8,1×1,64 [64,1×1,8] 8,3×3,8 (C=8),×2</td></tr><tr><td colspan="2">[64,1×1,8 8,3×3,8 [8,1×1,128 [128,1×1,8 8,3×3,8</td><td colspan="2">[64,1×1,16 (C=8) 16,3×3,16 16,1×1,128 [128,1×1,16 (C=8) 16,3×3,16</td></tr><tr><td colspan="2">[8,1×1,128 [128,1×1,16 16,3×3,16 (C=8)</td><td colspan="2">(C=8),×2 [16,1×1,128] 128,1×1,32</td></tr><tr><td colspan="2">16,1×1,256 [256,1×1,16] 16,3×3,16 (C=8) 16,1×1,256</td><td colspan="2">[32,1×1,256 [256,1×1,32] 32,3×3,32 (C=8),×2 32,1×1,256]</td></tr><tr><td colspan="2">Average Pool 100 fc, softmax</td><td colspan="2">Average Pool 100 fc,softmax</td></tr></table>
|
| 277 |
+
|
| 278 |
+
Also for these experiments, we follow the data augmentation strategy described in (Xie et al., 2017). The input image has size $2 2 4 \mathbf { x } 2 2 4$ and it is randomly cropped from the resized original image. We use a mini-batch size of 256 on 8 GPUs (32 per GPU), with a weight decay of 0.0001 and a momentum of 0.9. We use four incremental training phases with a total of 120 epochs. In phase 1 we train the model for 30 epochs with a learning rate of 0.1 for the convolutional and fully-connected layers, and a learning rate of 0.2 for the masks. In phase 2 we finetune the model from phase $^ { l }$ for another 30 epochs with a learning rate of 0.1 and a learning rate of 0.0 for the masks (i.e., we use the fixed connectivity learned in phase 1). In phase 3 we finetune the weights from phase 2 for 30 epochs with a learning rate of 0.01 and the learning rate of the masks is 0.0. Finally, in phase 4 we finetune the weights from phase 3 for 30 epochs with a learning rate of 0.001 while the learning rate of the masks is still set to 0.0.
|
| 279 |
+
|
| 280 |
+
# E.3 ARCHITECTURES AND SETTINGS FOR EXPERIMENTS ON MINI-IMAGENET
|
| 281 |
+
|
| 282 |
+
For the experiments on the Mini-ImageNet dataset, a 64x64 crop is randomly sampled from the scaled 84x84 image or its horizontal flip, with per-pixel mean subtracted (Krizhevsky et al., 2012). For testing, we use the center $6 4 \mathrm { x } 6 4$ crop. The specifications of the models are identical to the CIFAR-100 models used in the previous subsection, except that the first input convolutional layer in the network is followed by a max pooling layer. The models are trained on 8 GPUs with a mini-batch size of 256 (32 per GPU), with a weight decay of 0.0005 and momentum of 0.9. Similar to training CIFAR-100 dataset, we also adopt four incremental training phases with a total of 320 epochs.
|
md/train/SygLehCqtm/SygLehCqtm.md
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING PROTEIN SEQUENCE EMBEDDINGS USING INFORMATION FROM STRUCTURE
|
| 2 |
+
|
| 3 |
+
Tristan Bepler
|
| 4 |
+
Computational and Systems Biology
|
| 5 |
+
Computer Science and Artificial Intelligence Laboratory
|
| 6 |
+
Massachusetts Institute of Technology
|
| 7 |
+
Cambridge, MA 02139, USA
|
| 8 |
+
tbepler@mit.edu
|
| 9 |
+
|
| 10 |
+
# Bonnie Berger
|
| 11 |
+
|
| 12 |
+
Computer Science and Artificial Intelligence Laboratory
|
| 13 |
+
Department of Mathematics
|
| 14 |
+
Massachusetts Institute of Technology
|
| 15 |
+
Cambridge, MA 02139, USA
|
| 16 |
+
bab@mit.edu
|
| 17 |
+
|
| 18 |
+
# ABSTRACT
|
| 19 |
+
|
| 20 |
+
Inferring the structural properties of a protein from its amino acid sequence is a challenging yet important problem in biology. Structures are not known for the vast majority of protein sequences, but structure is critical for understanding function. Existing approaches for detecting structural similarity between proteins from sequence are unable to recognize and exploit structural patterns when sequences have diverged too far, limiting our ability to transfer knowledge between structurally related proteins. We newly approach this problem through the lens of representation learning. We introduce a framework that maps any protein sequence to a sequence of vector embeddings — one per amino acid position — that encode structural information. We train bidirectional long short-term memory (LSTM) models on protein sequences with a two-part feedback mechanism that incorporates information from (i) global structural similarity between proteins and (ii) pairwise residue contact maps for individual proteins. To enable learning from structural similarity information, we define a novel similarity measure between arbitrarylength sequences of vector embeddings based on a soft symmetric alignment (SSA) between them. Our method is able to learn useful position-specific embeddings despite lacking direct observations of position-level correspondence between sequences. We show empirically that our multi-task framework outperforms other sequence-based methods and even a top-performing structure-based alignment method when predicting structural similarity, our goal. Finally, we demonstrate that our learned embeddings can be transferred to other protein sequence problems, improving the state-of-the-art in transmembrane domain prediction.
|
| 21 |
+
|
| 22 |
+
# 1 INTRODUCTION
|
| 23 |
+
|
| 24 |
+
Proteins are linear chains of amino acid residues that fold into specific 3D conformations as a result of the physical properties of the amino acid sequence. These structures, in turn, determine the wide array of protein functions, from binding specificity to catalytic activity to localization within the cell. Information about structure is vital for studying the mechanisms of these molecular machines in health and disease, and for development of new therapeutics. However, experimental structure determination is costly and atomic structures have only been determined for a tiny fraction of known proteins. Methods for finding proteins with related structure directly from sequence are of considerable interest, but the problem is challenging, because sequence similarity and structural similarity are only loosely related [1, 2, 3, 4], e.g. similar structural folds can be formed by diverse sequences. As a result, our ability to transfer knowledge between proteins with similar structures is limited.
|
| 25 |
+
|
| 26 |
+
In this work, we address this problem by learning protein sequence embeddings using weak supervision from global structural similarity for the first time. Specifically, we aim to learn a bidirectional LSTM (biLSTM) embedding model, mapping sequences of amino acids to sequences of vector representations, such that residues occurring in similar structural contexts will be close in embedding space. This is difficult, because we have not observed position-level correspondences between sequences, only global sequence similarity. We solve this by defining a whole sequence similarity measure from sequences of vector embeddings. The measure decomposes into an alignment of the sequences and pairwise comparison of the aligned positions in embedding space. For the alignment, we propose a soft symmetric alignment (SSA) mechanism — a symmetrization of the directional alignment commonly used in attention mechanisms. Furthermore, in order to take advantage of information about local structural context within proteins, we extend this framework to include position-level supervision from contacts between residues in the individual protein structures. This multitask framework (Figure 1) allows us to newly leverage both global structural similarity between proteins and residue-residue contacts within proteins for training embedding models.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 1: Diagram of the learning framework. (1) Amino acid sequences are transformed into sequences of vector embeddings by the encoder model. (2) The similarity prediction module takes pairs of proteins represented by their sequences of vector embeddings and predicts their shared SCOP level. Sequences are first aligned based on L1 distance between their vector embeddings using SSA. From the alignment, a similarity score is calculated and related to shared SCOP levels by ordinal regression. (3) The contact prediction module uses the sequence of vector embeddings to predict contacts between amino acid positions within each protein. The contact loss is calculated by comparing these predictions with contacts observed in the 3D structure of the protein. Error signal from both tasks is used to fit the parameters of the encoder.
|
| 30 |
+
|
| 31 |
+
We first benchmark our model’s ability to correctly predict structural similarity between pairs of sequences using the SCOPe ASTRAL dataset [5]. This dataset contains protein domains manually classified into a hierarchy of structural categories (Appendix Figure 3). We show that our model dramatically outperforms other sequence-based protein comparison methods when predicting comembership in the SCOP hierarchy. Remarkably, our model even outperforms TMalign [6], which requires structures as input and therefore structures must be known a priori. In contrast, our model uses only sequence as input. Next, we perform an ablation study to evaluate the importance of our modeling components for structural similarity prediction. We also consider an additional task, secondary structure prediction, to assess the model’s ability to capture local structure features. We demonstrate that SSA outperforms alternative alignment methods for both of these tasks and that inclusion of the contact prediction training task further improves performance.
|
| 32 |
+
|
| 33 |
+
Finally, we demonstrate that the embeddings learned by our model are generally applicable to other protein machine learning problems by leveraging our embeddings to improve the state-of-the-art in transmembrane prediction. This work presents the first attempt in learning protein sequence embeddings from structure and takes a step towards bridging the sequence-structure divide with representation learning.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Current work in protein sequence embeddings has primarily been focused on unsupervised k-mer co-occurence approaches to learn fixed sized vector representations [7, 8] based on similar methods in NLP [9, 10, 11, 12]. Melvin et al. [13] also learn fixed sized semantic embeddings by projecting alignment scores into a low dimensional vector to recapitulate rankings given by existing alignment tools and shared superfamily membership. However, fixed sized vector representations are limited, because they are not usable for any sequence labeling problems (e.g. active site prediction, transmembrane region prediction, etc.). Other methods have focused on manual feature engineering based on biophysical and sequence attributes [14]. These methods rely on expert knowledge and do not capture properties that emerge from interactions between amino acids.
|
| 38 |
+
|
| 39 |
+
Instead, we seek to learn embeddings that encode the full structural context in which each amino acid occurs. This is inspired partly by the recent success of unsupervised contextual embedding models using bidirectional recurrent neural network language models [15, 16] where word embeddings, learned as a function of their context, have been successfully transferred to other tasks. In particular, we apply a similar language model for the first time on protein sequences as part of our supervised framework. Supervised embedding models have also been trained for natural language inference (NLI) but produce only fixed sized embeddings [17, 18, 19].
|
| 40 |
+
|
| 41 |
+
At the same time, problems involving word alignment given matched sequences, such as cross lingual word embeddings and document similarity, have also been explored. Cross lingual word embeddings are learned from unaligned parallel text, where sentences are matched between languages but words are not. Kociský et al. ˇ [20] learn bilingual word embeddings jointly with a FastAlign [21] word alignment model using expectation maximization. BilBOWA [22] learns cross lingual word embeddings using parallel sentences without word level alignments by assuming a uniform alignment between words. However, Gouws et al. [22] assume all pairings between words are equally likely and do not infer them from current values of the embeddings. Related methods have been developed for measuring similarity between documents based on their words. Word Mover’s Distance (WMD) and its supervised variant align words between pairs of documents by solving an optimal transport problem given by distance between word vectors. However, these methods are not designed for learning neural network embedding models and the embeddings are not contextual. Furthermore, WMD alignments are prohibitively expensive when alignments must be computed at every optimization step, scaling as $\scriptstyle { \bar { O } } ( p ^ { 3 } \log p )$ where $p$ is the number of unique words.
|
| 42 |
+
|
| 43 |
+
Our SSA solves these problems via an alignment mechanism inspired by previous work using soft alignments and attention mechanisms for sequence modeling [23, 24]. Further elaborate directional alignments have been used for question answering and reading comprehension models [25, 26, 27] and for natural language inference [28, 29, 29]. Unlike these methods, however, our SSA method is both symmetric and memoryless. Furthermore, it is designed for learning interpretable embeddings based on a similarity measure between individual sequence elements. It is also fast and memory efficient - scaling with the product of the sequence lengths.
|
| 44 |
+
|
| 45 |
+
Protein fold recognition is the problem of classifying proteins into folds (for example, as defined by the SCOP database) based on their sequences. Approaches to this problem have largely been based on sequence homology using sequence similarity to classify structures based on close sequence matches [5, 30]. These methods are either direct sequence alignment tools [31, 32] or based on profile HMMs in which multiple sequence alignments are first built by iterative search against a large sequence database, the multiple sequence alignments are converted into profile HMMs, and then sequences are compared using HMM-sequence or HMM-HMM alignments [33, 34]. However, these methods are only appropriate for matching proteins with high sequence similarity [2, 3, 30]. In contrast, we focus on learning protein sequence representations that directly capture structure information in an easily transferable manner. We hypothesize that this approach will improve our ability to detect structural similarity from sequence while also producing useful features for other learning tasks.
|
| 46 |
+
|
| 47 |
+
# 3 METHODS
|
| 48 |
+
|
| 49 |
+
In this section, we describe the three components of our framework (Figure 1) in detail: (1) the specific choice of embedding model, a multi-layer bidirectional LSTM with additional inputs from a pretrained LSTM language model, (2) soft symmetric alignment and ordinal regression components for relating sequences of vector representations for pairs of proteins to their global structural similarity, and (3) the pairwise feature vectors and convolutional neural network design for residue-residue contact prediction.
|
| 50 |
+
|
| 51 |
+
# .1 BILSTM SEQUENCE ENCODER WITH PRETRAINED LANGUAGE MODE
|
| 52 |
+
|
| 53 |
+
BiLSTM encoder. The encoder takes a sequence of amino acids representing a protein and encodes it into a sequence of vector representations of the same length. To allow the vector representations at each position to be functions of all surrounding amino acids, we structure the encoder as a stack of bidirectional LSTMs followed by a linear layer projecting the outputs of the last biLSTM layer into the final embedding space (Appendix Figure 2).
|
| 54 |
+
|
| 55 |
+
Pretrained language model. The concept of feeding LSTM language model representations as inputs for supervised learning problems as part of a larger neural network model has shown recent success in NLP but has not yet been tried for biological sequences. Inspired partially by the success of ELMo [16], we consider, in addition to 1-hot representations of the amino acids, the inclusion of the hidden layers of a pretrained bidirectional LSTM language model as inputs to the encoder described above. The language model is pretrained on the raw protein sequences in the protein families database (Pfam) [35] to predict the amino acid at each position of each protein given the previous amino acids and the following amino acids (see Appendix section A.1 for details).
|
| 56 |
+
|
| 57 |
+
Specifically, given the language model hidden states at each position, $i$ , denoted as $h _ { i } ^ { L M }$ , and the 1-hot representation of the amino acid at those positions, $x _ { i }$ , we introduce a learned linear transformation of these representations with ReLU non-linearity,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
h _ { i } ^ { i n p u t } = \mathrm { R e L U } ( W ^ { L M } h _ { i } ^ { L M } + W ^ { x } x _ { i } + b ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
which is passed as input to the biLSTM sequence encoder. The parameters $W ^ { L M }$ , $W ^ { x }$ , and $b$ are trained together with the parameters of the biLSTM encoder. The parameters of the language model itself are frozen during training. In experiments without the language model, $h _ { i } ^ { L M }$ is set to zero for all positions.
|
| 64 |
+
|
| 65 |
+
# 3.2 PROTEIN STRUCTURE COMPARISON
|
| 66 |
+
|
| 67 |
+
The primary task we consider for training the sequence embedding model with structural information is the prediction of global structural similarity between protein sequences as defined by shared membership in the SCOP hierarchy. SCOP is an expertly curated database of protein domain structures in which protein domains are assigned into a hierarchy of structures (Appendix Figure 3). Specifically, we define this as a multiclass classification problem in which a pair of proteins is classified into no similarity, class level similarity, fold level similarity, superfamily level similarity, or family level similarity based on the most specific level of the SCOP hierarchy shared by those proteins. We encode these labels as $y \in \{ 0 , 1 , 2 , 3 , 4 \}$ based on the number of levels shared (i.e. $\scriptstyle { \mathsf { y } } = 0$ encodes no similarity, $\mathrm { y } { = } 1$ encodes class similarity, etc.). In the following two sections, we describe how protein sequences are compared based on their sequences of vector embeddings using soft symmetric alignment and then how this alignment score is used to predict the specific similarity class by taking advantage of the natural ordering of these classes in an ordinal regression framework.
|
| 68 |
+
|
| 69 |
+
# 3.2.1 SOFT SYMMETRIC ALIGNMENT
|
| 70 |
+
|
| 71 |
+
In order to calculate the similarity of two amino acid sequences given that each has been encoded into a sequence of vector representations, $z _ { 1 } . . . z _ { n }$ and $z _ { 1 } ^ { \prime } . . . \bar { z } _ { m } ^ { \prime }$ , we develop a soft symmetric alignment mechanism in which the similarity between two sequences is calculated based on their vector embeddings as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\hat { s } = - \frac { 1 } { A } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } a _ { i j } | | z _ { i } - z _ { j } ^ { \prime } | | _ { 1 }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $a _ { i j }$ are entries of the alignment matrix given by
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\alpha _ { i j } = \frac { \exp ( - | | z _ { i } - z _ { j } ^ { \prime } | | _ { 1 } ) } { \sum _ { k = 1 } ^ { n } \exp ( - | | z _ { i } - z _ { k } ^ { \prime } | | _ { 1 } ) } , \qquad \beta _ { i j } = \frac { \exp ( - | | z _ { i } - z _ { j } ^ { \prime } | | _ { 1 } ) } { \sum _ { k = 1 } ^ { m } \exp ( - | | z _ { k } - z _ { j } ^ { \prime } | | _ { 1 } ) } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
a _ { i j } = \alpha _ { i j } + \beta _ { i j } - \alpha _ { i j } \beta _ { i j }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
$\begin{array} { r } { A = \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } a _ { i j } } \end{array}$ is the length of the alignment.
|
| 88 |
+
|
| 89 |
+
# 3.2.2 ORDINAL REGRESSION
|
| 90 |
+
|
| 91 |
+
Next, to relate this scalar similarity to the ordinal structural similarities defined using SCOP $( y \in$ $\{ 0 , 1 , 2 , 3 , 4 \} )$ , we adopt an ordinal regression framework. Specifically, we learn a series of binary classifiers to predict whether the structural similarity level is greater than or equal to each level, $t$ , given the alignment score (Equation 1). Given parameters $\theta _ { 1 } . . . \theta _ { 4 }$ and $b _ { 1 } . . . b _ { 4 }$ , the probability that two sequences share similarity greater than or equal to $t$ is defined by $\hat { p } ( y \ge t ) = \mathrm { s i g m o i d } ( \theta _ { t } \hat { s } + b _ { t } )$ , with the constraint that $\theta _ { t } \geq 0$ to enforce that $\hat { p }$ increases monotonically with $\hat { s }$ . The structural similarity loss is then given by
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
L ^ { s i m i l a r i t y } = \underset { x , x ^ { \prime } } { \mathbb { E } } \left[ \sum _ { t = 1 } ^ { 4 } ( y \geq t ) \mathrm { l o g } ( \hat { p } ( y \geq t ) ) + ( y < t ) \mathrm { l o g } ( 1 - \hat { p } ( y \geq t ) ) \right] .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
These parameters are fit jointly with the parameters of the sequence encoder by backpropogating through the SSA which is fully differentiable. Furthermore, given these classifiers, the predicted probability that two sequences belong to structural similarity level $t$ is $\hat { p } ( y = t ) = \hat { p } ( y \geq t ) ( \bar { 1 } - p ( y \geq$ $t + 1 )$ ) with $\hat { p } ( y \ge 0 ) = 1$ by definition.
|
| 98 |
+
|
| 99 |
+
# 3.3 RESIDUE-RESIDUE CONTACT PREDICTION
|
| 100 |
+
|
| 101 |
+
We can augment our SSA framework, in which position-level correspondence is inferred between sequences, with position-level supervision directly in the form of within protein contacts between residues. We introduce a secondary task of within protein residue-residue contact prediction with the hypothesis that the fine-grained structural supervision provided by the observed contacts will improve the quality of the embeddings. Contact prediction is a binary classification problem in which we seek to predict whether residues at positions $i$ and $j$ within an amino acid sequence make contact in the 3D structure. Following common practice in the protein structure field, we define two positions as making contact if the $C \alpha$ atoms of those residues occur within 8Åin the 3D structure.
|
| 102 |
+
|
| 103 |
+
In order to predict contacts from the sequence of embedding vectors given by the encoder for an arbitrary protein of length $_ \mathrm { N }$ , we define a pairwise features tensor of size $( \mathrm { N x N x 2 D } )$ where D is the dimension of the embedding vector containing pairwise features given by the concatenation of the absolute element-wise differences and the element-wise products of the vector representations for each pair of positions, $v _ { i j } = [ | z _ { i } - z _ { j } | ; z _ { i } \odot z _ { j } ]$ . We choose this featurization because it is symmetric, $v _ { i j } = v _ { j i }$ , and has shown widespread utility for pairwise comparison models in NLP [36]. These vectors are then transformed through a single hidden layer of dimension $_ \mathrm { H }$ (implemented as a width 1 convolutional layer) and ReLU activation giving $\dot { h _ { i j } } = \mathrm { R e L U } ( W v _ { i j } + b )$ . Contact predictions are then made by convolving a single $7 \mathbf { x } 7$ filter over the resulting $\mathbf { N X N X H }$ tensor with padding and sigmoid activation to give an NxN matrix containing the predicted probability for each pair of residues forming a contact.
|
| 104 |
+
|
| 105 |
+
Given the observed contacts, we define the contact prediction loss, $L ^ { c o n t a c t }$ , to be the expectation of the cross entropy between the observed labels and the predicted contact probabilities taken over all pairs of residues within each protein in the dataset.
|
| 106 |
+
|
| 107 |
+
Complete multitask loss. We define the full multitask objective by
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\lambda L ^ { s i m i l a r i t y } + ( 1 - \lambda ) L ^ { c o n t a c t }
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\lambda$ is a parameter that interpolates between the structural similarity and contact prediction losses. This error signal is backpropogated through the contact prediction specific parameters defined in section 3.3, the similarity prediction specific parameters defined in section 3.2, and the parameters of sequence encoder defined in section 3.1 to train the entire model end-to-end.
|
| 114 |
+
|
| 115 |
+
# 3.4 HYPERPARAMETERS AND TRAINING DETAILS
|
| 116 |
+
|
| 117 |
+
Our encoder consists of 3 biLSTM layers with 512 hidden units each and a final output embedding dimension of 100 (Appendix Figure 2). Language model hidden states are projected into a 512 dimension vector before being fed into the encoder. In the contact prediction module, we use a hidden layer with dimension 50. These hyperparameters were chosen to be as large as possible while fitting on a single GPU with reasonable minibatch size. While we compare performance with simpler encoder architectures in section 4.2, it is possible that performance could be improved further with careful architecture search. However, that is beyond the scope of this work.
|
| 118 |
+
|
| 119 |
+
Sequence embedding models are trained for 100 epochs using ADAM with a learning rate of 0.001 and otherwise default parameters provided by PyTorch. Each epoch consists of 100,000 examples sampled from the SCOP structural similarity training set with smoothing of the similarity level distribution of 0.5. In other words, the probability of sampling a pair of sequences with similarity level $t$ is proportional to $N _ { t } ^ { 0 . 5 }$ where $N _ { t }$ is the number of sequence pairs with $t$ similarity in the training set. This is to slightly upweight sampling of highly similar pairs of sequences that would otherwise be rare. We choose 0.5 specifically such that a minibatch of size 64 is expected to contain two pairs of sequences with family level similarity. The structural similarity component of the loss is estimated with minibatches of 64 pairs of sequences. When using the full multitask objective, the contact prediction component uses minibatches of 10 sequences and $\lambda = 0 . 1$ . Furthermore, during training we apply a small perturbation to the sequences by resampling the amino acid at each position from the uniform distribution with probability 0.05. These hyperparameters were selected using a validaton set as described in Appendix section A.2. All models were implemented in PyTorch and trained on a single NVIDIA Tesla V100 GPU. Each model took roughly 3 days to train and required 16 GB of GPU RAM. Additional runtime and memory details can be found in Appendix A.3.
|
| 120 |
+
|
| 121 |
+
In the following sections, we refer to the 3-layer biLSTM encoder trained with the full framework as "SSA (full)" and the framework without contact prediction (i.e. $\lambda = 1$ ) as "SSA (no contact prediction)."
|
| 122 |
+
|
| 123 |
+
# 4 RESULTS
|
| 124 |
+
|
| 125 |
+
# 4.1 STRUCTURAL SIMILARITY PREDICTION ON THE SCOP DATABASE
|
| 126 |
+
|
| 127 |
+
We first evaluate the performance of our full SSA embedding model for predicting structural similarity between amino acid sequences using the SCOP dataset. We benchmark our embedding model against several widely used sequence-based protein comparison methods, Needleman-Wunsch alignment (NW-align), phmmer [33], an HMM-to-sequence comparison method, and HHalign [34], an HMMto-HMM comparison method. For HHalign, profle HMMs for each sequence were constructed by iterative search against the uniref30 database. We also benchmark our method agains TMalign, a method for evaluating protein similarity based on alignments of protein structures. Details for each of these baselines can be found in Appendix section A.4. Methods are compared based on accuracy of classifying the shared SCOP level, correlation between the similarity score and shared SCOP level, and average precision scores when considering correct matches at each level of the SCOP hierarchy (i.e. proteins that are in the same class, proteins in the same fold, etc.).
|
| 128 |
+
|
| 129 |
+
Table 1: Comparison of the full SSA model with three protein sequence alignment methods (NWalign, phmmer, and HHalign) and the structure alignment method TMalign. We measure accuracy, Pearson’s correlation $( r )$ , Spearman’s rank correlation $( \rho )$ , and average precision scores for retrieving protein pairs with structural similarity of at least class, fold, superfamily, and family levels.
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Accuracy</td><td colspan="2">Correlation</td><td colspan="4">Average precision score</td></tr><tr><td>r</td><td>p</td><td>Class</td><td>Fold</td><td>Superfamily</td><td>Family</td></tr><tr><td colspan="8">ASTRAL 2.06 test set</td></tr><tr><td>NW-align</td><td>0.78462</td><td>0.18854</td><td>0.14046</td><td>0.30898</td><td>0.40875</td><td>0.58435</td><td>0.52703</td></tr><tr><td>phmmer [HMMER 3.2.1]</td><td>0.78454</td><td>0.21657</td><td>0.06857</td><td>0.26022</td><td>0.34655</td><td>0.53576</td><td>0.50316</td></tr><tr><td>HHalign [HHsuite 3.0.0]</td><td>0.78851</td><td>0.36759</td><td>0.23240</td><td>0.40347</td><td>0.62065</td><td>0.86444</td><td>0.52220</td></tr><tr><td>TMalign</td><td>0.80831</td><td>0.61687</td><td>0.37405</td><td>0.54866</td><td>0.85072</td><td>0.83340</td><td>0.57059</td></tr><tr><td>SSA (full)</td><td>0.95149</td><td>0.90954</td><td>0.69018</td><td>0.91458</td><td>0.90229</td><td>0.95262</td><td>0.64781</td></tr><tr><td colspan="8">ASTRAL 2.07 new test set</td></tr><tr><td>NW-align</td><td>0.80842</td><td>0.37671</td><td>0.23101</td><td>0.43953</td><td>0.77081</td><td>0.86631</td><td>0.82442</td></tr><tr><td>phmmer [HMMER 3.2.1]</td><td>0.80907</td><td>0.65326</td><td>0.25063</td><td>0.38253</td><td>0.72475</td><td>0.82879</td><td>0.81116</td></tr><tr><td>HHalign [HHsuite 3.0.0]</td><td>0.80883</td><td>0.68831</td><td>0.27032</td><td>0.47761</td><td>0.83886</td><td>0.94122</td><td>0.82284</td></tr><tr><td>TMalign</td><td>0.81275</td><td>0.81354</td><td>0.39702</td><td>0.59277</td><td>0.91588</td><td>0.93936</td><td>0.82301</td></tr><tr><td>SSA (full)</td><td>0.93151</td><td>0.92900</td><td>0.66860</td><td>0.89444</td><td>0.93966</td><td>0.96266</td><td>0.86602</td></tr></table>
|
| 132 |
+
|
| 133 |
+
The SCOP benchmark datasets are formed by splitting the SCOPe ASTRAL 2.06 dataset, filtered to a maximum sequence identity of $9 5 \%$ , into 22,408 train and 5,602 heldout sequences. From the heldout sequences, we randomly sample 100,000 pairs as the ASTRAL 2.06 structural similarity test set. Furthermore, we define a second test set using the newest release of SCOPe (2.07) by collecting all protein sequences added between the 2.06 and 2.07 ASTRAL releases. This gives a set of 688 protein sequences all pairs of which define the ASTRAL 2.07 new test set. The average percent identity between pairs of sequences within all three datasets is $13 \%$ . Sequence length statistics can be found in Appendix Table 4.
|
| 134 |
+
|
| 135 |
+
We find that our full SSA embedding model outperforms all other methods on all metrics on both datasets. On the 2.06 test set, we improve overall prediction accuracy from 0.79 to 0.95, Pearson’s correlation from 0.37 to 0.91, and Spearman’s rank correlation from 0.23 to 0.69 over the next best sequence comparison method, HHalign, without requiring any database search to construct sequence profiles. Furthermore, our full SSA model is much better for retrieving proteins sharing the same fold — the structural level of most interest for finding distant protein homologues — improving the average precision score by 0.28 on the 2.06 test set and 0.10 on the 2.07 test set over HHalign. We find that our full SSA embedding model even outperforms TMalign, a method for comparing proteins based on their 3D structures, when predicting shared SCOP membership. This is remarkable considering that our model uses only sequence information when making predictions whereas TMalign is provided with the known protein structures. The largest improvement comes at the SCOP class level where TMalign achieves much lower average precision score for retrieving these weak structural matches.
|
| 136 |
+
|
| 137 |
+
# 4.2 ABLATION STUDY OF FRAMEWORK COMPONENTS
|
| 138 |
+
|
| 139 |
+
We next evaluate the individual model components on two tasks: structure similarity prediction on the ASTRAL 2.06 test set and 8-class secondary structure prediction on a $40 \%$ sequence identity filtered dataset containing 22,086 protein sequences from the protein data bank (PDB) [37], a repository of experimentally determined protein structures. Secondary structure prediction is a sequence labeling problem in which we attempt to classify every position of a protein sequence into one of eight classes describing the local 3D structure at that residue. We use this task to measure the utility of our embeddings for position specific prediction problems. For this problem, we split the secondary structure dataset into 15,461 training and 6,625 testing sequences. We then treat each position of each sequence as an independent datapoint with features either given by the 100-d embedding vector or 1-hot encoding of the $\mathbf { k }$ -mer at that position and train a fully connected neural network (2 hidden layers, 1024 units each, ReLU activations) to predict the secondary structure class from the feature vector. These models are trained with cross entropy loss for 10 epochs using ADAM with learning rate 0.001 and a minibatch size of 256.
|
| 140 |
+
|
| 141 |
+
Table 2: Study of individual model components. Results of structural similarity prediction on the ASTRAL 2.06 test set and secondary structure prediction are provided for embedding models trained with various components of our multitask framework. The SSA model trained without the language model component of the encoder and without contact prediction (SSA (without language model)), the SSA, UA, and ME models trained without contact prediction (ME, UA, SSA (without contact prediction)), and the full SSA embedding model.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan="2">Embedding Model/Features</td><td colspan="3">Structural similarity</td><td colspan="2">Secondary structure</td></tr><tr><td>Accuracy</td><td>r</td><td>p</td><td>Perplexity</td><td>Accuracy</td></tr><tr><td>1-mer</td><td></td><td></td><td></td><td>4.804</td><td>0.374</td></tr><tr><td>3-mer</td><td></td><td></td><td></td><td>4.222</td><td>0.444</td></tr><tr><td>5-mer</td><td></td><td></td><td></td><td>5.154</td><td>0.408</td></tr><tr><td>SSA (no contact prediction, no LM)</td><td>0.89847</td><td>0.81459</td><td>0.64693</td><td>3.818</td><td>0.511</td></tr><tr><td>ME (no contact prediction)</td><td>0.92821</td><td>0.85977</td><td>0.67122</td><td>4.058</td><td>0.480</td></tr><tr><td>UA (no contact prediction)</td><td>0.93524</td><td>0.87536</td><td>0.67017</td><td>4.470</td><td>0.427</td></tr><tr><td>SSA (no contact prediction)</td><td>0.93794</td><td>0.88048</td><td>0.67645</td><td>4.027</td><td>0.487</td></tr><tr><td>SSA (full)</td><td>0.95149</td><td>0.90954</td><td>0.69018</td><td>2.861</td><td>0.630</td></tr></table>
|
| 144 |
+
|
| 145 |
+
SSA outperforms alternative comparison methods. We first demonstrate the importance of our SSA mechanism when training the contextual embedding model by comparing the performance of biLSTM encoders trained with SSA versus the same encoders trained with uniform alignment and a mean embedding comparison approaches [22]. In uniform alignment (UA), we consider a uniform prior over possible alignments giving the similarity score. For the mean embedding method (ME), we instead calculate the similarity score based on the difference between the average embedding of each sequence. For these baselines, we substitute
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\hat { s } ^ { U A } = - \frac { 1 } { n m } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } | | z _ { i } - z _ { j } ^ { \prime } | | _ { 1 } \qquad \mathrm { a n d } \qquad \hat { s } ^ { M E } = - \Biggl | \Biggl | \frac { 1 } { n } \sum _ { i = 1 } ^ { n } z _ { i } - \frac { 1 } { m } \sum _ { j = 1 } ^ { m } z _ { j } ^ { \prime } \Biggr | \Biggr | _ { 1 }
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
in for SSA similarity (Equation 1) respectively during model training and prediction. These models are trained without contact prediction $\lambda = 1$ ) to compare the alignment component in isolation.
|
| 152 |
+
|
| 153 |
+
We find that not only are the SSA embeddings better predictors of secondary structure than $\mathbf { k }$ -mer features (accuracy 0.487 vs. 0.444 for 3-mers), but that the SSA mechanism is necessary for achieving best performance on both the structure similarity and local structure prediction tasks. As seen in table 2, the ME model achieves close to SSA performance on secondary structure prediction, but is significantly worse for SCOP similarity prediction. The UA model, on the other hand, is close to SSA on SCOP similarity but much worse when predicting secondary structure. This suggests that our SSA mechanism captures the best of both methods, allowing embeddings to be position specific as in the ME model but also being better predictors of SCOP similarity as in the UA model.
|
| 154 |
+
|
| 155 |
+
Contact prediction improves embeddings. Although the SSA mechanism allows our embedding model to capture position specific information, we wanted to explore whether positional information within sequences in the form of contact prediction could be used to improve the embeddings. We train models with and without the contact prediction task and find that including contact prediction improves both the structural similarity prediction and secondary structure prediction results. The accuracy of secondary structure prediction improves from 0.487 without to 0.630 with contact prediction (Table 2). This suggests that the contact prediction task dramatically improves the quality of the local embeddings on top of the weak supervision provided by whole structure comparison. For reference, we also report contact prediction performance for our full SSA model in Appendix A.5.
|
| 156 |
+
|
| 157 |
+
Table 3: Accuracy of transmembrane prediction using structural embeddings in 10-fold cross validation and comparison with other transmembrane prediction methods. BiLSTM $+ \mathrm { C R F }$ models using either our full SSA model embeddings or 1-hot encodings of the amino acids as features are displayed below the dotted line. We compare with results for a variety of transmembrane prediction methods previously reported on the TOPCONS dataset.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Prediction category</td><td rowspan="2">Overall</td></tr><tr><td>TM</td><td>SP+TM</td><td>Globular</td><td>Globular+SP</td></tr><tr><td>TOPCONS</td><td>0.80</td><td>0.80</td><td>0.97</td><td>0.91</td><td>0.87</td></tr><tr><td>MEMSAT-SVM</td><td>0.67</td><td>0.52</td><td>0.88</td><td>0.00</td><td>0.52</td></tr><tr><td>Philius</td><td>0.70</td><td>0.75</td><td>0.94</td><td>0.94</td><td>0.83</td></tr><tr><td>Phobius</td><td>0.55</td><td>0.83</td><td>0.95</td><td>0.94</td><td>0.82</td></tr><tr><td>PolyPhobius</td><td>0.55</td><td>0.83</td><td>0.95</td><td>0.94</td><td>0.82</td></tr><tr><td>SPOCTOPUS</td><td>0.71</td><td>0.78</td><td>0.78</td><td>0.79</td><td>0.76</td></tr><tr><td>biLSTM+CRF(1-hot)</td><td>0.32</td><td>0.34</td><td>0.99</td><td>0.46</td><td>0.52</td></tr><tr><td>biLSTM+CRF (SSA(full))</td><td>0.77</td><td>0.85</td><td>1.00</td><td>0.94</td><td>0.89</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Encoder architecture and pretrained language model are important. Finally, we show, for the first time with biological sequences, that a language model pretrained on a large unsupervised protein sequence database can be used to transfer information to supervised sequence modeling problems. SCOP similarity classification results for SSA embedding models trained with and without LM hidden layer inputs shows that including the LM substantially improves performance, increasing accuracy from 0.898 to 0.938. Furthermore, we examine the extent to which LM hidden states capture all useful structural information by training SSA embedding models with less expressive power than our 3-layer biLSTM architecture (Appendix Table 5). We find that the LM hidden states are not sufficient for high performance on the structural similarity task with linear, fully connected (i.e. width 1 convolution), and single layer biLSTM embedding models having lower accuracy, Pearson, and Spearman correlations than the 3-layer biLSTM on the ASTRAL 2.06 test set.
|
| 162 |
+
|
| 163 |
+
# 4.3 TRANSMEMBRANE PREDICTION
|
| 164 |
+
|
| 165 |
+
We demonstrate the potential utility of our protein sequence embedding model for transfering structural information to other sequence prediction problems by leveraging our embedding model for transmembrane prediction. In transmembrane prediction, we wish to detect which, if any, segments of the amino acid sequence cross the lipid bilayer for proteins integrated into the cell membrane. This is a well studied problem in protein biology with methods generally consisting of HMMs with sophisticated, manually designed hidden state transition distributions and emission distributions including information about residue identity, amino acid frequencies from multiple sequence alignments, local structure, and chemical properties. Newer methods are also interested in detection of signal peptides, which are short amino acid stretches at the beginning of a protein sequence signaling for this protein to be inserted into the cell membrane.
|
| 166 |
+
|
| 167 |
+
To benchmark our embedding vectors for this problem, we develop a conditional random field (CRF) model in which the propensity of each hidden state given the sequence of embedding vectors is defined by a single layer biLSTM with 150 units. As a baseline, we include an identical biLSTM $^ +$ CRF model using only 1-hot encodings of the amino acids as features. For the transition probabilities between states, we adopt the same structure as used in TOPCONS [38] and perform 10-fold cross validation on the TOPCONS transmembrane benchmark dataset. We report results for correctly predicting regions in proteins with only transmembrane domains (TM), transmembrane domains and a signal peptide $( \mathrm { S P + T M } )$ , neither transmembrane nor signal peptide domains (Globular), or a signal peptide but no transmembrane regions (Globular $+ \mathrm { S P }$ ). Transmembrane state labels are predicted with Viterbi decoding. Again following TOPCONS, predictions are counted as correct if, for TM proteins, our model predicts no signal peptide, the same number of transmembrane regions, and those regions overlap with real regions by at least five positions. Correct $\mathrm { S P + T M }$ predictions are defined in the same way except that proteins must be predicted to start with a signal peptide. Globular protein predictions are correct if no transmembrane or signal peptides are predicted and Globular $+ \mathrm { S P }$ predictions are correct if only a leading signal peptide is predicted.
|
| 168 |
+
|
| 169 |
+
We find that our transmembrane predictions rank first or tied for first in 3 out of the 4 categories $\mathrm { S P + T M }$ , Globular, and Globular $+ \mathrm { S P }$ ) and ranks second for the TM category. Overall, our transmembrane predictions are best with prediction accuracy of 0.89 vs 0.87 for TOPCONS. Remarkably, this is by simply replacing the potential function in the CRF with a function of our embedding vectors, the hidden state grammar is the same as that of TOPCONS. Furthermore, the performance cannot be attributed solely to the biLSTM $^ +$ CRF structure, as the biLSTM $^ +$ CRF with 1-hot encoding of the amino acids performs poorly, tying MEMSAT-SVM for worst performance. This is particularly noteworthy, because TOPCONS is a meta-predictor. It uses outputs from a wide variety of other transmembrane prediction methods to define the transmembrane state potentials.
|
| 170 |
+
|
| 171 |
+
# 5 CONCLUSION
|
| 172 |
+
|
| 173 |
+
In this work, we proposed a novel alignment approach to learning contextual sequence embeddings with weak supervision from a global similarity measure. Our SSA model is fully differentiable, fast to compute, and can be augmented with position-level structural information. It outperforms competition in predicting protein structural similarity including, remarkably, structure alignment with TMalign. One consideration of training using SCOP, however, is that we focus exclusively on single-domain protein sequences. This means that the highly contextual embeddings given by the biLSTM encoder to single domains may differ from embeddings for the same domain in a multi-domain sequence. One interesting extension would thus be to modify the encoder architecture or training procedure to better model domains in multi-domain contexts. Nonetheless, the resulting embeddings are widely useful, allowing us to improve over the state-of-the-art in transmembrane region prediction, and can easily be applied to other protein prediction tasks such as predicting functional properties, active site locations, protein-protein interactions, etc. Most methods that use HMM sequence profiles or position-specific scoring matrices could be augmented with our embeddings. The broader framework extends to other related (non-biological) tasks.
|
| 174 |
+
|
| 175 |
+
# 6 ACKNOWLEDGMENTS
|
| 176 |
+
|
| 177 |
+
We would like to thank Tommi Jaakkola, Rohit Singh, Perry Palmedo, and members of the Berger lab for their helpful feedback.
|
| 178 |
+
|
| 179 |
+
# REFERENCES
|
| 180 |
+
|
| 181 |
+
[1] A G Murzin, S E Brenner, T Hubbard, and C Chothia. SCOP: a structural classification of proteins database for the investigation of sequences and structures. J. Mol. Biol., 247(4):536–540, April 1995.
|
| 182 |
+
[2] L Holm and C Sander. Mapping the protein universe. Science, 273(5275):595–603, August 1996.
|
| 183 |
+
[3] Hin Hark Gan, Rebecca A Perlow, Sharmili Roy, Joy Ko, Min Wu, Jing Huang, Shixiang Yan, Angelo Nicoletta, Jonathan Vafai, Ding Sun, Lihua Wang, Joyce E Noah, Samuela Pasquali, and Tamar Schlick. Analysis of protein sequence/structure similarity relationships. Biophys. J., 83(5):2781–2791, November 2002.
|
| 184 |
+
[4] S E Brenner, C Chothia, T J Hubbard, and A G Murzin. Understanding protein structure: using scop for fold interpretation. Methods Enzymol., 266:635–643, 1996.
|
| 185 |
+
[5] Naomi K Fox, Steven E Brenner, and John-Marc Chandonia. SCOPe: Structural classification of proteins– extended, integrating SCOP and ASTRAL data and classification of new structures. Nucleic Acids Res., 42 (Database issue):D304–9, January 2014.
|
| 186 |
+
[6] Y. Zhang and J. Skolnick. TM-align: a protein structure alignment algorithm based on the TM-score. Nucleic Acids Res., 33(7):2302–2309, 2005.
|
| 187 |
+
[7] Ehsaneddin Asgari and Mohammad R. K. Mofrad. Continuous distributed representation of biological sequences for deep proteomics and genomics. PLOS ONE, 10(11):1–15, 11 2015. doi: 10.1371/journal. pone.0141287. URL https://doi.org/10.1371/journal.pone.0141287.
|
| 188 |
+
[8] K. K. Yang, Z. Wu, C. N. Bedbrook, and F. H. Arnold. Learned protein embeddings for machine learning. Bioinformatics, 34(15):2642–2648, Aug 2018.
|
| 189 |
+
[9] Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In Eric P Xing and Tony Jebara, editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1188–1196, Bejing, China, 2014. PMLR.
|
| 190 |
+
[10] Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. In International Conference on Learning Representations, 2017.
|
| 191 |
+
[11] Ryan Kiros, Yukun Zhu, Ruslan R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-Thought vectors. In Advances in Neural Information Processing Systems, pages 3294–3302, 2015.
|
| 192 |
+
[12] Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. arXiv preprint arXiv:1602.03483, 2016.
|
| 193 |
+
[13] Iain Melvin, Jason Weston, William Stafford Noble, and Christina Leslie. Detecting remote evolutionary relationships among proteins by large-scale semantic embedding. PLoS computational biology, 7(1): e1001047, 2011.
|
| 194 |
+
[14] D. Ofer and M. Linial. ProFET: Feature engineering captures high-level protein functions. Bioinformatics, 31(21):3429–3436, Nov 2015.
|
| 195 |
+
[15] Matthew Peters, Waleed Ammar, Chandra Bhagavatula, and Russell Power. Semi-supervised sequence tagging with bidirectional language models. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 1756–1765, 2017.
|
| 196 |
+
[16] Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), volume 1, pages 2227–2237, 2018.
|
| 197 |
+
[17] Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2015.
|
| 198 |
+
[18] Lili Mou, Zhao Meng, Rui Yan, Ge Li, Yan Xu, Lu Zhang, and Zhi Jin. How transferable are neural networks in NLP applications? In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 479–489, 2016.
|
| 199 |
+
[19] Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 670–680, 2017.
|
| 200 |
+
[20] Tomáš Kociský, Karl Moritz Hermann, and Phil Blunsom. Learning bilingual word representations by ˇ marginalizing alignments. In Proceedings of ACL, pages 224–229, 2014.
|
| 201 |
+
[21] Chris Dyer, Victor Chahuneau, and Noah A Smith. A simple, fast, and effective reparameterization of ibm model 2. In Proceedings of NAACL-HLT, pages 644–649, 2013.
|
| 202 |
+
[22] Stephan Gouws, Yoshua Bengio, and Greg Corrado. BilBOWA: Fast bilingual distributed representations without word alignments. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 748–756, Lille, France, 2015. PMLR.
|
| 203 |
+
[23] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
|
| 204 |
+
[24] Karl Moritz Hermann, Tomáš Kociský, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, ˇ and Phil Blunsom. Teaching machines to read and comprehend. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 1693–1701, Cambridge, MA, USA, 2015. MIT Press.
|
| 205 |
+
[25] Rudolf Kadlec, Martin Schmid, Ondrej Bajgar, and Jan Kleindienst. Text understanding with the attention sum reader network. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pages 908–918, 2016.
|
| 206 |
+
[26] Yiming Cui, Zhipeng Chen, Si Wei, Shijin Wang, Ting Liu, and Guoping Hu. Attention-over-attention neural networks for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 593–602, 2017.
|
| 207 |
+
[27] Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In International Conference on Learning Representations, 2017.
|
| 208 |
+
[28] Hua He and Jimmy Lin. Pairwise word interaction modeling with deep neural networks for semantic similarity measurement. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 937–948, 2016.
|
| 209 |
+
[29] Ankur P Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. arXiv preprint arXiv:1606.01933, 2016.
|
| 210 |
+
[30] John-Marc Chandonia, Naomi K Fox, and Steven E Brenner. SCOPe: Manual curation and artifact removal in the structural classification of proteins - extended database. J. Mol. Biol., 429(3):348–355, February 2017.
|
| 211 |
+
[31] S F Altschul, W Gish, W Miller, E W Myers, and D J Lipman. Basic local alignment search tool. J. Mol. Biol., 215(3):403–410, October 1990.
|
| 212 |
+
[32] S B Needleman and C D Wunsch. A general method applicable to the search for similarities in the amino acid sequence of two proteins. J. Mol. Biol., 48(3):443–453, March 1970.
|
| 213 |
+
[33] R. D. Finn, J. Clements, and S. R. Eddy. HMMER web server: interactive sequence similarity searching. Nucleic Acids Res., 39(Web Server issue):29–37, Jul 2011.
|
| 214 |
+
[34] J. Soding, A. Biegert, and A. N. Lupas. The HHpred interactive server for protein homology detection and structure prediction. Nucleic Acids Res., 33(Web Server issue):W244–248, Jul 2005.
|
| 215 |
+
[35] R. D. Finn, A. Bateman, J. Clements, P. Coggill, R. Y. Eberhardt, S. R. Eddy, A. Heger, K. Hetherington, L. Holm, J. Mistry, E. L. Sonnhammer, J. Tate, and M. Punta. Pfam: the protein families database. Nucleic Acids Res., 42(Database issue):D222–230, Jan 2014.
|
| 216 |
+
[36] Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from Tree-Structured long Short-Term memory networks. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, pages 1556–1566, 2015.
|
| 217 |
+
[37] Helen M. Berman, John Westbrook, Zukang Feng, Gary Gilliland, T. N. Bhat, Helge Weissig, Ilya N. Shindyalov, and Philip E. Bourne. The protein data bank. Nucleic Acids Research, 28(1):235–242, 2000. doi: 10.1093/nar/28.1.235. URL http://dx.doi.org/10.1093/nar/28.1.235.
|
| 218 |
+
[38] K. D. Tsirigos, C. Peters, N. Shu, L. Kall, and A. Elofsson. The TOPCONS web server for consensus prediction of membrane protein topology and signal peptides. Nucleic Acids Res., 43(W1):W401–407, Jul 2015.
|
| 219 |
+
[39] T J Hubbard, A G Murzin, S E Brenner, and C Chothia. SCOP: a structural classification of proteins database. Nucleic Acids Res., 25(1):236–239, January 1997.
|
| 220 |
+
[40] Joerg Schaarschmidt, Bohdan Monastyrskyy, Andriy Kryshtafovych, and Alexandre MJJ Bonvin. Assessment of contact predictions in casp12: Co-evolution and deep learning coming of age. Proteins: Structure, Function, and Bioinformatics, 86:51–66, 2018.
|
| 221 |
+
[41] Sheng Wang, Siqi Sun, Zhen Li, Renyu Zhang, and Jinbo Xu. Accurate de novo prediction of protein contact map by ultra-deep learning model. PLoS computational biology, 13(1):e1005324, 2017.
|
| 222 |
+
[42] Yang Liu, Perry Palmedo, Qing Ye, Bonnie Berger, and Jian Peng. Enhancing evolutionary couplings with deep convolutional neural networks. Cell systems, 6(1):65–74, 2018.
|
| 223 |
+
[43] David T Jones, Tanya Singh, Tomasz Kosciolek, and Stuart Tetchner. Metapsicov: combining coevolution methods for accurate prediction of contacts and long range hydrogen bonding in proteins. Bioinformatics, 31(7):999–1006, 2014.
|
| 224 |
+
[44] Sergey Ovchinnikov, Hetunandan Kamisetty, and David Baker. Robust and accurate prediction of residue– residue interactions across protein interfaces using evolutionary information. Elife, 3:e02030, 2014.
|
| 225 |
+
|
| 226 |
+
A APPENDIX
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 2: Illustration of the embedding model. The amino acid sequence is first passed through the pretrained language model in both forward and reverse directions. The hidden states at each position of both directions of the language model are concatenated together with a one hot representation of the amino acids and passed as input to the encoder. The final vector representations of each position of the amino acid sequence are given by a linear transformation of the outputs of the final bidirectional LSTM layer.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 3: Illustration of the SCOP hierarchy modified from Hubbard et al. [39].
|
| 233 |
+
|
| 234 |
+
Table 4: Sequence length statistics for the SCOPe datasets. We report the mean and standard deviation along with minimum and maximum sequence lengths.
|
| 235 |
+
|
| 236 |
+
<table><tr><td rowspan="2"></td><td colspan="4"> Sequence Length</td></tr><tr><td>Mean</td><td> Std. Dev.</td><td>Min</td><td>Max</td></tr><tr><td>Dataset 2.06 train</td><td>176</td><td>110</td><td>20</td><td>1,449</td></tr><tr><td>2.06 test</td><td>180</td><td>114</td><td>21</td><td>1,500</td></tr><tr><td>2.07 new test</td><td>190</td><td>149</td><td>25</td><td>1,664</td></tr></table>
|
| 237 |
+
|
| 238 |
+
Table 5: Comparison of encoder architectures on the ASTRAL 2.06 test set. Encoders included LM inputs and were trained using SSA without contact prediction.
|
| 239 |
+
|
| 240 |
+
<table><tr><td>Embedding Model</td><td>Accuracy</td><td>r</td><td>p</td></tr><tr><td>Linear</td><td>0.85277</td><td>0.74419</td><td>0.60333</td></tr><tr><td>Fully connected (1-layer, 512 units)</td><td>0.91013</td><td>0.84193</td><td>0.67024</td></tr><tr><td>BiLSTM (1-layer)</td><td>0.92964</td><td>0.87239</td><td>0.67485</td></tr><tr><td>BiLSTM (3-layer)</td><td>0.93794</td><td>0.88048</td><td>0.67645</td></tr></table>
|
| 241 |
+
|
| 242 |
+
# A.1 LANGUAGE MODEL TRAINING
|
| 243 |
+
|
| 244 |
+
The bidirectional LSTM language model was trained on the full set of protein domain sequences in the Pfam database, 21,827,419 total sequences. The language model was trained to predict the amino acid at position $i$ given observations of all amino acids before $i$ and all amino acids after $i$ by minimizing the cross entropy loss with log predicted log probabilities given by the sum of the forward and reverse LM direction predictions
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\log p ( x _ { i } | x _ { - i } ) = \log p ^ { F } ( x _ { i } ) + \log p ^ { R } ( x _ { i } )
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
where $p ^ { F } ( x _ { i } )$ is the probability given by the forward direction LSTM and $p ^ { R } ( x _ { i } )$ is the probability given by the reverse direction LSTM.
|
| 251 |
+
|
| 252 |
+
The language model architecture consisted of a 2-layer LSTM with 1024 units in each layer followed by a linear transformation into the 20-d amino acid prediction. All parameters were shared between the forward and reverse direction components. The model was trained for a single epoch using ADAM with a learning rate of 0.001 and minibatch size of 32.
|
| 253 |
+
|
| 254 |
+
# A.2 HYPERPARAMETER SELECTION
|
| 255 |
+
|
| 256 |
+
We select the resampling probability and $\lambda$ hyperparameters based on structural similarity prediction accuracy on a validation set held out from the SCOP ASTRAL 2.06 training set (Section 4.1). For these experiments, we hold out 2,240 random sequences from the 22,408 sequences of the training set. From these held out sequences, we randomly sample 100,000 pairs as the validation set.
|
| 257 |
+
|
| 258 |
+
Table 6: Evaluation of amino acid resampling probability and contact prediction loss weight, $\lambda$ , for structural similarity prediction on the validation set. (Top) Resampling probability of 0.05 is compared with no resampling for 3-layer biLSTM encoders with and without language model components that are trained using SSA without contact prediction. (Bottom) Comparison of models trained using the full framework with $\lambda = 0 . 5$ , $\lambda = 0 . 3 3$ , and $\lambda = 0 . 1$ .
|
| 259 |
+
|
| 260 |
+
<table><tr><td>Encoder</td><td>Resampling</td><td>Contact Prediction</td><td>Accuracy</td></tr><tr><td>3-layer biLSTM (no LM)</td><td>no</td><td>no</td><td>0.89770</td></tr><tr><td>3-layer biLSTM (no LM)</td><td>yes</td><td>no</td><td>0.90011</td></tr><tr><td>3-layer biLSTM</td><td>no</td><td>no</td><td>0.92838</td></tr><tr><td>3-layer biLSTM</td><td>yes</td><td>no</td><td>0.93375</td></tr><tr><td>3-layer biLSTM</td><td>yes</td><td>入= 0.5</td><td>0.94181</td></tr><tr><td>3-layer biLSTM</td><td>yes</td><td>入= 0.33</td><td>0.94474</td></tr><tr><td>3-layer biLSTM</td><td>yes</td><td>入=0.1</td><td>0.94749</td></tr></table>
|
| 261 |
+
|
| 262 |
+
Resampling probability. We consider models trained with amino acid resampling probability 0.05 and without amino acid resampling in the simplified framework (SSA without contact prediction) using the 3-layer biLSTM encoder with and without the language model component. We find that the structural similarity results are slightly improved when using amino acid resampling regardless of whether the LM component of the encoder is included (Appendix Table 6). Based on this result, all models were trained with amino acid resampling of 0.05.
|
| 263 |
+
|
| 264 |
+
Multitask loss weight, $\lambda$ . We evaluate three values of $\lambda$ , interpolating between the structural similarity loss and contact prediction loss, for predicting structural similarity on the validation set. Prediction accuracy increased progressively as $\lambda$ decreased and all models trained with contact prediction outperformed those trained without contact prediction (Appendix Table 6). Because it gave the best prediction accuracy on the validation set, $\lambda = 0 . 1$ was selected for training models with our full framework.
|
| 265 |
+
|
| 266 |
+
# A.3 TIME AND MEMORY REQUIREMENTS
|
| 267 |
+
|
| 268 |
+
Embedding time and memory scale linearly with sequence length. Embedding time is very fast ( 0.03 ms per amino acid on an NVIDIA V100) and easily fits on a single GPU $( < 9 \mathrm { G B }$ of RAM to embed 130,000 amino acids). Computing the SSA for sequence comparison scales as the product of the sequence lengths, $\mathrm { { { O } ( n m ) } }$ , but is easily parallelized on a GPU. Computing the SSA for all 237,016 pairs of sequences in the SCOPe ASTRAL 2.07 new test set required on average $0 . 4 3 ~ \mathrm { m s }$ per pair (101 seconds total) when each comparison was calculated serially on a single NVIDIA V100. The contact prediction component scales quadratically with sequence length for both time and memory.
|
| 269 |
+
|
| 270 |
+
# A.4 STRUCTURAL SIMILARITY PREDICTION BENCHMARKS
|
| 271 |
+
|
| 272 |
+
For the NW-align method, similarity between protein sequences was computed using the BLOSUM62 substitution matrix with gap open and extend penalties of -11 and -1 respectively. For phmmer, each pair of sequences was compared in both directions (i.e. query->target and target->query) using the ’–max’ option. The similarity score for each pair was treated as the average off the query->target and target->query scores. For HHalign, multiple sequence alignments were first built for each sequence by using HHblits to search for similar sequences in the uniclust30 database with a maximum of 2 rounds of iteration (-n 2). Sequences pairs were then scored by using HHalign to score the target- $>$ query and query->target HMM-HMM alignments. Again, the average of the two scores was treated as the overall HHalign score. Finally, for TMalign, the structures for each pair of proteins were aligned and the scores for the query->target and target- $\textgreater$ query alignments were averaged to give the overall TMalign score for each pair of proteins.
|
| 273 |
+
|
| 274 |
+
To calculate the classification accuracy from the above scores, thresholds were found to maximize prediction accuracy when binning scores into similarity levels using 100,000 pairs of sequences sampled from the ASTRAL 2.06 training set.
|
| 275 |
+
|
| 276 |
+
# A.5 CONTACT PREDICTION PERFORMANCE
|
| 277 |
+
|
| 278 |
+
Although we use contact prediction as an auxiliary task to provide position-level structural supervision for the purpose of improving embedding quality and structure similarity prediction, we include results for predicting contacts using the trained contact prediction module here. We report results for contact prediction using the full SSA model on the SCOP ASTRAL 2.06 test set and 2.07 new test set in Appendix Table 7. Precision, recall, and F1 score are calculated using a probability threshold of 0.5 for assigning predicted contacts. We consider performance for predicting all contacts (i.e. contacts between all amino acid positions, excluding neighbors, $| i - j | \geq 2 $ ), our training objective, and for distant contacts $( | i - j | \geq 1 2 )$ which are the focus of co-evolution based methods. We also report the precision of the top $L$ , $L / 2$ , and $L / 5$ contact predictions, where $L$ is the length of the protein sequence.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Dataset</td><td>Contacts</td><td>Precision</td><td>Recall</td><td>F1</td><td>AUPR</td><td>Pr @ L</td><td>Pr @ L/2</td><td>Pr @ L/5</td></tr><tr><td>2.06 test</td><td>All</td><td>0.87299</td><td>0.72486</td><td>0.78379</td><td>0.84897</td><td>0.99659</td><td>0.99867</td><td>0.99911</td></tr><tr><td>2.06 test</td><td>Distant</td><td>0.71814</td><td>0.47432</td><td>0.52521</td><td>0.60198</td><td>0.62536</td><td>0.72084</td><td>0.78983</td></tr><tr><td>2.07 new test</td><td>All</td><td>0.879077</td><td>0.72888</td><td>0.78874</td><td>0.84577</td><td>0.99471</td><td>0.99879</td><td>0.99914</td></tr><tr><td>2.07 new test</td><td>Distant</td><td>0.70281</td><td>0.46570</td><td>0.50454</td><td>0.57957</td><td>0.59458</td><td>0.66942</td><td>0.72418</td></tr></table>
|
| 281 |
+
|
| 282 |
+
Table 7: Contact prediction performance of the full SSA model on the SCOP ASTRAL 2.06 test set and the 2.07 new test set. We report precision, recall, F1 score, and the area under the precision-recall curve (AUPR) for predicting all contacts $( | i - j | \geq 2 )$ and distant contacts $( | i - j | \geq 1 2 )$ ) in the test set proteins. We also report precision of the top $L$ , $L / 2$ , and $L / 5$ predicted contacts.
|
| 283 |
+
|
| 284 |
+
In order to facilitate some comparison with state-of-the-art co-evolution based contact prediction methods, we also report results for contact prediction using our full SSA model on the publicly released set of free modelling targets from CASP12 [40]. This dataset consists of 21 protein domains. We include the complete list at the end of this section. We compare with deep convolutional neural network models using co-evolution features, RaptorX-Contact [41], iFold & Deepfold-Contact [42], and MetaPSICOV [43], and with GREMLIN [44], an entirely co-evolution based approach. We find that our model dramatically outperforms these methods when predicting all contacts but performs worse when predicting only distant contacts (Appendix Table 8). This is unsurprising, as our model is trained to predict all contacts, of which local contacts are much more abundant than distant contacts, whereas the co-evolution methods are designed to predict distant contacts. Furthermore, we wish to emphasize that our model is tuned for structural similarity prediction and that our contact prediction module is extremely simple, being only a single fully connected layer followed by a single convolutional layer. It is possible that much better performance could be achieved using our embeddings with a more sophisticated contact prediction architecture. That said, our model does outperform the pure co-evolution method, GREMLIN, based on AUPR for predicting distant contacts. These results suggest that our embeddings may be useful as features, in combination with co-evolution based features, for improving dedicated contact prediction models on both local and distant contacts.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Contacts</td><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td><td>AUPR</td><td>Pr @ L</td><td>Pr @ L/2</td><td>Pr @ L/5</td></tr><tr><td>All</td><td>GREMLIN</td><td>0.75996</td><td>0.04805</td><td>0.07573</td><td>0.09319</td><td>0.23348</td><td>0.30969</td><td>0.36271</td></tr><tr><td></td><td>iFold_1</td><td>0.11525</td><td>0.3443</td><td>0.16631</td><td>0.20027</td><td>0.40381</td><td>0.48265</td><td>0.53176</td></tr><tr><td></td><td>Deepfold-Contact</td><td>0.15949</td><td>0.30481</td><td>0.16092</td><td>0.19487</td><td>0.39047</td><td>0.44670</td><td>0.47191</td></tr><tr><td></td><td>MetaPSICOV</td><td>0.51715</td><td>0.08935</td><td>0.13673</td><td>0.19329</td><td>0.42288</td><td>0.50202</td><td>0.58202</td></tr><tr><td></td><td>RaptorX-Contact</td><td>0.41937</td><td>0.14135</td><td>0.19373</td><td>0.20501</td><td>0.43254</td><td>0.50384</td><td>0.56178</td></tr><tr><td></td><td>SSA (full)</td><td>0.78267</td><td>0.47298</td><td>0.58091</td><td>0.61299</td><td>0.98773</td><td>0.99147</td><td>0.9928</td></tr><tr><td>Distant</td><td>GREMLIN</td><td>0.73652</td><td>0.06184</td><td>0.08973</td><td>0.07231</td><td>0.15211</td><td>0.22508</td><td>0.27663</td></tr><tr><td></td><td>iFold_1</td><td>0.10405</td><td>0.60654</td><td>0.17084</td><td>0.26605</td><td>0.33625</td><td>0.40596</td><td>0.46482</td></tr><tr><td></td><td>Deepfold-Contact</td><td>0.14852</td><td>0.52808</td><td>0.16548</td><td>0.26589</td><td>0.3422</td><td>0.39832</td><td>0.41885</td></tr><tr><td></td><td>MetaPSICOV</td><td>0.59992</td><td>0.13366</td><td>0.18350</td><td>0.25332</td><td>0.35483</td><td>0.43886</td><td>0.51106</td></tr><tr><td></td><td>RaptorX-Contact</td><td>0.38873</td><td>0.23186</td><td>0.26050</td><td>0.29023</td><td>0.37874</td><td>0.45729</td><td>0.51607</td></tr><tr><td></td><td>SSA (full)</td><td>0.35222</td><td>0.03950</td><td>0.06216</td><td>0.10226</td><td>0.16548</td><td>0.19138</td><td>0.22780</td></tr></table>
|
| 287 |
+
|
| 288 |
+
Table 8: Contact prediction performance of the full SSA model on the CASP12 free modelling targets with results of state-of-the-art co-evolution based methods for comparison. We report precision, recall, F1 score, and the area under the precision-recall curve (AUPR) for predicting all contacts $( | i - j | \geq 2 )$ and distant contacts $( | i - j | \geq 1 2 )$ ). We also report precision of the top $L$ , $\bar { L } / 2$ , and $L / 5$ predicted contacts.
|
| 289 |
+
|
| 290 |
+
CASP12 free modeling domains: T0859-D1, T0941-D1, T0896-D3, T0900-D1, T0897-D1, T0898-D1, T0862-D1, T0904-D1, T0863-D2, T0912-D3, T0897-D2, T0863-D1, T0870-D1, T0864- D1, T0886-D2, T0892-D2, T0866-D1, T0918-D1, T0918-D2, T0918-D3, T0866-D1
|
md/train/SyxS0T4tvS/SyxS0T4tvS.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ROBERTA: A ROBUSTLY OPTIMIZED BERT PRETRAINING APPROACH
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Language model pretraining has led to significant performance gains but careful comparison between different approaches is challenging. Training is computationally expensive, often done on private datasets of different sizes, and, as we show, hyperparameter choices have significant impact on the final results. We present a replication study of BERT pretraining (Devlin et al., 2019) that carefully measures the impact of many key hyperparameters and training data size. We find that BERT was significantly undertrained, and can match or exceed the performance of every model published after it. Our best model achieves state-of-the-art results on GLUE, RACE, SQuAD, SuperGLUE and XNLI. These results highlight the importance of previously overlooked design choices, and raise questions about the source of recently reported improvements. We release our models and code.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Self-training methods such as ELMo (Peters et al., 2018), GPT (Radford et al., 2018), BERT (Devlin et al., 2019), XLM (Lample & Conneau, 2019), and XLNet (Yang et al., 2019) have brought significant performance gains, but it can be challenging to determine which aspects of the methods contribute the most. Training is computationally expensive, limiting the amount of tuning that can be done, and modeling advances are often conflated with changes in data size or composition.
|
| 12 |
+
|
| 13 |
+
We present a replication study of BERT pretraining (Devlin et al., 2019), which includes a careful evaluation of the effects of hyperparameter tuning and training set size. We find that BERT was significantly undertrained and propose an improved training recipe, which we call RoBERTa, that can match or exceed the performance of all of the post-BERT methods. Our modifications are simple, they include: (1) training the model longer, with bigger batches, over more data; (2) removing the next sentence prediction objective; (3) training on longer sequences; and (4) dynamically changing the masking pattern applied to the training data. We also collect a large new dataset (CC-NEWS) of comparable size to other privately used datasets, to better control for training set size effects.
|
| 14 |
+
|
| 15 |
+
When controlling for training data, our improved training procedure improves upon the published BERT results on the GLUE (Wang et al., 2019b) and SQuAD (Rajpurkar et al., 2016) benchmarks. When trained for longer over additional data, our model achieves a score of 88.5 on the public GLUE leaderboard, matching the 88.4 reported by Yang et al. (2019). Our model establishes a new stateof-the-art on 4/9 of the GLUE tasks, as well as RACE (Lai et al., 2017), SuperGLUE (Wang et al., 2019a), and XNLI (Conneau et al., 2018), and matches the state-of-the-art on SQuAD. Overall, we re-establish that BERT’s masked language model training objective is competitive with recently proposed alternatives such as perturbed autoregressive language modeling (Yang et al., 2019).2
|
| 16 |
+
|
| 17 |
+
In summary, the contributions of this paper are: (1) We present a set of important BERT design choices and training strategies and introduce alternatives that lead to better downstream task performance; (2) We use a novel dataset, CC-NEWS, and confirm that using more data for pretraining further improves performance on downstream tasks; (3) Our training improvements show that masked language model pretraining, under the right design choices, is competitive with all other recently published methods. We release our model, pretraining and fine-tuning code.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
Setup: BERT (Devlin et al., 2019) takes as input a concatenation of two segments (sequences of tokens), $x _ { 1 } , \ldots , x _ { N }$ and $y _ { 1 } , \dots , y _ { M }$ . Segments usually consist of more than one natural sentence. The two segments are presented as a single input sequence to BERT with special tokens delimiting them: $[ C L S ] , x _ { 1 } , \ldots , x _ { N } , [ S E P ] , y _ { 1 } , \ldots , y _ { M } , [ E O S ]$ . $M$ and $N$ are constrained such that $M + N <$ $T$ , where $T$ is a parameter that controls the maximum sequence length during training.
|
| 22 |
+
|
| 23 |
+
Architecture: BERT uses the now ubiquitous transformer architecture (Vaswani et al., 2017), which we will not review in detail. We use a transformer architecture with $L$ layers. Each block has $A$ self-attention heads and hidden dimension $H$ .
|
| 24 |
+
|
| 25 |
+
Training Objectives: BERT uses two pretraining objectives: masked language modeling and next sentence prediction. For the Masked Language Model (MLM) objective, BERT is trained via a crossentropy loss to predict $15 \%$ of the input tokens, selected at random. To prevent the model from cheating, $80 \%$ of these selected tokens are replaced by a special $[ M A S K ]$ symbol in the input, $10 \%$ are replaced by a random token from the vocabulary, and $10 \%$ are left unchanged.
|
| 26 |
+
|
| 27 |
+
Next Sentence Prediction (NSP) is a binary classification loss for predicting whether two segments follow each other in the original text. Positive examples are created by taking consecutive sentences from the text corpus. Negative examples are created by pairing segments from different documents. Positive and negative examples are sampled with equal probability.
|
| 28 |
+
|
| 29 |
+
Optimization: BERT is optimized with AdamW (Kingma & Ba, 2015) using the following parameters: $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , $\epsilon = 1 \mathrm { e } { - } 6$ and decoupled weight decay of 0.01 (Loshchilov & Hutter, 2019). The learning rate is warmed up over the first 10,000 steps to a peak value of 1e-4, and then linearly decayed. BERT trains with a dropout of 0.1 on all layers and attention weights, and a GELU activation function (Hendrycks & Gimpel, 2016). Models are pretrained for $S = \overline { { 1 } } , 0 0 0 , 0 0 0$ updates, with mini-batches containing $B = 2 5 6$ sequences of maximum length $T = 5 1 2$ tokens.
|
| 30 |
+
|
| 31 |
+
Data: BERT is trained on a combination of BOOKCORPUS (Zhu et al., 2015) plus English WIKIPEDIA, which totals 16GB of uncompressed text.3
|
| 32 |
+
|
| 33 |
+
# 3 EXPERIMENTAL SETUP
|
| 34 |
+
|
| 35 |
+
# 3.1 IMPLEMENTATION
|
| 36 |
+
|
| 37 |
+
We reimplement BERT in FAIRSEQ (Ott et al., 2019). We primarily follow the original BERT optimization hyperparameters, given in Section 2, except for the peak learning rate and number of warmup steps, which are tuned separately for each setting. We found training to be very sensitive to the Adam epsilon term, and in some cases we obtained better performance or improved stability after tuning it. We also set $\beta _ { 2 } = 0 . 9 8$ to improve stability when training with large batch sizes.
|
| 38 |
+
|
| 39 |
+
We pretrain with sequences of at most $T = 5 1 2$ tokens. Unlike Devlin et al. (2019), we do not randomly inject short sequences, and we do not train with a reduced sequence length for the first $90 \%$ of updates. We train only with full-length sequences.
|
| 40 |
+
|
| 41 |
+
We train with mixed precision floating point arithmetic on DGX-1 machines, each with ${ 8 \times 3 2 { \mathrm { G B } } }$ Nvidia V100 GPUs interconnected by Infiniband (Micikevicius et al., 2018).
|
| 42 |
+
|
| 43 |
+
# 3.2 DATA
|
| 44 |
+
|
| 45 |
+
BERT-style pretraining crucially relies on large quantities of text. Baevski et al. (2019) demonstrate that increasing data size can result in improved end-task performance. Several efforts have trained on datasets larger and more diverse than the original BERT (Radford et al., 2019; Yang et al., 2019; Zellers et al., 2019). Unfortunately, not all of the additional datasets can be publicly released. For our study, we focus on gathering as much data as possible for experimentation, allowing us to match the overall quality and quantity of data as appropriate for each comparison.
|
| 46 |
+
|
| 47 |
+
We consider five English-language corpora of varying sizes and domains, totaling over 160GB of uncompressed text: (1&2) BOOKCORPUS (Zhu et al., 2015) plus English WIKIPEDIA, which is the original data used to train BERT (16GB); (3) CC-NEWS, which we collect from the English portion of the CommonCrawl News dataset (Nagel, 2016), containing 63 million English news articles crawled between September 2016 and February 2019 (76GB after filtering);4 (4) OPENWEBTEXT (Gokaslan & Cohen, 2019), an open-source recreation of the WebText corpus described in Radford et al. (2019), containing web content extracted from URLs shared on Reddit with at least three upvotes (38GB);5 (5) STORIES, a dataset introduced in Trinh & Le (2018) containing a subset of CommonCrawl data filtered to match the story-like style of Winograd schemas (31GB).
|
| 48 |
+
|
| 49 |
+
# 3.3 EVALUATION
|
| 50 |
+
|
| 51 |
+
Following previous work, we evaluate our pretrained models by finetuning on downstream tasks:
|
| 52 |
+
|
| 53 |
+
• GLUE: The General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019b) is a collection of 9 datasets for evaluating natural language understanding systems. Tasks are framed as either single-sentence classification or sentence-pair classification tasks. The GLUE organizers provide training and development data splits as well as a submission server and leaderboard that allows participants to evaluate and compare their systems on private held-out test data. • SQuAD: The Stanford Question Answering Dataset (SQuAD) provides a paragraph of context and a question. The task is to answer the question with a span extracted from the context. We evaluate on SQuAD V1.1 and V2.0 (Rajpurkar et al., 2016; 2018). In V1.1 the context always contains an answer, while in V2.0 some questions are not answered in the provided context. • RACE: ReAding Comprehension from Examinations (RACE) (Lai et al., 2017) is a large-scale reading comprehension dataset collected from English examinations in China. The task is to choose among four possible answers to a given question, using a given passage of text as context. • Additional Benchmarks: In the Appendix we present additional results for SuperGLUE (Wang et al., 2019a) and XNLI (Conneau et al., 2018).
|
| 54 |
+
|
| 55 |
+
# 4 TRAINING PROCEDURE ANALYSIS
|
| 56 |
+
|
| 57 |
+
This section explores and quantifies which choices are important for successfully pretraining BERT models. We keep the model architecture fixed.6 Specifically, we begin by training BERT models with the same configuration as $\mathbf { B E R T _ { B A S E } }$ $L = 1 2$ , $H = 7 6 8$ , $A = 1 2$ , 110M params).
|
| 58 |
+
|
| 59 |
+
# 4.1 STATIC VS. DYNAMIC MASKING
|
| 60 |
+
|
| 61 |
+
As discussed in Section 2, BERT relies on predicting randomly masked tokens. The original BERT implementation performed masking once during data preprocessing, resulting in a single static mask. To avoid repeating the same masks at every epoch, training data was duplicated 10 times prior to preprocessing, so that each training sequence was seen with the same mask only four times over the course of 40 training epochs. We instead train with dynamic masking, where we generate the masking pattern on-the-fly each time we input a sequence to the model. This becomes crucial when pretraining for more steps or with larger datasets, and additionally performs marginally better than static masking on some downstream tasks (see Appendix A).
|
| 62 |
+
|
| 63 |
+
# 4.2 MODEL INPUT FORMAT AND NEXT SENTENCE PREDICTION
|
| 64 |
+
|
| 65 |
+
In the original BERT pretraining procedure, the model observes two concatenated document segments and is trained via an auxiliary Next Sentence Prediction (NSP) loss to predict whether these segments were sampled contiguously from the same document or from distinct documents.
|
| 66 |
+
|
| 67 |
+
Table 1: Development set results for base models pretrained over BOOKCORPUS and WIKIPEDIA. All models are trained for 1M steps with a batch size of 256 sequences. We report F1 for SQuAD and accuracy for MNLI-m, SST-2 and RACE. Reported results are medians over five random initializations (seeds). Results for $\mathbf { B E R T _ { B A S E } }$ and $\mathbf { X L N e t } _ { \mathrm { B A S E } }$ are from Yang et al. (2019).
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Model</td><td>SQuAD 1.1/2.0</td><td>MNLI-m</td><td>SST-2</td><td>RACE</td></tr><tr><td colspan="5">Our reimplementation (with NSP loss):</td></tr><tr><td>SEGMENT-PAIR</td><td>90.4/78.7</td><td>84.0</td><td>92.9</td><td>64.2</td></tr><tr><td>SENTENCE-PAIR</td><td>88.7/76.2</td><td>82.9</td><td>92.1</td><td>63.0</td></tr><tr><td colspan="5">Our reimplementation (without NSP loss):</td></tr><tr><td>FULL-SENTENCES</td><td>90.4/79.1</td><td>84.7</td><td>92.5</td><td>64.8</td></tr><tr><td>DOC-SENTENCES</td><td>90.6/79.7</td><td>84.7</td><td>92.7</td><td>65.6</td></tr><tr><td>BERTBASE</td><td>88.5/76.3</td><td>84.3</td><td>92.8</td><td>64.3</td></tr><tr><td>XLNetBASE (K=7)</td><td>-/81.3</td><td>85.8</td><td>92.7</td><td>66.1</td></tr><tr><td>XLNetBASE (K=6)</td><td>-/81.0</td><td>85.6</td><td>93.4</td><td>66.7</td></tr></table>
|
| 70 |
+
|
| 71 |
+
The NSP objective was designed to improve performance on downstream tasks, such as Natural Language Inference (Bowman et al., 2015), which require predicting relationships between pairs of sentences. Devlin et al. (2019) observe that removing NSP hurts performance, with significant performance degradation on QNLI, MNLI, and SQuAD 1.1. However, recent work has questioned the necessity of the NSP loss (Lample & Conneau, 2019; Yang et al., 2019; Joshi et al., 2019).
|
| 72 |
+
|
| 73 |
+
To better understand this discrepancy, we compare several alternative training formats:
|
| 74 |
+
|
| 75 |
+
• SEGMENT-PAIR $^ +$ NSP: This follows the original input format used in BERT (Devlin et al., 2019), with the NSP loss. Each input has a pair of segments, which can each contain multiple natural sentences, but the total combined length must be less than 512 tokens. SENTENCE-PAIR $+ \mathrm { N S P }$ : Each input contains a pair of natural sentences, either sampled from a contiguous portion of one document or from separate documents. Since these inputs are significantly shorter than 512 tokens, we increase the batch size so that the total number of tokens remains similar to SEGMENT-PAIR $+ \mathrm { N S P }$ . We retain the NSP loss. FULL-SENTENCES: Each input is packed with full sentences sampled contiguously from one or more documents, such that the total length is at most 512 tokens. Inputs may cross document boundaries. When we reach the end of one document, we begin sampling sentences from the next document and add an extra separator token between documents. We remove the NSP loss. DOC-SENTENCES: Inputs are constructed similarly to FULL-SENTENCES, except that they may not cross document boundaries. Inputs sampled near the end of a document may be shorter than 512 tokens, so we dynamically increase the batch size in these cases to achieve a similar number of total tokens as FULL-SENTENCES. We remove the NSP loss.
|
| 76 |
+
|
| 77 |
+
Results Table 1 shows results for the four different settings. We first compare the original SEGMENT-PAIR input format from Devlin et al. (2019) to the SENTENCE-PAIR format; both formats retain the NSP loss, but the latter uses single sentences. We find that using individual sentences hurts performance on downstream tasks, which we hypothesize is because the model is not able to learn long-range dependencies.
|
| 78 |
+
|
| 79 |
+
We next compare training without the NSP loss and training with blocks of text from a single document (DOC-SENTENCES). We find that this setting outperforms the originally published BERTBASE results and that removing the NSP loss matches or slightly improves downstream task performance, in contrast to Devlin et al. (2019). It is possible that the original BERT implementation may only have removed the loss term while still retaining the SEGMENT-PAIR input format.
|
| 80 |
+
|
| 81 |
+
Finally we find that restricting sequences to come from a single document (DOC-SENTENCES) performs slightly better than packing sequences from multiple documents (FULL-SENTENCES). However, because the DOC-SENTENCES format results in variable batch sizes, we use FULL-SENTENCES in the remainder of our experiments for easier comparison with related work.
|
| 82 |
+
|
| 83 |
+
<table><tr><td>batch size</td><td>learning rate</td><td>epochs</td><td>steps</td><td> perplexity</td><td>MNLI-m</td><td>SST-2</td></tr><tr><td>256</td><td>1e-4</td><td>32</td><td>1M</td><td>3.99</td><td>84.7</td><td>92.5</td></tr><tr><td rowspan="3">2K</td><td rowspan="3">7e-4</td><td>32</td><td>125K</td><td>3.68</td><td>85.2</td><td>93.1</td></tr><tr><td>64</td><td>250K</td><td>3.59</td><td>85.3</td><td>94.1</td></tr><tr><td>128</td><td>500K</td><td>3.51</td><td>85.4</td><td>93.5</td></tr><tr><td rowspan="3">8K</td><td rowspan="3">1e-3</td><td>32</td><td>31K</td><td>3.77</td><td>84.4</td><td>93.2</td></tr><tr><td>64</td><td>63K</td><td>3.60</td><td>85.3</td><td>93.5</td></tr><tr><td>128</td><td>125K</td><td>3.50</td><td>85.8</td><td>94.1</td></tr></table>
|
| 84 |
+
|
| 85 |
+
Table 2: Perplexity on held-out validation data and dev set accuracy on MNLI-m and SST-2 for various batch sizes (# sequences) as we vary the number of passes (epochs) through the $\mathrm { { B O O K S } + }$ WIKI data. Reported results are medians over five random initializations (seeds). The learning rate is tuned for each batch size. All results are for $\mathbf { B E R T _ { B A S E } }$ with FULL-SENTENCE inputs.
|
| 86 |
+
|
| 87 |
+
# 4.3 TRAINING WITH LARGE BATCHES
|
| 88 |
+
|
| 89 |
+
Past work in neural machine translation has shown that training with large mini-batches can improve optimization speed and end-task performance when the learning rate is tuned appropriately (Ott et al., 2018). Large batches are also easily parallelized via data parallel training.7
|
| 90 |
+
|
| 91 |
+
Table 2 shows the masked LM perplexity and end-task accuracy for $\mathbf { B E R T _ { B A S E } }$ as we increase the batch size, while tuning the learning rate. Devlin et al. (2019) originally trained $\mathbf { B E R T _ { B A S E } }$ for 1M steps with a batch size of 256 sequences; however a batch size of 2K sequences performs better, even controlling for the number of epochs, suggesting that the original BERT batch size was too small. We also observe that training with extremely large batches (8K) becomes more efficient as we train for more epochs.8 In the remainder of our experiments we train with batches of 8K sequences.
|
| 92 |
+
|
| 93 |
+
# 4.4 TEXT ENCODING
|
| 94 |
+
|
| 95 |
+
Byte-Pair Encoding (BPE) (Sennrich et al., 2016) is a hybrid between character- and word-level modeling based on subwords units. BPE vocabulary sizes typically range from 10K-100K subword units; however, unicode characters can account for a sizeable portion of this vocabulary when modeling large and diverse corpora, such as the ones considered in this work.
|
| 96 |
+
|
| 97 |
+
The original BERT implementation (Devlin et al., 2019) used a character-level BPE vocabulary of size 30K. We instead adopt the larger byte-level BPE vocabulary of size 50K introduced in Radford et al. (2019), which uses bytes rather than unicode characters as the base subword units and can therefore encode any input text without introducing “unknown” tokens. This adds approximately 15M and 20M extra parameters for $\mathbf { B E R T _ { B A S E } }$ and BERTLARGE, respectively.
|
| 98 |
+
|
| 99 |
+
Early experiments revealed only minor differences between these encodings, with the byte-level BPE achieving slightly worse end-task performance on some tasks. Nevertheless, we believe the advantages of a universal encoding scheme outweighs the minor degredation in performance and use this encoding in the remainder of our experiments.
|
| 100 |
+
|
| 101 |
+
# 5 ROBERTA
|
| 102 |
+
|
| 103 |
+
In the previous section we propose modifications to the BERT pretraining procedure that improve end-task performance. We now aggregate these improvements and evaluate their combined impact. We call this configuration RoBERTa for Robustly optimized BERT approach. Specifically, RoBERTa is trained with dynamic masking (Section 4.1), FULL-SENTENCES without NSP loss (Section 4.2), large mini-batches (Section 4.3) and a larger byte-level BPE (Section 4.4).
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Model</td><td>data</td><td>batch size</td><td>steps</td><td>SQuAD (v1.1/2.0)</td><td>MNLI-m</td><td>SST-2</td></tr><tr><td>RoBERTa</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>with BOOKS +WIKI</td><td>16GB</td><td>8K</td><td>100K</td><td>93.6/87.3</td><td>89.0</td><td>95.3</td></tr><tr><td>+ additional data ($3.2)</td><td>160GB</td><td>8K</td><td>100K</td><td>94.0/87.7</td><td>89.3</td><td>95.6</td></tr><tr><td>+ pretrain longer</td><td>160GB</td><td>8K</td><td>300K</td><td>94.4/88.7</td><td>90.0</td><td>96.1</td></tr><tr><td>+ pretrain even longer</td><td>160GB</td><td>8K</td><td>500K</td><td>94.6/89.4</td><td>90.2</td><td>96.4</td></tr><tr><td>BERTLARGE</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>with BoOKS +WIKI</td><td>13GB</td><td>256</td><td>1M</td><td>90.9/81.8</td><td>86.6</td><td>93.7</td></tr><tr><td>XLNetLARGE</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>with BoOKS +WIKI</td><td>13GB</td><td>256</td><td>1M</td><td>94.0/87.8</td><td>88.4</td><td>94.4</td></tr><tr><td>+ additional data</td><td>126GB</td><td>2K</td><td>500K</td><td>94.5/88.8</td><td>89.8</td><td>95.6</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 3: Development set results for RoBERTa as we pretrain over more data $\mathbf { 1 6 G B } \mathbf { 1 6 0 G B }$ of text) and pretrain for longer $1 0 0 \mathrm { K } 3 0 0 \mathrm { K } 5 0 0 \mathrm { K }$ steps). Each row accumulates improvements from the rows above. RoBERTa matches the architecture and training objective of $\mathbf { B E R T _ { L A R G E } }$ . Results for $\mathbf { B E R T _ { L A R G E } }$ and $\mathrm { X L N e t } _ { \mathrm { L A R G E } }$ are from Devlin et al. (2019) and Yang et al. (2019), respectively. Complete results on all GLUE tasks can be found in Appendix C.
|
| 108 |
+
|
| 109 |
+
Additionally, we investigate two other important factors that have been under-emphasized in previous work: (1) the data used for pretraining, and (2) the number of training passes through the data. For example, XLNet (Yang et al., 2019) was pretrained using 10 times more data than BERT, with a batch size eight times larger for half as many optimization steps, thus seeing four times as many sequences in pretraining compared to Devlin et al. (2019).
|
| 110 |
+
|
| 111 |
+
To help disentangle the importance of these factors from other modeling choices (e.g., the pretraining objective), we begin by training RoBERTa following the $\mathbf { B E R T _ { L A R G E } }$ architecture $L = 2 4$ , $H =$ 1024, $A = 1 6$ , 355M parameters). We pretrain for 100K steps over a comparable BOOKCORPUS plus WIKIPEDIA dataset as was used in Devlin et al. (2019). We pretrain our model using 1024 V100 GPUs, which takes approximately one day per 100K steps.
|
| 112 |
+
|
| 113 |
+
Results We present our results in Table 3. When controlling for training data, we observe that RoBERTa provides a large improvement over the originally reported BERTLARGE results, reaffirming the importance of the design choices we explored in Section 4.
|
| 114 |
+
|
| 115 |
+
Next, we combine this data with the three additional datasets described in Section 3.2. We train RoBERTa over the combined data with the same number of training steps as before (100K). In total, we pretrain over 160GB of text. We observe further improvements in performance across all downstream tasks, validating the importance of data size and diversity in pretraining.9 9
|
| 116 |
+
|
| 117 |
+
Finally, we pretrain RoBERTa for significantly longer, increasing the number of pretraining steps from 100K to 300K, and then further to 500K. We again observe significant gains in downstream task performance, and the 300K and 500K step models outperform XLNetLARGE across most tasks. We note that even our longest-trained model does not appear to overfit our data and would likely benefit from additional training.
|
| 118 |
+
|
| 119 |
+
# 5.1 GLUE RESULTS
|
| 120 |
+
|
| 121 |
+
For GLUE, we consider two finetuning settings. In the first setting (single-task, dev), we finetune RoBERTa separately for each of the GLUE tasks, using only the training data for the corresponding task. We consider a limited hyperparameter sweep with batch sizes $\in \{ 1 6 , 3 2 \}$ and learning rates $\in \ \{ 1 \mathrm { e } { - } 5 , 2 \mathrm { e } { - } 5 , 3 \mathrm { e } { - } 5 \}$ , with a linear warmup for the first $6 \%$ of steps followed by a linear decay to 0. We finetune for 10 epochs with early stopping based on each task’s dev set. The rest of the hyperparameters remain the same as during pretraining. In this setting, we report the median development set results for each task over five random initializations, without model ensembling.
|
| 122 |
+
|
| 123 |
+
In the second setting (ensembles, test), we compare RoBERTa to other approaches on the test set via the GLUE leaderboard. While many submissions to the GLUE leaderboard depend on multi-task finetuning, our submission depends only on single-task finetuning. For RTE, STS and MRPC we finetune starting from the MNLI single-task model, following Phang et al. (2018). We explore a slightly wider hyperparameter space, described in Appendix C, and ensemble between 5 and 7 models per task. Two of the GLUE tasks require task-specific finetuning approaches to achieve competitive leaderboard results; these approaches are described in Appendix B.
|
| 124 |
+
|
| 125 |
+
Table 4: Results on GLUE. All results are based on a 24-layer architecture. $\mathbf { B E R T _ { L A R G E } }$ and $\mathbf { X L N e t } _ { \mathrm { L A R G E } }$ results are from Devlin et al. (2019) and Yang et al. (2019), respectively. RoBERTa results on the dev set are a median over five runs. RoBERTa results on the test set are ensembles of single-task models. For RTE, STS and MRPC we finetune starting from the MNLI model.
|
| 126 |
+
|
| 127 |
+
<table><tr><td></td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>SST</td><td>MRPC</td><td>CoLA</td><td>STS</td><td>WNLI</td><td>Avg</td></tr><tr><td colspan="9">Single-task single models on dev</td><td></td></tr><tr><td>BERTLARGE</td><td>86.6/-</td><td>92.3</td><td>91.3</td><td>70.4</td><td>93.2</td><td>88.0</td><td>60.6</td><td>90.0</td><td></td><td>=</td></tr><tr><td>XLNetLARGE</td><td>89.8/-</td><td>93.9</td><td>91.8</td><td>83.8</td><td>95.6</td><td>89.2</td><td>63.6</td><td>91.8</td><td>=</td><td>=</td></tr><tr><td>RoBERTa</td><td>90.2/90.2</td><td>94.7</td><td>92.2</td><td>86.6</td><td>96.4</td><td>90.9</td><td>68.0</td><td>92.4</td><td>91.3</td><td>1</td></tr><tr><td colspan="9">Ensembles on test (from leaderboard asof July 25,2019)</td><td></td><td></td></tr><tr><td>ALICE</td><td>88.2/87.9</td><td>95.7</td><td>90.7</td><td>83.5</td><td>95.2</td><td>92.6</td><td>68.6</td><td>91.1</td><td>80.8</td><td>86.3</td></tr><tr><td>MT-DNN</td><td>87.9/87.4</td><td>96.0</td><td>89.9</td><td>86.3</td><td>96.5</td><td>92.7</td><td>68.4</td><td>91.1</td><td>89.0</td><td>87.6</td></tr><tr><td>XLNet</td><td>90.2/89.8</td><td>98.6</td><td>90.3</td><td>86.3</td><td>96.8</td><td>93.0</td><td>67.8</td><td>91.6</td><td>90.4</td><td>88.4</td></tr><tr><td>RoBERTa</td><td>90.8/90.2</td><td>98.9</td><td>90.2</td><td>88.2</td><td>96.7</td><td>92.3</td><td>67.8</td><td>92.2</td><td>89.0</td><td>88.5</td></tr></table>
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Model</td><td>SQuAD 2.0 EM F1</td></tr><tr><td>Single models on test (as of July 25,2019)</td><td>89.1†</td></tr><tr><td>XLNetLARGE RoBERTa</td><td>86.3t 86.8</td></tr><tr><td>XLNet+ SG-Net Verifier</td><td>89.8 89.9†</td></tr><tr><td></td><td>87.0t</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 5: Results on SQuAD. $\dagger$ indicates results that depend on additional external training data. RoBERTa uses only the provided SQuAD data in both dev and test settings. $\mathbf { B E R T _ { L A R G E } }$ and XLNetLARGE results are from Devlin et al. (2019) and Yang et al. (2019), respectively.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Model</td><td>SQuAD 1.1 EM</td><td>F1</td><td>SQuAD 2.0 EM F1</td></tr><tr><td>Single models on dev, w/o data augmentation</td><td></td><td></td><td></td></tr><tr><td>BERTLARGE</td><td>84.1</td><td>90.9 79.0</td><td>81.8</td></tr><tr><td>XLNetLARGE</td><td>89.0</td><td>94.5 86.1</td><td>88.8</td></tr><tr><td>RoBERTa</td><td>88.9</td><td>94.6 86.5</td><td>89.4</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Results We present our results in Table 4. In the first setting (single-task, dev), RoBERTa achieves state-of-the-art results on all 9 of the GLUE task development sets. Crucially, RoBERTa uses the same masked language modeling pretraining objective and architecture as $\mathbf { B E R T _ { L A R G E } }$ , yet consistently outperforms both $\mathbf { B E R T _ { L A R G E } }$ and $\mathbf { X L N e t } _ { \mathrm { L A R G E } }$ . This raises questions about the relative importance of model architecture and pretraining objective, compared to more mundane details like dataset size and training time that we explore in this work. A more comprehensive comparison of the BERT and XLNet pretraining objectives is needed, but is left to future work.
|
| 136 |
+
|
| 137 |
+
In the second setting (ensembles, test), we submit RoBERTa to the GLUE leaderboard and achieve state-of-the-art results on 4 out of 9 tasks and the highest average score to date. Notably, RoBERTa does not depend on multi-task finetuning, and we expect future work may further improve these results by incorporating more sophisticated multi-task finetuning procedures.
|
| 138 |
+
|
| 139 |
+
# 5.2 SQUAD RESULTS
|
| 140 |
+
|
| 141 |
+
We adopt a much simpler approach for SQuAD compared to past work. While BERT (Devlin et al., 2019) and XLNet (Yang et al., 2019) augment their training data with additional QA datasets, we only finetune RoBERTa using the provided SQuAD training data. We also use a single learning rate for all layers, in contrast to the custom layer-wise learning rate scheduled used by Yang et al. (2019).
|
| 142 |
+
|
| 143 |
+
For SQuAD v1.1 we follow the same finetuning procedure as Devlin et al. (2019). For SQuAD v2.0, we additionally classify whether a given question is answerable; we train this classifier jointly with the span predictor by summing the classification and span loss terms.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>Accuracy</td><td>Middle</td><td>High</td></tr><tr><td>Single models on test (as of July 25, 2</td><td></td><td></td><td>2019)</td></tr><tr><td>BERTLARGE</td><td>72.0</td><td>76.6</td><td>70.1</td></tr><tr><td>XLNetLARGE</td><td>81.7</td><td>85.4</td><td>80.2</td></tr><tr><td>RoBERTa</td><td>83.2</td><td>86.5</td><td>81.3</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 6: Results on the RACE test set. $\mathbf { B E R T } _ { \mathrm { L A R G E } }$ and $\mathbf { X L N e t } _ { \mathrm { L A R G E } }$ results from Yang et al. (2019).
|
| 148 |
+
|
| 149 |
+
Results We present our results in Table 5. On the SQuAD v1.1 development set, RoBERTa matches the state-of-the-art set by XLNet. On the SQuAD v2.0 development set, RoBERTa sets a new state-of-the-art, improving over XLNet by 0.4 points (EM) and 0.6 points (F1).
|
| 150 |
+
|
| 151 |
+
We also submit RoBERTa to the public SQuAD 2.0 leaderboard. Most of the top systems build upon either BERT (Devlin et al., 2019) or XLNet (Yang et al., 2019) and therefore rely on additional external training data. Our single RoBERTa model outperforms all but one of the single model submissions, and is the top scoring system among those that do not rely on additional external data.
|
| 152 |
+
|
| 153 |
+
# 5.3 RACE RESULTS
|
| 154 |
+
|
| 155 |
+
In RACE, systems are provided with a passage of text, an associated question, and must classify which of four candidate answers is correct. We modify RoBERTa for this task by concatenating each candidate answer with the corresponding question and passage. We encode each of these four sequences and pass the resulting $I C L S J$ representations through a fully-connected layer, which is used to predict the correct answer. We truncate question-answer pairs that are longer than 128 tokens and, if needed, the passage so that the total length is at most 512 tokens.
|
| 156 |
+
|
| 157 |
+
Results are presented in Table 6. RoBERTa achieves state-of-the-art accuracy across all settings.
|
| 158 |
+
|
| 159 |
+
# 6 RELATED WORK
|
| 160 |
+
|
| 161 |
+
Pretraining methods have been designed with different training objectives, including language modeling (Dai & Le, 2015; Peters et al., 2018; Howard & Ruder, 2018), machine translation (McCann et al., 2017), and masked language modeling (Devlin et al., 2019; Lample & Conneau, 2019). Many recent papers have used a basic recipe of finetuning models for each end task (Howard & Ruder, 2018; Radford et al., 2018), and pretraining with some variant of a masked language model objective. However, newer methods have improved performance by multi-task fine tuning (Dong et al., 2019), incorporating entity embeddings (Sun et al., 2019), span prediction (Joshi et al., 2019), and multiple variants of autoregressive pretraining (Song et al., 2019; Chan et al., 2019; Yang et al., 2019). Performance is also typically improved by training bigger models on more data (Devlin et al., 2019; Baevski et al., 2019; Yang et al., 2019; Radford et al., 2019). Our goal was to replicate, simplify, and better tune the training of BERT, as a reference point for better understanding the relative performance of all of these methods.
|
| 162 |
+
|
| 163 |
+
# 7 CONCLUSION
|
| 164 |
+
|
| 165 |
+
We evaluate a number of design decisions when pretraining BERT models, demonstrating that performance can be substantially improved by training the model longer, with bigger batches over more data; removing the next sentence prediction objective; training on longer sequences; and dynamically changing the masking pattern applied to the training data. We additionally use a novel dataset, CC-NEWS, and release our models and code for pretraining and finetuning at: anonymous URL.
|
| 166 |
+
|
| 167 |
+
Our improved pretraining procedure, which we call RoBERTa, achieves state-of-the-art results on GLUE, RACE, SQuAD, SuperGLUE and XNLI. These results illustrate the importance of these previously overlooked design decisions and suggest that BERT’s pretraining objective remains competitive with recently proposed alternatives.
|
| 168 |
+
|
| 169 |
+
# REFERENCES
|
| 170 |
+
|
| 171 |
+
Eneko Agirre, Llu´ıs Marquez, and Richard Wicentowski (eds.). \` Proceedings of the Fourth International Workshop on Semantic Evaluations (SemEval-2007). 2007.
|
| 172 |
+
|
| 173 |
+
Alexei Baevski, Sergey Edunov, Yinhan Liu, Luke Zettlemoyer, and Michael Auli. Cloze-driven pretraining of self-attention networks. arXiv preprint arXiv:1903.07785, 2019.
|
| 174 |
+
|
| 175 |
+
Roy Bar Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. 2006.
|
| 176 |
+
|
| 177 |
+
Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. The fifth PASCAL recognizing textual entailment challenge. 2009.
|
| 178 |
+
|
| 179 |
+
Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Empirical Methods in Natural Language Processing (EMNLP), 2015.
|
| 180 |
+
|
| 181 |
+
William Chan, Nikita Kitaev, Kelvin Guu, Mitchell Stern, and Jakob Uszkoreit. KERMIT: Generative insertion-based modeling for sequences. arXiv preprint arXiv:1906.01604, 2019.
|
| 182 |
+
|
| 183 |
+
Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. BoolQ: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of NAACL-HLT 2019, 2019.
|
| 184 |
+
|
| 185 |
+
Alexis Conneau, Ruty Rinott, Guillaume Lample, Adina Williams, Samuel R. Bowman, Holger Schwenk, and Veselin Stoyanov. Xnli: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2018.
|
| 186 |
+
|
| 187 |
+
Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine learning challenges. evaluating predictive uncertainty, visual object classification, and recognising tectual entailment, pp. 177–190. Springer, 2006.
|
| 188 |
+
|
| 189 |
+
Andrew M Dai and Quoc V Le. Semi-supervised sequence learning. In Advances in Neural Information Processing Systems (NIPS), 2015.
|
| 190 |
+
|
| 191 |
+
Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. The CommitmentBank: Investigating projection in naturally occurring discourse. 2019. To appear in proceedings of Sinn und Bedeutung 23. Data can be found at https://github.com/mcdm/CommitmentBank/.
|
| 192 |
+
|
| 193 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In North American Association for Computational Linguistics (NAACL), 2019.
|
| 194 |
+
|
| 195 |
+
William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
|
| 196 |
+
|
| 197 |
+
Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. Unified language model pre-training for natural language understanding and generation. arXiv preprint arXiv:1905.03197, 2019.
|
| 198 |
+
|
| 199 |
+
Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, pp. 1–9. Association for Computational Linguistics, 2007.
|
| 200 |
+
|
| 201 |
+
Aaron Gokaslan and Vanya Cohen. Openwebtext corpus. http://web.archive.org/save/ http://Skylion007.github.io/OpenWebTextCorpus, 2019.
|
| 202 |
+
|
| 203 |
+
Felix Hamborg, Norman Meuschke, Corinna Breitinger, and Bela Gipp. news-please: A generic news crawler and extractor. In Proceedings of the 15th International Symposium of Information Science, 2017.
|
| 204 |
+
|
| 205 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 206 |
+
|
| 207 |
+
Matthew Honnibal and Ines Montani. spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing. To appear, 2017.
|
| 208 |
+
|
| 209 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. arXiv preprint arXiv:1801.06146, 2018.
|
| 210 |
+
|
| 211 |
+
Shankar Iyer, Nikhil Dandekar, and Kornl Csernai. First quora dataset release: Question pairs. https://data.quora.com/First-Quora-Dataset-Release-QuestionPairs, 2016.
|
| 212 |
+
|
| 213 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. SpanBERT: Improving pre-training by representing and predicting spans. arXiv preprint arXiv:1907.10529, 2019.
|
| 214 |
+
|
| 215 |
+
Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. Looking beyond the surface: A challenge set for reading comprehension over multiple sentences. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 252–262, 2018.
|
| 216 |
+
|
| 217 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 218 |
+
|
| 219 |
+
Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu, Yordan Yordanov, and Thomas Lukasiewicz. A surprisingly robust trick for winograd schema challenge. arXiv preprint arXiv:1905.06290, 2019.
|
| 220 |
+
|
| 221 |
+
Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. Race: Large-scale reading comprehension dataset from examinations. arXiv preprint arXiv:1704.04683, 2017.
|
| 222 |
+
|
| 223 |
+
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
|
| 224 |
+
|
| 225 |
+
Hector J Levesque, Ernest Davis, and Leora Morgenstern. The Winograd schema challenge. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, volume 46, pp. 47, 2011.
|
| 226 |
+
|
| 227 |
+
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Improving multi-task deep neural networks via knowledge distillation for natural language understanding. arXiv preprint arXiv:1904.09482, 2019a.
|
| 228 |
+
|
| 229 |
+
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-task deep neural networks for natural language understanding. arXiv preprint arXiv:1901.11504, 2019b.
|
| 230 |
+
|
| 231 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Bkg6RiCqY7.
|
| 232 |
+
|
| 233 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Advances in Neural Information Processing Systems (NIPS), pp. 6297–6308, 2017.
|
| 234 |
+
|
| 235 |
+
Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. Mixed precision training. In International Conference on Learning Representations, 2018.
|
| 236 |
+
|
| 237 |
+
Sebastian Nagel. Cc-news. http://web.archive.org/save/http://commoncrawl. org/2016/10/news-dataset-available, 2016.
|
| 238 |
+
|
| 239 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation (WMT), 2018.
|
| 240 |
+
|
| 241 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. FAIRSEQ: A fast, extensible toolkit for sequence modeling. In North American Association for Computational Linguistics (NAACL): System Demonstrations, 2019.
|
| 242 |
+
|
| 243 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In North American Association for Computational Linguistics (NAACL), 2018.
|
| 244 |
+
|
| 245 |
+
Jason Phang, Thibault Fvry, and Samuel R. Bowman. Sentence encoders on stilts: Supplementary training on intermediate labeled-data tasks. arXiv preprint arXiv:1811.01088, 2018.
|
| 246 |
+
|
| 247 |
+
Mohammad Taher Pilehvar and Jose Camacho-Collados. WiC: The word-in-context dataset for evaluating context-sensitive meaning representations. In Proceedings of NAACL-HLT, 2019.
|
| 248 |
+
|
| 249 |
+
Adam Poliak, Aparajita Haldar, Rachel Rudinger, J. Edward Hu, Ellie Pavlick, Aaron Steven White, and Benjamin Van Durme. Collecting diverse natural language inference problems for sentence representation evaluation. In Proceedings of EMNLP, 2018.
|
| 250 |
+
|
| 251 |
+
Alec Radford, Karthik Narasimhan, Time Salimans, and Ilya Sutskever. Improving language understanding with unsupervised learning. Technical report, OpenAI, 2018.
|
| 252 |
+
|
| 253 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical report, OpenAI, 2019.
|
| 254 |
+
|
| 255 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Empirical Methods in Natural Language Processing (EMNLP), 2016.
|
| 256 |
+
|
| 257 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. In Association for Computational Linguistics (ACL), 2018.
|
| 258 |
+
|
| 259 |
+
Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S. Gordon. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In 2011 AAAI Spring Symposium Series, 2011.
|
| 260 |
+
|
| 261 |
+
Rachel Rudinger, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. Gender bias in coreference resolution. In Proceedings of NAACL-HLT, 2018.
|
| 262 |
+
|
| 263 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Association for Computational Linguistics (ACL), pp. 1715–1725, 2016.
|
| 264 |
+
|
| 265 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Empirical Methods in Natural Language Processing (EMNLP), 2013.
|
| 266 |
+
|
| 267 |
+
Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and Tie-Yan Liu. MASS: Masked sequence to sequence pre-training for language generation. In International Conference on Machine Learning (ICML), 2019.
|
| 268 |
+
|
| 269 |
+
Yu Stephanie Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xinlun Tian, Danxiang Zhu, Hao Tian, and Hua Wu. ERNIE: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019.
|
| 270 |
+
|
| 271 |
+
Trieu H Trinh and Quoc V Le. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847, 2018.
|
| 272 |
+
|
| 273 |
+
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, 2017.
|
| 274 |
+
|
| 275 |
+
Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. SuperGLUE: A stickier benchmark for general-purpose language understanding systems. arXiv preprint 1905.00537, 2019a.
|
| 276 |
+
|
| 277 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations (ICLR), 2019b.
|
| 278 |
+
|
| 279 |
+
Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint 1805.12471, 2018.
|
| 280 |
+
|
| 281 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In North American Association for Computational Linguistics (NAACL), 2018.
|
| 282 |
+
|
| 283 |
+
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.
|
| 284 |
+
|
| 285 |
+
Yang You, Jing Li, Jonathan Hseu, Xiaodan Song, James Demmel, and Cho-Jui Hsieh. Reducing bert pre-training time from 3 days to 76 minutes. arXiv preprint arXiv:1904.00962, 2019.
|
| 286 |
+
|
| 287 |
+
Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. Defending against neural fake news. arXiv preprint arXiv:1905.12616, 2019.
|
| 288 |
+
|
| 289 |
+
Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. ReCoRD: Bridging the gap between human and machine commonsense reading comprehension. arXiv preprint 1810.12885, 2018.
|
| 290 |
+
|
| 291 |
+
Yukun Zhu, Ryan Kiros, Richard Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In arXiv preprint arXiv:1506.06724, 2015.
|
| 292 |
+
|
| 293 |
+
A STATIC VS. DYNAMIC MASKING
|
| 294 |
+
|
| 295 |
+
<table><tr><td>Masking</td><td> SQuAD 2.0</td><td>MNLI-m</td><td>SST-2</td></tr><tr><td>reference</td><td>76.3</td><td>84.3</td><td>92.8</td></tr><tr><td>Our reimplementation:</td><td></td><td></td><td></td></tr><tr><td>static</td><td>78.3</td><td>84.3</td><td>92.5</td></tr><tr><td>dynamic</td><td>78.7</td><td>84.0</td><td>92.9</td></tr></table>
|
| 296 |
+
|
| 297 |
+
Table 7: Comparison between the published $\mathbf { B E R T _ { B A S E } }$ results from Devlin et al. (2019) to our reimplementation with either static or dynamic masking. We report F1 for SQuAD and accuracy for MNLI-m and SST-2. Reported results are medians over 5 random initializations (seeds). Reference results are from Yang et al. (2019). We find that our reimplementation with static masking performs similar to the original BERT model, and dynamic masking is comparable or slightly better than static masking.
|
| 298 |
+
|
| 299 |
+
# B TASK-SPECIFIC MODIFICATIONS FOR GLUE
|
| 300 |
+
|
| 301 |
+
Two of the GLUE tasks require task-specific finetuning approaches to achieve competitive leaderboard results:
|
| 302 |
+
|
| 303 |
+
QNLI Recent submissions on the GLUE leaderboard adopt a pairwise ranking formulation for the QNLI task, in which candidate answers are mined from the training set and compared to one another, and a single (question, candidate) pair is classified as positive (Liu et al., 2019b;a; Yang et al., 2019). This formulation significantly simplifies the task, but is not directly comparable to BERT (Devlin et al., 2019). Following recent work, we adopt the ranking approach for our test submission, but for direct comparison with BERT all reported development set results are based on a pure classification approach.
|
| 304 |
+
|
| 305 |
+
WNLI We found the provided NLI-format data to be challenging to work with. Instead we use the reformatted WNLI data from SuperGLUE (Wang et al., 2019a), which indicates the span of the query pronoun and referent. We then finetune RoBERTa using a variation of the approach from Kocijan et al. (2019). In particular, for a given input sentence, we first use spaCy (Honnibal & Montani, 2017) to extract additional candidate noun phrases from the sentence, and then finetune our model so that it assigns higher scores to positive referent phrases than for any of the generated negative candidate phrases.
|
| 306 |
+
|
| 307 |
+
In contrast to Kocijan et al. (2019), who finetune BERT using a margin ranking loss between (query, candidate) pairs, we instead use a single cross entropy loss term over the log-probabilities for the query and all mined candidates. This reduces the number of hyperparameters that need to be tuned and in practice produces more stable results on the development set. Our best model achieved $9 2 . 3 \%$ development set accuracy, compared to $9 0 . 2 \%$ accuracy for the margin loss approach.
|
| 308 |
+
|
| 309 |
+
One unfortunate consequence of our overall approach is that we can only make use of the positive training examples, which excludes over half of the provided training data.10
|
| 310 |
+
|
| 311 |
+
# C FULL RESULTS ON GLUE
|
| 312 |
+
|
| 313 |
+
In Table 8 we present the full set of development set results for RoBERTa on all 9 GLUE datasets.11 We present results for a LARGE configuration with 355M parameters that follows BERTLARGE, as well as a BASE configuration with 125M parameters that follows BERTBASE.
|
| 314 |
+
|
| 315 |
+
<table><tr><td></td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>SST</td><td>MRPC</td><td>CoLA</td><td>STS</td></tr><tr><td>RoBERTaBASE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>+ all data + 500k steps</td><td>87.6</td><td>92.8</td><td>91.9</td><td>78.7</td><td>94.8</td><td>90.2</td><td>63.6</td><td>91.2</td></tr><tr><td>RoBERTaLARGE</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>with BOOKS +WIKI</td><td>89.0</td><td>93.9</td><td>91.9</td><td>84.5</td><td>95.3</td><td>90.2</td><td>66.3</td><td>91.6</td></tr><tr><td>+ additional data (83.2)</td><td>89.3</td><td>94.0</td><td>92.0</td><td>82.7</td><td>95.6</td><td>91.4</td><td>66.1</td><td>92.2</td></tr><tr><td>+ pretrain longer 300k</td><td>90.0</td><td>94.5</td><td>92.2</td><td>83.3</td><td>96.1</td><td>91.1</td><td>67.4</td><td>92.3</td></tr><tr><td>+ pretrain longer 500k</td><td>90.2</td><td>94.7</td><td>92.2</td><td>86.6</td><td>96.4</td><td>90.9</td><td>68.0</td><td>92.4</td></tr></table>
|
| 316 |
+
|
| 317 |
+
Table 8: Development set results on GLUE tasks for various configurations of RoBERTa. All results are a median over five runs.
|
| 318 |
+
|
| 319 |
+
D PRETRAINING HYPERPARAMETERS
|
| 320 |
+
Table 9: Hyperparameters for pretraining RoBERTaLARGE and RoBERTaBASE.
|
| 321 |
+
|
| 322 |
+
<table><tr><td>Hyperparam</td><td>RoBERTaLARGE</td><td>RoBERTaBASE</td></tr><tr><td>Number of Layers</td><td>24</td><td>12</td></tr><tr><td>Hidden size</td><td>1024</td><td>768</td></tr><tr><td>FFN inner hidden size</td><td>4096</td><td>3072</td></tr><tr><td>Attention heads</td><td>16</td><td>12</td></tr><tr><td>Attention head size</td><td>64</td><td>64</td></tr><tr><td>Dropout</td><td>0.1</td><td>0.1</td></tr><tr><td>Attention Dropout</td><td>0.1</td><td>0.1</td></tr><tr><td>Warmup Steps</td><td>24k</td><td>24k</td></tr><tr><td>Peak Learning Rate</td><td>4e-4</td><td>6e-4</td></tr><tr><td>Batch Size</td><td>8k</td><td>8k</td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.01</td></tr><tr><td>Max Steps</td><td>500k</td><td>500k</td></tr><tr><td>Learning Rate Decay</td><td>Linear</td><td>Linear</td></tr><tr><td>Adam ∈</td><td>1e-6</td><td>1e-6</td></tr><tr><td>Adam β1</td><td>0.9</td><td>0.9</td></tr><tr><td>Adam β2</td><td>0.98</td><td>0.98</td></tr><tr><td>Gradient Clipping</td><td>0.0</td><td>0.0</td></tr></table>
|
| 323 |
+
|
| 324 |
+
E FINETUNING HYPERPARAMETERS
|
| 325 |
+
Table 10: Hyperparameters for finetuning $\mathrm { R o B E R T a _ { L A R G E } }$ on RACE, SQuAD and GLUE. We select the best hyperparameter values based on the median of 5 random seeds for each task.
|
| 326 |
+
|
| 327 |
+
<table><tr><td>Hyperparam</td><td>RACE</td><td> SQuAD</td><td>GLUE</td><td>SuperGLUE</td></tr><tr><td>Learning Rate</td><td>1e-5</td><td>1.5e-5</td><td>{1e-5,2e-5,3e-5}</td><td>{1e-5,2e-5,3e-5}</td></tr><tr><td>Batch Size</td><td>16</td><td>48</td><td>{16,32}</td><td>32</td></tr><tr><td>Weight Decay</td><td>0.1</td><td>0.01</td><td>0.1</td><td>0.1</td></tr><tr><td>Max Epochs</td><td>4</td><td>2</td><td>10</td><td>{10,50}</td></tr><tr><td>Learning Rate Decay</td><td>Linear</td><td>Linear</td><td>Linear</td><td>Linear</td></tr><tr><td>Warmup ratio</td><td>0.06</td><td>0.06</td><td>0.06</td><td>0.10</td></tr></table>
|
| 328 |
+
|
| 329 |
+
F RESULTS ON SUPERGLUE
|
| 330 |
+
|
| 331 |
+
<table><tr><td></td><td>BoolQ</td><td>CB</td><td>COPA</td><td>MultiRC</td><td>ReCoRD</td><td>RTE</td><td>WiC</td><td>wsC</td><td>Avg</td></tr><tr><td colspan="10">Single-task single models on dev</td></tr><tr><td>BERT++</td><td>80.1</td><td>96.4/95.0</td><td>78.0</td><td>70.7/24.7</td><td>70.6/69.8</td><td>82.3</td><td>74.9</td><td>68.3</td><td>74.6</td></tr><tr><td>RoBERTa</td><td>86.9</td><td>98.2/-</td><td>94.0</td><td>85.7/-</td><td>89.5/89.0</td><td>86.6</td><td>75.6</td><td>-</td><td>-</td></tr><tr><td colspan="10">Ensembles on test (from leaderboard as of August 12,2019)</td></tr><tr><td>BERT</td><td>77.4</td><td>75.7/83.6</td><td>70.6</td><td>70.0/24.1</td><td>72.0/71.3</td><td>71.7</td><td>69.6</td><td>64.4</td><td>69.0</td></tr><tr><td>BERT++</td><td>79.0</td><td>84.8/90.4</td><td>73.8</td><td>70.0/24.1</td><td>72.0/71.3</td><td>79.0</td><td>69.6</td><td>64.4</td><td>71.5</td></tr><tr><td>Outside Best</td><td>80.4</td><td>-</td><td>84.4</td><td>70.4/24.5</td><td>74.8/73.0</td><td>82.7</td><td>-</td><td>1</td><td>1</td></tr><tr><td>RoBERTa</td><td>87.1</td><td>90.5/95.2</td><td>90.6</td><td>84.4/52.5</td><td>90.6/90.0</td><td>88.2</td><td>69.9</td><td>89.0</td><td>84.6</td></tr><tr><td>Human (est.)</td><td>89.0</td><td>95.8/98.9</td><td>100.0</td><td>81.8/51.9</td><td>91.7/91.3</td><td>93.6</td><td>80.0</td><td>100.0</td><td>89.8</td></tr></table>
|
| 332 |
+
|
| 333 |
+
Table 11: Results on SuperGLUE. All results are based on a 24-layer architecture. RoBERTa results on the development set are a median over five runs. RoBERTa results on the test set are ensembles of single-task models. Averages are obtained from the SuperGLUE leaderboard.
|
| 334 |
+
|
| 335 |
+
We also evaluate RoBERTa on the SuperGLUE benchmark (Wang et al., 2019a), which consists of 8 natural language understanding tasks.12 We largely follow the same setup for SuperGLUE as we did for GLUE, with several task-specific modifications:
|
| 336 |
+
|
| 337 |
+
• BoolQ and MultiRC: we follow the same input format as the Wang et al. (2019a) baseline.
|
| 338 |
+
• CB: we finetune starting from the MNLI model, following Phang et al. (2018).
|
| 339 |
+
• COPA: we concatenate the premise and each alternative with because and so markers for cause and effect questions, respectively. This input format more closely matches the pretraining data format and provides better results in practice.
|
| 340 |
+
• ReCoRD: during training we adopt a pairwise ranking formulation with one negative and positive entity for each (passage, query) pair. At evaluation time, we pick the entity with the highest score for each question.
|
| 341 |
+
• WiC: we input the pair of sentences as normal. We then feed the concatenation of the representations of the two marked words and the [CLS] token to the classification layer.
|
| 342 |
+
• RTE and WSC: we reused our submission to the GLUE leaderboard.
|
| 343 |
+
|
| 344 |
+
In Table 11 we present RoBERTa results on the 8 SuperGLUE datasets. RoBERTa achieves stateof-the-art results on the development and test sets for BoolQ, CB, COPA, MultiRC and ReCoRD and the highest average score to date on the SuperGLUE leaderboard.
|
| 345 |
+
|
| 346 |
+
# G RESULTS ON XNLI
|
| 347 |
+
|
| 348 |
+
<table><tr><td></td><td>en</td><td>fr</td><td>es</td><td>de</td><td>el</td><td>bg</td><td>ru</td><td>tr</td><td>ar</td><td>vi</td><td>th</td><td>zh</td><td>hi</td><td>SW</td><td>ur</td><td>△</td></tr><tr><td>Machine translation baselines (TRANSLATE-TEST)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>XLM(MLM+TLM)</td><td>85.0</td><td>79.0</td><td>79.5</td><td>78.1</td><td>77.8</td><td>77.6</td><td>75.5</td><td>73.7</td><td>73.7</td><td>70.8</td><td>70.4</td><td>73.6</td><td>69.0</td><td>64.7</td><td>65.1</td><td>74.2</td></tr><tr><td>XLM-en</td><td>88.8</td><td>81.4</td><td>82.3</td><td>80.1</td><td>80.3</td><td>80.9</td><td>76.2</td><td>76.0</td><td>75.4</td><td>72.0</td><td>71.9</td><td>75.6</td><td>70.0</td><td>65.8</td><td>65.8</td><td>76.2</td></tr><tr><td>RoBERTa</td><td>91.3</td><td>82.9</td><td>84.3</td><td>81.2</td><td>81.7</td><td>83.1</td><td>78.3</td><td>76.8</td><td>76.6</td><td>74.2</td><td>74.0</td><td>77.5</td><td>70.9</td><td>66.6</td><td>66.8</td><td>77.8</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 12: Results on XNLI (Conneau et al., 2018) for $\mathrm { R o B E R T a _ { L A R G E } }$ in the TRANSLATE-TEST setting. We report macro-averaged accuracy $( \Delta )$ using the provided English translations of the XNLI test sets. RoBERTa achieves state of the art results on all 15 languages.
|
md/train/YwpZmcAehZ/YwpZmcAehZ.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING DYNAMIC CONVOLUTION VIA MATRIX DECOMPOSITION
|
| 2 |
+
|
| 3 |
+
Yunsheng $\mathbf { L i ^ { 1 } }$ , Yinpeng Chen2, Xiyang Dai2, Mengchen Liu2, Dongdong Chen2, Ye $\mathbf { Y } \mathbf { u } ^ { 2 }$ , Lu Yuan2, Zicheng $\mathbf { L i u } ^ { 2 }$ , Mei Chen2, Nuno Vasconcelos1
|
| 4 |
+
|
| 5 |
+
1 Department of Electrical and Computer Engineering, University of California San Diego 2 Microsoft yul554@ucsd.edu, {yiche,xidai,mengcliu,dochen}@microsoft.com {Yu.Ye,luyuan,zliu,Mei.Chen}@microsoft.com, nvasconcelos@ucsd.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recent research in dynamic convolution shows substantial performance boost for efficient CNNs, due to the adaptive aggregation of $K$ static convolution kernels. It has two limitations: (a) it increases the number of convolutional weights by $K$ - times, and (b) the joint optimization of dynamic attention and static convolution kernels is challenging. In this paper, we revisit it from a new perspective of matrix decomposition and reveal the key issue is that dynamic convolution applies dynamic attention over channel groups after projecting into a higher dimensional latent space. To address this issue, we propose dynamic channel fusion to replace dynamic attention over channel groups. Dynamic channel fusion not only enables significant dimension reduction of the latent space, but also mitigates the joint optimization difficulty. As a result, our method is easier to train and requires significantly fewer parameters without sacrificing accuracy. Source code is at https://github.com/liyunsheng13/dcd.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Dynamic convolution (Yang et al., 2019; Chen et al., 2020c) has recently become popular for the implementation of light-weight networks (Howard et al., 2017; Zhang et al., 2018b). Its ability to achieve significant performance gains with negligible computational cost has motivated its adoption for multiple vision tasks (Su et al., 2020; Chen et al., 2020b; Ma et al., 2020; Tian et al., 2020). The basic idea is to aggregate multiple convolution kernels dynamically, according to an input dependent attention mechanism, into a convolution weight matrix
|
| 14 |
+
|
| 15 |
+
$$
|
| 16 |
+
{ W } ( { \pmb x } ) = \sum _ { k = 1 } ^ { K } { \pi } _ { k } ( { \pmb x } ) { W } _ { k } \quad \mathrm { s . t . } \quad 0 \leq { \pi } _ { k } ( { \pmb x } ) \leq 1 , \sum _ { k = 1 } ^ { K } { \pi } _ { k } ( { \pmb x } ) = 1 ,
|
| 17 |
+
$$
|
| 18 |
+
|
| 19 |
+
where $K$ convolution kernels $\{ W _ { k } \}$ are aggregated linearly with attention scores $\{ \pi _ { k } ( \pmb x ) \}$
|
| 20 |
+
|
| 21 |
+
Dynamic convolution has two main limitations: (a) lack of compactness, due to the use of $K$ kernels, and (b) a challenging joint optimization of attention scores $\{ \pi _ { k } ( \pmb x ) \}$ and static kernels $\{ W _ { k } \}$ . Yang et al. (2019) proposed the use of a sigmoid layer to generate attention scores $\{ \pi _ { k } ( \pmb x ) \}$ , leading to a significantly large space for the convolution kernel $W ( { \pmb x } )$ that makes the learning of attention scores $\{ \pi _ { k } ( \pmb { x } ) \}$ difficult. Chen et al. (2020c) replaced the sigmoid layer with a softmax function to compress the kernel space. However, small attention scores $\pi _ { k }$ output by the softmax make the corresponding kernels $W _ { k }$ difficult to learn, especially in early training epochs, slowing training convergence. To mitigate these limitations, these two methods require additional constraints. For instance, Chen et al. (2020c) uses a large temperature in the softmax function to encourage nearuniform attention.
|
| 22 |
+
|
| 23 |
+
In this work, we revisit the two limitations via matrix decomposition. To expose the limitations, we reformulate dynamic convolution in terms of a set of residuals, re-defining the static kernels as
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
W _ { k } = W _ { 0 } + \Delta W _ { k } , \quad k \in \{ 1 , \dots , K \}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Dynamic convolution via matrix decomposition. Left: Reformulating the vanilla dynamic convolution by matrix decomposition (see Eq. 3). It applies dynamic attention $\mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \pi \mathbf { \Pi } \mathbf { \Pi } \left( \pmb { x } \right)$ over channel groups in a high dimensional space $( S V ^ { \bar { T } } { \pmb x } ~ \in ~ \mathbb { R } ^ { \pmb { \dot { K } } \pmb { \dot { C } } } ,$ ). Right: proposed dynamic convolution decomposition, which applies dynamic channel fusion $\Phi ( { \pmb x } )$ in a low dimensional space ${ \bf \nabla } Q ^ { T } { \bf x } \in$ $\mathbb { R } ^ { L }$ , $L \ll C )$ , resulting in a more compact model.
|
| 31 |
+
|
| 32 |
+
where $\begin{array} { r } { { W _ { 0 } } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } W _ { k } } \end{array}$ is the average kernel and $\Delta W _ { k } = W _ { k } - W _ { 0 }$ a residual weight matrix. Further decomposing the latter with an SVD, $\Delta W _ { k } = U _ { k } S _ { k } V _ { k } ^ { T }$ , leads to
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\boldsymbol { W } ( \boldsymbol { x } ) = \sum _ { k = 1 } ^ { K } \pi _ { k } ( \boldsymbol { x } ) \boldsymbol { W } _ { 0 } + \sum _ { k = 1 } ^ { K } \pi _ { k } ( \boldsymbol { x } ) \boldsymbol { U } _ { k } \boldsymbol { S } _ { k } \boldsymbol { V } _ { k } ^ { T } = \boldsymbol { W } _ { 0 } + \boldsymbol { U } \boldsymbol { \Pi } ( \boldsymbol { x } ) \boldsymbol { S } \boldsymbol { V } ^ { T } ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $U = [ U _ { 1 } , \dots , U _ { K } ]$ , ${ \pmb S } = d i a g ( { \pmb S } _ { 1 } , \ldots , { \pmb S } _ { K } )$ , $V = [ V _ { 1 } , \dots , V _ { K } ]$ , and $\mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \pi \mathbf { \Pi } \mathbf { \Pi } \left( \pmb { x } \right)$ stacks attention scores diagonally as $\Pi ( { \pmb x } ) = d i a g ( \pi _ { 1 } ( { \pmb x } ) { \pmb I } , \ldots , \pi _ { K } ( { \pmb x } ) { \pmb I } )$ , where $\pmb { I }$ is an identity matrix. This decomposition, illustrated in Figure $^ { 1 , }$ shows that the dynamic behavior of $W ( { \pmb x } )$ is implemented by the dynamic residual $U \mathbf { I I } ( \mathbf { \bar { x } } ) S V ^ { T }$ , which projects the input $_ { \textbf { \em x } }$ to a higher dimensional space $\Dot { S V } ^ { T } x$ (from $C$ to $K C$ channels), applies dynamic attention $\Pi ( x )$ over channel groups, and reduces the dimension back to $C$ channels, through multiplication by $U$ . This suggests that the limitations of vanilla dynamic convolution are due to the use of attention over channel groups, which induces a high dimensional latent space, leading to small attention values that may suppress the learning of the corresponding channels.
|
| 39 |
+
|
| 40 |
+
To address this issue, we propose a dynamic convolution decomposition (DCD), that replaces dynamic attention over channel groups with dynamic channel fusion. The latter is based on a full dynamic matrix $\Phi ( { \pmb x } )$ , of which each element $\phi _ { i , j } ( \pmb { x } )$ is a function of input $_ { \textbf { \em x } }$ . As shown in Figure 1-(right), the dynamic residual is implemented as the product $P \Phi ( { \pmb x } ) Q ^ { T }$ of $\Phi ( { \pmb x } )$ and two static matrices $P , Q$ , such that $Q$ compresses the input into a low dimensional latent space, $\Phi ( { \pmb x } )$ dynamically fuses the channels in this space, and $_ { P }$ expands the number of channels to the output space. The key innovation is that dynamic channel fusion with $\Phi ( { \pmb x } )$ enables a significant dimensionality reduction of the latent space $Q ^ { T } { \pmb x } \in \mathbb { R } ^ { L }$ , $L \ll C$ ). Hence the number of parameters in $P , Q$ is significantly reduced, when compared to $U , V$ of Eq. 3, resulting in a more compact model. Dynamic channel fusion also mitigates the joint optimization challenge of vanilla dynamic convolution, as each column of $P , Q$ is associated with multiple dynamic coefficients of $\Phi ( { \pmb x } )$ . Hence, a few dynamic coefficients of small value are not sufficient to suppress the learning of static matrices $P , Q$ . Experimental results show that DCD both significantly reduces the number of parameters and achieves higher accuracy than vanilla dynamic convolution, without requiring the additional constraints of (Yang et al., 2019; Chen et al., 2020c).
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
Efficient CNNs: MobileNet (Howard et al., 2017; Sandler et al., 2018; Howard et al., 2019) decomposes $k \times k$ convolution into a depthwise and a pointwise convolution. ShuffleNet (Zhang et al., 2018b; Ma et al., 2018) uses group convolution and channel shuffle to further simplify pointwise convolution. Further improvements of these architectures have been investigated recently. EfficientNet (Tan & Le, 2019a; Tan et al., 2020) finds a proper relationship between input resolution and width/depth of the network. Tan & Le (2019b) mix up multiple kernel sizes in a single convolution. Chen et al. (2020a) trades massive multiplications for much cheaper additions. Han et al. (2020) applies a series of cheap linear transformations to generate ghost feature maps. Zhou et al. (2020) flips the structure of inverted residual blocks to alleviate information loss. Yu et al. (2019) and Cai et al. (2019) train one network that supports multiple sub-networks of different complexities.
|
| 45 |
+
|
| 46 |
+
Matrix Decomposition: Lebedev et al. (2014) and Denton et al. (2014) use Canonical Polyadic decomposition (CPD) of convolution kernels to speed up networks, while Kim et al. (2015) investigates Tucker decompositions for the same purpose. More recently, Kossaifi et al. (2020) combines tensor decompositions with MobileNet to design efficient higher-order networks for video tasks, while Phan et al. (2020) proposes a stable CPD to deal with degeneracies of tensor decompositions during network training. Unlike DCD, which decomposes a convolutional kernel dynamically by adapting the core matrix to the input, these works all rely on static decompositions.
|
| 47 |
+
|
| 48 |
+
Dynamic Neural Networks: Dynamic networks boost representation power by adapting parameters or activation functions to the input. Ha et al. (2017) uses a secondary network to generate parameters for the main network. Hu et al. (2018) reweights channels by squeezing global context. Li et al. (2019) adapts attention over kernels of different sizes. Dynamic convolution (Yang et al., 2019; Chen et al., 2020c) aggregates multiple convolution kernels based on attention. Ma et al. (2020) uses grouped fully connected layer to generate convolutional weights directly. Chen et al. (2020b) extends dynamic convolution from spatial agnostic to spatial specific. Su et al. (2020) proposes dynamic group convolution that adaptively selects input channels to form groups. Tian et al. (2020) applies dynamic convolution to instance segmentation. Chen et al. (2020d) adapts slopes and intercepts of two linear functions in ReLU (Nair & Hinton, 2010; Jarrett et al., 2009).
|
| 49 |
+
|
| 50 |
+
# 3 DYNAMIC CONVOLUTION DECOMPOSITION
|
| 51 |
+
|
| 52 |
+
In this section, we introduce the dynamic convolution decomposition proposed to address the limitations of vanilla dynamic convolution. For conciseness, we assume a kernel $W$ with the same number of input and output channels $C _ { i n } = C _ { o u t } = C \mathrm { \rangle }$ and ignore bias terms. We focus on $1 \times 1$ convolution in this section and generalize the procedure to $k \times k$ convolution in the following section.
|
| 53 |
+
|
| 54 |
+
# 3.1 REVISITING VANILLA DYNAMIC CONVOLUTION
|
| 55 |
+
|
| 56 |
+
Vanilla dynamic convolution aggregates $K$ convolution kennels $\{ W _ { k } \}$ with attention scores $\{ \pi _ { k } ( \pmb x ) \}$ (see Eq. 1). It can be reformulated as adding a dynamic residual to a static kernel, and the dynamic residual can be further decomposed by SVD (see Eq. 3), as shown in Figure 1. This has two limitations. First, the model is not compact. Essentially, $i t$ expands the number of channels by a factor of $K$ and applies dynamic attention over $K$ channel groups. The dynamic residual $U \mathbf { I I } ( \mathbf { \dot { x } } ) S V ^ { T }$ is a $C \times C$ matrix, of maximum rank $C$ , but sums $K C$ rank-1 matrices, since
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\pmb { W } ( \pmb { x } ) = \pmb { W } _ { 0 } + \pmb { U } \pmb { \Pi } ( \pmb { x } ) \pmb { S } \pmb { V } ^ { T } = \pmb { W } _ { 0 } + \sum _ { i = 1 } ^ { K C } \pi _ { \uparrow i / C | } ( \pmb { x } ) \pmb { u } _ { i } s _ { i , i } \pmb { v } _ { i } ^ { T } ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\mathbf { \Delta } \mathbf { u } _ { i }$ is the $i ^ { t h }$ column vector of matrix $U$ , ${ \mathbf { } } v _ { i }$ is the $i ^ { t h }$ column vector of matrix $V$ , $s _ { i , i }$ is the $i ^ { t h }$ diagonal entry of matrix $_ { s }$ and $\lceil \cdot \rceil$ is ceiling operator. The static basis vectors $\mathbf { \Delta } \mathbf { u } _ { i }$ and ${ \mathbf { } } v _ { i }$ are not shared across different rank-1 matrices $( \pi _ { \lceil i / C \rceil } ( \pmb { x } ) \pmb { u } _ { i } s _ { i , i } \pmb { v } _ { i } ^ { T } )$ . This results in model redundancy. Second, it is difficult to jointly optimize static matrices $U$ , $V$ and dynamic attention $\mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \mathbf { \Pi } \pi \mathbf { \Pi } \mathbf { \Pi } \left( \pmb { x } \right)$ . This is because a small attention score $\pi _ { \lceil i / C \rceil }$ may suppress the learning of corresponding columns $\mathbf { \Delta } \mathbf { u } _ { i }$ , ${ \mathbf { } } v _ { i }$ in $U$ and $V$ , especially in early training epochs (as shown in Chen et al. (2020c)).
|
| 63 |
+
|
| 64 |
+
# 3.2 DYNAMIC CHANNEL FUSION
|
| 65 |
+
|
| 66 |
+
We propose to address the limitations of the vanilla dynamic convolution with a dynamic channel fusion mechanism, implemented with a full matrix $\Phi ( { \pmb x } )$ , where each element $\phi _ { i , j } ( \pmb { x } )$ is a function of input $_ { \textbf { \em x } }$ . $\Phi ( { \pmb x } )$ is a $L \times L$ matrix, dynamically fusing channels in the latent space $\mathbb { R } ^ { L }$ . The key idea is to significantly reduce dimensionality in the latent space, $L \ll C$ , to enable a more compact model. Dynamic convolution is implemented with dynamic channel fusion using
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\pmb { W } ( \pmb { x } ) = \pmb { W } _ { 0 } + \pmb { P } \pmb { \Phi } ( \pmb { x } ) \pmb { Q } ^ { T } = \pmb { W } _ { 0 } + \sum _ { i = 1 } ^ { L } \sum _ { j = 1 } ^ { L } \pmb { p } _ { i } \phi _ { i , j } ( \pmb { x } ) \pmb { q } _ { j } ^ { T } ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $Q \in \mathbb { R } ^ { C \times L }$ compresses the input into a low dimensional space $( Q ^ { T } \pmb { x } \in \mathbb { R } ^ { L } )$ , the resulting $L$ channels are fused dynamically by $\bar { \Phi } ( { \boldsymbol { x } } ) \in \mathbb { R } ^ { L \times L }$ and expanded to the number of output channels by $\pmb { P } \in \mathbb { R } ^ { C \times L }$ . This is denoted as dynamic convolution decomposition (DCD). The dimension $L$ of the latent space is constrained by $\dot { L } ^ { 2 } < C$ . The default value of $L$ in this paper is empirically set to b Cblog √Cc c, which means dividing C by 2 repeatedly until it is less than C.
|
| 73 |
+
|
| 74 |
+
With this new design, the number of static parameters is significantly reduced (i.e. $L C$ parameters in $_ { r }$ or $\textit { \textbf { Q } } \nu . s$ . $K C ^ { 2 }$ parameters in $U$ or $V$ , $L ~ < ~ \sqrt { C } )$ , resulting in a more compact model. Mathematically, the dynamic residual $P \Phi ( { \pmb x } ) Q ^ { T }$ sums $L ^ { 2 }$ rank-1 matrices ${ \pmb p } _ { i } \phi _ { i , j } ( { \pmb x } ) { \pmb q } _ { j } ^ { T }$ , where $\mathbf { \nabla } _ { \mathbf { p } _ { i } }$ is the $i ^ { t h }$ column vector of $_ { r }$ , and $\pmb q _ { j }$ is the $j ^ { t h }$ column vector of $Q$ . The constraint $L ^ { 2 } < C$ , guarantees that this number $( L ^ { 2 } )$ is much smaller than the counterpart $( K C )$ of vanilla dynamic convolution (see Eq. 4). Nevertheless, due to the use of a full matrix, dynamic channel fusion $\Phi ( { \pmb x } )$ retains the representation power needed to achieve good classification performance.
|
| 75 |
+
|
| 76 |
+
DCD also mitigates the joint optimization difficulty. Since each column of $_ { r }$ (or $Q$ ) is associated with multiple dynamic coefficients (e.g. $\mathbf { \nabla } p _ { i }$ is related to $\phi _ { i , 1 } , \ldots , \phi _ { i , L } )$ , it is unlikely that the learning of $\pmb { p } _ { i }$ is suppressed by a few dynamic coefficients of small value.
|
| 77 |
+
|
| 78 |
+
In summary, DCD performs dynamic aggregation differently from vanilla dynamic convolution. Vanilla dynamic convolution uses a shared dynamic attention mechanism to aggregate unshared static basis vectors in a high dimensional latent space. In contrast, DCD uses an unshared dynamic channel fusion mechanism to aggregate shared static basis vectors in a low dimensional latent space.
|
| 79 |
+
|
| 80 |
+
# 3.3 MORE GENERAL FORMULATION
|
| 81 |
+
|
| 82 |
+
So far, we have focused on the dynamic residual and shown that dynamic channel fusion enables a compact implementation of dynamic convolution. We next discuss the static kernel $W _ { 0 }$ . Originally, it is multiplied by a dynamic scalar $\textstyle \sum _ { k } \pi _ { k } ( { \pmb x } )$ , which is canceled in Eq. 3 as attention scores sum to one. Relaxing the constraint $\begin{array} { r } { \sum _ { k } \pi _ { k } ( \mathbf { \bar { x } } ) = 1 } \end{array}$ results in the more general form
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\pmb { W } ( \pmb { x } ) = \pmb { \Lambda } ( \pmb { x } ) \pmb { W } _ { 0 } + \pmb { P } \pmb { \Phi } ( \pmb { x } ) \pmb { Q } ^ { T } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\pmb { \Lambda } ( \pmb { x } )$ is a $C \times C$ diagonal matrix and $\lambda _ { i , i } ( \pmb { x } )$ a function of $_ { \textbf { \em x } }$ . In this way, $\pmb { \Lambda } ( \pmb { x } )$ implements channel-wise attention after the static kernel $W _ { 0 }$ , generalizing Eq. 5 where $\pmb { \Lambda } ( \pmb { x } )$ is an identity matrix. Later, we will see that this generalization enables additional performance gains.
|
| 89 |
+
|
| 90 |
+
Relation to Squeeze-and-Excitation (SE) (Hu et al., 2018): The dynamic channel-wise attention mechanism implemented by $\pmb { \Lambda } ( \pmb { x } )$ is related to but different from SE. It is parallel to a convolution and shares the input with the convolution. It can be thought of as either a dynamic convolution kernel ${ \pmb y } = ( { \pmb \Lambda } ( { \pmb x } ) { \pmb W } _ { 0 } ) { \pmb x }$ or an input-dependent attention mechanism applied to the output feature map of the convolution ${ \pmb y } = { \pmb \Lambda } ( { \pmb x } ) ( { \pmb W } _ { 0 } { \pmb x } )$ . Thus, its computational complexity is $\operatorname* { m i n } ( \mathcal { O } ( C ^ { 2 } ) , \mathcal { O } ( H W C ) )$ , where $H$ and $W$ are height and width of the feature map.
|
| 91 |
+
|
| 92 |
+
In contrast, SE is placed after a convolution and uses the output of the convolution as input. It can only apply channel attention on the output feature map of the convolution as $y = \pmb { \Lambda } ( z ) z$ , where $z = W _ { 0 } { \pmb x }$ . Its computational complexity is $\mathcal { O } ( H W C )$ . Clearly, SE requires more computation than dynamic channel-wise attention $\pmb { \Lambda } ( \pmb { x } )$ when the resolution of the feature map $( H \times W )$ is high.
|
| 93 |
+
|
| 94 |
+
# 3.4 DYNAMIC CONVOLUTION DECOMPOSITION LAYER
|
| 95 |
+
|
| 96 |
+
Implementation: Figure 2 shows the diagram of a dynamic convolution decomposition (DCD) layer. It uses a light-weight dynamic branch to generate coefficients for both dynamic channel-wise attention $\pmb { \Lambda } ( \pmb { x } )$ and dynamic channel fusion $\Phi ( { \pmb x } )$ . Similar to Squeeze-and-Excitation (Hu et al., 2018), the dynamic branch first applies average pooling to the input $_ { \textbf { \em x } }$ . This is followed by two fully connected (FC) layers with an activation layer between them. The first FC layer reduces the number of channels by $r$ and the second expands them into $C + L ^ { 2 }$ outputs $C$ for $\pmb { \Lambda }$ and $L ^ { 2 }$ for $\Phi$ ). Eq. 6 is finally used to generate convolutional weights $W ( { \pmb x } )$ . Similarly to a static convolution, a DCD layer also includes a batch normalization and an activation (e.g. ReLU) layer.
|
| 97 |
+
|
| 98 |
+
Parameter Complexity: DCD has similar FLOPs to the vanilla dynamic convolution. Here, we focus on parameter complexity. Static convolution and vanilla dynamic convolution require $C ^ { 2 }$ and $K C ^ { 2 }$ parameters, respectively. DCD requires $C ^ { 2 }$ , $C L$ , and $C L$ parameters for static matrices $W _ { 0 }$ , $_ { P }$ and $Q$ , respectively. An additional $( 2 C + L ^ { 2 } ) \frac { C } { r }$ parameters are required by the dynamic branch to generate $\pmb { \Lambda } ( \pmb { x } )$ and $\Phi ( { \pmb x } )$ , where $r$ is the reduction rate of the first FC layer. The total complexity is $\begin{array} { r } { C ^ { 2 } + 2 C L + ( 2 C + L ^ { 2 } ) \frac { C } { r } } \end{array}$ . Since $L$ is constrained as $L ^ { 2 } < C$ , the complexity upper bound is $( 1 + \textstyle { \frac { 3 } { r } } ) C ^ { 2 } + 2 C \sqrt { C }$ . When choosing $r = 1 6$ , the complexity is about $1 \frac { 3 } { 1 6 } C ^ { 2 }$ . This is much less than what is typical for vanilla dynamic convolution ( $\mathrm { 4 } C ^ { 2 }$ in Chen et al. (2020c) and $8 C ^ { 2 }$ in Yang et al. (2019)).
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: Dynamic convolution decomposition layer. The input $_ { \textbf { \em x } }$ first goes through a dynamic branch to generate $\pmb { \Lambda } ( \pmb { x } )$ and $\Phi ( { \pmb x } )$ , and then to generate the convolution matrix $W ( { \pmb x } )$ using Eq. 6.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 3: Sparse dynamic residual, which is represented as a diagonal block matrix. Each diagonal block is decomposed separately as $\bar { P } _ { b } \Phi _ { b } Q _ { b } ^ { T }$ . Note that the static kernel $W _ { 0 }$ is still a full size matrix.
|
| 105 |
+
|
| 106 |
+
# 4 EXTENSIONS OF DYNAMIC CONVOLUTION DECOMPOSITION
|
| 107 |
+
|
| 108 |
+
In this section, we extend the dynamic decomposition of $1 \times 1$ convolution (Eq. 6) in three ways: (a) sparse dynamic residual where $P \Phi ( { \pmb x } ) Q ^ { \dagger }$ is a diagonal block matrix, (b) $k \times k$ depthwise convolution, and (c) $k \times k$ convolution. Here, $k$ refers to the kernel size.
|
| 109 |
+
|
| 110 |
+
# 4.1 DCD WITH SPARSE DYNAMIC RESIDUAL
|
| 111 |
+
|
| 112 |
+
The dynamic residual $P \Phi ( { \pmb x } ) Q ^ { T }$ can be further simplified into a block-diagonal matrix of blocks $P _ { b } \Phi _ { b } ( { \boldsymbol { x } } ) Q _ { b } ^ { T } , b \in \{ 1 , . . . , \dot { B } \}$ , leading to
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
W ( \pmb { x } ) = \Lambda ( \pmb { x } ) W _ { 0 } + \bigoplus _ { b = 1 } ^ { B } P _ { b } \Phi _ { b } ( \pmb { x } ) Q _ { b } ^ { T } ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\bigoplus _ { i = 1 } ^ { n } A _ { i } = d i a g ( A _ { 1 } , \ldots , A _ { n } )$ . This form has Eq. 6 as a special case, where $B = 1$ . Note that the static kernel $W _ { 0 }$ is still a full matrix and only the dynamic residual is sparse (see Figure 3). We will show later that keeping as few as $\frac { 1 } { 8 }$ of the entries of the dynamic residual non-zero ( $B = 8$ ) has a minimal performance degradation, still significantly outperforming a static kernel.
|
| 119 |
+
|
| 120 |
+
# 4.2 DCD OF $k \times k$ DEPTHWISE CONVOLUTION
|
| 121 |
+
|
| 122 |
+
The weights of a $k \times k$ depthwise convolution kernel form a $C \times k ^ { 2 }$ matrix. DCD can be generalized to such matrices by replacing in Eq. 6 the matrix $Q$ (which squeezes the number of channels) with a matrix $\pmb { R }$ (which squeezes the number of kernel elements)
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { r } { \pmb { W } ( \pmb { x } ) = \pmb { \Lambda } ( \pmb { x } ) \pmb { W } _ { 0 } + \pmb { P } \pmb { \Phi } ( \pmb { x } ) \pmb { R } ^ { T } , } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $W ( { \pmb x } )$ and $W _ { 0 }$ are $C \times k ^ { 2 }$ matrices, $\Lambda ( x )$ is a diagonal $C \times C$ matrix that implements channel-wise attention, $\pmb { R }$ is a $k ^ { 2 } \times L _ { k }$ matrix that reduces the number of kernel elements from $k ^ { 2 }$ to $L _ { k }$ , $\Phi ( x )$ is a $L _ { k } \times L _ { k }$ matrix that performs dynamic fusion along $L _ { k }$ latent kernel elements and $_ { r }$ is a $C \times L _ { k }$ weight matrix for depthwise convolution over $L _ { k }$ kernel elements. The default value of $L _ { k }$ is $\lfloor k ^ { 2 } / 2 \rfloor$ . Since depthwise convolution is channel separable, $\Phi ( x )$ does not fuse channels, fusing instead $L _ { k }$ latent kernel elements.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: The dynamic convolution decomposition for $k \times k$ convolution.
|
| 132 |
+
|
| 133 |
+
# 4.3 DCD OF $k \times k$ CONVOLUTION
|
| 134 |
+
|
| 135 |
+
Joint fusion of channels and kernel elements: A $k \times k$ convolution kernel forms a $C \times C \times k ^ { 2 }$ tensor. DCD can be generalized to such tensors by extending Eq. 6 into a tensor form (see Figure 4)
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
W ( { \pmb x } ) = W _ { 0 } \times _ { 2 } \Lambda ( { \pmb x } ) + \Phi ( { \pmb x } ) \times _ { 1 } { \pmb Q } \times _ { 2 } { \pmb P } \times _ { 3 } { \pmb R } ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $\times _ { n }$ refers to $n$ -mode multiplication (Lathauwer et al., 2000), $W _ { 0 }$ is a $C \times C \times k ^ { 2 }$ tensor, $\Lambda ( x )$ is a diagonal $C \times C$ matrix that implements channel-wise attention, $Q$ is a $C \times L$ matrix that reduces the number of input channels from $C$ to $L , R$ is a $k ^ { 2 } \times L _ { k }$ matrix that reduces the number of kernel elements from $k ^ { 2 }$ to $L _ { k }$ , $\Phi ( x )$ is a $L \times L \times L _ { k }$ tensor that performs joint fusion of $L$ channels over $L _ { k }$ latent kernel elements, and $_ { r }$ is a $C \times L$ matrix that expands the number of channels from $L$ to $C$ . The numbers of latent channels $L$ and latent kernel elements $L _ { k }$ are constrained by $L _ { k } < k ^ { 2 }$ and $L ^ { 2 } L _ { k } \le C$ . Their default values are set empirically to $L _ { k } = \lfloor k ^ { 2 } / 2 \rfloor$ , $\begin{array} { r } { L = \lfloor \frac { C / L _ { k } ^ { \top } } { 2 ^ { \lfloor l o g _ { 2 } \sqrt { C / L _ { k } } \rfloor } } \rfloor } \end{array}$
|
| 142 |
+
|
| 143 |
+
Channel fusion alone: We found that the fusion of channels $\Phi ( { \pmb x } ) \times _ { 1 } Q$ is more important than the fusion of kernel elements $\Phi ( { \pmb x } ) \times _ { 3 } R$ . Therefore, we reduce $L _ { k }$ to 1 and increase $L$ accordingly. $\pmb { R }$ is simplified into a one-hot vector $[ 0 , \ldots , 0 , 1 , 0 , \ldots , 0 ] ^ { T }$ , where the ‘1’ is located at the center (assuming that $k$ is an odd number). As illustrated in Figure 4-(b), the tensor of dynamic residual $\Phi ( { \pmb x } ) \times _ { 1 } { \pmb Q } \times _ { 2 } { \pmb P } \times _ { 3 } { \pmb R }$ only has one non-zero slice, which is equivalent to a $1 \times 1$ convolution. Therefore, the DCD of a $k \times k$ convolution is essentially adding a $1 \times 1$ dynamic residual to a static $k \times k$ kernel.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTS
|
| 146 |
+
|
| 147 |
+
In this section, we present the results of DCD on ImageNet classification (Deng et al., 2009). ImageNet has 1,000 classes with 1,281,167 training and 50, 000 validation images. We also report ablation studies on different components of the approach.
|
| 148 |
+
|
| 149 |
+
All experiments are based on two network architectures: ResNet (He et al., 2016) and MobileNetV2 (Sandler et al., 2018). DCD is implemented on all convolutional layers of ResNet and all $1 \times 1$ convolutional layers of MobileNetV2. The reduction ratio $r$ is set to 16 for ResNet and MobileNetV2 $\times 1 . 0$ , and to 8 for smaller models (MobileNetV2 $\times 0 . 5$ and $\times 0 . 3 5 )$ ). All models are trained by SGD with momentum 0.9. The batch size is 256 and remaining training parameters are as follows.
|
| 150 |
+
|
| 151 |
+
ResNet: The learning rate starts at 0.1 and is divided by 10 every 30 epochs. The model is trained with 100 epochs. Dropout (Srivastava et al., 2014) 0.1 is used only for ResNet-50.
|
| 152 |
+
|
| 153 |
+
MobileNetV2: The initial learning rate is 0.05 and decays to 0 in 300 epochs, according to a cosine function. Weight decay of 2e-5 and a dropout rate of 0.1 are also used. For MobileNetV2 $\times 1 . 0$ Mixup (Zhang et al., 2018a) and label smoothing are further added to avoid overfitting.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Model</td><td>Params MAdds</td><td>Top-1</td></tr><tr><td>Wo (static)</td><td>2.0M 97.0M</td><td>65.4</td></tr><tr><td>AWo</td><td>2.4M 97.4M</td><td>68.2</td></tr><tr><td>W+PΦQT</td><td>2.7M 104.4M</td><td>69.2</td></tr><tr><td>AW+PΦQT</td><td>2.9M 104.6M</td><td>69.8</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 1: Different formulations of dynamic convolution decomposition on ImageNet classification.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Model</td><td>Params</td><td>MAdds</td><td>Top-1</td></tr><tr><td>Wo (static)</td><td>11.1M</td><td>1.81G</td><td>70.4</td></tr><tr><td>AWo</td><td>11.7M</td><td>1.81G</td><td>71.5</td></tr><tr><td>Wo+PΦQT</td><td>13.6M</td><td>1.83G</td><td>72.8</td></tr><tr><td>AW+PΦQT</td><td>14.0M</td><td>1.83G</td><td>73.1</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# (a) MobileNet ${ \bf V } 2 \times 0 . 5$
|
| 162 |
+
|
| 163 |
+
# (b) ResNet-18
|
| 164 |
+
|
| 165 |
+
# 5.1 INSPECTING DIFFERENT DCD FORMULATIONS
|
| 166 |
+
|
| 167 |
+
Table 1 summarizes the influence of different components (e.g. dynamic channel fusion $\Phi ( { \pmb x } )$ , dynamic channel-wise attention $\pmb { \Lambda } ( \pmb { x } ) )$ ) of DCD on MobileNet ${ \bf V } 2 \times 0 . 5$ and ResNet-18 performance. The table shows that both dynamic components, $\pmb { \Lambda } ( \pmb { x } )$ and $\Phi ( { \pmb x } )$ of Eq. 6. enhance accuracy substantially $( + 2 . 8 \%$ and $+ 3 . 8 \%$ for MobileNetV2 $\times 0 . 5$ , $+ 1 . 1 \%$ and $+ 2 . 4 \%$ for ResNet-18), when compared to the static baseline. Using dynamic channel fusion only $( W _ { 0 } + P \Phi Q ^ { T } )$ has slightly more parameters, FLOPs, and accuracy than using dynamic channel-wise attention only $( \Lambda W _ { 0 } )$ . The combination of the two mechanisms provides additional improvement.
|
| 168 |
+
|
| 169 |
+
# 5.2 ABLATIONS
|
| 170 |
+
|
| 171 |
+
A number of ablations were performed on MobileNet ${ \bf V } 2 { \bf \Psi } \times 0 . 5$ to analyze DCD performance in terms of two questions.
|
| 172 |
+
|
| 173 |
+
1. How does the dimension $( L )$ of the latent space affect performance?
|
| 174 |
+
|
| 175 |
+
2. How do three DCD variants perform?
|
| 176 |
+
|
| 177 |
+
The default configuration is the general form of DCD (Eq. 6) with a full size dynamic residual $B = 1$ ) for all pointwise convolution layers. The default latent space dimension is $\begin{array} { r } { \dot { L } = \lfloor \frac { C } { 2 ^ { \lfloor l o g _ { 2 } \sqrt { C } \rfloor } } \rfloor } \end{array}$
|
| 178 |
+
|
| 179 |
+
Latent Space Dimension $L$ : The dynamic channel fusion matrix $\Phi ( { \pmb x } )$ has size $L \times L$ . Thus, $L$ controls both the representation and the parameter complexity of DCD. We adjust it by applying different multipliers to the default value of $L$ . Table 2 shows the results of MobileNetV2 $\times 0 . 5$ for four multiplier values ranging from $\times 1 . 0$ to $\times 0 . 2 5$ . As $L$ decreases, fewer parameters are required and the performance degrades slowly. Even with a very low dimensional latent space $( L \times 0 . 2 5 )$ , DCD still outperforms the static baseline by $3 . 3 \%$ top-1 accuracy.
|
| 180 |
+
|
| 181 |
+
Table 2: Dimension of the latent space $L$ evaluated on ImageNet classification (MobileNetV2 $\times 0 . 5$ is used).
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Model</td><td>L</td><td>Params</td><td>MAdds</td><td>Top-1</td></tr><tr><td>static</td><td>-</td><td>2.0M</td><td>97.0M</td><td>65.4</td></tr><tr><td rowspan="4">DCD</td><td>×0.25</td><td>2.4M</td><td>99.8M</td><td>68.7</td></tr><tr><td>×0.50</td><td>2.5M</td><td>101.3M</td><td>69.0</td></tr><tr><td>×0.75</td><td>2.6M</td><td>102.9M</td><td>69.6</td></tr><tr><td>×1.0</td><td>2.9M</td><td>104.6M</td><td>69.8</td></tr></table>
|
| 184 |
+
|
| 185 |
+
# Number of Diagonal Blocks $B$ in the Dynamic
|
| 186 |
+
|
| 187 |
+
Residual: Table 3-(a) shows classification results for four values of $B$ . The dynamic residual is a full matrix when $B = 1$ , while only $\frac { 1 } { 8 }$ of its entries are non-zero for $B = 8$ . Accuracy degrades slowly as the dynamic residual becomes sparser (increasing $B$ ). The largest performance drop happens when $B$ is changed from 1 to 2, as half of the weight matrix $W ( { \pmb x } )$ becomes static. However, performance is still significantly better than that of the static baseline. The fact that even the sparsest $B = 8$ outperforms the static baseline by $2 . 9 \%$ (from $6 5 . 4 \%$ to $6 8 . 3 \%$ ) demonstrates the representation power of the dynamic residual. In all cases, dynamic channel-wise attention $\pmb { \Lambda } ( \pmb { x } )$ enables additional performance gains.
|
| 188 |
+
|
| 189 |
+
DCD at Different Layers: Table 3-(b) shows the results of implementing DCD for three different types of layers (a) DW: depthwise convolution (Eq. 8), (b) PW: pointwise convolution (Eq. 6), and (c) CLS: fully connected classifier, which is a special case of pointwise convolution (the input resolution is $1 \times 1$ ). Using DCD in any type of layer improves on the performance of the static baseline $( + 2 . 9 \%$ for depthwise convolution, $+ 4 . 4 \%$ for pointwise convolution, and $+ 1 . 2 \%$ for classifier). Combining DCD for both pointwise convolution and classifier achieves the best performance
|
| 190 |
+
|
| 191 |
+
Table 3: Extensions of dynamic convolution decompostion (DCD) evaluated on ImageNet classification (MobileNetV2 $\times 0 . 5$ is used).
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Network</td><td>B</td><td>Params</td><td>MAdds</td><td>Top-1</td></tr><tr><td>Wo (static)</td><td>-</td><td>2.0M</td><td>97.0M 65.4</td><td></td></tr><tr><td rowspan="4">Wo + PΦQT</td><td>1</td><td>2.7M</td><td>104.4M</td><td>69.2</td></tr><tr><td>2</td><td>2.6M</td><td>101.0M</td><td>68.5</td></tr><tr><td>4</td><td>2.5M</td><td>99.1M</td><td>68.4</td></tr><tr><td>8</td><td>2.5M</td><td>98.5M</td><td>68.3</td></tr><tr><td rowspan="4">AWo+PΦQT</td><td>1</td><td>2.9M</td><td>104.6M</td><td>69.8</td></tr><tr><td>2</td><td>2.8M</td><td>101.3M</td><td>68.9</td></tr><tr><td>4</td><td>2.7M</td><td>99.4M</td><td>68.8</td></tr><tr><td>8</td><td>2.7M</td><td>98.8M</td><td>68.5</td></tr></table>
|
| 194 |
+
|
| 195 |
+
$\mathbf { ( b ) }$ DCD at different layers. DW, PW, and CLS indicate depthwise convolution, pointwise convolution and classifier respectively.
|
| 196 |
+
|
| 197 |
+
# (a) Number of diagonal blocks $B$ in the dynamic residual.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>DW</td><td>PW</td><td>CLS</td><td>Params MAdds</td><td>Top-1</td></tr><tr><td></td><td></td><td>2.0M</td><td>97.0M</td><td>65.4</td></tr><tr><td>√</td><td></td><td>2.4M</td><td>97.5M</td><td>68.3</td></tr><tr><td></td><td>√</td><td></td><td>2.9M 104.6M</td><td>69.8</td></tr><tr><td></td><td></td><td>√</td><td>2.2M 97.2M</td><td>66.6</td></tr><tr><td>√</td><td></td><td>√</td><td>2.6M 97.7M</td><td>69.0</td></tr><tr><td>√</td><td>√</td><td></td><td>3.3M 105.1M</td><td>69.6</td></tr><tr><td></td><td>√</td><td>√</td><td>3.1M 104.8M</td><td>70.2</td></tr><tr><td>√</td><td>√</td><td>√</td><td>3.5M 105.3M</td><td>70.0</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Table 4: Comparing DCD with the vanilla dynamic convolution CondConv (Yang et al., 2019) and DY-Conv (Chen et al., 2020c). ✶indicates the dynamic model with the fewest parameters (static model is not included). CondConv contains $K = 8$ kernels and DY-Conv contains $K = 4$ kernels.
|
| 202 |
+
|
| 203 |
+
<table><tr><td>Width</td><td>Model</td><td>Params</td><td>MAdds</td><td>Top-1</td></tr><tr><td>×1.0</td><td>static DY-Conv CondConv DCD (ours)</td><td>3.5M 300.0M 11.1M 312.9M 27.5M 329.0M *5.5M 326.0M</td><td></td><td>72.0 75.2 74.6 75.2</td></tr><tr><td>×0.5</td><td>static DY-Conv CondConv DCD (ours)</td><td>2.0M 4.0M 15.5M *3.1M</td><td>97.0M 101.4M 113.0M 104.8M</td><td>65.4 69.9 68.4 70.2</td></tr><tr><td>×0.35</td><td>static DY-Conv DCD (ours)</td><td>1.7M 2.8M *2.3M</td><td>59.2M 62.0M 63.1M</td><td>60.3 65.9 66.6</td></tr></table>
|
| 204 |
+
|
| 205 |
+
<table><tr><td>Depth</td><td>Model</td><td>Params</td><td>MAdds</td><td>Top-1</td></tr><tr><td rowspan="2">ResNet-50</td><td>static</td><td>23.5M</td><td>3.8G</td><td>76.2</td></tr><tr><td>DCD (ours)</td><td>30.7M</td><td>3.9G</td><td>77.9</td></tr><tr><td rowspan="3">ResNet-18</td><td>static</td><td>11.1M</td><td>1.81G</td><td>70.4</td></tr><tr><td>DY-Conv</td><td>42.7M</td><td>1.85G</td><td>72.7</td></tr><tr><td>DCD (ours)</td><td>*14.0M</td><td>1.83G</td><td>73.1</td></tr><tr><td rowspan="3">ResNet-10</td><td>static</td><td>5.2M</td><td>0.89G</td><td>63.5</td></tr><tr><td>DY-Conv</td><td>18.6M</td><td>0.91G</td><td>67.7</td></tr><tr><td>DCD (ours)</td><td>*6.5M</td><td>0.90G</td><td>68.8</td></tr></table>
|
| 206 |
+
|
| 207 |
+
# (a) MobileNetV2.
|
| 208 |
+
|
| 209 |
+
(b) ResNet.
|
| 210 |
+
|
| 211 |
+
$( + 4 . 8 \% )$ . We notice a performance drop (from $7 0 . 2 \%$ to $7 0 . 0 \%$ ) when using DCD in all three types of layers. We believe this is due to overfitting, as it has higher training accuracy.
|
| 212 |
+
|
| 213 |
+
Extension to $3 \times 3$ Convolution: We use ResNet-18, which stacks 16 layers of $3 \times 3$ convolution, to study the $3 \times 3$ extension of DCD (see Section 4.3). Compared to the static baseline $7 0 . 4 \%$ top-1 accuracy), DCD with joint fusion of channels and kernel elements (Eq. 9) improves top-1 accuracy $( 7 1 . 3 \% )$ by $0 . 9 \%$ . The top-1 accuracy is further improved by $1 . 8 \%$ $( 7 3 . 1 \% )$ , when using DCD with channel fusion alone, which transforms the dynamic residual as a $1 \times 1$ convolution matrix (see Figure 4-(b)). This demonstrates that dynamic fusion is more effective across channels than across kernel elements.
|
| 214 |
+
|
| 215 |
+
Summary: Based on the ablations above, DCD should be implemented with both dynamic channel fusion $\Phi$ and dynamic channel-wise attention $\pmb { \Lambda }$ , the default latent space dimension $L$ , and a full size residual $B = 1$ . DCD is recommended for pointwise convolution and classifier layers in MobileNetV2. For $3 \times 3$ convolutions in ResNet, DCD should be implemented with channel fusion alone. The model can be made more compact, for a slight performance drop, by (a) removing dynamic channel-wise attention $\pmb { \Lambda }$ , (b) reducing the latent space dimension $L$ , (c) using a sparser dynamic residual (increasing $B$ ), and (d) implementing DCD in depthwise convolution alone.
|
| 216 |
+
|
| 217 |
+
# 5.3 MAIN RESULTS
|
| 218 |
+
|
| 219 |
+
DCD was compared to the vanilla dynamic convolution (Yang et al., 2019; Chen et al., 2020c) for MobileNetV2 and ResNet, using the settings recommended above, with the results of
|
| 220 |
+
|
| 221 |
+
Table $4 ^ { 1 }$ . DCD significantly reduces the number of parameters while improving the performance of both network architectures. For MobileNetV2 $\times 1 . 0$ , DCD only requires $50 \%$ of the parameters of (Chen et al., 2020c) and $2 5 \%$ of the parameters of (Yang et al., 2019). For ResNet-18, it only requires $33 \%$ of the parameters of (Chen et al., 2020c), while achieving a $0 . 4 \%$ gain in top-1 accuracy. Although DCD requires slightly more MAdds than (Chen et al., 2020c), the increment is negligible. These results demonstate that DCD is more compact and effective.
|
| 222 |
+
|
| 223 |
+
Figure 5 compares DCD to DY-Conv (Chen et al., 2020c) in terms of training convergence. DY-Conv uses a large temperature in its softmax to alleviate the joint optimization difficulty and make training more efficient. Without any additional parameter tuning, DCD converges even faster than DY-Conv with a large temperature and achieves higher accuracy.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 5: The comparison of training and validation error between DCD and DY-Conv on MobileNetV2 $\times 0 . 5$ . $\tau$ is the temperature in softmax. Best viewed in color.
|
| 227 |
+
|
| 228 |
+
# 5.4 ANALYSIS OF DYNAMIC CHANNEL FUSION
|
| 229 |
+
|
| 230 |
+
To validate the dynamic property, $\Phi ( { \pmb x } )$ should have different values over different images. We measure this by averaging the variance of each entry $\begin{array} { r } { \sigma _ { \Phi } = \sum _ { i , j } \sigma _ { i , j } / L ^ { 2 } } \end{array}$ where $\sigma _ { i , j }$ is the variance of $\phi _ { i , j } ( \pmb { x } )$ , over all validation images. To compare $\sigma _ { \Phi }$ across layers, we normalize it by the variance of the corresponding input feature map. Figure 6 shows the normalized variance $\sigma _ { \Phi }$ across layers in MobileNetV2. Clearly, the dynamic coefficients vary more in the higher layers. We believe this is because the higher layers encode more context information, providing more clues to adapt convolution weights.
|
| 231 |
+
|
| 232 |
+
# 5.5 INFERENCE TIME
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 6: Normalized variance of dynamic coefficients $\sigma _ { \Phi }$ across layers in MobileNetV2 $\times 0 . 5$ and $\times 1 . 0$ .
|
| 236 |
+
|
| 237 |
+
We use a single-threaded core AMD EPYC CPU 7551P $( 2 . 0 \mathrm { G H z } )$ to measure running time (in milliseconds) on MobileNetV2 $\times 0 . 5$ and $\times 1 . 0$ . Running time is calculated by averaging the inference time of 5,000 images with batch size 1. Both static baseline and DCD are implemented in PyTorch. Compared with the static baseline, DCD consumes about $8 \%$ more MAdds (97.0M vs 104.8M) and $14 \%$ more running time (91ms vs $\mathrm { 1 0 4 m s ) }$ for Mobile ${ \mathrm { N e t V } } 2 \times 0 . 5$ . For MobileNetV2 $\times 1 . 0$ , DCD consumes $9 \%$ more MAdds (300.0M vs 326.0M) and $12 \%$ more running time (146ms vs $1 6 3 \mathrm { m s }$ ). The overhead is higher in running time than MAdds. We believe this is because the optimizations of global average pooling and fully connected layers are not as efficient as convolution. This small penalty in inference time is justified by the DCD gains of $4 . 8 \%$ and $3 . 2 \%$ top-1 accuracy over MobileNetV2 $\times 0 . 5$ and $\times 1 . 0$ respectively.
|
| 238 |
+
|
| 239 |
+
# 6 CONCLUSION
|
| 240 |
+
|
| 241 |
+
In this paper, we have revisited dynamic convolution via matrix decomposition and demonstrated the limitations of dynamic attention over channel groups: it multiplies the number of parameters by $K$ and increases the difficulty of joint optimization. We proposed a dynamic convolution decomposition to address these issues. This applies dynamic channel fusion to significantly reduce the dimensionality of the latent space, resulting in a more compact model that is easier to learn with often improved accuracy. We hope that our work provides a deeper understanding of the gains recently observed for dynamic convolution.
|
| 242 |
+
|
| 243 |
+
# REFERENCES
|
| 244 |
+
|
| 245 |
+
Han Cai, Chuang Gan, and Song Han. Once for all: Train one network and specialize it for efficient deployment. ArXiv, abs/1908.09791, 2019.
|
| 246 |
+
|
| 247 |
+
Hanting Chen, Yunhe Wang, Chunjing Xu, Boxin Shi, Chao Xu, Qi Tian, and Chang Xu. Addernet: Do we really need multiplications in deep learning? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020a.
|
| 248 |
+
|
| 249 |
+
Jyun-Ruei Chen, Xijun Wang, Zichao Guo, X. Zhang, and J. Sun. Dynamic region-aware convolution. ArXiv, abs/2003.12243, 2020b.
|
| 250 |
+
|
| 251 |
+
Yinpeng Chen, Xiyang Dai, Mengchen Liu, Dongdong Chen, Lu Yuan, and Zicheng Liu. Dynamic convolution: Attention over convolution kernels. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020c.
|
| 252 |
+
|
| 253 |
+
Yinpeng Chen, Xiyang Dai, Mengchen Liu, Dongdong Chen, Lu Yuan, and Zicheng Liu. Dynamic relu. arXiv preprint arXiv:2003.10027, abs/2003.10027, 2020d.
|
| 254 |
+
|
| 255 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 256 |
+
|
| 257 |
+
Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in neural information processing systems, pp. 1269–1277, 2014.
|
| 258 |
+
|
| 259 |
+
David Ha, Andrew M. Dai, and Quoc V. Le. Hypernetworks. ICLR, 2017.
|
| 260 |
+
|
| 261 |
+
Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. Ghostnet: More features from cheap operations. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, and Hartwig Adam. Searching for mobilenetv3. CoRR, abs/1905.02244, 2019. URL http://arxiv.org/abs/1905. 02244.
|
| 266 |
+
|
| 267 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 268 |
+
|
| 269 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 270 |
+
|
| 271 |
+
Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multistage architecture for object recognition? In The IEEE International Conference on Computer Vision (ICCV), 2009.
|
| 272 |
+
|
| 273 |
+
Yong-Deok Kim, Eunhyeok Park, Sungjoo Yoo, Taelim Choi, Lu Yang, and Dongjun Shin. Compression of deep convolutional neural networks for fast and low power mobile applications. arXiv preprint arXiv:1511.06530, 2015.
|
| 274 |
+
|
| 275 |
+
Jean Kossaifi, Antoine Toisoul, Adrian Bulat, Yannis Panagakis, Timothy M Hospedales, and Maja Pantic. Factorized higher-order cnns with an application to spatio-temporal emotion estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6060–6069, 2020.
|
| 276 |
+
|
| 277 |
+
L. D. Lathauwer, B. D. Moor, and J. Vandewalle. A multilinear singular value decomposition. In SIAM J. Matrix Anal. Appl, 2000.
|
| 278 |
+
|
| 279 |
+
Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan Oseledets, and Victor Lempitsky. Speeding-up convolutional neural networks using fine-tuned cp-decomposition. arXiv preprint arXiv:1412.6553, 2014.
|
| 280 |
+
|
| 281 |
+
Xiang Li, Wenhai Wang, Xiaolin Hu, and Jian Yang. Selective kernel networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 282 |
+
|
| 283 |
+
Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In The European Conference on Computer Vision (ECCV), September 2018.
|
| 284 |
+
|
| 285 |
+
Ningning Ma, X. Zhang, J. Huang, and J. Sun. Weightnet: Revisiting the design space of weight networks. volume abs/2007.11823, 2020.
|
| 286 |
+
|
| 287 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 288 |
+
|
| 289 |
+
Anh-Huy Phan, Konstantin Sobolev, Konstantin Sozykin, Dmitry Ermilov, Julia Gusak, Petr Tichavsky, Valeriy Glukhov, Ivan Oseledets, and Andrzej Cichocki. Stable low-rank tensor decomposition for compression of convolutional neural network. arXiv preprint arXiv:2008.05441, 2020.
|
| 290 |
+
|
| 291 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4510–4520, 2018.
|
| 292 |
+
|
| 293 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(56):1929–1958, 2014. URL http://jmlr.org/papers/v15/ srivastava14a.html.
|
| 294 |
+
|
| 295 |
+
Zhuo Su, Linpu Fang, Wen xiong Kang, D. Hu, M. Pietikainen, and Li Liu. Dynamic group convo- ¨ lution for accelerating convolutional neural networks. In ECCV, August 2020.
|
| 296 |
+
|
| 297 |
+
Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In ICML, pp. 6105–6114, Long Beach, California, USA, 09–15 Jun 2019a.
|
| 298 |
+
|
| 299 |
+
Mingxing Tan and Quoc V. Le. Mixconv: Mixed depthwise convolutional kernels. In 30th British Machine Vision Conference 2019, 2019b.
|
| 300 |
+
|
| 301 |
+
Mingxing Tan, Ruoming Pang, and Quoc V. Le. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 302 |
+
|
| 303 |
+
Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In ECCV, August 2020.
|
| 304 |
+
|
| 305 |
+
Brandon Yang, Gabriel Bender, Quoc V. Le, and Jiquan Ngiam. Condconv: Conditionally parameterized convolutions for efficient inference. In NeurIPS, 2019.
|
| 306 |
+
|
| 307 |
+
Jiahui Yu, Linjie Yang, Ning Xu, Jianchao Yang, and Thomas Huang. Slimmable neural networks. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ . } = { }$ H1gMCsAqY7.
|
| 308 |
+
|
| 309 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ r1Ddp1-Rb.
|
| 310 |
+
|
| 311 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018b.
|
| 312 |
+
|
| 313 |
+
Daquan Zhou, Qi-Bin Hou, Y. Chen, Jiashi Feng, and S. Yan. Rethinking bottleneck structure for efficient mobile network design. In ECCV, August 2020.
|
md/train/a2Gr9gNFD-J/a2Gr9gNFD-J.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Characterizing possible failure modes in physics-informed neural networks
|
| 2 |
+
|
| 3 |
+
Aditi S. Krishnapriyan $^ { * , 1 , 2 }$ , Amir Gholami∗,2, Shandian Zhe3, Robert M. Kirby3, Michael W. Mahoney2,4
|
| 4 |
+
1Lawrence Berkeley National Laboratory, 2University of California, Berkeley, 3University of Utah, 4International Computer Science Institute
|
| 5 |
+
{aditik1, amirgh, mahoneymw}@berkeley.edu, {zhe, kirby}@cs.utah.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Recent work in scientific machine learning has developed so-called physicsinformed neural network (PINN) models. The typical approach is to incorporate physical domain knowledge as soft constraints on an empirical loss function and use existing machine learning methodologies to train the model. We demonstrate that, while existing PINN methodologies can learn good models for relatively trivial problems, they can easily fail to learn relevant physical phenomena for even slightly more complex problems. In particular, we analyze several distinct situations of widespread physical interest, including learning differential equations with convection, reaction, and diffusion operators. We provide evidence that the soft regularization in PINNs, which involves PDE-based differential operators, can introduce a number of subtle problems, including making the problem more ill-conditioned. Importantly, we show that these possible failure modes are not due to the lack of expressivity in the NN architecture, but that the PINN’s setup makes the loss landscape very hard to optimize. We then describe two promising solutions to address these failure modes. The first approach is to use curriculum regularization, where the PINN’s loss term starts from a simple PDE regularization, and becomes progressively more complex as the NN gets trained. The second approach is to pose the problem as a sequence-to-sequence learning task, rather than learning to predict the entire space-time at once. Extensive testing shows that we can achieve up to 1-2 orders of magnitude lower error with these methods as compared to regular PINN training.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Partial differential equations (PDEs) are commonly used to describe different phenomena in science and engineering. These PDEs are often derived by starting from governing first principles (e.g., conservation of mass or energy). It is typically not possible to find analytical solutions to these PDEs for many real-world settings. Thus, many different numerical methods (e.g., the finite element method [44], pseudo-spectral methods [9], etc.) have been introduced to approximate their solutions/behavior. However, these PDEs can be quite complex for several settings (e.g., turbulence simulations), and numerical integration techniques, which typically update and improve a candidate solution iteratively until convergence, are often quite computationally expensive. Motivated by this—as well as the increasing quantities of data available in many scientific and engineering applications—there has been recent interest in developing machine learning (ML) approaches to find the solution of the underlying PDEs (and/or work in tandem with numerical solutions). As a result, the area of Scientific Machine Learning (SciML)—which aims to couple traditional scientific mechanistic modeling (typically, differential equations) with data-driven ML methodologies (most recently, neural network training)—has emerged. In this vein, there have been a number of ML approaches to incorporate scientific knowledge into such problems while keeping the automatic, data-driven estimates of the solution [2, 17, 33, 39].
|
| 14 |
+
|
| 15 |
+
A recent line of work involves Physics-Informed Neural Network (PINN) models, which aim to incorporate physical domain knowledge as soft constraints on an empirical loss function, that is then optimized using existing ML training methodologies. To some degree, PINNs are an example of “grafting together” domain-driven models and data-driven methodologies. However, there are important subtleties with this, and we identify several possible failure modes with a naive approach. We then illustrate possible directions for addressing these failure modes.
|
| 16 |
+
|
| 17 |
+
Background and problem overview. Many of the problems with a PDE constraint fit the following abstraction:
|
| 18 |
+
|
| 19 |
+
$$
|
| 20 |
+
\mathcal { F } ( u ( x , t ) ) = 0 , \qquad x \in \Omega \subset \mathbb { R } ^ { d } , \quad t \in [ 0 , T ] ,
|
| 21 |
+
$$
|
| 22 |
+
|
| 23 |
+
where $\mathcal { F }$ is a differential operator representing the PDE, $u ( x , t )$ is the state variable (i.e., parameter of interest), $x / t$ denote space/time, $T$ is the time horizon, and $\Omega$ is the spatial domain. Since $\mathcal { F }$ is a differential operator, in general one must specify appropriate boundary and/or initial conditions to ensure the existence/uniqueness of a solution to Eq. 1. In the context of PDEs, $\mathcal { F }$ can be taxonomized into a parabolic, hyperbolic, or elliptic differential operator [23]. Quintessential examples of $\mathcal { F }$ include: the convection equation (a hyperbolic PDE), where $u ( x , t )$ could model fluid movement, e.g., air or some liquid, over space and time; the diffusion equation (a parabolic PDE), where $u ( x , t )$ could model the temperature distribution over space and time; and the Laplace equation (an elliptic PDE), where $u ( x )$ could model a steady-state diffusion equation, in the limit as $t \to \infty$ .
|
| 24 |
+
|
| 25 |
+
One possible data-driven approach is to incorporate domain information by applying Eq. 1 as a “hard constraint” when training a NN on the data. This can be formulated as the following constrained optimization problem,
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\operatorname* { m i n } _ { \theta } \mathcal { L } ( u ) \quad \mathrm { s . t . } \quad \mathcal { F } ( u ) = 0 ,
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where $\mathcal { L } ( u )$ is the data-fit term (including initial/boundary conditions), and where $\mathcal { F }$ is a constraint on the residual of the PDE system under consideration (i.e., the “physics” knowledge in the equation itself). As mentioned before, for many practical use cases, it is not possible to derive closed form solutions for these problems, and it is often quite difficult to solve problems of the form of Eq. 2, with $\mathcal { F } ( u )$ as a hard constraint.
|
| 32 |
+
|
| 33 |
+
Another (related but different) data-driven approach is to impose the constraint as a “soft constraint” on the outputs of the NN model,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r } { \operatorname* { m i n } _ { \theta } \mathcal { L } ( u ) + \lambda _ { \mathcal { F } } \mathcal { F } ( u ) , } \\ { \mathcal { L } ( u ) = \mathcal { L } _ { u _ { 0 } } + \mathcal { L } _ { u _ { b } } . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Here, $\mathcal { L } _ { u _ { 0 } }$ and $\mathcal { L } _ { u _ { b } }$ measure the misfit of the NN prediction and the initial/boundary conditions (which are pre-specified/given as input to the problem), and $\theta$ denotes the NN parameters (which takes $( x , t )$ , and possibly other quantities, as inputs and then outputs $u ( x , t ) )$ . Furthermore, $\lambda _ { \mathcal { F } }$ is a regularization parameter that controls the emphasis on the PDE based residual (which we ideally want to be zero). The goal is then to use ML methodologies (stochastic optimization, etc.) to train this NN model to minimize the loss in Eq. 3. In particular, the NN is trained to minimize this modified loss function, where the modification is to penalize the violations of $\mathcal { F } ( u )$ for some $\lambda _ { \mathcal { F } } \geq 0$ However, even with a large training dataset, this approach does not guarantee that the NN will obey the conservation/governing equations in the constraint Eq. 1. In many SciML problems, these sorts of constraints on the system matter, as they correspond to physical mechanisms of the system. For example, if the conservation of energy equation is only approximately satisfied, then the system being simulated may behave qualitatively differently or even result in unrealistic solutions.
|
| 40 |
+
|
| 41 |
+
We should also note that this approach of incorporating physics-based regularization, where the regularization constraint, $\mathcal { L } _ { \mathcal { F } }$ , corresponds to a differential operator, is very different than incorporating much simpler norm-based regularization (such as $L _ { 1 }$ or $L _ { 2 }$ regularization), as is common in ML more generally. Here, the regularization operator, $\mathcal { L } _ { \mathcal { F } }$ is non-trivially structured—it involves a differential operator that could actually be ill-conditioned, and it does not correspond to a nice convex set (as does a norm ball). Moreover, $\mathcal { L } _ { \mathcal { F } }$ corresponds to actual physical quantities, and there is often an important distinction between satisfying the constraint exactly versus satisfying the constraint approximately (the soft constraint approach doing only the latter).
|
| 42 |
+
|
| 43 |
+
Main contributions. The contributions of this paper are as follows:
|
| 44 |
+
|
| 45 |
+
• We analyze PINN models on simple, yet physically relevant, problems of convection, reaction, and reaction-diffusion. We find that the vanilla/regular PINN approach only works for very easy parameter regimes (i.e., small PDE coefficients), but that it fails to learn relevant physics in even moderately more challenging physical regimes, even for problems that have simple closed-form analytical solutions. For many cases, the vanilla PINN approach achieves almost $100 \%$ error, as compared to the ground truth solution, even after extensive hyperparameter tuning. (See $\ S 3$ for details.) We analyze the loss landscape of trained PINN models and find that adding/increasing the PDE-based soft constraint regularization ( $\mathcal { L } _ { \mathcal { F } }$ in Eq. 3) makes it more complex and harder to optimize, especially for cases with non-trivial coefficients. We also study how the loss landscape changes as the regularization parameter $( \lambda _ { \mathcal { F } } )$ is changed. We find that reducing the regularization parameter can help alleviate the complexity of the loss landscape, but this in turn leads to poor solutions with high errors that do not satisfy the PDE/constraint. (See $\ S 4$ for details.)
|
| 46 |
+
We demonstrate that the NN architecture has the capacity/expressivity to find a good solution, thereby showing that these problems are not due to the limited capacity of the NN architecture. Instead, we argue that the failure is due to optimization difficulties associated with the PINN’s soft PDE constraint. (See $\ S 5$ for details.)
|
| 47 |
+
• We propose two paths forward to address these failure modes through (i) curriculum regularization and (ii) posing the learning problem as a sequence-to-sequence learning task. First, in curriculum regularization, we start by imposing the PDE constraint $( \mathcal { L } _ { \mathcal { F } } )$ with small coefficients, which are progressively increased to the target problem’s settings as the model gets trained. This gives the NN an opportunity to first train with easier constraints, before it is exposed to the target constraint which could be hard to optimize from the beginning. Second, we show that changing the learning problem to a sequence-to-sequence learning problem can reduce the PINN error, again without any change to the NN architecture. In this setup, the NN is trained on a time segment, instead of the full space-time, which could be more difficult to learn. The task is then to predict the solution and reduce the loss only over smaller time segments. We extensively test both approaches and show that they can reduce the error by up to 1-2 orders of magnitude as compared to regular PINN training, and in many cases can better capture “sharp” features in the solution. (See $\ S 5$ for details.)
|
| 48 |
+
• We have open sourced our framework [26] which is built on top of PyTorch both to help
|
| 49 |
+
|
| 50 |
+
with reproducibility and also to enable other researchers to extend the results.
|
| 51 |
+
|
| 52 |
+
# 2 Related work
|
| 53 |
+
|
| 54 |
+
There is a large body of related work, and here we briefly discuss the most related lines of work.
|
| 55 |
+
|
| 56 |
+
Machine learning and PDEs. ML approaches for PDE problems have been increasing rapidly in recent years [13, 19]. A number of tools and methodologies now exist to solve scientific problems by combining ML and domain insights [14, 20, 27, 28, 38]. As mentioned earlier, a popular approach to combine ML and physical knowledge is to include aspects of the PDE term as part of the optimization process via regularization. A notable aspect of such an approach is that the NN can be trained only on data that comes from the governing equation(s) itself (though additional data can be included as well, if available), i.e., with a relatively small amount of data. This has garnered interest and shown successful results in a wide variety of science and engineering problems and applications [3, 11, 16, 29–31, 43].
|
| 57 |
+
|
| 58 |
+
However, there have also been issues observed with this formulation. For example, it did not work well for stiff ordinary differential equations (ODEs) describing chemical kinetics [15], for certain heterogeneous media problems [7], or for certain fluid flow problems [10]. Furthermore, PINN models have been analyzed in the context of neural tangent kernels (i.e., towards the infinite width limit) to study their convergence [36, 37]. This work found some cases where the model failed (such as when the target function exhibits “high frequency features”) and showed some preliminary solutions via the lens of the neural tangent kernel. It has been argued that some of these problems may be due an imbalance in back-propagated gradients in the loss function during training, and a learning-rate annealing scheme has been proposed to mitigate this [35].
|
| 59 |
+
|
| 60 |
+
Physical priors and constraints in NNs. Imposing physical priors and constraints on NN systems is common in SciML problems, as a way to try to enforce a property of interest. This idea has been introduced in different forms in the past (for instance [5, 18, 25, 28, 32]). Some approaches have focused on embedding specialized physical constraints into NNs, such as conservation of energy or momentum [4, 12] or multiscale features [34]. While methods focusing on constraining the output of the NN are more common, it is difficult to enforce such constraints exactly in ML settings. Previous work has tried to impose hard constraints in ML (both within the context of SciML and otherwise) [6, 21, 22, 24, 40], although this can be computationally expensive, and does not guarantee better results or convergence.
|
| 61 |
+
|
| 62 |
+
# 3 Possible failure modes for physics-informed neural networks
|
| 63 |
+
|
| 64 |
+
In this section, we highlight several examples where the PINN formulation defined in Eq. 3 does not predict the solution well. We first demonstrate this with two different types of simple, canonical PDE/ODE systems which have simple analytical solutions: convection ( §3.1), and reaction ( §A). We then also include a diffusion component by looking at the reaction-diffusion problem ( $\ S 3 . 2 )$ . Note that the convection problem has a linear PDE constraint, and reaction/reaction-diffusion problems both have non-linear PDE terms.2 We show that PINNs can only learn simple problems with very small parameter values (e.g., small convection or reaction coefficients). We demonstrate that these models fail to learn the relevant physical phenomena for non-trivial cases (e.g., relatively larger coefficients). As we will see, while adding the physical constraint as a soft regularization may be easier to deploy and optimize with existing unconstrained optimization methods, this approach does come with trade-offs, including that in many cases the optimization problem becomes much more difficult to solve.
|
| 65 |
+
|
| 66 |
+
Experiment setup. We study both linear and non-linear PDEs/ODEs, and we vary the convection, reaction, and diffusion coefficients for each problem (hereafter, we refer to these as PDE coefficients). For each problem, we aim to minimize the loss function in Eq. 3. We use a 4-layer fully-connected NN with 50 neurons per layer, a hyperbolic tangent activation function, and randomly sample collocation points $( x , t )$ on the domain. Furthermore, all the systems that we consider have periodic boundary conditions. We enforce this through an extra term in the loss function that takes the difference between the predicted NN solution at each boundary. We train this network using the L-BFGS optimizer and sweep over learning rates from $1 \mathrm { e } { - 4 }$ to 2.0.3 After training the PINN, we measure the $L _ { 2 }$ relative and absolute errors between the PINN’s predicted solution and the analytical solution. The $L _ { 2 }$ relative error is $\frac { 1 } { N } \sum _ { i = 0 } ^ { N } \frac { | | \hat { u } - u | | _ { 2 } } { | | u | | _ { 2 } }$ and the absolute error is $\frac { 1 } { N } \sum _ { i = 0 } ^ { N } \left| \right| \hat { u } - u \left| \right| _ { 2 }$ $N$ is the number of evaluation grid points, $\hat { u }$ is the predicted solution by the PINN, and $u$ is the true solution. For all cases, we run models at least ten times with different preset random seeds, and we average the relative and absolute errors in $u ( x , t )$ . For each loss function, $\hat { u }$ is the output of the NN and shorthand for $\hat { u } = N N ( \theta , x , t )$ .
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 1: Prediction error for 1D convection ( §3.1) problem, when $\beta$ is changed. The PINN has difficulty predicting the solution past a certain timestep, but is able to fit the boundary conditions. Additional figures for different $\beta$ values can be seen in Fig. C.1.
|
| 70 |
+
|
| 71 |
+
# 3.1 Learning convection
|
| 72 |
+
|
| 73 |
+
Problem formulation. We first consider a one-dimensional convection problem, a hyperbolic PDE which is commonly used to model transport phenomena:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { c } { \displaystyle { \frac { \partial u } { \partial t } + \beta \frac { \partial u } { \partial x } = 0 , \quad x \in \Omega , t \in [ 0 , T ] , } } \\ { \displaystyle { u ( x , 0 ) = h ( x ) , \quad x \in \Omega . } } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Here, $\beta$ is the convection coefficient and $h ( x )$ is the initial condition. For constant $\beta$ and periodic boundary conditions, this problem has a simple analytical solution:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
u _ { \mathrm { { a n a l y t i c a l } } } ( x , t ) = F ^ { - 1 } \big ( F ( h ( x ) ) e ^ { - i \beta k t } \big ) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $F$ is the Fourier transform, $i = \sqrt { - 1 }$ , and $k$ denotes frequency in the Fourier domain. The general loss function for this problem (corresponding to Eq. 3) is
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } ( \theta ) = \frac { 1 } { { { N _ { u } } } } \sum _ { i = 1 } ^ { { N _ { u } } } { \left( { { \hat { u } } - u _ { 0 } ^ { i } } \right) ^ { 2 } } + \frac { 1 } { { { N _ { f } } } } \sum _ { i = 1 } ^ { { N _ { f } } } { \lambda _ { i } \Big ( \frac { { \partial \hat { u } } } { { \partial t } } + \beta \frac { { \partial \hat { u } } } { { \partial x } } \Big ) ^ { 2 } } + \mathcal { L } _ { B } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\hat { u } = N N ( \theta , x , t )$ is the output of the NN, and $\mathcal { L } _ { B }$ is the boundary loss. For periodic boundary conditions with $\Omega = [ 0 , 2 \pi )$ , this loss is:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathcal { L } _ { B } = \frac { 1 } { N _ { b } } \sum _ { i = 1 } ^ { N _ { b } } \Big ( \hat { u } ( \theta , 0 , t ) - \hat { u } ( \theta , 2 \pi , t ) \Big ) ^ { 2 } .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
We use the following simple initial and periodic boundary conditions:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { c } { { u ( x , 0 ) = s i n ( x ) , } } \\ { { u ( 0 , t ) = u ( 2 \pi , t ) . } } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Observations. We apply the PINN’s soft regularization to this problem, and we optimize the loss function in Eq. 7. After training, we measure the relative and absolute errors between the PINN’s predicted solution and the analytical solution, as reported in Fig. 1(a). As one can see, the PINN is only able to achieve good solutions for small values of convection coefficient, and it fails when $\beta$ becomes larger, reaching a relative error of almost $100 \%$ for $\beta > 1 0$ . We also provide visualization of the exact and PINN solution in Fig. 1(b-c). One can clearly see that the PINN is unable to learn the solution. As we will later show, the NN architecture does have enough capacity to find the solution, but the training/optimization problem is very difficult to solve with PINNs (and importantly, it may require extensive hyperparameter tuning which is often not feasible in practice).
|
| 104 |
+
|
| 105 |
+
# 3.2 Learning reaction-diffusion
|
| 106 |
+
|
| 107 |
+
Problem formulation. We next look at a reaction-diffusion system, where we add a diffusion operator to the reaction equation discussed above. Note that for pure diffusion, the solution dissipates
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 2: Prediction error for $\mathbfcal { m }$ reaction-diffusion $( \ \ S 3 . 2 )$ problem. We can clearly see that the PINN has difficulty predicting the solution (especially the “sharpness” of the solution) and is unable to capture the correct behavior. Additional figures for different $\nu$ values can be seen in Fig. D.1.
|
| 111 |
+
|
| 112 |
+
to a steady-state of uniform/constant distribution, which may be trivial to learn. Therefore, we consider studying the reaction-diffusion system:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { c } { \displaystyle { \frac { \partial u } { \partial t } - \nu \frac { \partial ^ { 2 } u } { \partial x ^ { 2 } } - \rho u ( 1 - u ) = 0 , \quad x \in \Omega , t \in ( 0 , T ] , } } \\ { \displaystyle { u ( x , 0 ) = h ( x ) , \quad x \in \Omega . } } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
Here, $\nu$ $( \nu > 0 )$ ) is the diffusion coefficient. The solution of such a system can be solved for via Strang splitting, i.e., splitting the equation into two separate models (a reaction component and a diffusion component):
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { \frac { d u } { d t } = \rho u ( 1 - u ) } \\ { \frac { d u } { d t } = \nu \frac { \partial ^ { 2 } u } { \partial x ^ { 2 } } . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
For each timestep, we can solve the reaction equation through Eq. 15 (in $\ S \mathrm { A }$ ). The diffusion equation has the following analytical solution:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
u _ { \mathrm { a n a l y t i c a l } } ( x , t ) = F ^ { - 1 } \big ( F ( u ( x , t = t ^ { n } ) ) e ^ { - \nu k ^ { 2 } t } \big ) ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $u ( x , t = t ^ { n } )$ is the solution at the $n ^ { t h }$ time step. We solve the reaction equation for each timestep, and then use the reaction solution as the initial condition to solve the diffusion component and get the final solution.
|
| 131 |
+
|
| 132 |
+
The general loss function for this problem is,
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r } { \mathcal { L } ( \boldsymbol { \theta } ) = \displaystyle \frac { 1 } { N _ { u } } \sum _ { i = 1 } ^ { N _ { u } } \Big ( \hat { u } - u _ { 0 } ^ { i } \Big ) ^ { 2 } + } \\ { \displaystyle \frac { 1 } { N _ { f } } \sum _ { i = 1 } ^ { N _ { f } } \lambda _ { i } \Big ( \frac { \partial \hat { u } } { \partial t } - \nu \frac { \partial ^ { 2 } \hat { u } } { \partial x ^ { 2 } } - \rho \hat { u } ( 1 - \hat { u } ) \Big ) ^ { 2 } + \mathcal { L } _ { B } , } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\mathcal { L } _ { B }$ is the boundary loss. Similar to the previous example, periodic boundary conditions can be enforced by including $\mathcal { L } _ { B }$ from Eq. 8 as an extra term in the loss.
|
| 139 |
+
|
| 140 |
+
Observations. Similar to the previous case, we can see that the PINN also fails to learn reactiondiffusion. We illustrate a case in Fig. 2 with $\rho = 5$ , when $\nu = 5$ . The PINN achieves a high relative error of $93 \%$ . Here, we can clearly see that the PINN is unable to capture either the reaction or diffusion component. Additional figures for different $\nu$ values can be seen in Fig. D.1. In particular, for $\nu = 2$ the PINN achieves a relative error of $50 \%$ . Here, we see that it is unable to capture the “sharper” transitions, though it can predict the center of the solution a little better.
|
| 141 |
+
|
| 142 |
+
# 4 Diagnosing possible failure modes for physics-informed NNs
|
| 143 |
+
|
| 144 |
+
Thus far, we have shown that PINNs can result in high errors even for simple physical regimes, in particular for PDEs/ODEs with non-trivial convection/reaction/diffusion coefficients. Here, we demonstrate that one of the underlying reasons for this arises due to the PDE-based soft constraint of $\mathcal { L } _ { \mathcal { F } }$ , which makes the loss landscape difficult to optimize. We first (in $\ S 4 . 1$ ) analyze the loss landscape to illustrate how increasing this soft regularization can lead to more complex loss landscapes, thus leading to optimization difficulties. We then (in $\ S _ { \mathbf { B } }$ ) demonstrate how this is related to regularizing with differential operators, which can result in ill-conditioning.
|
| 145 |
+
|
| 146 |
+
Figure 3: Loss landscapes for varying values of $\beta _ { z }$ , for the $\mathbfcal { m }$ convection example in $\ S 3 . I$ . The loss landscape is more smooth at low $\beta$ , and it becomes increasingly more complex as $\beta$ increases, which can make the optimization problem more difficult. In particular, at higher $\beta$ , the optimizer gets stuck in a certain regime. These results support that adding the PDE soft regularization term results in a more complex optimization loss landscape.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>200 150 100 50 1.0 0.5 0.5 1.0-1.0 (a) β = 1.0 β</td><td>(b) β = 10.0</td><td colspan="3">(c) β = 20.0</td><td>(e) β = 40.0</td></tr><tr><td>Relative error</td><td></td><td>10 1.08× 10-2</td><td>20</td><td>30</td><td>40</td></tr><tr><td></td><td>7.84 × 10-3 3.17× 10-3</td><td>6.03×10-3</td><td>7.50× 10-1 4.32×10-1</td><td>8.97×10-1 5.42×10-1</td><td>9.61 ×10-1</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 4.1 Soft PDE regularization and optimization difficulties
|
| 151 |
+
|
| 152 |
+
Here, we analyze how the loss landscape changes for different regimes for the convection problem in $\ S 3 . 1$ with/without the soft regularization in PINNs. We show that adding the soft regularization can actually make the problem harder to optimize, i.e., the regularization leads to less smooth loss landscapes. For all the experiments, we plot the loss landscape by perturbing the (trained) model across the first two dominant Hessian eigenvectors and computing the corresponding loss values. This tends to be more informative than perturbing the model parameters in random directions [41, 42].
|
| 153 |
+
|
| 154 |
+
Figure 3 shows the loss landscape for the convection problem (discussed in $\ S 3 . 1$ ), for different $\beta$ values. Interestingly, the loss landscape at a relatively low $\beta = 1$ is rather smooth, but increasing $\beta$ further results in a complex and non-symmetric loss landscape. It is also evident that the optimizer has gotten stuck in a local minima with a very high loss function for large $\beta$ values.
|
| 155 |
+
|
| 156 |
+
Finally, we study the impact of changing the weight/multiplier for the soft regularization term (i.e., the $\lambda$ parameter in Eq. 3), which can be relevant in improving PINN performance [35]. While we find that tuning $\lambda$ can help change the error, it cannot resolve the problem, as shown in Fig. E.1. Note that as the regularization parameter is increased, the loss landscape becomes increasingly more complex and harder to optimize (additionally, see the $\mathbf { Z }$ -axis scale).
|
| 157 |
+
|
| 158 |
+
# 5 Expressivity versus optimization difficulty
|
| 159 |
+
|
| 160 |
+
In this section, we first show that the failure modes we observed are not necessarily due to the specific NN architecture that we used in our experiments. In particular, we show that the NN model does have the expressivity/capacity to learn the convection/reaction/diffusion coefficient cases where the vanilla PINN method fails. Additionally, in the process of demonstrating this, we also describe two methods that lead to significantly lower error rates. In particular, we show that changing the learning paradigm to curriculum regularization can make the optimization problem easier to solve (as discussed in $\ S 5 . 1$ ). Second, we show that posing the problem as sequence-to-sequence learning may lead to better results than learning the entire state-space at once (as discussed in $\ S 5 . 2 )$ .
|
| 161 |
+
|
| 162 |
+
# 5.1 Curriculum PINN Regularization
|
| 163 |
+
|
| 164 |
+
One may contend that the failure modes shown in $\ S 3$ may be because the NN does not have enough capacity. Here, we show that this is not the underlying reason. To do so, we devise a “curriculum regularization” method to warm start the NN training by finding a good initialization for the weights. Instead of training the PINN to learn the solution right away for cases with higher $\beta / \rho$ , we start by training the PINN on lower $\beta / \rho$ (easier for the PINN to learn) and then gradually move to training the PINN on higher $\beta / \rho$ , respectively. We test these results for the examples in $\ S 3 . 1$ and $\ S \mathrm { A }$ . This is somewhat analogous to curriculum learning in ML [1], but applied by progressively making the PDE/ODE harder to solve.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Schematic outlining curriculum regularization and example result for 1D convection from $\ S 3 . I$ The training procedure for regular PINNs training versus curriculum PINN training for the convection example in $\ S 3 . I$ . The regular PINN training only involves training at $\beta = 3 0$ , while curriculum regularization starts at a lower $\beta$ , trains a model, and then uses the weights of this model to reinitialize the NN for training the next $\beta$ . The curriculum training approach is able to do significantly better (by almost two orders of magnitude).
|
| 168 |
+
|
| 169 |
+
Table 1: Training the PINN gradually on more difficult problems improves performance. 1D convection example in $\ \ S 3 . 1 .$ . The curriculum training approach achieves significantly better errors.
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan=1 colspan=3>Regular PINN(</td><td rowspan=1 colspan=1> Curriculum training</td></tr><tr><td rowspan=2 colspan=1>1D convection: β = 20</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>7.50 × 10-1</td><td rowspan=1 colspan=1>9.84 × 10-3</td></tr><tr><td rowspan=1 colspan=1>Absolute error</td><td rowspan=1 colspan=1>4.32×10-1</td><td rowspan=1 colspan=1>5.42 ×10-3</td></tr><tr><td rowspan=2 colspan=1>1D convection: β = 30</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>8.97×10-1</td><td rowspan=1 colspan=1>2.02 × 10-2</td></tr><tr><td rowspan=1 colspan=1>Absolute error</td><td rowspan=1 colspan=1>5.42×10-1</td><td rowspan=1 colspan=1>1.10 ×10-2</td></tr><tr><td rowspan=2 colspan=1>1D convection: β = 40</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>9.61 × 10-1</td><td rowspan=1 colspan=1>5.33 × 10-2</td></tr><tr><td rowspan=1 colspan=1>Absolute error</td><td rowspan=1 colspan=1>5.82 ×10-1</td><td rowspan=1 colspan=1>2.69 ×10-2</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Figure 4 shows the training procedure for an example convection case $( \ S 3 . 1 )$ with $\beta = 3 0$ . As Fig. 4(c) shows, the curriculum regularization approach results in a much more accurate solution than regular PINN training. With curriculum regularization, the relative error is almost two orders of magnitude lower. Additionally, this is true across all the other regimes that we found regular PINNs to fail, as shown in Tab. 1. In Fig. E.2, we also show that curriculum regularization not only decreases error significantly, but also decreases the variance of the error. In Fig. E.3, we see that curriculum regularization results in a much smoother loss landscape as compared to regular PINN training.
|
| 174 |
+
|
| 175 |
+
Curriculum regularization also works well for the reaction example in $\ S \mathbf { A }$ . In this case, we start by training with a low $\rho$ value (reaction coefficient), and then increase gradually to higher $\rho$ values. The results can be seen in Fig. E.4. We can see that the error is $0 . 1 \textrm { - } 0 . 6 $ orders of magnitude lower for $\rho = 2 - 4$ (when the regular PINN error is not as high), and then greatly decreases error by 1-2 orders of magnitude for $\rho = 5 - 1 0$ . As we discussed before, PINN has difficulty in learning sharp features for high values of $\rho$ . However, the curriculum regularization overcomes this, even for $\rho = 1 0$ , as seen in Fig. E.4(c).
|
| 176 |
+
|
| 177 |
+
# 5.2 Sequence-to-sequence learning vs learning the entire space-time solution
|
| 178 |
+
|
| 179 |
+
The original PINN approach of [28] trains the NN model to predict the entire space-time at once (i.e., predict $u$ for all locations and time points). In certain cases, this can be more difficult to learn. Here, we demonstrate that it may be better to pose the problem as a sequence-to-sequence (seq2seq) learning task, where the NN learns to predict the solution at the next time step, instead of all times.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
6 Figure 5: Schematic outlining seq2seq learning. In contrast to regular PINN training, the solution in seq2seq learning is predicted for only one $\Delta t$ step at a time. Then, the predicted solution at $t = \Delta t$ is used as the initial condition for the next segment. To allow fair comparison, we keep the total number of 5 collocation points to be exactly the same in either approach. That is, we do not increase the number of collocation points for seq2seq learning in the right, and keep it to be the same as in the corresponding segment in the left figure.
|
| 183 |
+
|
| 184 |
+
Table 2: Predicting the entire state space versus discretizing the state space (i.e., seq2seq learning) for $\mathbfcal { m }$ reaction-diffusion ( $\ S 3 . 2 )$ . The seq2seq learning achieves lower error for both $\Delta t = 0 . 0 5$ and $\Delta t = 0 . 1$ , in comparison to the PINN’s approach of predicting the entire state space at once.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1> Entire state space</td><td rowspan=1 colspan=1>△t = 0.05</td><td rowspan=1 colspan=1>△t = 0.1</td></tr><tr><td rowspan=2 colspan=1>v=2,p=5</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>5.07× 10-1</td><td rowspan=1 colspan=1>2.04 × 10-2</td><td rowspan=1 colspan=1>1.18 × 10-2</td></tr><tr><td rowspan=1 colspan=1>Absolute error</td><td rowspan=1 colspan=1>2.70 ×10-1</td><td rowspan=1 colspan=1>1.06 × 10-2</td><td rowspan=1 colspan=1>6.41 × 10-3</td></tr><tr><td rowspan=1 colspan=1>v=3,p=5</td><td rowspan=1 colspan=1> Relative error Absolute error</td><td rowspan=1 colspan=1>7.98 × 10-14.79 × 10-1</td><td rowspan=1 colspan=1>1.92 × 10-21.01 × 10-2</td><td rowspan=1 colspan=1>1.56 × 10-28.17 × 10-3</td></tr><tr><td rowspan=2 colspan=1>v=4,p=5</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>8.84×10-1</td><td rowspan=1 colspan=1>2.37 × 10-2</td><td rowspan=1 colspan=1>1.59 × 10-2</td></tr><tr><td rowspan=1 colspan=1>Absolute error</td><td rowspan=1 colspan=1>5.74 × 10-1</td><td rowspan=1 colspan=1>1.15 ×10-2</td><td rowspan=1 colspan=1>8.01 ×10-3</td></tr><tr><td rowspan=1 colspan=1>v=5,ρ=5</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>9.35 × 10-1</td><td rowspan=1 colspan=1>2.36 × 10-2</td><td rowspan=1 colspan=1>2.39 ×10-2</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1> Absolute error</td><td rowspan=1 colspan=1>6.46 × 10-1</td><td rowspan=1 colspan=1>1.09 × 10-2</td><td rowspan=1 colspan=1>1.15 × 10-2</td></tr><tr><td rowspan=1 colspan=1>v=6,p=5</td><td rowspan=1 colspan=1>Relative error</td><td rowspan=1 colspan=1>9.60 × 10-1</td><td rowspan=1 colspan=1>2.81 ×10-2</td><td rowspan=1 colspan=1>2.69 × 10-2</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1> Absolute error</td><td rowspan=1 colspan=1>6.84 × 10-1</td><td rowspan=1 colspan=1>1.17 × 10-2</td><td rowspan=1 colspan=1>1.28 × 10-2</td></tr></table>
|
| 187 |
+
|
| 188 |
+
This way, we can use a marching-in-time scheme to predict different sequences/time points. Note that the only data available here is from the PDE itself, i.e., just the initial condition. We take the prediction at $t = \Delta t$ and use this as the initial condition to make a prediction at $t = 2 \Delta t$ , and so on. This is schematically outlined in Fig. 5.
|
| 189 |
+
|
| 190 |
+
We test this scheme by using the exact same NN architecture as in previous sections, and we report the results in Tab. E.1 for the convection problem of $\ S 3 . 1$ , Tab. E.2 for the reaction problem of $\ S \mathrm { A }$ , and Tab. 2 for the reaction-diffusion problem of $\ S 3 . 2$ . We compare the relative/absolute error when the learning is posed as a seq2seq problem (i.e., predicting the state space with a “time marching scheme” of one timestep prediction at a time) to the PINN approach of predicting the whole state space at once.4
|
| 191 |
+
|
| 192 |
+
We explore the following cases where the PINN does poorly, varying $\beta , \rho$ , and $\nu$ coefficients:
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 6: Predicting the entire state space vs seq2seq learning for $\mathbfcal { m }$ reaction-diffusion. The regular PINN is unable to capture the “sharp” and/or diffusive features correctly. However, the seq2seq learning approach is able to capture the correct solution, and achieves almost two orders of magnitude lower error.
|
| 196 |
+
|
| 197 |
+
1) For 1D convection ( §3.1), higher $\beta$ values from 30-40.
|
| 198 |
+
|
| 199 |
+
2) For 1D reaction ( $\ S _ { \mathbf { A } } )$ , $\rho$ coefficients from 5-10.
|
| 200 |
+
|
| 201 |
+
3) For 1D reaction-diffusion ( §3.2), a fixed $\rho = 5$ and $\nu$ coefficients from 2-6.
|
| 202 |
+
|
| 203 |
+
For these cases, we find that posing the problem as seq2seq learning results in significantly lower error. The difference is particularly striking for the reaction and reaction-diffusion cases, where the seq2seq PINN model decreases error by almost two orders of magnitude. An example case is shown Fig. 6, where the seq2seq approach is able to recover the solution, while regular PINNs does very poorly. Note that this behavior also has analogues with numerical methods used in scientific computing, where space-time problems are typically harder to solve, as compared to time marching methods [8]. Intuitively, since the problem is ill-conditioned, restricting the dimensions is expected to help. Furthermore, the underlying function/mapping of the input to the solution should be much simpler to approximate over a smaller time span, as compared to the full time horizon.
|
| 204 |
+
|
| 205 |
+
These initial results are promising, and further developments may lead to still better ways of using PINNs and learning PDEs. In particular, using more sophisticated methods to predict timesteps across the state space may provide improved performance, as may including more sophisticated seq2seq approaches and tuning the regularization parameter (i.e., amount of constraint added).
|
| 206 |
+
|
| 207 |
+
# 6 Conclusions
|
| 208 |
+
|
| 209 |
+
PINNs—and SciML more generally—hold great promise for expanding the scope of ML methodology to important problems in science and engineering. For these problems, however, integrating ML methods with PDE-based domain-driven constraints as a soft regularization term can lead to subtle and critical issues. In particular, we show that this approach can have fundamental limitations which results in failure modes for learning relevant physics commonly used in different fields of science. To show this, we picked two fundamental PDE problems of diffusion and convection and showed that the PINN only works for very simple cases, failing to learn the relevant physical phenomena for even moderately more challenging regimes. We then analyzed the problem to characterize the underlying reasons why these failures occur. In particular, we studied the PINN loss landscape behavior and found it becomes it becomes increasingly complex for large values of diffusion or convection coefficients, and with/without non-homogeneous forcing. We also discussed that the problem is not necessarily due to the limited capacity of the NN, but that it is partly an optimization problem resulting in the PDE-based soft constraint used in PINNs. Furthermore, we showed that the PINN approach of solving for the entire space-time at once may not be efficient, and instead posing the problem as a sequence-to-sequence learning task can provide lower error rates. Addressing these and related issues will be critical if we hope to go beyond existing cut-and-paste approaches, toward engineering a more intimate connection between scientific methodologies and ML methodologies. This will be needed to deliver on the promise of PINNs and SciML more generally.
|
| 210 |
+
|
| 211 |
+
# 7 Acknowledgements.
|
| 212 |
+
|
| 213 |
+
We are thankful to Shashank Subramanian for his feedback and contributions. We also acknowledge helpful discussions with Prof. George Biros, Geoffrey Negiar, and Daniel Rothchild. ASK was supported by Laboratory Directed Research and Development (LDRD) funding under Contract Number DE-AC02-05CH11231 at LBNL and the Alvarez Fellowship in the Computational Research Division at LBNL. AG was supported through funding from Samsung SAIT. MWM would also like to acknowledge the UC Berkeley CLTC, ARO, NSF, and ONR. The UC Berkeley team also acknowledges gracious support from Intel corporation, Intel VLAB, Samsung, Amazon AWS, Google Cloud, Google TPU Research Cloud, and Google Brain (in particular Prof. David Patterson, Dr. Ed Chi, and Jing Li). Our conclusions do not necessarily reflect the position or the policy of our sponsors, and no official endorsement should be inferred.
|
| 214 |
+
|
| 215 |
+
# References
|
| 216 |
+
|
| 217 |
+
[1] Y. Bengio, J. Louradour, R. Collobert, and J. Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48, 2009.
|
| 218 |
+
[2] S. L. Brunton, B. R. Noack, and P. Koumoutsakos. Machine learning for fluid mechanics. Annual Review of Fluid Mechanics, 52:477–508, 2020. [3] Y. Chen, L. Lu, G. E. Karniadakis, and L. Dal Negro. Physics-informed neural networks for inverse problems in nano-optics and metamaterials. Optics express, 28(8):11618–11633, 2020.
|
| 219 |
+
[4] M. Cranmer, S. Greydanus, S. Hoyer, P. Battaglia, D. Spergel, and S. Ho. Lagrangian neural networks. arXiv preprint arXiv:2003.04630, 2020.
|
| 220 |
+
[5] M. Dissanayake and N. Phan-Thien. Neural-network-based approximations for solving partial differential equations. communications in Numerical Methods in Engineering, 10(3):195–201, 1994. [6] P. L. Donti, D. Rolnick, and J. Z. Kolter. Dc3: A learning method for optimization with hard constraints. arXiv preprint arXiv:2104.12225, 2021. [7] V. Dwivedi, N. Parashar, and B. Srinivasan. Distributed learning machines for solving forward and inverse problems in partial differential equations. Neurocomputing, 420:299–316, 2021.
|
| 221 |
+
[8] K. Eriksson, D. Estep, P. Hansbo, and C. Johnson. Computational differential equations. Cambridge University Press, 1996.
|
| 222 |
+
[9] B. Fornberg. A practical guide to pseudospectral methods. Cambridge university press, 1998.
|
| 223 |
+
[10] O. Fuks and H. A. Tchelepi. Limitations of physics informed machine learning for nonlinear twophase transport in porous media. Journal of Machine Learning for Modeling and Computing, 1 (1), 2020.
|
| 224 |
+
[11] N. Geneva and N. Zabaras. Modeling the dynamics of pde systems with physics-constrained deep auto-regressive networks. Journal of Computational Physics, 403:109056, 2020.
|
| 225 |
+
[12] S. Greydanus, M. Dzamba, and J. Yosinski. Hamiltonian neural networks. Advances in Neural Information Processing Systems, 32:15379–15389, 2019.
|
| 226 |
+
[13] J. Han, A. Jentzen, and E. Weinan. Solving high-dimensional partial differential equations using deep learning. Proceedings of the National Academy of Sciences, 115(34):8505–8510, 2018.
|
| 227 |
+
[14] O. Hennigh, S. Narasimhan, M. A. Nabian, A. Subramaniam, K. Tangsali, Z. Fang, M. Rietmann, W. Byeon, and S. Choudhry. Nvidia simnet™: An ai-accelerated multi-physics simulation framework. In International Conference on Computational Science, pages 447–461. Springer, 2021.
|
| 228 |
+
[15] W. Ji, W. Qiu, Z. Shi, S. Pan, and S. Deng. Stiff-pinn: Physics-informed neural network for stiff chemical kinetics. arXiv preprint arXiv:2011.04520, 2020.
|
| 229 |
+
[16] X. Jin, S. Cai, H. Li, and G. E. Karniadakis. Nsfnets (navier-stokes flow nets): Physics-informed neural networks for the incompressible navier-stokes equations. Journal of Computational Physics, 426:109951, 2021.
|
| 230 |
+
[17] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang. Physicsinformed machine learning. Nature Reviews Physics, 3(6):422–440, 2021.
|
| 231 |
+
[18] I. E. Lagaris, A. Likas, and D. I. Fotiadis. Artificial neural networks for solving ordinary and partial differential equations. IEEE transactions on neural networks, 9(5):987–1000, 1998.
|
| 232 |
+
[19] Z. Long, Y. Lu, X. Ma, and B. Dong. Pde-net: Learning pdes from data. In International Conference on Machine Learning, pages 3208–3216. PMLR, 2018.
|
| 233 |
+
[20] L. Lu, X. Meng, Z. Mao, and G. E. Karniadakis. Deepxde: A deep learning library for solving differential equations. SIAM Review, 63(1):208–228, 2021.
|
| 234 |
+
[21] L. Lu, R. Pestourie, W. Yao, Z. Wang, F. Verdugo, and S. G. Johnson. Physics-informed neural networks with hard constraints for inverse design. arXiv preprint arXiv:2102.04626, 2021.
|
| 235 |
+
[22] P. Márquez-Neila, M. Salzmann, and P. Fua. Imposing hard constraints on deep networks: Promises and limitations. arXiv preprint arXiv:1706.02025, 2017.
|
| 236 |
+
[23] P. Moin. Fundamentals of engineering numerical analysis. Cambridge University Press, 2010.
|
| 237 |
+
[24] Y. Nandwani, A. Pathak, P. Singla, et al. A primal dual formulation for deep learning with constraints. Advances in Neural Information Processing Systems, 2019.
|
| 238 |
+
[25] D. R. Parisi, M. C. Mariani, and M. A. Laborde. Solving differential equations with unsupervised neural networks. Chemical Engineering and Processing: Process Intensification, 42(8-9):715– 721, 2003.
|
| 239 |
+
[26] C. possible failure modes in physics-informed neural networks. https://github.com/a1k12/characterizing-pinns-failure-modes, 2021.
|
| 240 |
+
[27] C. Rackauckas, Y. Ma, J. Martensen, C. Warner, K. Zubov, R. Supekar, D. Skinner, A. Ramadhan, and A. Edelman. Universal differential equations for scientific machine learning. arXiv preprint arXiv:2001.04385, 2020.
|
| 241 |
+
[28] M. Raissi, P. Perdikaris, and G. E. Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378:686–707, 2019.
|
| 242 |
+
[29] M. Raissi, A. Yazdani, and G. E. Karniadakis. Hidden fluid mechanics: Learning velocity and pressure fields from flow visualizations. Science, 367(6481):1026–1030, 2020.
|
| 243 |
+
[30] F. Sahli Costabal, Y. Yang, P. Perdikaris, D. E. Hurtado, and E. Kuhl. Physics-informed neural networks for cardiac activation mapping. Frontiers in Physics, 8:42, 2020.
|
| 244 |
+
[31] J. Sirignano and K. Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of computational physics, 375:1339–1364, 2018.
|
| 245 |
+
[32] B. P. van Milligen, V. Tribaldos, and J. Jiménez. Neural network differential equation and plasma equilibrium solver. Physical review letters, 75(20):3594, 1995.
|
| 246 |
+
[33] L. von Rueden, S. Mayer, K. Beckh, B. Georgiev, S. Giesselbach, R. Heese, B. Kirsch, J. Pfrommer, A. Pick, R. Ramamurthy, et al. Informed machine learning–a taxonomy and survey of integrating knowledge into learning systems. arXiv preprint arXiv:1903.12394, 2019.
|
| 247 |
+
[34] B. Wang, W. Zhang, and W. Cai. Multi-scale deep neural network (mscalednn) methods for oscillatory stokes flows in complex domains. arXiv preprint arXiv:2009.12729, 2020.
|
| 248 |
+
[35] S. Wang, Y. Teng, and P. Perdikaris. Understanding and mitigating gradient pathologies in physics-informed neural networks. arXiv preprint arXiv:2001.04536, 2020.
|
| 249 |
+
[36] S. Wang, H. Wang, and P. Perdikaris. On the eigenvector bias of fourier feature networks: From regression to solving multi-scale pdes with physics-informed neural networks. arXiv preprint arXiv:2012.10047, 2020.
|
| 250 |
+
[37] S. Wang, X. Yu, and P. Perdikaris. When and why pinns fail to train: A neural tangent kernel perspective. arXiv preprint arXiv:2007.14527, 2020.
|
| 251 |
+
[38] E. Weinan, J. Han, and A. Jentzen. Deep learning-based numerical methods for highdimensional parabolic partial differential equations and backward stochastic differential equations. Communications in Mathematics and Statistics, 5(4):349–380, 2017.
|
| 252 |
+
[39] J. Willard, X. Jia, S. Xu, M. Steinbach, and V. Kumar. Integrating physics-based modeling with machine learning: A survey. arXiv preprint arXiv:2003.04919, 2020.
|
| 253 |
+
[40] K. Xu and E. Darve. Physics constrained learning for data-driven inverse modeling from sparse observations. arXiv preprint arXiv:2002.10521, 2020.
|
| 254 |
+
[41] Z. Yao, A. Gholami, Q. Lei, K. Keutzer, and M. W. Mahoney. Hessian-based analysis of large batch training and robustness to adversaries. Advances in Neural Information Processing Systems, 2018.
|
| 255 |
+
[42] Z. Yao, A. Gholami, K. Keutzer, and M. W. Mahoney. Pyhessian: Neural networks through the lens of the hessian. In 2020 IEEE International Conference on Big Data (Big Data), pages 581–590. IEEE, 2020.
|
| 256 |
+
[43] Y. Zhu, N. Zabaras, P.-S. Koutsourelakis, and P. Perdikaris. Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data. Journal of Computational Physics, 394:56–81, 2019.
|
| 257 |
+
[44] O. C. Zienkiewicz, R. L. Taylor, P. Nithiarasu, and J. Zhu. The finite element method, volume 3. McGraw-hill London, 1977.
|
md/train/d3k38LTDCyO/d3k38LTDCyO.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Well-tuned Simple Nets Excel on Tabular Datasets
|
| 2 |
+
|
| 3 |
+
# Arlind Kadra
|
| 4 |
+
|
| 5 |
+
Department of Computer Science University of Freiburg kadraa@cs.uni-freiburg.de
|
| 6 |
+
|
| 7 |
+
Marius Lindauer Institute for Information Processing Leibniz University Hannover lindauer@tnt.uni-hannover.de
|
| 8 |
+
|
| 9 |
+
# Frank Hutter
|
| 10 |
+
|
| 11 |
+
# Josif Grabocka
|
| 12 |
+
|
| 13 |
+
Department of Computer Science University of Freiburg & Bosch Center for Artificial Intelligence fh@cs.uni-freiburg.de
|
| 14 |
+
|
| 15 |
+
Department of Computer Science University of Freiburg grabocka@informatik.uni-freiburg.de
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Tabular datasets are the last “unconquered castle” for deep learning, with traditional ML methods like Gradient-Boosted Decision Trees still performing strongly even against recent specialized neural architectures. In this paper, we hypothesize that the key to boosting the performance of neural networks lies in rethinking the joint and simultaneous application of a large set of modern regularization techniques. As a result, we propose regularizing plain Multilayer Perceptron (MLP) networks by searching for the optimal combination/cocktail of 13 regularization techniques for each dataset using a joint optimization over the decision on which regularizers to apply and their subsidiary hyperparameters.
|
| 20 |
+
|
| 21 |
+
We empirically assess the impact of these regularization cocktails for MLPs in a large-scale empirical study comprising 40 tabular datasets and demonstrate that (i) well-regularized plain MLPs significantly outperform recent state-of-the-art specialized neural network architectures, and (ii) they even outperform strong traditional ML methods, such as XGBoost.
|
| 22 |
+
|
| 23 |
+
# 1 Introduction
|
| 24 |
+
|
| 25 |
+
In contrast to the mainstream in deep learning (DL), in this paper, we focus on tabular data, a domain that we feel is understudied in DL. Nevertheless, it is of great relevance for many practical applications, such as climate science, medicine, manufacturing, finance, recommender systems, etc. During the last decade, traditional machine learning methods, such as Gradient-Boosted Decision Trees (GBDT) [5], dominated tabular data applications due to their superior performance, and the success story DL has had for raw data (e.g., images, speech, and text) stopped short of tabular data.
|
| 26 |
+
|
| 27 |
+
Even in recent years, the existing literature still gives mixed messages on the state-of-the-art status of deep learning for tabular data. While some recent neural network methods [1, 46] claim to outperform GBDT, others confirm that GBDT are still the most accurate method on tabular data [48, 26]. The extensive experiments on 40 datasets we report indeed confirm that recent neural networks [1, 46, 11] do not outperform GBDT when the hyperparameters of all methods are thoroughly tuned.
|
| 28 |
+
|
| 29 |
+
We hypothesize that the key to improving the performance of neural networks on tabular data lies in exploiting the recent DL advances on regularization techniques (reviewed in Section 3), such as data augmentation, decoupled weight decay, residual blocks and model averaging (e.g., dropout or snapshot ensembles), or on learning dynamics (e.g., look-ahead optimizer or stochastic weight averaging).
|
| 30 |
+
|
| 31 |
+
Indeed, we find that even plain Multilayer Perceptrons (MLPs) achieve state-of-the-art results when regularized by multiple modern regularization techniques applied jointly and simultaneously.
|
| 32 |
+
|
| 33 |
+
Applying multiple regularizers jointly is already a common standard for practitioners, who routinely mix regularization techniques (e.g. Dropout with early stopping and weight decay). However, the deeper question of “Which subset of regularizers gives the largest generalization performance on a particular dataset among dozens of available methods?” remains unanswered, as practitioners currently combine regularizers via inefficient trial-and-error procedures. In this paper, we provide a simple, yet principled answer to that question, by posing the selection of the optimal subset of regularization techniques and their inherent hyperparameters, as a joint search for the best combination of MLP regularizers for each dataset among a pool of 13 modern regularization techniques and their subsidiary hyperparameters (Section 4).
|
| 34 |
+
|
| 35 |
+
From an empirical perspective, this paper is the first to provide compelling evidence that wellregularized neural networks (even simple MLPs!) indeed surpass the current state-of-the-art models in tabular datasets, including recent neural network architectures and GBDT (Section 6). In fact, the performance improvements are quite pronounced and highly significant.1 We believe this finding to potentially have far-reaching implications, and to open up a garden of delights of new applications on tabular datasets for DL.
|
| 36 |
+
|
| 37 |
+
Our contributions are as follows:
|
| 38 |
+
|
| 39 |
+
1. We demonstrate that modern DL regularizers (developed for DL applications on raw data, such as images, speech, or text) also substantially improve the performance of deep multilayer perceptrons on tabular data. 2. We propose a simple, yet principled, paradigm for selecting the optimal subset of regularization techniques and their subsidiary hyperparameters (so-called regularization cocktails). 3. We demonstrate that these regularization cocktails enable even simple MLPs to outperform both recent neural network architectures, as well as traditional strong ML methods, such as GBDT, on tabular data. Specifically, we are the first to show neural networks to significantly (and substantially) outperform XGBoost in a fair, large-scale experimental study.
|
| 40 |
+
|
| 41 |
+
# 2 Related Work on Deep Learning for Tabular Data
|
| 42 |
+
|
| 43 |
+
Recently, various neural architectures have been proposed for improving the performance of neural networks on tabular data. TabNet [1] introduced a sequential attention mechanism for capturing salient features. Neural oblivious decision ensembles (NODE [46]) blend the concept of hierarchical decisions into neural networks. Self-normalizing neural networks [29] have neuron activations that converge to zero mean and unit variance, which in turn, induces strong regularization and allows for high-level representations. Regularization learning networks train a regularization strength on every neural weight by posing the problem as a large-scale hyperparameter tuning scheme [48]. The recent NET-DNF technique introduces a novel inductive bias in the neural structure corresponding to logical Boolean formulas in disjunctive normal forms [26]. An approach that is often mistaken as deep learning for tabular data is AutoGluon Tabular [11], which builds ensembles of basic neural networks together with other traditional ML techniques, with its key contribution being a strong stacking approach. We emphasize that some of these publications claim to outperform Gradient Boosted Decision Trees (GDBT) [1, 46], while other papers explicitly stress that the neural networks tested do not outperform GBDT on tabular datasets [48, 26]. In contrast, we do not propose a new kind of neural architecture, but a novel paradigm for learning a combination of regularization methods.
|
| 44 |
+
|
| 45 |
+
# 3 An Overview of Regularization Methods for Deep Learning
|
| 46 |
+
|
| 47 |
+
Weight decay: The most classical approaches of regularization focused on minimizing the norms of the parameter values, e.g., either the L1 [51], the L2 [52], or a combination of L1 and L2 known as the Elastic Net [63]. A recent work fixes the malpractice of adding the decay penalty term before momentum-based adaptive learning rate steps (e.g., in common implementations of Adam [27]), by decoupling the regularization from the loss and applying it after the learning rate computation [36].
|
| 48 |
+
|
| 49 |
+
Data Augmentation: Among the augmentation regularizers, Cut-Out [10] proposes to mask a subset of input features (e.g., pixel patches for images) for ensuring that the predictions remain invariant to distortions in the input space. Along similar lines, Mix-Up [60] generates new instances as a linear span of pairs of training examples, while Cut-Mix [58] suggests super-positions of instance pairs with mutually-exclusive pixel masks. A recent technique, called Aug-Mix [20], generates instances by sampling chains of augmentation operations. On the other hand, the direction of reinforcement learning (RL) for augmentation policies was elaborated by Auto-Augment [7], followed by a technique that speeds up the training of the RL policy [34]. Recently, these complex and expensive methods were superseded by simple and cheap methods that yield similar performance (RandAugment [8]) or even improve on it (TrivialAugment [41]). Last but not least, adversarial attack strategies (e.g., FGSM [17]) generate synthetic examples with minimal perturbations, which are employed in training robust models [37].
|
| 50 |
+
|
| 51 |
+
Ensemble methods: Ensembled machine learning models have been shown to reduce variance and act as regularizers [45]. A popular ensemble neural network with shared weights among its base models is Dropout [49], which was extended to a variational version with a Gaussian posterior of the model parameters [28]. As a follow-up, Mix-Out [32] extends Dropout by statistically fusing the parameters of two base models. Furthermore, so-called snapshot ensembles [21] can be created using models from intermediate convergence points of stochastic gradient descent with restarts [35]. In addition to these efficient ensembling approaches, ensembling independent classifiers trained in separate training runs can yield strong performance (especially for uncertainty quantification), be it based on independent training runs only differing in random seeds (deep ensembles [31]), training runs differing in hyperparameter settings (hyperdeep ensembles, [55]), or training runs with different neural architectures (neural ensemble search [59]).
|
| 52 |
+
|
| 53 |
+
Structural and Linearization: In terms of structural regularization, ResNet adds skip connections across layers [18], while the Inception model computes latent representations by aggregating diverse convolutional filter sizes [50]. A recent trend adds a dosage of linearization to deep models, where skip connections transfer embeddings from previous less non-linear layers [18, 22]. Along similar lines, the Shake-Shake regularization deploys skip connections in parallel convolutional blocks and aggregates the parallel representations through affine combinations [15], while Shake-Drop extends this mechanism to a larger number of CNN architectures [56].
|
| 54 |
+
|
| 55 |
+
Implicit: The last family of regularizers broadly encapsulates methods that do not directly propose novel regularization techniques but have an implicit regularization effect as a virtue of their ‘modus operandi’ [2]. The simplest such implicit regularization is Early Stopping [57], which limits overfitting by tracking validation performance over time and stopping training when validation performance no longer improves. Another implicit regularization method is Batch Normalization, which improves generalization by reducing internal covariate shift [24]. The scaled exponential linear units (SELU) represent an alternative to batch-normalization through self-normalizing activation functions [30]. On the other hand, stabilizing the convergence of the training routine is another implicit regularization, for instance by introducing learning rate scheduling schemes [35]. The recent strategy of stochastic weight averaging relies on averaging parameter values from the local optima encountered along the sequence of optimization steps [25], while another approach conducts updates in the direction of a few ‘lookahead’ steps [61].
|
| 56 |
+
|
| 57 |
+
# 4 Regularization Cocktails for Multilayer Perceptrons
|
| 58 |
+
|
| 59 |
+
# 4.1 Problem Definition
|
| 60 |
+
|
| 61 |
+
A training set is composed of features $\mathbf { X } ^ { ( \mathrm { T r a i n } ) }$ and targets $\mathbf { y } ^ { ( \mathrm { T r a i n } ) }$ , while the test dataset is denoted by $\mathbf { X } ^ { ( \mathrm { T e s t } ) } , \mathbf { y } ^ { ( \mathrm { T e s t } ) }$ . A parametrized function $f$ , i.e., a neural network, approximates the targets as $\hat { \mathbf { y } } = f ( \mathbf { X } ; \theta )$ , where the parameters $\pmb \theta$ are trained to minimize a differentiable loss function $\mathcal { L }$ as $\begin{array} { r l } { \arg \operatorname* { m i n } _ { \pmb { \theta } } \mathcal { L } \left( \mathbf { y } ^ { ( \mathrm { T r a i n } ) } , f \left( \mathbf { X } ^ { ( \mathrm { T r a i n } ) } ; \pmb { \theta } \right) \right) } & { { } } \end{array}$ . To generalize into minimizing $\mathcal { L } \left( \mathbf { y } ^ { ( \mathrm { T e s t } ) } , f ( \mathbf { X } ^ { ( \mathrm { T e s t } ) } ; \pmb { \theta } ) \right)$ , t he parameters of $\scriptstyle { \dot { \boldsymbol { f } } }$ are controlled with a regularization technique $\Omega$ that avoids overfitting to the peculiarities of the training data. With a slight abuse of notation we denote $f \left( \mathbf { X } ; \Omega \left( { \pmb { \theta } } ; { \pmb { \lambda } } \right) \right)$ to be the predictions of the model $f$ whose parameters $\pmb \theta$ are optimized under the regime of the regularization method $\Omega ( \cdot ; \lambda )$ , where $\lambda \in \Lambda$ represents the hyperparameters of $\Omega$ . The training data is further divided into two subsets as training and validation splits, the later denoted by $\mathbf { X } ^ { \mathrm { ( V a l ) } } , \mathbf { y } ^ { \mathrm { ( V a l ) } }$ , such that $\boldsymbol { \lambda }$ can be tuned on the validation loss via the following hyperparameter optimization objective:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { r l } & { \lambda ^ { * } \in \underset { \lambda \in \Lambda } { \arg \operatorname* { m i n } } \mathscr { L } \left( \mathbf { y } ^ { ( \mathrm { V a l } ) } , f \left( \mathbf { X } ^ { ( \mathrm { V a l } ) } ; \pmb { \theta } _ { \lambda } ^ { * } \right) \right) , } \\ & { \mathrm { s . t . } \theta _ { \lambda } ^ { * } \in \underset { \pmb { \theta } } { \arg \operatorname* { m i n } } \mathscr { L } \left( \mathbf { y } ^ { ( \mathrm { T r a i n } ) } , f ( \mathbf { X } ^ { ( \mathrm { T r a i n } ) } ; \Omega \left( \pmb { \theta } ; \lambda \right) \right) . } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
After finding the optimal (or in practice at least a well-performing) configuration $\lambda ^ { * }$ , we re-fit $\pmb { \theta }$ on the entire training dataset, i.e., $\bar { \mathbf { X } } ^ { ( \mathrm { T r a i n } ) } \cup \mathbf { X } ^ { ( \mathrm { V a l } ) }$ and $\mathbf { y } ^ { ( \mathrm { T r a i n } ) } \cup \mathbf { y } ^ { ( \mathrm { V a l } ) }$ .
|
| 68 |
+
|
| 69 |
+
While the search for optimal hyperparameters $\boldsymbol { \lambda }$ is an active field of research in the realm of AutoML [23], still the choice of the regularizer $\Omega$ mostly remains an ad-hoc practice, where practitioners select a few combinations among popular regularizers (Dropout, L2, Batch Normalization, etc.). In contrast to prior studies, we hypothesize that the optimal regularizer is a cocktail mixture of a large set of regularization methods, all being simultaneously applied with different strengths (i.e., dataset-specific hyperparameters). Given a set of $K$ regularizers $\{ ( \Omega ^ { ( k ) } ( \cdot ; \lambda ^ { ( k ) } ) \} _ { k = 1 } ^ { K } : = \{ \Omega ^ { ( 1 ) } ( \cdot ; \lambda ^ { ( 1 ) } ) , \dots , \Omega ^ { ( K ) } ( \cdot ; \lambda ^ { ( K ) } ) \}$ , each with its own hyperparameters $\pmb { \lambda } ^ { ( k ) } \in \pmb { \Lambda } ^ { ( k ) } , \forall k \in \{ 1 , \dots , K \}$ , the problem of finding the optimal cocktail of regularizers is:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l } & { \lambda ^ { * } \in \underset { \lambda : = ( \lambda ^ { ( 1 ) } , \ldots , \lambda ^ { ( K ) } ) \in ( \Lambda ^ { ( 1 ) } , \ldots , \Lambda ^ { ( K ) } ) } { \mathrm { a r g ~ m i n } } ~ \mathcal { L } \left( \mathbf { y } ^ { ( \mathrm { V a l } ) } , f \left( \mathbf { X } ^ { ( \mathrm { V a l } ) } ; \pmb { \theta } _ { \lambda } ^ { * } \right) \right) } \\ & { \mathrm { s . t . } \ b _ { \lambda } ^ { * } \in \underset { \theta } { \mathrm { a r g ~ m i n } } ~ \mathcal { L } \left( \mathbf { y } ^ { ( \mathrm { T r a i n } ) } , f \left( \mathbf { X } ^ { ( \mathrm { T r a i n } ) } ; \left\{ \Omega ^ { ( k ) } \left( \pmb { \theta } , \lambda ^ { ( k ) } \right) \right\} _ { k = 1 } ^ { K } \right) \right) } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
The intuitive interpretation of Equation 2 is searching for the optimal hyperparameters $\boldsymbol { \lambda }$ (i.e., strengths) of the cocktail’s regularizers using the validation set, given that the optimal prediction model parameters $\pmb { \theta }$ are trained under the regime of all the regularizers being applied jointly. We stress that, for each regularizer, the hyperparameters $\lambda ^ { ( k ) }$ include a conditional hyperparameter controlling whether the $k$ -th regularizer is applied or skipped. The best cocktail might comprise only a subset of regularizers.
|
| 76 |
+
|
| 77 |
+
# 4.2 Cocktail Search Space
|
| 78 |
+
|
| 79 |
+
To build our regularization cocktails we combine the 13 regularization methods listed in Table 1, which represent the categories of regularizers covered in Section 3. The regularization cocktail’s search space with the exact ranges for the selected regularizers’ hyperparameters is given in the same table. In total, the optimal cocktail is searched in a space of 19 hyperparameters.
|
| 80 |
+
|
| 81 |
+
While we can in principle use any hyperparameter optimization method, we decided to use the multi-fidelity Bayesian optimization method BOHB [12] since it achieves strong performance across a wide range of computing budgets by combining Hyperband [33] and Bayesian Optimization [40], and since BOHB can deal with the categorical hyperparameters we use for enabling or disabling regularization techniques and the corresponding conditional structures. Appendix A describes the implementation details for the deployed HPO method. Some of the regularization methods cannot be combined, and we, therefore, introduce the following constraints to the proposed search space: (i) Shake-Shake and Shake-Drop are not simultaneously active since the latter builds on the former; (ii) Only one data augmentation technique out of Mix-Up, Cut-Mix, Cut-Out, and FGSM adversarial learning can be active at once due to a technical limitation of the base library we use [62].
|
| 82 |
+
|
| 83 |
+
# 5 Experimental Protocol
|
| 84 |
+
|
| 85 |
+
# 5.1 Experimental Setup and Datasets
|
| 86 |
+
|
| 87 |
+
We use a large collection of 40 tabular datasets (listed in Table 9 of Appendix D). This includes 31 datasets from the recent open-source OpenML AutoML Benchmark $[ 1 6 ] ^ { 2 }$ . In addition, we added
|
| 88 |
+
|
| 89 |
+
<table><tr><td>Group</td><td>Regularizer</td><td>Hyperparameter</td><td>Type</td><td>Range</td><td>Conditionality</td></tr><tr><td rowspan="3">Implicit</td><td>BN</td><td>BN-active</td><td>Boolean</td><td>{True,False}</td><td></td></tr><tr><td>SWA</td><td>SWA-active</td><td>Boolean</td><td>{True,False}</td><td></td></tr><tr><td rowspan="2">LA</td><td>LA-active Step size</td><td>Boolean Continuous</td><td>{True,False} [0.5,0.8]</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>LA-active LA-active</td></tr><tr><td rowspan="2">w. Decay</td><td rowspan="2">WD</td><td>Num. steps WD-active</td><td>Integer</td><td>[5,10]</td><td></td></tr><tr><td>Decay factor</td><td>Boolean Continuous</td><td>{True,False} [10-5,0.1]</td><td>WD-active</td></tr><tr><td rowspan="4">Ensemble</td><td rowspan="2">DO</td><td>DO-active</td><td>Boolean</td><td>{True,False}</td><td>1</td></tr><tr><td>Dropout shape</td><td>Nominal</td><td>{funnel,long funnel, diamond,hexagon,</td><td>DO-active</td></tr><tr><td></td><td>Drop rate</td><td></td><td>brick,triangle,stairs} [0.0,0.8]</td><td>DO-active</td></tr><tr><td>SE</td><td>SE-active</td><td>Continuous Boolean</td><td>{True,False}</td><td>=</td></tr><tr><td rowspan="4">Structural</td><td>SC</td><td>SC-active</td><td>Boolean</td><td>{True,False}</td><td></td></tr><tr><td rowspan="2">SD</td><td>MB choice</td><td>Nominal</td><td>{SS,SD,Standard}</td><td>SC-active</td></tr><tr><td>Max. probability</td><td>Continuous</td><td>[0.0,1.0]</td><td>SC-active ^MB choice = SD</td></tr><tr><td>SS</td><td>-</td><td>-</td><td>-</td><td>SC-active △MB choice = SS</td></tr><tr><td rowspan="5">Augmentation</td><td>1</td><td>Augment</td><td>Nominal</td><td>{MU,CM,CO,AT,None}</td><td></td></tr><tr><td>MU</td><td>Mix. magnitude</td><td>Continuous</td><td>[0.0,1.0]</td><td>Augment= MU</td></tr><tr><td>CM</td><td>Probability</td><td>Continuous</td><td>[0.0,1.0]</td><td>Augment = CM</td></tr><tr><td rowspan="2">CO</td><td>Probability</td><td>Continuous</td><td>[0.0,1.0]</td><td>Augment = CO</td></tr><tr><td>Patch ratio</td><td>Continuous</td><td>[0.0,1.0]</td><td>Augment = CO</td></tr><tr><td></td><td>AT</td><td>1</td><td>1</td><td>1</td><td>Augment = AT</td></tr></table>
|
| 90 |
+
|
| 91 |
+
Table 1: The configuration space for the regularization cocktail regarding the explicit regularization hyperparameters of the methods and the conditional constraints enabling or disabling them. (BN: Batch Normalization, SWA: Stochastic Weight Averaging, LA: Lookahead Optimizer, WD: Weight Decay, DO: Dropout, SE: Snapshot Ensembles, SC: Skip Connection, MB: Multi-branch choice, SD: Shake-Drop, SS: Shake-Shake, MU: Mix-Up, CM: Cut-Mix, CO: Cut-Out, and AT: FGSM Adversarial Learning)
|
| 92 |
+
|
| 93 |
+
9 popular datasets from UCI [3] and Kaggle that contain roughly $1 0 0 \mathrm { K } +$ instances. Our resulting benchmark of 40 datasets includes tabular datasets that represent diverse classification problems, containing between 452 and 416 188 data points, and between 4 and 2 001 features, varying in terms of the number of numerical and categorical features. The datasets are retrieved from the OpenML repository [54] using the OpenML-Python connector [14] and split as $6 0 \%$ training, $2 0 \%$ validation, and $2 0 \%$ testing sets. The data is standardized to have zero mean and unit variance where the statistics for the standardization are calculated on the training split.
|
| 94 |
+
|
| 95 |
+
We ran all experiments on a CPU cluster, each node of which contains two Intel Xeon E5-2630v4 CPUs with 20 CPU cores each, running at 2.2GHz and a total memory of 128GB. We chose the PyTorch library [43] as a deep learning framework and extended the AutoDL-framework Auto-Pytorch [39, 62] with our implementations for the regularizers of Table 1. We provide the code for our implementation at the following link: https://github.com/releaunifreiburg/ WellTunedSimpleNets.
|
| 96 |
+
|
| 97 |
+
To optimally utilize resources, we ran BOHB with 10 workers in parallel, where each worker had access to 2 CPU cores and 12GB of memory, executing one configuration at a time. Taking into account the dimensions $D$ of the considered configuration spaces, we ran BOHB for at most 4 days, or at most $4 0 \times D$ hyperparameter configurations, whichever came first. During the training phase, each configuration was run for 105 epochs, in accordance with the cosine learning rate annealing with restarts (described in the following subsection). For the sake of studying the effect on more datasets, we only evaluated a single train-val-test split. After the training phase is completed, we report the results of the best hyperparameter configuration found, retrained on the joint train and validation set.
|
| 98 |
+
|
| 99 |
+
# 5.2 Fixed Architecture and Optimization Hyperparameters
|
| 100 |
+
|
| 101 |
+
In order to focus exclusively on investigating the effect of regularization we fix the neural architecture to a simple multilayer perceptron (MLP) and also fix some hyperparameters of the general training procedure. These fixed hyperparameter values, as specified in Table 4 of Appendix B.1, have been tuned for maximizing the performance of an unregularized neural network on our dataset collection (see Table 9 in Appendix D). We use a 9-layer feed-forward neural network with 512 units for each layer, a choice motivated by previous work [42].
|
| 102 |
+
|
| 103 |
+
Moreover, we set a low learning rate of $1 0 ^ { - 3 }$ after performing a grid search for finding the best value across datasets. We use AdamW [36], which implements decoupled weight decay, and cosine annealing with restarts [35] as a learning rate scheduler. Using a learning rate scheduler with restarts helps in our case because we keep a fixed initial learning rate. For the restarts, we use an initial budget of 15 epochs, with a budget multiplier of 2, following published practices [62]. Additionally, since our benchmark includes imbalanced datasets, we use a weighted version of categorical cross-entropy and balanced accuracy [4] as the evaluation metric.
|
| 104 |
+
|
| 105 |
+
# 5.3 Research Hypotheses and Associated Experiments
|
| 106 |
+
|
| 107 |
+
Hypothesis 1: Regularization cocktails outperform state-of-the-art deep learning architectures on tabular datasets.
|
| 108 |
+
|
| 109 |
+
Experiment 1: We compare our well-regularized MLPs against the recently proposed deep learning architectures Node [46] and TabNet [1]. Additionally, we compare against two versions of AutoGluon Tabular [11], a version that features stacking and a version that additionally includes hyperparameter optimization. Moreover, we add an unregularized version of our MLP for reference, as well as a version of our MLP regularized with Dropout (where the dropout hyperparameters are tuned on every dataset). Lastly, we also compare against self-normalizing neural networks [29] by using the same MLP backbone as with our regularization cocktails.
|
| 110 |
+
|
| 111 |
+
Hypothesis 2: Regularization cocktails outperform Gradient-Boosted Decision Trees (GBDTs), the most commonly used traditional ML method and de-facto state-of-the-art for tabular data.
|
| 112 |
+
|
| 113 |
+
Experiment 2: We compare against three different implementations of GBDT: an implementation from scikit-learn [44] and optimized by Auto-sklearn [13], the popular XGBoost [5], and lastly, the recently proposed CatBoost [47].
|
| 114 |
+
|
| 115 |
+
Hypothesis 3: Regularization cocktails are time-efficient and achieve strong anytime results.
|
| 116 |
+
|
| 117 |
+
Experiment 3: We compare our regularization cocktails against XGBoost over time.
|
| 118 |
+
|
| 119 |
+
# 5.4 Experimental Setup for the Baselines
|
| 120 |
+
|
| 121 |
+
All baselines use the same train, validation, and test splits, the same seed, and the same HPO resources and constraints as for our automatically-constructed regularization cocktails (4 days on 20 CPU cores with 128GB of memory). After finding the best incumbent configuration, the baselines are refitted on the union of the training and validation sets and evaluated on the test set. The baselines consist of two recent neural architectures, two versions of AutoGluon Tabular with neural networks, and three implementations of GBDT, as follows:
|
| 122 |
+
|
| 123 |
+
TabNet: This library does not provide an HPO algorithm by default; therefore, we also used BOHB for this search space, with the hyperparameter value ranges recommended by the authors [1].
|
| 124 |
+
|
| 125 |
+
Node: This library does not offer an HPO algorithm by default. We performed a grid search among the hyperparameter value ranges as proposed by the authors [46]; however, we faced multiple memory and runtime issues in running the code. To overcome these issues we used the default hyperparameters the authors used in their public implementation.
|
| 126 |
+
|
| 127 |
+
AutoGluon Tabular: This library constructs stacked ensembles with bagging among diverse neural network architectures having various kinds of regularization [11]. The training of the stacking ensemble of neural networks and its hyperparameter tuning are integrated into the library. Hyperparameter optimization (HPO) is deactivated by default to give more resources to stacking, but here we study AutoGluon based on either stacking or HPO (and HPO actually performs somewhat better). While AutoGluon Tabular by default uses a broad range of traditional ML techniques, here, in order to study it as a “pure” deep learning method, we restrict it to only use neural networks as base learners.
|
| 128 |
+
|
| 129 |
+
ASK-GBDT: The GBDT implementation of scikit-learn offered by Auto-sklearn [13] uses SMAC for HPO, and we used the default hyperparameter search space given by the library.
|
| 130 |
+
|
| 131 |
+
XGBoost: The original library [5] does not incorporate an HPO algorithm by default, so we used BOHB for its HPO. We defined a search space for XGBoost’s hyperparameters following the best practices by the community; we describe this in the Appendix B.2.
|
| 132 |
+
|
| 133 |
+
CatBoost: Like for XGBoost, the original library [47] does not incorporate an HPO algorithm, so we used BOHB for its HPO, with the hyperparameter search space recommended by the authors.
|
| 134 |
+
|
| 135 |
+
For in-depth details about the different baseline configurations with the exact hyperparameter search spaces, please refer to Appendix B.2.
|
| 136 |
+
|
| 137 |
+
Table 2: Comparison of well-regularized MLPs vs. other methods in terms of balanced accuracy. N/A values indicate a failure due to exceeding the cluster’s memory (24GB per process) or runtime limits (4 days). The acronyms stand for ${ \bf M L P + D }$ : MLP with Dropout, XGB.: XGBoost, ASK-G.: GBDT by Auto-sklearn, AutoGL. S: Autogluon with stacking enabled, TabN.: TabNet and $\mathrm { M L P + C }$ : our MLP regularized by cocktails.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Dataset</td><td>#Ins./#Feat.</td><td>MLP</td><td>MLP+D</td><td>XGB.</td><td>ASK-G.</td><td>TabN.</td><td>Node</td><td>AutoGL. S</td><td>MLP+C</td></tr><tr><td>anneal</td><td>898/39</td><td>84.131</td><td>86.916</td><td>85.416</td><td>90.000</td><td>84.248</td><td>20.000</td><td>80.000</td><td>89.270</td></tr><tr><td>kr-vs-kp</td><td>3196/37</td><td>99.701</td><td>99.850</td><td>99.850</td><td>99.850</td><td>93.250</td><td>97.264</td><td>99.687</td><td>99.850</td></tr><tr><td>arrhythmia</td><td>452/280</td><td>37.991</td><td>38.704</td><td>48.779</td><td>46.850</td><td>43.562</td><td>N/A</td><td>48.934</td><td>61.461</td></tr><tr><td>mfeat.</td><td>2000 /217</td><td>97.750</td><td>98.000</td><td>98.000</td><td>97.500</td><td>97.250</td><td>97.250</td><td>98.000</td><td>98.000</td></tr><tr><td>credit-g</td><td>1000/21</td><td>69.405</td><td>68.095</td><td>68.929</td><td>71.191</td><td>61.190</td><td>73.095</td><td>69.643</td><td>74.643</td></tr><tr><td>vehicle</td><td>846/19</td><td>83.766</td><td>82.603</td><td>74.973</td><td>80.165</td><td>79.654</td><td>75.541</td><td>83.793</td><td>82.576</td></tr><tr><td>kc1</td><td>2109 /22</td><td>70.274</td><td>72.980</td><td>66.846</td><td>63.353</td><td>52.517</td><td>55.803</td><td>67.270</td><td>74.381</td></tr><tr><td>adult</td><td>48842/15</td><td>76.893</td><td>78.520</td><td>79.824</td><td>79.830</td><td>77.155</td><td>78.168</td><td>80.557</td><td>82.443</td></tr><tr><td>walking.</td><td>149332/5</td><td>60.997</td><td>63.754</td><td>61.616</td><td>62.764</td><td>56.801</td><td>N/A</td><td>60.800</td><td>63.923</td></tr><tr><td>phoneme</td><td>5404/6</td><td>87.514</td><td>88.387</td><td>87.972</td><td>88.341</td><td>86.824</td><td>82.720</td><td>83.943</td><td>86.619</td></tr><tr><td>skin-seg.</td><td>245057/4</td><td>99.971</td><td>99.962</td><td>99.968</td><td>99.967</td><td>99.961</td><td>N/A</td><td>99.973</td><td>99.953</td></tr><tr><td>ldpa</td><td>164860/8</td><td>62.831</td><td>67.035</td><td>99.008</td><td>68.947</td><td>54.815</td><td>N/A</td><td>53.023</td><td>68.107</td></tr><tr><td>nomao</td><td>34465 /119</td><td>95.917</td><td>96.232</td><td>96.872</td><td>97.217</td><td>95.425</td><td>96.217</td><td>96.420</td><td>96.826</td></tr><tr><td>cnae</td><td>1080/857</td><td>87.500</td><td>90.741</td><td>94.907</td><td>93.519</td><td>89.352</td><td>96.759</td><td>92.593</td><td>95.833</td></tr><tr><td>blood.</td><td>748/5</td><td>67.836</td><td>68.421</td><td>62.281</td><td>64.985</td><td>64.327</td><td>50.000</td><td>67.251</td><td>67.617</td></tr><tr><td>bank.</td><td>45211/17</td><td>78.076</td><td>83.145</td><td>72.658</td><td>72.283</td><td>70.639</td><td>74.607</td><td>79.483</td><td>85.993</td></tr><tr><td>connect.</td><td>67557/43</td><td>73.627</td><td>76.345</td><td>72.374</td><td>72.645</td><td>72.045</td><td>N/A</td><td>75.622</td><td>80.073</td></tr><tr><td>shuttle</td><td>58000/10</td><td>99.475</td><td>99.892</td><td>98.563</td><td>98.571</td><td>88.017</td><td>42.805</td><td>83.433</td><td>99.948</td></tr><tr><td>higgs</td><td>98050/29</td><td>67.752</td><td>66.873</td><td>72.944</td><td>72.926</td><td>72.036</td><td>N/A</td><td>73.798</td><td>73.546</td></tr><tr><td>australian</td><td>690/15</td><td>86.268</td><td>86.268</td><td>89.717</td><td>88.589</td><td>85.278</td><td>83.468</td><td>88.248</td><td>87.088</td></tr><tr><td>car</td><td>1728/7</td><td>97.442</td><td>99.690</td><td>92.376</td><td>100.000</td><td>98.701</td><td>46.119</td><td>99.675</td><td>99.587</td></tr><tr><td>segment</td><td>2310/20</td><td>94.805</td><td>94.589</td><td>93.723</td><td>93.074</td><td>91.775</td><td>90.043</td><td>91.991</td><td>93.723</td></tr><tr><td>fashion.</td><td>70000 /785</td><td>90.464</td><td>90.507</td><td>91.243</td><td>90.457</td><td>89.793</td><td>N/A</td><td>91.336</td><td>91.950</td></tr><tr><td>jungle.</td><td>44819/7</td><td>97.061</td><td>97.237</td><td>87.325</td><td>83.070</td><td>73.425</td><td>N/A</td><td>93.017</td><td>97.471</td></tr><tr><td>numerai</td><td>96320/22</td><td>50.262</td><td>50.301</td><td>52.363</td><td>52.421</td><td>51.599</td><td>52.364</td><td>51.706</td><td>52.668</td></tr><tr><td>devnagari</td><td>92000 /1025</td><td>96.125</td><td>97.000</td><td>93.310</td><td>77.897</td><td>94.179</td><td>N/A</td><td>97.734</td><td>98.370</td></tr><tr><td>helena</td><td>65196/28</td><td>16.836</td><td>23.983</td><td>21.994</td><td>21.144</td><td>19.032</td><td>N/A</td><td>27.115</td><td>27.701</td></tr><tr><td>jannis</td><td>83733/55</td><td>51.505</td><td>55.118</td><td>55.225</td><td>55.593</td><td>56.214</td><td>N/A</td><td>58.526</td><td>65.287</td></tr><tr><td>volkert</td><td>58310/181</td><td>65.081</td><td>66.996</td><td>64.170</td><td>63.428</td><td>59.409</td><td>N/A</td><td>70.195</td><td>71.667</td></tr><tr><td>miniboone</td><td>130064 /51</td><td>90.639</td><td>94.099</td><td>94.024</td><td>94.137</td><td>62.173</td><td>N/A</td><td>94.978</td><td>94.015</td></tr><tr><td>apsfailure</td><td>76000 /171</td><td>87.759</td><td>91.194</td><td>88.825</td><td>91.797</td><td>51.444</td><td>N/A</td><td>88.890</td><td>92.535</td></tr><tr><td>christine</td><td>5418/1637</td><td>70.941</td><td>70.756</td><td>74.815</td><td>74.447</td><td>69.649</td><td>73.247</td><td>74.170</td><td>74.262</td></tr><tr><td>dilbert</td><td>10000/2001</td><td>96.930</td><td>96.733</td><td>99.106</td><td>98.704</td><td>97.608</td><td>N/A</td><td>98.758</td><td>99.049</td></tr><tr><td>fabert</td><td>8237/801</td><td>63.707</td><td>64.814</td><td>70.098</td><td>70.120</td><td>62.277</td><td>66.097</td><td>68.142</td><td>69.183</td></tr><tr><td>jasmine</td><td>2984/145</td><td>78.048</td><td>76.211</td><td>80.546</td><td>78.878</td><td>76.690</td><td>80.053</td><td>80.046</td><td>79.217</td></tr><tr><td>sylvine</td><td>5124/21</td><td>93.070</td><td>93.363</td><td>95.509</td><td>95.119</td><td>83.595</td><td>93.852</td><td>93.753</td><td>94.045</td></tr><tr><td>dionis</td><td>416188 /61</td><td>91.905</td><td>92.724</td><td>91.222</td><td>74.620</td><td>83.960</td><td>N/A</td><td>94.127</td><td>94.010</td></tr><tr><td>aloi</td><td>108000 /129</td><td>92.331</td><td>93.852</td><td>95.338</td><td>13.534</td><td>93.589</td><td>N/A</td><td>97.423</td><td>97.175</td></tr><tr><td>ccfraud</td><td>284807 /31</td><td>50.000</td><td>50.000</td><td>90.303</td><td>92.514</td><td>85.705</td><td>N/A</td><td>91.831</td><td>92.531</td></tr><tr><td>clickpred.</td><td>399482/12</td><td>63.125</td><td>64.367</td><td>58.361</td><td>58.201</td><td>50.163</td><td>N/A 19/2/0</td><td>54.410 30/9/1</td><td>64.280</td></tr><tr><td>Wins/Losses/Ties Wilcoxon p-value</td><td>MLP+C vs... MLP+C vs...</td><td>35/5/0 5.3 ×10-7</td><td>30/8/2 8.9 × 10-6</td><td>26/12/2 6×10-4</td><td>29/11/0 2.8 ×10-4</td><td>38/2/0 4.5×10-8</td></table>
|
| 140 |
+
|
| 141 |
+
# 6 Experimental Results
|
| 142 |
+
|
| 143 |
+
We present the comparative results of our MLPs regularized with the proposed regularization cocktails $\mathrm { ( M L P { + } C ) }$ ) against ten baselines (descriptions in Section 5.4): (a) two state-of-the-art architectures (NODE, TabN.); $( b )$ two AutoGluon Tabular variants with neural networks that features stacking (AutoGL. S) and additionally HPO (AutoGL. HPO); (c) three Gradient-Boosted Decision Tree (GBDT) implementations (XGB., ASK-G., and CatBoost); (d) as well as three reference MLPs (unregularized (MLP), and regularized with Dropout $( \mathrm { M L P + D } )$ ) [49] or SELU (MLP+SELU) [30]).
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 1: Comparison of our proposed dataset-specific cocktail $\mathrm { ( M L P { + } C ) }$ against the top three baselines. Each dot in the plot represents a dataset, the y-axis our method’s errors and the $\mathbf { X }$ -axis the baselines’ errors.
|
| 147 |
+
|
| 148 |
+
Table 2 shows the comparison against a subset of the baselines, while the full detailed results involving all the remaining baselines are located in Table 13 in the appendix. It is worth reemphasizing that the hyperparameters of all the presented baselines (except the unregularized MLP, which has no hyperparameters and AutoGL. S) are carefully tuned on a validation set as detailed in Section 5 and the appendices referenced therein. The table entries represent the test sets’ balanced accuracies achieved over the described large-scale collection of 40 datasets. Figure 1 visualizes the results showing substantial improvements for our method.
|
| 149 |
+
|
| 150 |
+
To assess the statistical significance, we analyze the ranks of the classification accuracies across the 40 datasets. We use the Critical Difference (CD) diagram of the ranks based on the Wilcoxon significance test, a standard metric for comparing classifiers across multiple datasets [9]. The overall empirical comparison of the elaborated methods is given in Figure 2. The analysis of neural network baselines in Subplot 2a reveals a clear statistical significance of the regularization cocktails against the other methods. Apart from AutoGluon (both versions), the other neural architectures are not competitive even against an MLP regularized only with Dropout and optimized with our standard, fixed training pipeline of Adam with cosine annealing. To be even fairer to the weaker
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 2: Critical difference diagrams with a Wilcoxon significance analysis on 40 datasets. Connected ranks via a bold bar indicate that performances are not significantly different $( p > 0 . 0 5 )$ .
|
| 154 |
+
|
| 155 |
+
baselines (TabNet and Node) we tried boosting them by adding early stopping (indicated with $" { \bf + E S " }$ ), but their rank did not improve. Overall, the large-scale experimental analysis shows that Hypothesis 1 in Section 5.3 is validated: well-regularized simple deep MLPs outperform specialized neural architectures.
|
| 156 |
+
|
| 157 |
+
Next, we analyze the empirical significance of our well-regularized MLPs against the GBDT implementations in Figure 2b. The results show that our MLPs outperform all three GBDT variants (XGBoost, auto-sklearn, and CatBoost) with a statistically significant margin. We added early stopping $( " { \mathrm { + E S } } " )$ to XGBoost, but it did not improve its performance. Among the GBDT implementations, XGBoost without early stopping has a non-significant margin over the GBDT version of auto-sklearn as well as CatBoost. We conclude that well-regularized simple deep MLPs outperform GBDT, which validates Hypothesis 2 in Section 5.3.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Left: Cocktail ingredients occurring in at least $30 \%$ of the datasets. Right: Clustered histogram (union of member occurrences) with the acronyms from Table 1. Implicit: {BN, LA, SWA}, M. Averaging: {DO, SE}, Structural: {SC, SS, SD}, D. Augmentation: {MU, CM, CO, AT}.
|
| 161 |
+
|
| 162 |
+
The final cumulative comparison in Figure 2c provides a further result: none of the specialized previous deep learning methods (TabNet, NODE, AutoGluon Tabular) outperforms GBDT significantly. To the best of our awareness, this paper is therefore the first to demonstrate that neural networks beat GBDT with a statistically significant margin over a large-scale experimental protocol that conducts a thorough hyperparameter optimization for all methods.
|
| 163 |
+
|
| 164 |
+
Figure 3 provides a further analysis on the most prominent regularizers of the MLP cocktails, based on the frequency with which our HPO procedure selected the various regularization methods for each dataset’s cocktail. In the left plot, we show the frequent individual regularizers, while in the right plot the frequencies are
|
| 165 |
+
|
| 166 |
+
Table 3: Comparing the cocktails and XGBoost over different HPO budgets. The statistics are based on the test performance of the incumbent configurations over all the benchmark datasets.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Time (Hours)</td><td>Wins</td><td>Ties</td><td>Losses</td><td>p-value</td></tr><tr><td>0.25</td><td>21</td><td>1</td><td>17</td><td>0.8561</td></tr><tr><td>0.5</td><td>25</td><td>1</td><td>13</td><td>0.0145</td></tr><tr><td>1</td><td>24</td><td>1</td><td>14</td><td>0.0120</td></tr><tr><td>2</td><td>27</td><td>1</td><td>11</td><td>0.0006</td></tr><tr><td>4</td><td>28</td><td>1</td><td>11</td><td>0.0006</td></tr><tr><td>8</td><td>28</td><td>1</td><td>11</td><td>0.0004</td></tr><tr><td>16</td><td>28</td><td>1</td><td>11</td><td>0.0005</td></tr><tr><td>32</td><td>29</td><td>1</td><td>10</td><td>0.0003</td></tr><tr><td>64</td><td>30</td><td>1</td><td>9</td><td>0.0002</td></tr><tr><td>96</td><td>30</td><td>1</td><td>9</td><td>0.0002</td></tr></table>
|
| 169 |
+
|
| 170 |
+
grouped by types of regularizers. The grouping reveals that a cocktail for each dataset often has at least one ingredient from every regularization family (detailed in Section 3), highlighting the need for jointly applying diverse regularization methods.
|
| 171 |
+
|
| 172 |
+
Lastly, Table 3 shows the efficiency of our regularization cocktails compared to XGBoost over increasing HPO budgets. The descriptive statistics are calculated from the hyperparameter configurations with the best validation performance for all datasets during the HPO search, however, taking their respective test performances for comparison. A dataset is considered in the comparison only if the HPO procedure has managed to evaluate at least one hyperparameter configuration for the cocktail or baseline. As the table shows, our regularization cocktails achieve a better performance in only 15 minutes for the majority of datasets. After 30 minutes of HPO time, regularization cocktails are statistically significantly better than XGBoost. As more time is invested, the performance gap with XGBoost increases, and the results get even more significant; this is further visualized in the ranking plot over time in Figure 4. Based on these results, we conclude that regularization cocktails are time-efficient and achieve strong anytime results, which validates Hypothesis 3 in Section 5.3.
|
| 173 |
+
|
| 174 |
+
# 7 Conclusion
|
| 175 |
+
|
| 176 |
+
Summary. Focusing on the important domain of tabular datasets, this paper studied improvements to deep learning (DL) by better regularization techniques. We presented regularization cocktails, per-dataset-optimized combinations of many regularization techniques, and demonstrated that these improve the performance of even simple neural networks enough to substantially and significantly surpass XGBoost, the current state-of-the-art method for tabular datasets. We conducted a largescale experiment involving 13 regularization methods and 40 datasets and empirically showed that (i) modern DL regularization methods developed in the context of raw data (e.g., vision, speech, text) substantially improve the performance of deep neural networks on tabular data; (ii) regularization cocktails significantly outperform recent neural networks architectures, and most importantly iii) regularization cocktails outperform GBDT on tabular datasets.
|
| 177 |
+
|
| 178 |
+
Limitations. To comprehensively study basic principles, we have chosen an empirical evaluation that has many limitations. We only studied classification, not regression. We only used somewhat balanced datasets (the ratio of the minority class and the majority class is above 0.05). We did not study the regimes of extremely few or extremely many data points (our smallest data set contained 452 data points, our largest 416 188 data points). We also did not study datasets with extreme outliers, missing labels, semi-supervised data, streaming data, and many more modalities in which tabular data arises. An important point worth noticing is that the recent neural network architectures (Section 5.4) could also benefit from our regularization cocktails, but integrating the regularizers into these baseline libraries requires considerable coding efforts.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Ranking plot comparing XGBoost and regularization cocktails over time.
|
| 182 |
+
|
| 183 |
+
Future Work. This work opens up the door for a wealth of exciting follow-up research. Firstly, the per-dataset optimization of regularization cocktails may be substantially sped up by using metalearning across datasets [53]. Secondly, as we have used a fixed neural architecture, our method’s performance may be further improved by using joint architecture and hyperparameter optimization. Thirdly, regularization cocktails should also be tested under all the data modalities under “Limitations” above. In addition, it would be interesting to validate the gain of integrating our well-regularized MLPs into modern AutoML libraries, by combining them with enhanced feature preprocessing and ensembling.
|
| 184 |
+
|
| 185 |
+
Take-away. Even simple neural networks can achieve competitive classification accuracies on tabular datasets when they are well regularized, using dataset-specific regularization cocktails found via standard hyperparameter optimization.
|
| 186 |
+
|
| 187 |
+
# Societal Implications
|
| 188 |
+
|
| 189 |
+
Enabling neural networks to advance the state-of-the-art on tabular datasets may open up a garden of delights in many crucial applications, such as climate science, medicine, manufacturing, and recommender systems. In addition, the proposed networks can serve as a backbone for applications of data science for social good, such as the realm of fair machine learning where the associated data are naturally in a tabular form. However, there are also potential disadvantages in advancing deep learning for tabular data. In particular, even though complex GBDT ensembles are also hard to interpret, simpler traditional ML methods are much more interpretable than deep neural networks; we therefore encourage research on interpretable deep learning on tabular data.
|
| 190 |
+
|
| 191 |
+
# Acknowledgements
|
| 192 |
+
|
| 193 |
+
We acknowledge funding by the Robert Bosch GmbH, by the Eva Mayr-Stihl Foundation, the MWK of the German state of Baden-Württemberg, the BrainLinks-BrainTools CoE, the European Research Council (ERC) under the European Union’s Horizon 2020 programme, grant no. 716721, and the German Federal Ministry of Education and Research (BMBF, grant RenormalizedFlows 01IS19077C). The authors acknowledge support by the state of Baden-Württemberg through bwHPC and the German Research Foundation (DFG) through grant no INST 39/963-1 FUGG.
|
| 194 |
+
|
| 195 |
+
# References
|
| 196 |
+
|
| 197 |
+
[1] S. Arik and T. Pfister. Tabnet: Attentive interpretable tabular learning. In AAAI Conference on Artificial Intelligence, 2021.
|
| 198 |
+
|
| 199 |
+
[2] S. Arora, N. Cohen, W. Hu, and Y. Luo. Implicit regularization in deep matrix factorization. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alche Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 7413–7424. Curran Associates, Inc., 2019.
|
| 200 |
+
|
| 201 |
+
[3] A. Asuncion and D. Newman. Uci machine learning repository, 2007.
|
| 202 |
+
|
| 203 |
+
[4] K. Henning Brodersen, C., and E. Klaas Stephan J. M Buhmann. The balanced accuracy and its posterior distribution. In 2010 20th International Conference on Pattern Recognition, pages 3121–3124. IEEE, 2010.
|
| 204 |
+
|
| 205 |
+
[5] T. Chen and C. Guestrin. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 785–794, 2016.
|
| 206 |
+
|
| 207 |
+
[6] Yutian Chen, Aja Huang, Ziyu Wang, Ioannis Antonoglou, Julian Schrittwieser, David Silver, and Nando de Freitas. Bayesian optimization in alphago. CoRR, abs/1812.06855, 2018.
|
| 208 |
+
|
| 209 |
+
[7] E. Cubuk, B. Zoph, D. Mane, and V.Vasudevanand Q. Le. Autoaugment: Learning augmentation strategies from data. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 210 |
+
|
| 211 |
+
[8] Ekin D. Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V. Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, June 2020.
|
| 212 |
+
|
| 213 |
+
[9] J. Demšar. Statistical comparisons of classifiers over multiple data sets. J. Mach. Learn. Res., 7:1–30, December 2006.
|
| 214 |
+
|
| 215 |
+
[10] T. Devries and G. Taylor. Improved regularization of convolutional neural networks with cutout. ArXiv, abs/1708.04552, 2017.
|
| 216 |
+
|
| 217 |
+
[11] N. Erickson, J. Mueller, A. Shirkov, H. Zhang, P. Larroy, M. Li, and A. Smola. Autogluontabular: Robust and accurate automl for structured data. CoRR, abs/2003.06505, 2020.
|
| 218 |
+
|
| 219 |
+
[12] S. Falkner, A.Klein, and F. Hutter. BOHB: Robust and efficient hyperparameter optimization at scalae. In Proceedings of the 35th International Conference on Machine Learning (ICML 2018), pages 1436–1445, July 2018.
|
| 220 |
+
|
| 221 |
+
[13] M. Feurer, A. Klein, K. Eggensperger, J. Springenberg, M. Blum, and F. Hutter. Efficient and robust automated machine learning. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, page 2755–2763. MIT Press, 2015.
|
| 222 |
+
|
| 223 |
+
[14] M. Feurer, JN. van Rijn, A. Kadra, P. Gijsbers, N. Mallik, S. Ravi, A. Müller, J. Vanschoren, and F. Hutter. Openml-python: an extensible python api for openml. Journal of Machine Learning Research, 22(100):1–5, 2021.
|
| 224 |
+
|
| 225 |
+
[15] X. Gastaldi. Shake-shake regularization of 3-branch residual networks. In 5th International Conference on Learning Representations, ICLR. OpenReview.net, 2017.
|
| 226 |
+
|
| 227 |
+
[16] P. Gijsbers, E. LeDell, S. Poirier, J. Thomas, B. Bischl, and J. Vanschoren. An open source automl benchmark. arXiv preprint arXiv:1907.00909 [cs.LG], 2019. Accepted at AutoML Workshop at ICML 2019.
|
| 228 |
+
|
| 229 |
+
[17] I. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR, 2015.
|
| 230 |
+
|
| 231 |
+
[18] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 232 |
+
|
| 233 |
+
[19] P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup, and D. Meger. Deep reinforcement learning that matters. In S. McIlraith and K. Weinberger, editors, Proceedings of the Conference on Artificial Intelligence (AAAI’18). AAAI Press, 2018.
|
| 234 |
+
[20] D. Hendrycks, N. Mu, E. Cubuk, B. Zoph, J. Gilmer, and B. Lakshminarayanan. Augmix: A simple method to improve robustness and uncertainty under data shift. In International Conference on Learning Representations, 2020.
|
| 235 |
+
[21] G. Huang, Y. Li, G. Pleiss, Z. Liu, J. Hopcroft, and K. Weinberger. Snapshot Ensembles: Train 1, Get M for Free. International Conference on Learning Representations, November 2017.
|
| 236 |
+
[22] G. Huang, Z. Liu, L. van der Maaten, and K. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 237 |
+
[23] F. Hutter, L. Kotthoff, and J. Vanschoren, editors. Automated Machine Learning: Methods, Systems, Challenges. Springer, 2019. In press, available at http://automl.org/book.
|
| 238 |
+
[24] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In F. Bach and D. Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 448–456. PMLR, 07–09 Jul 2015.
|
| 239 |
+
[25] P. Izmailov, D. Podoprikhin, T. Garipov, D. Vetrov, and A. Wilson. Averaging weights leads to wider optima and better generalization. In Proceedings of the Thirty-Fourth Conference on Uncertainty in Artificial Intelligence, UAI, pages 876–885. AUAI Press, 2018.
|
| 240 |
+
[26] L. Katzir, G. Elidan, and R. El-Yaniv. Net-{dnf}: Effective deep modeling of tabular data. In International Conference on Learning Representations, 2021.
|
| 241 |
+
[27] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 242 |
+
[28] D. Kingma, T. Salimans, and M. Welling. Variational dropout and the local reparameterization trick. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, page 2575–2583. MIT Press, 2015.
|
| 243 |
+
[29] G. Klambauer, T. Unterthiner, A. Mayr, and S. Hochreiter. Self-normalizing neural networks. In Proceedings of the 31st international conference on neural information processing systems, pages 972–981, 2017.
|
| 244 |
+
[30] Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
|
| 245 |
+
[31] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 6405–6416, Red Hook, NY, USA, 2017. Curran Associates Inc.
|
| 246 |
+
[32] C. Lee, K. Cho, and W. Kang. Mixout: Effective regularization to finetune large-scale pretrained language models. In International Conference on Learning Representations, 2020.
|
| 247 |
+
[33] L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. J. Mach. Learn. Res., 18(1):6765–6816, January 2017.
|
| 248 |
+
[34] S. Lim, I. Kim, T. Kim, C. Kim, and S. Kim. Fast autoaugment. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d Alche-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 6665–6675. Curran Associates, Inc., 2019.
|
| 249 |
+
[35] I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR) 2017 Conference Track, April 2017.
|
| 250 |
+
|
| 251 |
+
[36] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
|
| 252 |
+
|
| 253 |
+
[37] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018.
|
| 254 |
+
|
| 255 |
+
[38] Gábor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language models. In International Conference on Learning Representations, 2018.
|
| 256 |
+
|
| 257 |
+
[39] H. Mendoza, A. Klein, M. Feurer, J. Tobias Springenberg, M. Urban, M. Burkart, M. Dippel, M. Lindauer, and F. Hutter. Towards automatically-tuned deep neural networks. In F. Hutter, L. Kotthoff, and J. Vanschoren, editors, AutoML: Methods, Sytems, Challenges, chapter 7, pages 141–156. Springer, December 2019.
|
| 258 |
+
|
| 259 |
+
[40] J. Mockus. Application of bayesian approach to numerical methods of global and stochastic optimization. J. Glob. Optim., 4(4):347–365, 1994.
|
| 260 |
+
|
| 261 |
+
[41] Samuel G. Müller and Frank Hutter. Trivialaugment: Tuning-free yet state-of-the-art data augmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 774–782, October 2021.
|
| 262 |
+
|
| 263 |
+
[42] A. Emin Orhan and X. Pitkow. Skip connections eliminate singularities. arXiv preprint arXiv:1701.09175, 2017.
|
| 264 |
+
|
| 265 |
+
[43] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in neural information processing systems, pages 8026–8037, 2019.
|
| 266 |
+
|
| 267 |
+
[44] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 268 |
+
|
| 269 |
+
[45] R. Polikar. Ensemble Learning. In C. Zhang and Y. Ma, editors, Ensemble Machine Learning: Methods and Applications, pages 1–34. Springer US, 2012.
|
| 270 |
+
|
| 271 |
+
[46] S. Popov, S. Morozov, and A. Babenko. Neural oblivious decision ensembles for deep learning on tabular data. In International Conference on Learning Representations, 2020.
|
| 272 |
+
|
| 273 |
+
[47] L. Prokhorenkova, G. Gusev, A. Vorobev, AV. Dorogush, and A. Gulin. Catboost: unbiased boosting with categorical features. Advances in Neural Information Processing Systems, 31, 2018.
|
| 274 |
+
|
| 275 |
+
[48] I. Shavitt and E. Segal. Regularization learning networks: Deep learning for tabular datasets. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, page 1386–1396. Curran Associates Inc., 2018.
|
| 276 |
+
|
| 277 |
+
[49] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929–1958, January 2014.
|
| 278 |
+
|
| 279 |
+
[50] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Thirty-first AAAI conference on artificial intelligence, 2017.
|
| 280 |
+
|
| 281 |
+
[51] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society (Series B), 58:267–288, 1996.
|
| 282 |
+
|
| 283 |
+
[52] A. Tikhonov. On the stability of inverse problems. In Doklady Akademii Nauk SSSR, 1943.
|
| 284 |
+
|
| 285 |
+
[53] J. Vanschoren. Meta-learning. In F. Hutter, L. Kotthoff, and J. Vanschoren, editors, Automated Machine Learning - Methods, Systems, Challenges, The Springer Series on Challenges in Machine Learning, pages 35–61. Springer, 2019.
|
| 286 |
+
|
| 287 |
+
[54] J. Vanschoren, J. Van Rijn, B. Bischl, and L. Torgo. Openml: networked science in machine learning. ACM SIGKDD Explorations Newsletter, 15(2):49–60, 2014.
|
| 288 |
+
|
| 289 |
+
[55] Florian Wenzel, Jasper Snoek, Dustin Tran, and Rodolphe Jenatton. Hyperparameter ensembles for robustness and uncertainty quantification. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 6514–6527. Curran Associates, Inc., 2020.
|
| 290 |
+
|
| 291 |
+
[56] Y. Yamada, M. Iwamura, and K. Kise. Shakedrop regularization, 2018.
|
| 292 |
+
|
| 293 |
+
[57] Y. Yao, L. Rosasco, and A. Caponnetto. On early stopping in gradient descent learning. Constructive Approximation, 26(2):289–315, August 2007.
|
| 294 |
+
|
| 295 |
+
[58] S. Yun, D. Han, S. Joon, S. Chun, J. Choe, and Y. Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In International Conference on Computer Vision (ICCV), 2019.
|
| 296 |
+
|
| 297 |
+
[59] Sheheryar Zaidi, Arber Zela, Thomas Elsken, Chris Holmes, Frank Hutter, and Yee Whye Teh. Neural ensemble search for uncertainty estimation and dataset shift. In Advances in Neural Information Processing Systems, 2021.
|
| 298 |
+
|
| 299 |
+
[60] H. Zhang, M. Cisse, Y. Dauphin, and D. Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
|
| 300 |
+
|
| 301 |
+
[61] M. Zhang, J. Lucas, J. Ba, and G. Hinton. Lookahead optimizer: k steps forward, 1 step back. In H. Wallach, H. Larochelle, A. Beygelzimer, F. Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, pages 9593–9604, 2019.
|
| 302 |
+
|
| 303 |
+
[62] L. Zimmer, M. Lindauer, and F. Hutter. Auto-pytorch tabular: Multi-fidelity metalearning for efficient and robust autodl. IEEE TPAMI, 2021. IEEE Early Access.
|
| 304 |
+
|
| 305 |
+
[63] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the royal statistical society: series B (statistical methodology), 67(2):301–320, 2005.
|
md/train/eXlxB3aLOe/eXlxB3aLOe.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GradInit: Learning to Initialize Neural Networks for Stable and Efficient Training
|
| 2 |
+
|
| 3 |
+
Chen Zhu University of Maryland chenzhu@cs.umd.edu
|
| 4 |
+
|
| 5 |
+
Renkun Ni University of Maryland rn9zm@cs.umd.edu
|
| 6 |
+
|
| 7 |
+
Zheng Xu Google Research xuzheng@google.com
|
| 8 |
+
|
| 9 |
+
Kezhi Kong University of Maryland kong@cs.umd.edu
|
| 10 |
+
|
| 11 |
+
W. Ronny Huang Google Research wrh@google.com
|
| 12 |
+
|
| 13 |
+
Tom Goldstein University of Maryland tomg@cs.umd.edu
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
Innovations in neural architectures have fostered significant breakthroughs in language modeling and computer vision. Unfortunately, novel architectures often result in challenging hyper-parameter choices and training instability if the network parameters are not properly initialized. A number of architecture-specific initialization schemes have been proposed, but these schemes are not always portable to new architectures. This paper presents GradInit, an automated and architecture agnostic method for initializing neural networks. GradInit is based on a simple heuristic; the norm of each network layer is adjusted so that a single step of SGD or Adam with prescribed hyperparameters results in the smallest possible loss value. This adjustment is done by introducing a scalar multiplier variable in front of each parameter block, and then optimizing these variables using a simple numerical scheme. GradInit accelerates the convergence and test performance of many convolutional architectures, both with or without skip connections, and even without normalization layers. It also improves the stability of the original Transformer architecture for machine translation, enabling training it without learning rate warmup using either Adam or SGD under a wide range of learning rates and momentum coefficients. Code is available at https://github.com/zhuchen03/gradinit.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
The initialization of network parameters has a strong impact on the training stability and performance of deep neural networks. Initializations that prevent gradient explosion/vanishing in back propagation played a key role in early successes with feed-forward networks [1, 2]. Even with cleverly designed initialization rules, complex models with many layers or multiple branches can still suffer from instability. For example, the original Transformer model [3] does not converge without learning rate warmup using the default initialization [4–6]; RoBERTa [7] and GPT-3 $\pmb { \| \widetilde { \ 8 } \| }$ have to tune the $\beta _ { 2 }$ parameter of Adam for stability when the batch size is large. Recent innovations have shown that architecture-specific initializations, which are carefully derived to maintain stability, can promote convergence without needing normalization layers [5, 9–12]. Unfortunately, the reliance on analytically derived initializations makes it difficult to realize the benefits of these methods when performing architecture search, training networks with branched or heterogeneous components, or proposing altogether new architectures.
|
| 22 |
+
|
| 23 |
+
In this work, we propose a simple method for learning the initialization of a network with any architecture. Typically, initialization schemes draw parameters independently from a zero-mean distribution, with the variance of each distribution set to pre-determined values depending on the dimensions of the layers [1, 2]. Rather than deriving a closed-form expression for the these distribution parameters, our method re-scales each random weight tensor (e.g. convolution kernels) directly by a learned scalar coefficient. This small set of coefficients is optimized to make the first step of a stochastic optimizer (e.g. SGD or Adam) as effective as possible at minimizing the training loss, while preventing the initial gradient norm from exploding. In addition, this process is designed to take into account the direction, step size, and stochasticity of the optimizer. Finally, after the variance has been learned for each parameter tensor, the random network parameters are re-scaled and optimization proceeds as normal. We empirically find that our methods can make the initialization fall into a smooth loss region, reduce the inter-sample gradient variance, and accelerates training.
|
| 24 |
+
|
| 25 |
+
Our proposed method, GradInit, is architecture agnostic, and works with both Adam and SGD optimizers. In the vision domain, we show it accelerates the convergence and test performance of a variety of deep architectures, from the vanilla feed-forward VGG net to ResNet, with or without Batch Normalization. It is efficient and scalable, finding good initializations using less than $1 \%$ of the total training time in our experiments, and it improves the initialization of ResNet-50 on ImageNet to obtain better final test accuracy. In the language domain, GradInit enables training the original Transformer model $\mathbb { \left[ 3 \right] }$ using either Adam or SGD without learning rate warmup for machine translation, which is commonly acknowledged to be difficult [4, 13]. As an extreme example of the capabilities of GradInit, we use it to initialize and train a 1202-layer ResNet that achieves significantly higher test accuracy than ResNet-110, which other initialization methods have failed to achieve.
|
| 26 |
+
|
| 27 |
+
Finally, by visualizing the initial norms and gradient variances of the weights before and after GradInit is applied, we show that GradInit is a useful tool for identifying potential causes for instability at initialization, such as those imposed by normalization layers, and we summarize interesting scale patterns learned by GradInit that can be helpful for designing better initialization rules.
|
| 28 |
+
|
| 29 |
+
# 2 Related Work
|
| 30 |
+
|
| 31 |
+
Controlling the norms of network parameters at initialization has proven to be an effective approach for speeding up and stabilizing training. Glorot and Bengio $\mathbb { M }$ studied how the variance of features evolves with depth in feed-forward linear neural networks by assuming both activations and weight tensors are independent and identical random variables. They developed a technique in which the variance of each filter scales with its fan-in (the number of input neurons). This style of analysis was later generalized to the case of ReLU networks $\pmb { \mathbb { Z } } ] \mathbf { l }$ . These two analyses are most effective for feed-forward networks without skip connections or normalization layers. Based on the orthogonal initialization scheme $\pmb { \mathbb { I } }$ , Mishkin and Matas $\mathbb { \left. \boldsymbol { \cdot } \boldsymbol { \cdot } \right. }$ proposed an iterative procedure to rescale the orthogonally initialized weights of each layer in feedforward networks so that the activations of that layer have unit variance. However, this method fails to prevent the blowup of activations with depth for ResNets [16]. Recently, Gurbuzbalaban and Hu $\mathbb { \ m }$ proposed initialization schemes such that the network can provably preserve any given moment of order $s \in ( 0 , 2 ]$ for the output of each layer. The motivation is that the stochastic gradient updates can result in heavy-tailedness in the distribution of the network weights with a potentially infinite variance, but finite $s$ -order moment $\mathbb { \lVert 1 8 \rVert }$ . Again, these initialization schemes can only be applied for feed-forward neural networks.
|
| 32 |
+
|
| 33 |
+
For more complex architectures, normalization layers $\mathbb { I m } \mathbb { Q } \mathbb { L O } \mathbb { I }$ and skip connections $\pmb { \mathbb { Z } } 1 \Vert$ stabilized training dynamics and improved the state-of-the-art. Similarly, learning rate warmup is a common trick for training large Transformers $\mathbb { \left[ 3 \right] }$ . These methods make training tractable for some models, but do not eliminate the high initial gradient variance that destabilizes training when the network is deep [9–11] or when the normalization layers are not carefully positioned [4].
|
| 34 |
+
|
| 35 |
+
Several authors have proposed better initializations for networks with skip connections. This is often achieved by replacing the normalization layers with simpler scaling or bias operations, and scaling the weight matrices in each layer so that the variance of activations does not increase with depth [9– 12]. Similar analysis has been applied to self attention in Transformers [5]. Without removing the normalization layers, it is possbile to stabilize the initial parameter updates by introducing carefully initialized learnable scale factors to the skip connections $\pmb { \Vert 6 \Vert }$ or the residual branches $[ [ 2 2 ] ]$ . However, such techniques are often restricted to one specific architecture such as ResNets.
|
| 36 |
+
|
| 37 |
+
Recently, Dauphin and Schoenholz $\boxed { \boxed { 1 6 } }$ proposed a task-agnostic and automatic initialization method, MetaInit, for any neural network achitecture. MetaInit optimized the norms of weight tensors to minimize the “gradient quotient”, which measures the effect of curvature near the initial parameters, on minibatches of random Gaussian samples. However, as training data is usually accessible for most tasks of interest, it is simpler and potentially more efficient to use the training data for initialization. MetaInit also involves the gradient of a Hessian-vector product that requires computing a “gradient of the gradient” multiple times in tandem, which is very computationally intensive. Our proposed method distinguishes itself from MetaInit in the following ways: (i) Our method is more computationally efficient. MetaInit involves computing third-order derivatives, results in long computing times and high memory usage. The memory overhead of MetaInit is more of an issue for networks with normalization layers. For the relatively small-scale CIFAR-10 problem with batch size 64, MetaInit requires three GPUs (RTX 2080Ti), while the proposed GradInit needs just one. (ii) Our method takes the stochasticity of minibatches into consideration. MetaInit uses the local curvature evaluated on a single minibatch, which fails to capture the variance of the loss/gradient between two different stochastic minibatches. (iii) Our method considers the training dynamics of different optimization algorithms including the learning rate and the direction of the gradient step, and effectively handles different optimizers including SGD and Adam.
|
| 38 |
+
|
| 39 |
+
# 3 Method
|
| 40 |
+
|
| 41 |
+
We aim to develop an initialization scheme applicable to arbitrary network architectures. Since previous works [1, 2, 9, 16, 10, 12] have shown that the initial weight norms effectively control the initial gradient norm on average, our method rescales the randomly initialized weight matrices using learnable scale factors.1
|
| 42 |
+
|
| 43 |
+
Using a small number of gradient descent steps on these scale factors, the proposed GradInit method chooses the initialization scalars so that the loss after the first gradient step taken by a stochastic optimizer (SGD or Adam) is as low as possible. The process of learning initialization coefficients accounts for the chosen learning rate, optimizer, and other parameters. To prevent gradient explosion, our method enforces a constraint that the gradient norm is no larger than a constant $\gamma$ .
|
| 44 |
+
|
| 45 |
+
Note that for scale-invariant weights, e.g., convolution kernels before BN layers, rescaling still changes their learning dynamics by changing their effective learning rate $\pm \overbrace { 1 2 3 } , \textcircled { 2 4 } ]$ . Empirically, GradInit goes beyond simply preventing exploding or vanishing gradients; it also reduces the gradient variance, making the initialization fall into a smooth loss region with small gradient variance so that training is fast, see discussion about Figure $\bigstar$ and comparisons in Figure $\bigtriangledown$
|
| 46 |
+
|
| 47 |
+
# 3.1 Efficient Learning-based Initialization via Constrained Optimization
|
| 48 |
+
|
| 49 |
+
We begin by filling all the weight matrices $\{ W _ { 1 } , \hdots , W _ { M } \}$ of the network with values drawn from independent zero-mean Gaussian distributions, except for the scales and biases of the normalization layers (if any), which are initialized to 1 and 0 respectively. During the initialization process, we keep $\{ W _ { 1 } , \hdots , W _ { M } \}$ constant, but we multiply each $W _ { i }$ with a learnable non-negative scale factor $\alpha _ { i }$ (initialized to 1). After initialization, we rescale the weights by the learned scale factors, and start training without the learnable scale factors just as normal. We use $\pmb { m } = \{ \alpha _ { 1 } , . . . , \alpha _ { M } \}$ to denote the set of scale factors, and $\pmb { \theta } _ { m } = \{ \alpha _ { 1 } \pmb { W } _ { 1 } , \ldots , \alpha _ { M } \pmb { W } _ { M } \}$ is the set of rescaled weight matrices.
|
| 50 |
+
|
| 51 |
+
Let $\begin{array} { r } { L ( S ; \pmb { \theta } ) = \frac { 1 } { | S | } \sum _ { x \in S } \ell ( x ; \pmb { \theta } ) } \end{array}$ be the average loss of the model parameterized by $\pmb \theta$ on a minibatch of samples $S$ , where $| S |$ is the number of samples in the minibatch. We use $\pmb { g } _ { S , \pmb { \theta } } = \nabla _ { \pmb { \theta } } L ( S ; \pmb { \theta } )$ as a shorthand for the gradient of $\pmb { \theta }$ . During standard training, this gradient is preprocessed/preconditioned by the optimization algorithm $\mathcal { A }$ , and then used to update the network parameters. GradInit solves the following constrained optimization problem:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } { \underset { m } { \mathrm { m i n i m i z e } } } & { L ( \tilde { S } ; \pmb { \theta } _ { m } - \eta \mathcal { A } [ \pmb { g } _ { S , \pmb { \theta } _ { m } } ] ) , } \\ { \mathrm { s u b j e c t ~ t o ~ } } & { \| \pmb { g } _ { S , \pmb { \theta } _ { m } } \| _ { p , s } \le \gamma , } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $S$ and $\tilde { S }$ are two different minibatches, $\eta$ is a prescribed learning rate for the optimization algorithm $\mathcal { A }$ , $p _ { \mathcal { A } }$ is the $\ell _ { p }$ -norm associated with $\mathcal { A }$ , and $\gamma$ is the upper bound for the norm. For the first gradient step, Adam uses $\mathcal { A } [ g _ { S , \theta _ { m } } ] = \mathrm { s i g n } ( g _ { S , \theta _ { m } } ) \left[ \left[ 2 5 \right] \right]$ , while SGD uses $\mathcal { A } [ g ( S ; \theta _ { m } ) ] =$
|
| 58 |
+
|
| 59 |
+
$\gamma \pmb { g } ( S ; \pmb { \theta } _ { m } ) / \| \pmb { g } ( S ; \pmb { \theta } _ { m } ) \| _ { 2 }$ . We show how to choose $\gamma$ and $p _ { \cal A }$ without tuning in Section 3.3. We discuss the formulation of this problem and how to solve it below.
|
| 60 |
+
|
| 61 |
+
# 3.2 Solving the Constrained Problem
|
| 62 |
+
|
| 63 |
+
The problem $( 1 )$ is solved using a stochastic gradient descent method in which we sample new mini-batches on each iteration. Since the proposed method uses gradient updates to compute the initialization, we dub it GradInit. We propose a simple solver to optimize objective $( 1 )$ in Algorithm 1 A key feature of our method is that is makes a simple approximation: after $g _ { S , \theta _ { m } }$ is computed on the forward pass of an iteration, we treat $\mathcal { A } [ \pmb { g } _ { S } , \pmb { \theta } _ { m } ]$ as a constant and do not back-propagate through $\mathcal { A } [ \pmb { g } _ { S } , \pmb { \theta } _ { m } ]$ on the backward pass. We make this choice to keep computing costs low, and because it is not possible to back-propagate through the non-differentiable sign function for Adam.
|
| 64 |
+
|
| 65 |
+
Algorithm 1 GradInit for learning the initialization of neural networks.
|
| 66 |
+
|
| 67 |
+
<table><tr><td></td><td>1: Input: Target optimization algorithm Aand learning raten for model training, initial model parameters 0o, learningrateTof the GradInit scales m,total iterations T,upper boundof the gradienty,lower bound for</td><td></td></tr><tr><td>2:mi←1</td><td>the initialization scalars α= O.01.</td><td></td></tr><tr><td></td><td>3: for t = 1 to T do</td><td></td></tr><tr><td>4:</td><td>Sample St from training set.</td><td></td></tr><tr><td>5:</td><td>Lt←S l(xk;0mt),gt←VθLt</td><td></td></tr><tr><td>6:</td><td>if |lgtllpA >γ then</td><td></td></tr><tr><td>7:</td><td>mt+1 ← mt -TVmtllgtllpA</td><td></td></tr><tr><td>8:</td><td>else</td><td></td></tr><tr><td>9:</td><td>Sample St from training set.</td><td></td></tr><tr><td>10:</td><td>Lt+1←s∑x∈ste(xk;Omt-nAlgt])</td><td></td></tr><tr><td>11: 12:</td><td>mt+1←mt-TVmtLt+1</td><td></td></tr></table>
|
| 68 |
+
|
| 69 |
+
To enforce the constraint in $( 1 )$ , we test whether the constraint is satisfied after computing $\pmb { g } ( S ; \pmb { \theta } _ { m } )$ . If not, we take a gradient descent step to minimize $\| \pmb { g } ( S ; \pmb { \theta } _ { m } ) \| _ { p _ { A } }$ , which involves computing second A order derivatives. If the constraint is satisfied, then we instead compute a gradient descent step for the loss. In addition, we set a lower bound $\underline { { \alpha } } = 0 . 0 1$ for all $\alpha _ { i }$ . We find that this prevents scalars from landing on small values during minimization and keeps the GradInit optimizer stable. In our experiments, we find the only layer that ever hit this lower bound is the final FC layer on some networks (see the figures in Section $4 . 1 )$ . We find this procedure converges reliably within 2000 iterations for ImageNet, and fewer than 400 iterations for CIFAR-10, taking less than $1 \%$ of the total training time on both problems. We also find it works well to set the step size $\tau$ to values within the range between $1 0 ^ { - 3 }$ and $1 0 ^ { - 1 }$ . During initialization, the gradient norm constraint is satisfied for the majority of iterations. The choice of $\gamma , p _ { \mathcal { A } }$ will be discussed in Section $\underline { { \boldsymbol { \left. 3 . 3 \right. } } }$
|
| 70 |
+
|
| 71 |
+
Stochasticity of mini-batching. The objective in $( 1 )$ uses two different mini-batches; $S$ is used to compute the gradient, and $\tilde { S }$ is used to compute the loss. Ideally, $S$ and $\tilde { S }$ should be independently sampled from the training set to capture the randomness of the stochastic optimizer. However, when the network has large initial gradient variance, the gradients on $S$ and $\tilde { S }$ usually differ a lot, and for $\tilde { S }$ , the gradient update step $\theta _ { m } - \eta \mathcal { A } \left[ g _ { S , \theta _ { m } } \right]$ becomes more similar to adding random perturbations to the parameters. We find our objective less effective at accelerating convergence in this case, as shown by the first-epoch accuracy $( A c c _ { 1 } )$ in Table $^ { 1 . }$ On the other hand, the randomness is not captured if $S = \tilde { S }$ , and we find empirically that $\theta _ { m }$ can exploit the loss by increasing the gradient norm and destabilize training in this case (see Table $\textcircled{8}$ . Without excessive tuning, we find that we get more reliable behavior for different architectures when $\tilde { S }$ is a mixture of $50 \%$ samples from $S$ and $50 \%$ re-sampled training data, and use this setting by default unless otherwise stated.
|
| 72 |
+
|
| 73 |
+
Table 1: Accuracies on CIFAR-10 using different overlapping ratios of $\tilde { S }$ and $S$ for GradInit.
|
| 74 |
+
|
| 75 |
+
<table><tr><td>Model</td><td>Sns |S]</td><td>Acc1</td><td>AcCbest</td></tr><tr><td>VGG-19</td><td>0</td><td>21.9 ± 4.4</td><td>94.5 ± 0.1</td></tr><tr><td>w/o BN</td><td>0.5</td><td>29.3 ± 0.6</td><td>94.7± 0.02</td></tr><tr><td>(20.03 M)</td><td>1</td><td>28.7 ± 1.0</td><td>94.5 ± 0.1</td></tr></table>
|
| 76 |
+
|
| 77 |
+
# 3.3 Setting and Enforcing the Constraint
|
| 78 |
+
|
| 79 |
+
The constraint in $\mathbb { \underline { { ( 1 ) } } }$ is included to prevent the network from minimizing the loss in a trivial way by blowing up the initial gradient. In other words, we want the optimizer to achieve small loss by choosing an effective search direction rather than by taking an extremely large step in a sub-optimal direction.
|
| 80 |
+
|
| 81 |
+
Setting $p _ { \cal A }$ and $\gamma$ through first-order approximation. We show that $p _ { \mathcal { A } }$ and $\gamma$ can be set easily with a rule of thumb and without a parameter search. From the first-order approximation, we expect the first gradient step to result in a change in the loss on $S$ as following:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
L ( S ; \theta _ { m } - \eta \mathcal { A } [ g _ { S , \theta _ { m } } ] ) - L ( S ; \theta _ { m } ) \approx - \eta \mathcal { A } [ g _ { S , \theta _ { m } } ] ^ { T } g _ { S , \theta _ { m } } = \left\{ \begin{array} { l l } { - \eta \| g _ { S , \theta _ { m } } \| _ { 2 } ^ { 2 } , } & { \mathrm { i f ~ } \mathcal { A } \mathrm { ~ i s ~ S G D } , } \\ { - \eta \| g _ { S , \theta _ { m } } \| _ { 1 } , } & { \mathrm { i f ~ } \mathcal { A } \mathrm { ~ i s ~ A d a m } . } \end{array} \right.
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
To effectively bound the approximated change in Eq. $^ { 2 , }$ we choose $\ell _ { p _ { A } }$ to be the $\ell _ { 2 }$ and $\ell _ { 1 }$ norm for ASGD and Adam respectively, so when the constraint is satisifed, the maximum change in the loss, according to our local approximation, is $\eta \gamma ^ { 2 }$ for SGD and $\eta \gamma$ for Adam. We recommend setting $\gamma$ such that $\eta \gamma ^ { 2 } = 0 . 1$ for SGD and $\eta \gamma = 0 . 1$ for Adam. According to the linear approximations, this limits the gradient magnitude so that the first step of SGD can decrease the loss by at most 0.1. This simple rule was used across all vision and language experiments.
|
| 88 |
+
|
| 89 |
+
Why a constraint and not a penalty? Instead of formulating GradInit as a constrained optimization, one can alternatively formulate it as minimizing the objective with a gradient penalty: minimize $L ( \tilde { S } ; \theta _ { m } - \eta A \left[ \pmb { g } _ { S , \theta _ { m } } \right] ) + \lambda \Vert \pmb { g } _ { S ; \theta _ { m } } \Vert _ { p _ { A } }$ , where $\lambda > 0$ is the penalty strength.
|
| 90 |
+
|
| 91 |
+
The penalized objective has two drawbacks compared to the constrained one in Eq. $^ { 1 . }$ First, every gradient descent step on the penalized objective involves second-order gradients due to the gradient regularization, while the constrained form does not need second-order gradients when the constraint is satisfied. Second, it is difficult to choose a good $\lambda$ that works well for all architectures. By contrast, we set $\gamma$ by analyzing the first-order approximation mentioned above, and find the same $\gamma$ works well for different architectures. The results supporting these two points are given in Table 2.
|
| 92 |
+
|
| 93 |
+
Table 2: Time cost and accuracy (average of 4 runs) for running one epoch of regularization/constrained form of GradInit.
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Model</td><td>VGG-19 w/o BN</td><td>VGG-19 W/BN</td><td>ResNet-110 ResNet-110 w/o BN w/BN</td></tr><tr><td>Time (s)</td><td>82 vs.56</td><td>100 vs. 62</td><td>169 vs.103 269vs.195</td></tr><tr><td>入=10-4</td><td>32.3,94.6</td><td>10.6,93.1</td><td>33.7,93.9 32.4,95.2</td></tr><tr><td>入=10-2</td><td>30.4,94.5</td><td>10.4,93.0</td><td>36.7,94.1 32.6,95.3</td></tr><tr><td>入=1</td><td>18.2, 74.7</td><td>38.5,95.1</td><td>30.7,94.2 36.5,95.3</td></tr><tr><td>γ=1</td><td>29.3,94.7</td><td>47.8, 95.1</td><td>36.2,94.6 38.2, 95.4</td></tr></table>
|
| 96 |
+
|
| 97 |
+
# 4 Experiments
|
| 98 |
+
|
| 99 |
+
We evaluate GradInit on benchmark datasets for image classification and machine translation tasks. For image classification, five different architectures are evaluated for CIFAR10 [26], and ResNet-50 is evaluated for ImageNet [27]. For machine translation, we use GradInit to find good initializations for a Post-LN Transformer without any change to its original architecture on IWSLT-14 De-En [28]. We observe that the method can remove the necessity of any form of learning rate warmup for both Adam and SGD.
|
| 100 |
+
|
| 101 |
+
We conduct our experiments in PyTorch. We use the fairseq library for machine translation $\left[ \left[ 2 9 \right] \right]$ . All the experiments on CIFAR-10 and IWSLT-14 DE-EN can run with one single NVIDIA RTX 2080 Ti GPU with 11GB of RAM.
|
| 102 |
+
|
| 103 |
+
GradInit first initializes the weights using Kaiming initialization [2] for all the Conv and FC layers for image classification. For machine translation, we use the default Xavier initialization [1]. We optimize the scale factors $\left\{ \alpha _ { i } \right\}$ with Adam $\pmb { \mathbb { B } } 0 \|$ using the default momentum parameters.
|
| 104 |
+
|
| 105 |
+
# 4.1 Image Datasets with Various Architectures
|
| 106 |
+
|
| 107 |
+
The introduction of Batch Normalization (BN) $\mathbb { \lVert 1 9 \rVert }$ and skip connections makes it relatively easy to train common CNNs for image classification to achieve high accuracy. Despite this, we show that
|
| 108 |
+
|
| 109 |
+
when the network is very deep, the network is unstable even when both BN and skip connections are used, and GradInit can significantly improve the stability. The results on CIFAR-10 are given in Table 3 and results on ImageNet are given in Table 6.
|
| 110 |
+
|
| 111 |
+
# 4.1.1 Settings
|
| 112 |
+
|
| 113 |
+
Architectures. On CIFAR-10, we focus on the feedforward VGG net and the prevalent and powerful ResNet, with and without BN layers. For networks without BN, we use learnable biases in all layers. For ResNet, we additionally evaluate a deep 1202-layer version. We give results for other architectures (Wide ResNet, DenseNet) in Appendix E due to space limits. We compare with four different methods/settings: 1) Kaiming Initialization [2]; 2) First train the network for one epoch with a constant learning rate equal to the starting learning rate, labelled as $^ { 6 } { + } 1$ epoch (Const. LR)" in Table 3; 3) First train the network for one epoch with a linear warmup learning rate, labbeled as $^ { 6 6 } { + 1 }$ epoch (Warmup)" in Table 3; 4) MetaInit [16].
|
| 114 |
+
|
| 115 |
+
On ImageNet, we use the ResNet-50 model $\mathbb { \left| \mathbb { Z } \right\| }$ . We compare with Kaiming Initialization, FixUp initialization $[ [ 9 $ and MetaInit. For the ResNet-50 without BN, we follow the architecture of FixUp for fair comparisons, but we still use the original Kaiming initialization as the starting point of GradInit.
|
| 116 |
+
|
| 117 |
+
Hyperparameters. We set $\mathcal { A }$ to SGD and $\eta = 0 . 1$ (the same as the base learning rate) for GradInit in all image classification experiments. On CIFAR-10, we train networks with a batch size of 128. We find MetaInit often takes 2 to 3 times as much memory as GradInit. We run GradInit or MetaInit for one epoch on the data, which takes less than $1 \%$ of the total training time. For GradInit, according to our analysis in Section $^ { 3 . 3 , }$ we fix the gradient norm constraint $\gamma = 1$ in all these experiments. Therefore, as in MetaInit, the only hyperparameter that needs to be tuned is the learning rate $\tau$ of the scale factors. We do a grid search on $\tau$ in the range $[ 1 0 ^ { - 3 } , 1 0 ^ { - 1 } ]$ , and report the results with the best average final test accuracy on 4 runs. After GradInit initialization, we use a learning rate of 0.1 and the cosine annealing learning rate schedule without restart $\textcircled { \scriptsize { 1 3 1 } }$ to train the model for 200 epochs, where the learning rate decays after each iteration and decays to 0 in the last iteration. Due to their high initial gradient variance (see Figure $^ { 6 ) }$ , we have applied gradient clipping (maximum norm is 1) to all non-BN networks so that they converge without GradInit under the same schedule.
|
| 118 |
+
|
| 119 |
+
On ImageNet, we train the ResNet-50 model for 90 epochs with a total batch size of 256 on 4 GPUs. Due to the difference in the library for training and the number of GPUs used, which affects the BN statistics, our baseline top-1 accuracy of ResNet-50 (w/ BN) on ImageNet is $0 . 7 9 \%$ lower than $\pmb { \mathbb { B 2 } }$ . We use SGD with a starting learning rate of 0.1 and decay the learning rate by 10 after the $3 0 \mathrm { t h }$ and 60th epoch. We provide additional details in Appendix A.
|
| 120 |
+
|
| 121 |
+
# 4.1.2 Results and Analysis
|
| 122 |
+
|
| 123 |
+
Table 3: First epoch $( A c c _ { 1 } )$ and best test accuracy over all epochs $( A c c _ { b e s t } )$ for models on CIFAR-10. We report the mean and standard error of the test accuracies in 4 experiments with different random seeds. Best results in each group are in bold.
|
| 124 |
+
|
| 125 |
+
<table><tr><td colspan="2">Model (#Params)</td><td>VGG-19 w/o BN (20.03M)</td><td>VGG-19 w/BN (20.04M)</td><td>ResNet-110 w/o BN (1.72M)</td><td>ResNet-110 w/BN (1.73M)</td><td>ResNet-1202 w/BN (19.42M)</td></tr><tr><td rowspan="2">Kaiming</td><td>AcC1</td><td>29.1 ± 1.5</td><td>12.6 ± 0.6</td><td>16.1 ± 2.1</td><td>23.2 ± 0.9</td><td>12.9 ± 2.8</td></tr><tr><td>AcCbest</td><td>94.5 ± 0.1</td><td>94.4 ± 0.1</td><td>94.2 ± 0.1</td><td>95.0± 0.2</td><td>94.4 ± 0.6</td></tr><tr><td rowspan="2">+1 epoch (Const. LR)</td><td>Acc1</td><td>37.2 ± 1.1</td><td>19.6 ± 4.0</td><td>21.0 ± 3.8</td><td>32.5 ±3.8</td><td>12.6 ± 2.8</td></tr><tr><td>Accbest</td><td>94.4± 0.1</td><td>94.5 ± 0.1</td><td>93.9 ± 0.4</td><td>94.7 ± 0.3</td><td>94.0 ± 0.4</td></tr><tr><td rowspan="2">+1 epoch (Warmup)</td><td>Acc1</td><td>37.4 ±1.2</td><td>53.5 ± 2.9</td><td>19.8 ± 0.5</td><td>48.7 ± 1.1</td><td>28.1 ± 1.3</td></tr><tr><td>AcCbest</td><td>94.4 ± 0.1</td><td>94.7 ± 0.1</td><td>94.1 ± 0.1</td><td>95.1 ± 0.1</td><td>95.4± 0.2</td></tr><tr><td rowspan="2">MetaInit</td><td>AcC1</td><td>30.5± 0.9</td><td>35.1 ± 0.6</td><td>14.6 ± 2.2</td><td>29.0 ± 1.5</td><td>11.7 ± 1.6</td></tr><tr><td>AcCbest</td><td>94.6 ± 0.1</td><td>94.6 ± 0.1</td><td>94.2 ± 0.1</td><td>94.8 ± 0.1</td><td>95.0 ± 0.5</td></tr><tr><td rowspan="2">GradInit</td><td>AcC1</td><td>29.3±0.6</td><td>47.8 ± 1.8</td><td>36.2 ±0.8</td><td>38.2 ± 0.9</td><td>29.0 ± 1.1</td></tr><tr><td>Accbest</td><td>94.7 ± 0.1</td><td>95.1 ± 0.1</td><td>94.6 ± 0.1</td><td>95.4± 0.1</td><td>96.2 ± 0.1</td></tr></table>
|
| 126 |
+
|
| 127 |
+
GradInit further stabilizes feedforward nets with BN. BN does stabilize VGG-19 and allows training without gradient clipping, but with an average first-epoch test accuracy of only 12.57 and an average final test accuracy lower than the version without BN (see Table $3 )$ , it does not seem to eliminate the instability of Kaiming initialization. As shown in Figure $\bigtriangledown ,$ its initial gradient variance is still relatively high compared with GradInit. BN could magnify the gradient variance when the variance of its input features (in the forward pass) is smaller than 1 (see Appendix $\boxed { \mathbf { C } }$ . GradInit reduces the gradient variance by 4 orders of magnitude compared to Kaiming initialization , resulting in significantly higher test accuracy after the first epoch $( 4 7 . 7 9 \%$ vs. $1 2 . 5 7 \%$ ), which also has an impact on the final test accuracy $( 9 5 . 1 3 \%$ vs. $9 4 . 4 1 \%$ ). The reduction in gradient variance is achieved mainly by scaling down the weights of the final FC layer and the last 2 BN layers, so that the variance of the activations is reduced in the forward pass. This learned behavior is consistent with the strategy of FixUp, where the final FC layer is initialized to 0. Another source of gradient variance reduction is achieved by increasing the weight norms of the remaining Conv and BN layers, so that the variance of the inputs to the BN layers is increased and the gradient magnifying effect of BN is alleviated in the backward pass. This reduced the ratio $\sigma ( \pmb { g } _ { 1 } ) / \bar { \sigma } ( \pmb { g } _ { 1 6 } )$ from 204.9 to 164.8 for the Conv layers in Figure 4. By contrast, FixUp only reduces the weight norms, which may not always be the best solution for networks with normalization layers.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 1: Top row: results of ResNet-110 on CIFAR-10. Bottom row: results of ResNet-50 on ImageNet. Left two columns: compare the relative cross-batch gradient variance on the training set for the BN and Conv/FC layers before and after GradInit. Right two columns: weight norms before and after GradInit. Ratio between points in the same layer reflects the scale factor. Note each of the residual blocks has 2 and 3 Conv and BN layers for the ResNet-110 and ResNet-50, respectively. The initial relative gradient variance are reduced for all layers except the final linear layer in both settings. The strategies are similar on two different datasets. Within each residual block, the last BN layer has the smallest scaling factors, and the scales of all Conv layers are surprisingly increased. Best viewed in color.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Comparing the convergence of Kaiming Initialization and GradInit on CIFAR-10, for models trained with SGD (left three) and Adam (right).
|
| 134 |
+
|
| 135 |
+
Deep residual networks still need better initializations. We also gain significant improvements from GradInit for ResNet-110 and ResNet-1202. In ResNets, the skip connections cause the variance of activations to accumulate as the ResNet goes deeper, even for the version with BN $\mathbb { m }$ . This issue is more significant when the ResNet scales to 1202 layers, from which we can see that with Kaiming initialization, the first-epoch accuracy of ResNet-1202 is quite low, and the final test accuracy is even worse than the shallower ResNet-110, matching the observations of He et al. $\pmb { \mathbb { D } } \mathbf { 1 } \mathbf { h }$ . Warmup is even more effective than MetaInit at accelerating the convergence and improving the final test accuracy of ResNet-1202, but GradInit still outperforms its final test accuracy by $0 . 8 \%$ , and the resulting ResNet-1202 finally achieved higher accuracy than ResNet-110.
|
| 136 |
+
|
| 137 |
+
The learned layer-wise rescaling patterns of GradInit are even more interesting for ResNets with BN. For ResNets with BN, recall that we have two Conv layers and two BN layers in each residual block. As shown in Figure 1, GradInit learns to increase the weight norms of all the linear layers except for the final FC layer, instead of decreasing as for the case without BN (see Figure $6 )$ . A more unique pattern is the collaborative behavior of the BN weights, where the second BN in each residual block is usually scaled down while the first BN is always scaled up. In deeper layers, the joint effect of these two BN weights is to downscale the activations and reduce their variance in the forward pass, with a more significant reducing effect as the layers get deeper. Intuitively, the marginal utility of adding a new layer decreases with depth. Therefore, for deeper layers, GradInit learns to further downscale the residual branch, and prevents the variance from increasing too much in the forward pass. Inside each residual block, increasing the scale factors of the first BN helps to reduce the magnification effect of the second BN on the gradient; forcing the input activations to the second convolution to have variance larger than 1 ensures its variance after the following convolution layer does not go below 1, avoiding the magnification effect that the second BN has on the gradient variance. See Appendix C for more discussions about the magnifying effect.
|
| 138 |
+
|
| 139 |
+
Table 4: Comparing the results of GradInit with fixed BN scale parameters (Fix BN) and only rescale the BN parameters (Only BN).
|
| 140 |
+
|
| 141 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Kaiming</td><td colspan="2">GradInit</td><td colspan="2">GradInit (Fix BN)</td><td rowspan="2">GradInit (Only BN) Accbest</td></tr><tr><td>Acco</td><td>Accbest</td><td>Acco</td><td>Accbest</td><td>Acco Accbest</td><td>Acco</td></tr><tr><td>VGG-19 (w/ BN)</td><td>12.6 ±0.6 94.4 ± 0.1 47.8 ± 1.8 95.1 ± 0.1 13.1 ± 0.9 94.6 ±0.1 14.4 ± 2.1 94.4 ± 0.1</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ResNet-110(w/BN) 23.2±0.9 95.0 ±0.2 38.2 ±0.9 95.4 ± 0.1 24.7±3.1 94.7±0.3 25.4±3.1 94.6± 0.3</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 5: Comparing the results with multiplying each weight matrix with a learnable scaler (Learning Scalars) on CIFAR10. The VGG-19 model is not able to converge unless we reduce the initial learning rate to 0.01, which obtained worse final accuracy. The ResNet-110 model’s $A c c _ { 0 }$ was $10 \%$ for 2 of the 4 runs.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td colspan="2">Learning Scalars</td><td colspan="2">GradInit</td></tr><tr><td></td><td>Acco</td><td>Accbest</td><td>Acco</td><td>AcCbest</td></tr><tr><td>VGG-19 (w/BN,Ir=0.1)</td><td>10.0±0.0</td><td></td><td>10.0±0.0 47.8±1.8 95.1±0.1</td><td></td></tr><tr><td>VGG-19 (w/BN,Ir=0.01) 50.6±0.8</td><td></td><td>93.4 ±0.1</td><td></td><td>=</td></tr><tr><td>ResNet-110 (w/BN)</td><td>21.5 ± 6.9</td><td></td><td>94.7 ± 0.1 38.2 ± 0.9 95.4 ± 0.1</td><td></td></tr></table>
|
| 146 |
+
|
| 147 |
+
Generalizing to Adam. Models in previous experiments are trained with SGD. We also consider the case when $\mathcal { A }$ is Adam and use AdamW $\mathbb { \lVert 3 3 \rVert }$ to train the ResNet-110 (w/ BN) model on CIFAR-10. Following $\pmb { \mathbb { B 4 } }$ , we use a cosine annealing learning rate schedule with initial learning rate $3 \times 1 0 ^ { - 3 }$ and weight decay 0.2. For GradInit, we set $\gamma = 2 5$ . The $A c c _ { 1 }$ and $A c c _ { b e s t }$ of Kaiming initialization and GradInit are $( 3 6 . 6 \pm 4 . 7$ , $9 4 . 9 \pm 0 . 1 )$ and $( 4 0 . 2 \pm 0 . 2$ , $9 5 . 3 \pm 0 . 1 )$ , respectively. We also show the per-epoch test accuracy in Figure 2.
|
| 148 |
+
|
| 149 |
+
The importance of rescaling BN layers. The scale parameters of BN layers usually controls the variance of activations and gradients in the forward and backward passes, while the linear layers right before the BN layers are scale-invariant. Although changing the magnitudes of the scale-invariant layers affect their learning dynamics $\mathbb { \left| \sum 3 \right| \left| \sum 4 \right| }$ , we find it important for GradInit to rescale both BN and other linear layers, as shown in Table 4.
|
| 150 |
+
|
| 151 |
+
The importance of GradInit’s objective. GradInit is designed to rescale the layers to solve the constrained optimization problem in Eq. $^ { 1 . }$ Simply letting the model to learn to rescale the layers cannot improve the results, and sometimes further causes instability, as shown in Table $5 .$ We hypothesize that the bad results with VGG are due to a mismatch between the scales/norms of the gradients of the scalars and the weights. To make this alternative work, we may need to set different learning rates for the scalars and the weights, which adds to the difficulty of hyperparameter tuning. Note we do not learn the scalars when training networks initialized by GradInit.
|
| 152 |
+
|
| 153 |
+
Table 6: $A c c _ { 1 } / A c c _ { b e s t }$ of ResNet-50 models on ImageNet. Result of MetaInit comes from Dauphin and Schoenholz $[ [ 1 6 ] ]$ and we reimplemented the rest.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>Kaiming</td><td>FixUp</td><td>MetaInit</td><td>GradInit</td></tr><tr><td>w/BN</td><td>14.6/75.9</td><td>1</td><td>-</td><td>19.2/76.2</td></tr><tr><td>w/o BN</td><td>1</td><td>18.0/75.7</td><td>-/75.4</td><td>19.2/75.8</td></tr></table>
|
| 156 |
+
|
| 157 |
+
GradInit scales to ImageNet. As shown in Table $6 ,$ GradInit also accelerates convergence and improves test accuracy of ResNet-50 on ImageNet, with or without BN layers, despite having to use a smaller batch size for GradInit than training due to our GPU memory limit. The acceleration achieved by GradInit is even more significant than FixUp, even on the network with the architecture designed for the initialization.
|
| 158 |
+
|
| 159 |
+
# 4.2 Training the Original Transformer Model without Warmup
|
| 160 |
+
|
| 161 |
+
For a Transformer model to converge, either an explicit or implicit learning rate warmup stage is needed, especially for the original Transformer architecture. It is observed that this Post-LN architecture tends to outperform the Pre-LN model $\textcircled { 6 }$ while having higher gradient variance at initialization [4]. Is it believed that this high variance makes a warmup stage inevitable. Previous works that removes the warmup stage often involves architectural changes, e.g., removing Layer Normalizations, since it can surprisingly cause instability [4]. Here, we show that with a proper initialization, we can do away with the warmup stage for the original Post-LN Transformer without any modification to the architecture. Table 7 summarizes the architectural changes and best results of methods for improving the initialization of Post-LN Transformers. We compare the stability of the GradInit and Admin initialization methods without warmup in Figure 3.
|
| 162 |
+
|
| 163 |
+
Table 7: A comparison of GradInit with with the results from the papers (top 4 rows), and our reimplementation of Admin for training the Post-LN Transformer model on the IWSLT-14 De-EN dataset. “Standard" refers to training with standard initialization and warmup.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Method</td><td>Remove LN</td><td>Wskip</td><td>Warmup</td><td>Optimizer</td><td>BLEU</td></tr><tr><td>Standard [6</td><td></td><td></td><td>√</td><td>RAdam</td><td>35.6</td></tr><tr><td>FixUp 回</td><td>√</td><td></td><td>√</td><td>Adam</td><td>34.5</td></tr><tr><td>T-FixUp[5]</td><td></td><td></td><td></td><td>Adam</td><td>35.5</td></tr><tr><td>Admin 回</td><td></td><td>√</td><td></td><td>RAdam</td><td>35.7</td></tr><tr><td>Admin</td><td></td><td>√</td><td></td><td>Adam</td><td>36.1</td></tr><tr><td>Admin</td><td></td><td>√</td><td></td><td>SGD</td><td>33.7</td></tr><tr><td>GradInit</td><td></td><td>√</td><td></td><td>Adam</td><td>36.0</td></tr><tr><td>GradInit</td><td></td><td></td><td></td><td>Adam</td><td>36.1</td></tr><tr><td>GradInit</td><td></td><td></td><td></td><td>SGD</td><td>35.6</td></tr></table>
|
| 166 |
+
|
| 167 |
+
# Dataset, Architecture, & Hyperparameters.
|
| 168 |
+
|
| 169 |
+
IWSLT’14 DE-EN $\pmb { \pmb { 2 8 } }$ is a German to English translation dataset that has $1 6 0 \mathrm { k }$ training examples. Our Transformer model is inherited from $\mathbf { \widehat { \mathbb { B } } }$ , which is a Post-LN Transformer placing its Layer Normalization after the summation of the skip connection and the residual branch. It has a 512- dimensional word embedding layer and 1024 dimensions in its hidden FFN layer. We also apply GradInit to the variant from Admin $\textcircled { 6 }$ , where a learnable vector ${ { \pmb w } _ { s k i p } }$ is element-wise multiplied with each dimension of the skip connection, but we initialize it to 1 for GradInit. Please refer to $\dot { \left. \left[ 6 \right] \right. }$ for how Admin initializes these weights. Following $\textcircled { 6 }$ , we use a linearly decaying learning rate schedule that decays from the maximum learning rate $\eta _ { \mathrm { m a x } }$ to 0 as the model trains for 100K iterations. For training with SGD, we set the prescribed learning rate $\eta _ { \mathrm { m a x } } = 0 . 1 5$ , and use $\eta = 0 . 1 5 , \gamma = 1$ for GradInit. We do a grid search on $\eta _ { \mathrm { m a x } }$ for Admin and report its best result in Table $\perp$ For training with Adam, we set $\dot { \eta } = 5 \times 1 0 ^ { - 4 } , \dot { \gamma } = 1 0 ^ { 3 }$ for the objective of GradInit, so that $\eta \gamma$ is $O ( 1 0 ^ { - 1 } )$ as discussed in Section 3.3. We train the initialized model $\eta _ { \mathrm { m a x } }$ and $\beta _ { 2 }$ as listed in Figure $3 .$ We evaluate the BLEU score every epoch, and report the best BLEU scores throughout training for each run. For GradInit, we set the maximum number of iterations $T$ to 780. By comparison, the warmup stage usually takes 4000 iterations, and we find that if we use 780 steps for warmup, the model does not converge with $\eta _ { \mathrm { m a x } } \ge 3 \times 1 0 ^ { - 4 }$ . For $\eta _ { \mathrm { m a x } } = 2 \times 1 0 ^ { - 4 }$ with 780-step warmup, the BLEU score is 35.4, worse than GradInit’s 36.0, showing the advantage of GradInit against warmup.
|
| 170 |
+
|
| 171 |
+
Stability after removing warmup for Adam. In Figure $\boxed { 3 }$ , the training process becomes more unstable as $\beta _ { 2 }$ grows larger. From the analysis of RAdam $[ \overbrace { 3 5 } ] ]$ , this is because the variance of the gradient has a stronger impact on the adaptive learning rate when $\beta _ { 2 }$ is closer to 1. Therefore, the largest $\beta _ { 2 } < 1$ that maintains the performance of the trained model reflects the stability of the initialization. We can see GradInit results in more stable models than Admin in general, though their best performance numbers are almost the same. In addition, we find ${ { \pmb w } _ { s k i p } }$ can help stabilize training in extreme hyper parameter settings, e.g., at $\eta _ { \mathrm { m a x } } = 5 \times 1 0 ^ { - 4 }$ and $\beta _ { 2 } = 0 . 9 9 5$ in Figure $\bigtriangledown _ { \ b { \lambda } }$ GradInit with ${ { \pmb w } _ { s k i p } }$ obtains a good average BLEU score of 36.0, while without ${ { \pmb w } _ { s k i p } }$ only succeeded in obtaining a BLEU score $> 3 5$ for one out of four experiments, resulting in an average BLEU score of 8.9.
|
| 172 |
+
|
| 173 |
+
We also find the network is unable to be trained without learning rate warmup if we just fix ${ { \pmb w } _ { s k i p } }$ to its initial value given by Admin and leave the initialization of other parameters unchanged. Nevertheless, with GradInit, we do not need to modify the architecture of Post-LN Transformer to obtain the same good result as Admin. For a closer look at the stabilization mechanism, we show the weight norms and gradient variance at initialization of the original Post-LN architecture using GradInit and Xavier initialization in Figure 9 of the Appendix. For Xavier initialization, the gradient variance is relatively higher for all encoder layers, so GradInit downscales the encoder layer weights more in general. For the LN weights, GradInit only
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: BLEU scores for the Post-LN Transformer without learning rate warmup using Adam on IWSLT-14 DE-EN under different learning rates $\eta _ { \mathrm { m a x } }$ ( $y$ axis) and $\beta _ { 2 }$ $x$ axis). Each result is averaged over 4 experiments.
|
| 177 |
+
|
| 178 |
+
downscales the final LN of both the encoder and decoder, which reduces the variance of the encoder and decoder during the forward pass. Another strategy GradInit learns is to downscale the weights of the output projection and the FFN layers, so that the residual branch is relatively down-weighted compared with the skip connection, similar to Admin.
|
| 179 |
+
|
| 180 |
+
Removing warmup without architectural change. Another widely observed phenomenon is that adaptive methods such as Adam seem to be much better than SGD for training Transformer-based language models [13]. Table 7 shows that, with GradInit, we can find a good initialization for the Post-LN Transformer on IWSLT-14 DE-EN that trains using SGD without learning rate warmup nor gradient clipping, and achieves performance close to Adam trained using the same type of learning rate schedule. By comparison, Admin also makes the Transformer trainable with SGD, but the BLEU score is lower than the one initialized with GradInit. By comparing Figures 9 and $1 0$ in the Appendix, we find GradInit for Adam and SGD adopts different rescaling patterns, with the Adam version depending more on downscaling the residual branches through the FFN and output projection layers than the SGD version, and the SGD version downscaling more in the final FFN block of the decoder. This highlights the importance of considering the optimization algorithm $\mathcal { A }$ in GradInit, and also indicates the presence of different ways to reduce the initial gradient variance.
|
| 181 |
+
|
| 182 |
+
# 5 Conclusion
|
| 183 |
+
|
| 184 |
+
In this paper, we propose GradInit, a gradient-based initialization scheme for any architecture. GradInit reinitializes a network by learning a scale factor for each randomly initialized parameter block of a network, so that the training loss evaluated on a different minibatch after one gradient step of a specific stochastic optimizer is minimized. Such a design takes the stochasticity, the learning rate, and the direction of the optimizer into account, allowing us to find better initializations tailored for the optimizer. The initialization learned by GradInit often decreases the gradient variance for most of the parameter blocks. We show that GradInit accelerates the convergence and improves the test performance of a variety of architectures on image classification. It also enables training the Post-LN Transformer without any form of learning rate warmup, even for SGD. GradInit can be a useful tool in the future discovery of better neural architectures that are otherwise discarded due to poor initializations. By analyzing the learned scaling coefficients and their impact on gradient variance, it can also serve a guide to design better initialization schemes for complex architectures to shorten the training schedule and save energy.
|
| 185 |
+
|
| 186 |
+
# 6 Acknowledgement
|
| 187 |
+
|
| 188 |
+
This project was supported by the Office of Naval Research, AFOSR MURI program, the DARPA Young Faculty Award, and the National Science Foundation Division of Mathematical Sciences. Additional support was provided by Capital One Bank and JP Morgan Chase.
|
| 189 |
+
|
| 190 |
+
References
|
| 191 |
+
[1] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010.
|
| 192 |
+
[2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In CVPR, 2015.
|
| 193 |
+
[3] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, pages 5998–6008, 2017.
|
| 194 |
+
[4] 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 ICML, 2020.
|
| 195 |
+
[5] Xiao Shi Huang, Felipe Perez, Jimmy Ba, and Maksims Volkovs. Improving transformer optimization through better initialization. In ICML, 2020.
|
| 196 |
+
[6] Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. Understanding the difficulty of training transformers. EMNLP, 2020.
|
| 197 |
+
[7] 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.
|
| 198 |
+
[8] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. NeurIPS, 2020.
|
| 199 |
+
[9] Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. In ICLR, 2019.
|
| 200 |
+
[10] Soham De and Sam Smith. Batch normalization biases residual blocks towards the identity function in deep networks. NeurIPS, 2020.
|
| 201 |
+
[11] Andrew Brock, Soham De, and Samuel L Smith. Characterizing signal propagation to close the performance gap in unnormalized resnets. ICLR, 2021.
|
| 202 |
+
[12] Andrew Brock, Soham De, Samuel L. Smith, and Karen Simonyan. High-performance largescale image recognition without normalization. arXiv preprint arXiv:2102.06171, 2021.
|
| 203 |
+
[13] Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim, Sashank J Reddi, Sanjiv Kumar, and Suvrit Sra. Why are adaptive methods good for attention models? NeurIPS, 2020.
|
| 204 |
+
[14] Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. ICLR, 2014.
|
| 205 |
+
[15] Dmytro Mishkin and Jiri Matas. All you need is a good init. ICLR, 2016.
|
| 206 |
+
[16] Yann N Dauphin and Samuel Schoenholz. Metainit: Initializing learning by learning to initialize. In NeurIPS, pages 12645–12657, 2019.
|
| 207 |
+
[17] Mert Gurbuzbalaban and Yuanhan Hu. Fractional moment-preserving initialization schemes for training deep neural networks. In International Conference on Artificial Intelligence and Statistics, pages 2233–2241. PMLR, 2021.
|
| 208 |
+
[18] Charles H Martin and Michael W Mahoney. Traditional and heavy-tailed self regularization in neural network models. arXiv preprint arXiv:1901.08276, 2019.
|
| 209 |
+
[19] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456, 2015.
|
| 210 |
+
[20] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 211 |
+
[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 212 |
+
[22] Thomas Bachlechner, Bodhisattwa Prasad Majumder, Huanru Henry Mao, Garrison W Cottrell, and Julian McAuley. Rezero is all you need: Fast convergence at large depth. arXiv preprint arXiv:2003.04887, 2020.
|
| 213 |
+
[23] Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch normalization. In International Conference on Learning Representations, 2019.
|
| 214 |
+
[24] Ruosi Wan, Zhanxing Zhu, Xiangyu Zhang, and Jian Sun. Spherical motion dynamics of deep neural networks with batch normalization and weight decay. arXiv preprint arXiv:2006.08419, 2020.
|
| 215 |
+
[25] Lukas Balles and Philipp Hennig. Dissecting adam: The sign, magnitude and variance of stochastic gradients. In ICML, pages 404–413, 2018.
|
| 216 |
+
[26] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 217 |
+
[27] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009.
|
| 218 |
+
[28] Mauro Cettolo, Jan Niehues, Sebastian Stüker, Luisa Bentivogli, and Marcello Federico. Report on the 11th iwslt evaluation campaign, iwslt 2014. In IWSLT, volume 57, 2014.
|
| 219 |
+
[29] Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In NAACL-HLT (Demonstrations), 2019.
|
| 220 |
+
[30] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR, 2015.
|
| 221 |
+
[31] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 222 |
+
[32] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 223 |
+
[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018.
|
| 224 |
+
[34] Chen Zhu, Yu Cheng, Zhe Gan, Furong Huang, Jingjing Liu, and Tom Goldstein. Maxva: Fast adaptation of step sizes by maximizing observed variance of gradients. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 628–643. Springer, 2021.
|
| 225 |
+
[35] Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. ICLR, 2020.
|
| 226 |
+
[36] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 227 |
+
[37] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 228 |
+
[38] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 229 |
+
[39] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 230 |
+
[40] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. ICLR, 2018.
|
| 231 |
+
[41] Jeremy Bernstein, Yu-Xiang Wang, Kamyar Azizzadenesheli, and Animashree Anandkumar. signsgd: Compressed optimisation for non-convex problems. In ICML, 2018.
|
| 232 |
+
|
| 233 |
+
# Checklist
|
| 234 |
+
|
| 235 |
+
1. For all authors...
|
| 236 |
+
|
| 237 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 238 |
+
(b) Did you describe the limitations of your work? [Yes] One limitation of our current work is we have not checked whether GradInit can improve the training of models from other domains such as speech.
|
| 239 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 240 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 241 |
+
|
| 242 |
+
2. If you are including theoretical results...
|
| 243 |
+
|
| 244 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 245 |
+
|
| 246 |
+
3. If you ran experiments...
|
| 247 |
+
|
| 248 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
|
| 249 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 250 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 251 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 252 |
+
|
| 253 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 254 |
+
|
| 255 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 256 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 257 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 258 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 259 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 260 |
+
|
| 261 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 262 |
+
|
| 263 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 264 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 265 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/fylclEqgvgd/fylclEqgvgd.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRANSFORMER PROTEIN LANGUAGE MODELS ARE UNSUPERVISED STRUCTURE LEARNERS
|
| 2 |
+
|
| 3 |
+
Roshan Rao∗
|
| 4 |
+
UC Berkeley
|
| 5 |
+
rmrao@berkeley.edu
|
| 6 |
+
|
| 7 |
+
Joshua Meier Facebook AI Research jmeier@fb.com
|
| 8 |
+
|
| 9 |
+
Tom Sercu Facebook AI Research tsercu@fb.com
|
| 10 |
+
|
| 11 |
+
Sergey Ovchinnikov Harvard University ${ \mathsf { S O } } { \mathbb { Q } } { \mathsf { q } }$ .harvard.edu
|
| 12 |
+
|
| 13 |
+
Alexander Rives
|
| 14 |
+
Facebook AI Research & New York University
|
| 15 |
+
arives@cs.nyu.edu
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
Unsupervised contact prediction is central to uncovering physical, structural, and functional constraints for protein structure determination and design. For decades, the predominant approach has been to infer evolutionary constraints from a set of related sequences. In the past year, protein language models have emerged as a potential alternative, but performance has fallen short of state-of-the-art approaches in bioinformatics. In this paper we demonstrate that Transformer attention maps learn contacts from the unsupervised language modeling objective. We find the highest capacity models that have been trained to date already outperform a stateof-the-art unsupervised contact prediction pipeline, suggesting these pipelines can be replaced with a single forward pass of an end-to-end model.1
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
Unsupervised modeling of protein contacts has an important role in computational protein design (Russ et al., 2020; Tian et al., 2018; Blazejewski et al., 2019) and is a central element of all current state-of-the-art structure prediction methods (Wang et al., 2017; Senior et al., 2020; Yang et al., 2019). The standard bioinformatics pipeline for unsupervised contact prediction includes multiple components with specialized tools and databases that have been developed and optimized over decades. In this work we propose replacing the current multi-stage pipeline with a single forward pass of a pre-trained end-to-end protein language model.
|
| 24 |
+
|
| 25 |
+
In the last year, protein language modeling with an unsupervised training objective has been investigated by multiple groups (Rives et al., 2019; Alley et al., 2019; Heinzinger et al., 2019; Rao et al., 2019; Madani et al., 2020). The longstanding practice in bioinformatics has been to fit linear models on focused sets of evolutionarily related and aligned sequences; by contrast, protein language modeling trains nonlinear deep neural networks on large databases of evolutionarily diverse and unaligned sequences. High capacity protein language models have been shown to learn underlying intrinsic properties of proteins such as structure and function from sequence data (Rives et al., 2019).
|
| 26 |
+
|
| 27 |
+
A line of work in this emerging field proposes the Transformer for protein language modeling (Rives et al., 2019; Rao et al., 2019). Originally developed in the NLP community to represent long range context, the main innovation of the Transformer model is its use of self-attention (Vaswani et al., 2017). Self-attention has particular relevance for the modeling of protein sequences. Unlike convolutional or recurrent models, the Transformer constructs a pairwise interaction map between all positions in the sequence. In principle this mechanism has an ideal form to model protein contacts.
|
| 28 |
+
|
| 29 |
+
In theory, end-to-end learning with a language model has advantages over the bioinformatics pipeline: (i) it replaces the expensive query, alignment, and training steps with a single forward pass, greatly accelerating feature extraction; and (ii) it shares parameters for all protein families, enabling generalization by capturing commonality across millions of evolutionarily diverse and unrelated sequences.
|
| 30 |
+
|
| 31 |
+
We demonstrate that Transformer protein language models learn contacts in the self-attention maps with state-of-the-art performance. We compare ESM-1b (Rives et al., 2020), a large-scale (650M parameters) Transformer model trained on UniRef50 (Suzek et al., 2007) to the Gremlin (Kamisetty et al., 2013) pipeline which implements a log linear model trained with pseudolikelihood (Balakrishnan et al., 2011; Ekeberg et al., 2013). Contacts can be extracted from the attention maps of the Transformer model by a sparse linear combination of attention heads identified by logistic regression. ESM-1b model contacts have higher precision than Gremlin contacts. When ESM and Gremlin are compared with access to the same set of sequences the precision gain from the protein language model is significant; the advantage holds on average even when Gremlin is given access to an optimized set of multiple sequence alignments incorporating metagenomics data.
|
| 32 |
+
|
| 33 |
+
We find a linear relationship between language modeling perplexity and contact precision. We also find evidence for the value of parameter sharing: the ESM-1b model significantly outperforms Gremlin on proteins with low-depth MSAs. Finally we explore the Transformer language model’s ability to generate sequences and show that generated sequences preserve contact information.
|
| 34 |
+
|
| 35 |
+
# 2 BACKGROUND
|
| 36 |
+
|
| 37 |
+
Multiple Sequence Alignments (MSAs) A multiple sequence alignment consists of a set of evolutionarily related protein sequences. Since real protein sequences are likely to have insertions, deletions, and substitutions, the sequences are aligned by minimizing a Levenshtein distance-like metric over all the sequences. In practice heuristic alignment schemes are used. Tools like Jackhmmer and HHblits can increase the number and diversity of sequences returned by iteratively performing the search and alignment steps (Johnson et al., 2010; Remmert et al., 2012).
|
| 38 |
+
|
| 39 |
+
Metrics For a protein of length $L$ , we evaluate the precision of the top $L , L / 2$ , and $L / 5$ contacts for short range $( | i - j | \in [ 6 , 1 2 ) \rangle$ , medium range $( | i - j | \in [ 1 2 , 2 4 ) )$ , and long range $. | i = j | \in$ $[ 2 4 , \infty )$ ) contacts. We also separately evaluate local contacts $( | i - j | \in [ 3 , 6 )$ ) for secondary structure prediction in Appendix A.9. In general, all contacts provide information about protein structure and important interactions, with shorter-range contacts being useful for secondary and local structure, while longer range contacts are useful for determining global structure (Taylor et al., 2014).
|
| 40 |
+
|
| 41 |
+
# 3 RELATED WORK
|
| 42 |
+
|
| 43 |
+
There is a long history of protein contact prediction (Adhikari & Cheng, 2016) both from MSAs, and more recently, with protein language models.
|
| 44 |
+
|
| 45 |
+
Supervised contact prediction Recently, supervised methods using deep learning have resulted in breakthrough results in supervised contact prediction (Wang et al., 2017; Jones & Kandathil, 2018; Yang et al., 2019; Senior et al., 2020; Adhikari & Elofsson, 2020). State-of-the art methods use deep residual networks trained with supervision from many protein structures. Inputs are typically covariance statistics (Jones & Kandathil, 2018; Adhikari & Elofsson, 2020), or inferred coevolutionary parameters (Wang et al., 2017; Liu et al., 2018; Senior et al., 2020; Yang et al., 2019). Other recent work with deep learning uses sequences or evolutionary features as inputs (AlQuraishi, 2018; Ingraham et al., 2019). Xu et al. (2020) demonstrates the incorporation of coevolutionary features is critical to performance of current state-of-the-art methods.
|
| 46 |
+
|
| 47 |
+
Unsupervised contact prediction In contrast to supervised methods, unsupervised contact prediction models are trained on sequences without information from protein structures. In principle this allows them to take advantage of large sequence databases that include information from many sequences where no structural knowledge is available. The main approach has been to learn evolutionary constraints among a set of similar sequences by fitting a Markov Random Field (Potts model) to the underlying MSA, a technique known as Direct Coupling Analysis (DCA). This was proposed by Lapedes et al. (1999) and reintroduced by Thomas et al. (2008) and Weigt et al. (2009).
|
| 48 |
+
|
| 49 |
+
Various methods have been developed to fit the underlying Markov Random Field, including meanfield DCA (mfDCA) (Morcos et al., 2011), sparse inverse covariance (PSICOV) (Jones et al., 2011) and pseudolikelihood maximization (Balakrishnan et al., 2011; Ekeberg et al., 2013; Seemayer et al., 2014). Pseudolikelihood maximization is generally considered state-of-the-art for unsupervised contact prediction and the Gremlin (Balakrishnan et al., 2011) implementation is used as the baseline throughout. We also provide mfDCA and PSICOV baselines. Recently deep learning methods have also been applied to fitting MSAs, and Riesselman et al. (2018) found evidence that factors learned by a VAE model may correlate with protein structure.
|
| 50 |
+
|
| 51 |
+
Structure prediction from contacts While we do not perform structure prediction in this work, many methods have been proposed to extend contact prediction to structure prediction. For example, EVFold (Marks et al., 2011) and DCAFold (Sulkowska et al., 2012) predict co-evolving couplings using a Potts Model and then generate 3D conformations by directly folding an initial conformation with simulated annealing, using the predicted residue-residue contacts as constraints. Similarly, FragFold (Kosciolek & Jones, 2014) and Rosetta (Ovchinnikov et al., 2016) incorporate constraints from a Potts Model into a fragment assembly based pipeline. Senior et al. (2019), use features from a Potts model fit with pseudolikelihood maximization to predict pairwise distances with a deep residual network and optimize the final structure using Rosetta. All of these works build directly upon the unsupervised contact prediction pipeline.
|
| 52 |
+
|
| 53 |
+
Contact prediction from protein language models Since the introduction of large scale language models for natural language processing (Vaswani et al., 2017; Devlin et al., 2019), there has been considerable interest in developing similar models for proteins (Alley et al., 2019; Rives et al., 2019; Heinzinger et al., 2019; Rao et al., 2019; Elnaggar et al., 2020; Lu et al., 2020; Madani et al., 2020; Shen et al., 2021). Rives et al. (2019) were the first to study protein Transformer language models, demonstrating that information about residue-residue contacts could be recovered from the learned representations by linear projections supervised with protein structures. Recently Vig et al. (2020) performed an extensive analysis of Transformer attention, identifying correspondences to biologically relevant features, and also found that different layers of the model are responsible for learning different features. In particular Vig et al. (2020) discovered a correlation between selfattention maps and contact patterns, suggesting they could be used for contact prediction.
|
| 54 |
+
|
| 55 |
+
Prior work benchmarking contact prediction with protein language models has focused on the supervised problem. Bepler & Berger (2019) were the first to fine-tune an LSTM pretrained on protein sequences to fit contacts. Rao et al. (2019) and Rives et al. (2020) perform benchmarking of multiple protein language models using a deep residual network fit with supervised learning on top of pretrained language modeling features.
|
| 56 |
+
|
| 57 |
+
In contrast to previous work on protein language models, we find that a state-of-the-art unsupervised contact predictor can be directly extracted from the Transformer self-attention maps. We perform a thorough analysis of the contact predictor, showing relationships between performance and MSA depth as well as language modeling perplexity. We also provide methods for improving performance using sequences from an MSA and for sampling sequences in a manner that preserves contacts.
|
| 58 |
+
|
| 59 |
+
# 4 MODELS
|
| 60 |
+
|
| 61 |
+
We compare Transformer models trained on large sequence databases to Potts Models trained on individual MSAs. While Transformers and Potts Models emerged in separate research communities, the two models share core similarities (Wang & Cho, 2019) which we exploit here. Our main result is that just as Gremlin directly represents contacts via its pairwise component (the weights), the Transformer also directly represents contacts via its pairwise component (the self-attention).
|
| 62 |
+
|
| 63 |
+
# 4.1 OBJECTIVES
|
| 64 |
+
|
| 65 |
+
For a set of training sequences, $X$ , Gremlin optimizes the following pseudolikelihood loss, where a single position is masked and predicted from its context. Inputs are aligned, so all have length $L$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathcal { L } _ { \mathrm { P L L } } ( X ; \theta ) = \underset { x \sim X } { \mathbb { E } } \sum _ { i = 1 } ^ { L } \log p ( x _ { i } | x _ { j \neq i } ; \theta )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Contact prediction pipeline. The Transformer is first pretrained on sequences from a large database (Uniref50) via Masked Language Modeling. Once finished training, the attention maps are extracted, passed through symmetrization and average product correction, then into a regression. The regression is trained on a small number $( n \leq 2 0 )$ ) of proteins to determine which attention heads are informative. At test time, contact prediction from an input sequence can be done entirely on GPU in a single forward pass.
|
| 73 |
+
|
| 74 |
+
The masked language modeling (MLM) loss used by the Transformer models can be seen as a generalization of the Potts Model objective when written as follows:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathcal { L } _ { \mathrm { M L M } } ( X ; \theta ) = \underset { x \sim X } { \mathbb { E } } \underset { \mathrm { m a s k } } { \mathbb { E } } \sum _ { i \in \mathrm { m a s k } } \log p ( x _ { i } | x _ { j \notin \mathrm { m a s k } } ; \theta )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
In contrast to Gremlin, the MLM objective applied by protein language modeling is trained on unaligned sequences. The key distinction of MLM is to mask and predict multiple positions concurrently, instead of masking and predicting one at a time. This enables the model to scale beyond individual MSAs to massive sequence datasets. In practice, the expectation under the masking pattern is computed stochastically using a single sample at each epoch.
|
| 81 |
+
|
| 82 |
+
# 4.2 GREMLIN
|
| 83 |
+
|
| 84 |
+
The log probability optimized by Gremlin is described in section A.3. Contacts are extracted from the pairwise Gremlin parameters by taking the Frobenius norm along the amino acid dimensions, resulting in an $L \times L$ coupling matrix. Average product correction (APC) is applied to this coupling matrix to determine the final predictions (Appendix A.2).
|
| 85 |
+
|
| 86 |
+
Gremlin takes an MSA as input. The quality of the output predictions are highly dependent on the construction of the MSA. We compare to Gremlin under two conditions. In the first condition, we present Gremlin with all MSAs from the trRosetta training set (Yang et al., 2019). These MSAs were generated from all of Uniref100 and are also supplemented with metagenomic sequences when the depth from Uniref100 is too low. The trRosetta MSAs are a key ingredient in the state-of-theart protein folding pipeline. See Yang et al. (2019) for a discussion on the significant impact of metagenomic sequences on the final result. In the second setting, we allow Gremlin access only to the same information as the ESM Transformers by generating MSAs via Jackhmmer on the ESM training set (a subset of Uniref50). See Appendix A.5 for Jackhmmer parameters.
|
| 87 |
+
|
| 88 |
+
# 4.3 TRANSFORMERS
|
| 89 |
+
|
| 90 |
+
We evaluate several pre-trained Transformer models, including ESM-1 (Rives et al., 2019), ProtBertBFD (Elnaggar et al., 2020) and the TAPE Transformer (Rao et al., 2019). The key differences between these models are the datasets, model sizes, and hyperparameters (major architecture differences described in Table 3). Liu et al. (2019) previously showed that these changes can have a significant impact on final model performance. In addition to ESM-1, we also evaluate an updated version, ESM-1b, which is the result of a hyperparameter sweep. The differences are described in
|
| 91 |
+
|
| 92 |
+
Table 1: Average precision on 14842 test structures for Transformer models trained on 20 structures.
|
| 93 |
+
|
| 94 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">6≤sep<12</td><td colspan="3">12≤sep<24</td><td colspan="3">24≤sep</td></tr><tr><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td></tr><tr><td>Gremlin (ESM Data)</td><td>15.2</td><td>23.0</td><td>37.8</td><td>18.1</td><td>27.9</td><td>44.3</td><td>31.3</td><td>43.1</td><td>55.5</td></tr><tr><td>mfDCA (trRosetta Data)</td><td>16.3</td><td>23.7</td><td>35.8</td><td>19.7</td><td>29.8</td><td>45.5</td><td>33.0</td><td>43.5</td><td>54.2</td></tr><tr><td>PSICOV²(trRosetta Data)</td><td>15.4</td><td>23.6</td><td>39.2</td><td>18.3</td><td>28.4</td><td>45.7</td><td>32.6</td><td>45.2</td><td>58.1</td></tr><tr><td>Gremlin (trRosetta Data)</td><td>17.2</td><td>26.7</td><td>44.4</td><td>21.1</td><td>33.3</td><td>52.3</td><td>39.3</td><td>52.2</td><td>62.8</td></tr><tr><td>TAPE</td><td>9.9</td><td>12.3</td><td>16.4</td><td>10.0</td><td>12.6</td><td>16.6</td><td>11.2</td><td>14.0</td><td>17.9</td></tr><tr><td>ProtBERT-BFD</td><td>20.4</td><td>30.7</td><td>48.4</td><td>24.3</td><td>35.5</td><td>52.0</td><td>34.1</td><td>45.0</td><td>57.4</td></tr><tr><td>ESM-1 (6 layer)</td><td>11.0</td><td>13.2</td><td>15.9</td><td>11.5</td><td>14.6</td><td>19.0</td><td>13.2</td><td>16.7</td><td>21.5</td></tr><tr><td>ESM-1 (12 layer)</td><td>15.2</td><td>21.1</td><td>30.5</td><td>18.1</td><td>24.7</td><td>34.0</td><td>23.7</td><td>30.5</td><td>39.3</td></tr><tr><td>ESM-1 (34 layer)</td><td>20.3</td><td>30.2</td><td>46.0</td><td>23.8</td><td>34.3</td><td>49.2</td><td>34.7</td><td>44.6</td><td>56.0</td></tr><tr><td>ESM-1b</td><td>21.6</td><td>33.2</td><td>52.7</td><td>26.2</td><td>38.6</td><td>56.4</td><td>41.1</td><td>53.3</td><td>66.1</td></tr></table>
|
| 95 |
+
|
| 96 |
+
Section A.4. The Transformer processes inputs through a series of blocks alternating multi-head self-attention and feed-forward layers. In each head of a self-attention layer, the Transformer views the encoded representation as a set of query-key-value triples. The output of the head is the result of scaled dot-product attention:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
{ \mathrm { A t t e n t i o n } } ( Q , K , V ) = { \mathrm { s o f t m a x } } ( Q K ^ { T } / { \sqrt { n } } ) \cdot V
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Rather than only computing the attention once, the multi-head approach runs scaled dot-product attention multiple times in parallel and concatenates the output. Since self-attention explicitly constructs pairwise interactions $( Q K ^ { T } )$ between all positions in the sequence, the model can directly represent residue-residue interactions. In this work, we demonstrate that the $Q K ^ { T }$ pairwise “self attention maps” indeed capture accurate contacts.
|
| 103 |
+
|
| 104 |
+
# 4.4 LOGISTIC REGRESSION
|
| 105 |
+
|
| 106 |
+
To extract contacts from a Transformer, we first pass the input sequence through the model to obtain the attention maps (one map for each head in each layer). We then symmetrize and apply APC to each attention map independently. The resulting maps are passed through an $L _ { 1 }$ -regularized logistic regression, which is applied independently at each amino acid pair $( i , j )$ . At training time, we only train the weights of the logistic regression; we do not backpropagate through the entire model. At test time, the entire prediction pipeline can be run in a single forward pass, providing a single end-toend pipeline for protein contact prediction that does not require any retrieval steps from a sequence database. See Appendix A.7 for a full description of the logistic regression setup.
|
| 107 |
+
|
| 108 |
+
# 5 RESULTS
|
| 109 |
+
|
| 110 |
+
We evaluate models with the 15051 proteins in the trRosetta training dataset (Yang et al., 2019), removing 43 proteins with sequence length greater than 1024, since ESM-1b was trained with a context size of 1024. Of these sequences, Jackhmmer fails on 126 when we attempt to construct MSAs using the ESM training set (see Appendix A.5). This leaves us with 14882 total sequences. We reserve 20 sequences for training, 20 sequences for validation, and 14842 sequences for testing.
|
| 111 |
+
|
| 112 |
+
Table 1 shows evaluations of Gremlin, ESM-1, ESM-1b as well as the TAPE and ProtBERT-BFD models. Confidence intervals are within 0.5 percentage points for all statistics in Tables 1 and 2. In Table 1, all Transformer model contact predictors are trained with logistic regression on 20 proteins. We find that with only 20 training proteins ESM-1b has higher precision than Gremlin for short, medium, and long range contacts.
|
| 113 |
+
|
| 114 |
+
Table 2: ESM-1b Ablations with limited supervision and with MSA information. $n$ is the number of logistic regression training proteins. $s$ is the number of sequences ensembled over.
|
| 115 |
+
|
| 116 |
+
<table><tr><td></td><td></td><td colspan="3">6≤sep<12</td><td colspan="3">12≤sep<24</td><td colspan="3">24≤sep</td></tr><tr><td>Model</td><td>Variant</td><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td></tr><tr><td rowspan="2">Gremlin</td><td>ESM Data</td><td>15.2</td><td>23.0</td><td>37.8</td><td>18.1</td><td>27.9</td><td>44.3</td><td>31.3</td><td>43.1</td><td>55.5</td></tr><tr><td>trRosetta Data</td><td>17.2</td><td>26.7</td><td>44.4</td><td>21.1</td><td>33.3</td><td>52.3</td><td>39.3</td><td>52.2</td><td>62.8</td></tr><tr><td rowspan="8">ESM-1b</td><td>top-1 heads</td><td>16.8</td><td>23.4</td><td>34.8</td><td>19.8</td><td>27.6</td><td>40.2</td><td>29.3</td><td>38.1</td><td>50.0</td></tr><tr><td>top-5 heads</td><td>19.2</td><td>28.5</td><td>44.5</td><td>23.3</td><td>33.8</td><td>49.0</td><td>35.0</td><td>45.2</td><td>57.3</td></tr><tr><td>top-10 heads</td><td>20.0</td><td>30.1</td><td>47.4</td><td>24.7</td><td>36.0</td><td>52.2</td><td>38.5</td><td>49.4</td><td>61.1</td></tr><tr><td>n=1,s=1</td><td>19.4</td><td>29.7</td><td>47.1</td><td>25.1</td><td>37.1</td><td>54.0</td><td>39.2</td><td>50.6</td><td>63.0</td></tr><tr><td>n=10,s=1</td><td>21.4</td><td>32.9</td><td>52.3</td><td>26.1</td><td>38.5</td><td>56.4</td><td>40.8</td><td>52.9</td><td>65.7</td></tr><tr><td>n=20, s=1</td><td>21.6</td><td>33.2</td><td>52.7</td><td>26.2</td><td>38.6</td><td>56.4</td><td>41.1</td><td>53.3</td><td>66.1</td></tr><tr><td>MSA, s=1</td><td>18.4</td><td>28.1</td><td>45.5</td><td>23.9</td><td>36.1</td><td>53.7</td><td>39.9</td><td>51.3</td><td>63.0</td></tr><tr><td>n=20, s=16</td><td>21.9</td><td>33.8</td><td>53.6</td><td>26.7</td><td>39.4</td><td>57.5</td><td>41.9</td><td>54.3</td><td>67.3</td></tr><tr><td rowspan="2">ESM-1b (s seqs)</td><td>n=20, s=32</td><td>22.0</td><td>34.1</td><td>54.0</td><td>26.9</td><td>39.8</td><td>58.1</td><td>42.3</td><td>54.8</td><td>67.8</td></tr><tr><td>n=20, s=64</td><td>22.1</td><td>34.3</td><td>54.3</td><td>27.1</td><td>40.1</td><td>58.5</td><td>42.6</td><td>55.1</td><td>68.2</td></tr></table>
|
| 117 |
+
|
| 118 |
+
In addition to this set, we also evaluate performance on 15 CASP13 FM Domains in Appendix A.6. On average ESM-1b has higher short, medium, and long range precision than Gremlin on all metrics, and in particular can significantly outperform on MSAs with low effective number of sequences. We also provide a comparison to the bilinear model proposed by Rives et al. (2020). The logistic regression model achieves a long-range contact precision at L of 18.6, while the fully supervised bilinear model achieves a long range precision at L of 20.1, an increase of only 1.5 points despite being trained on $7 0 0 \mathbf { x }$ more structures.
|
| 119 |
+
|
| 120 |
+
# 5.1 ABLATIONS: LIMITING SUPERVISION
|
| 121 |
+
|
| 122 |
+
While the language modeling objective is fully unsupervised, the logistic regression is trained with a small number of supervised examples. In this section, we study the dependence of the results on this supervision, providing evidence that the contacts are indeed learned in the unsupervised phase, and the logistic regression is only necessary to extract the contacts.
|
| 123 |
+
|
| 124 |
+
Top Heads Here we use the logistic regression only to determine the most important heads. Once they are selected, we discard the weights from the logistic regression and simply average the attention heads corresponding to the top- $k$ weight values. By taking the single best head from ESM-1b, we come close to Gremlin performance given the same data, and averaging the top-5 heads allows us to outperform Gremlin. Averaging the top-10 heads outperforms a full logistic regression on all other Transformer models and comes close to Gremlin given optimized MSAs.
|
| 125 |
+
|
| 126 |
+
Low-N The second variation we consider is to limit the number of supervised examples provided to the logistic regression. We find that with only a single training example, the model achieves a long range top-L precision of 39.2, which is statistically indistinguishable from Gremlin $( p >$ 0.05). Using only 10 training examples, the model outperforms Gremlin on all the metrics. Since these results depend on the sampled training proteins, we also show a bootstrapped performance distribution using 100 different logistic regression models in Appendix A.10. We find that with 1 protein, performance can vary significantly, with long range top-L precision mean of 35.6, a median of 38.4, and standard deviation 8.9. This variation greatly decreases when training on 20 proteins, with a long range top-L precision mean of 40.1, median of 41.1, and standard deviation of 0.3. See Fig. 12 for the full distribution on all statistics.
|
| 127 |
+
|
| 128 |
+
MSA Only Finally, we consider supervising the logistic regression only with MSAs instead of real structures. This is the same training data used by the Gremlin baseline. To do this, we first train Gremlin on each MSA. We take the output couplings from Gremlin and mark the top $L$ couplings with sequence separation $\geq 6$ in each protein as true contacts, and everything else as false contacts, creating a binary decision problem. When trained on 20 MSAs, we find that this model achieves a long range $\mathrm { P @ L }$ of 39.9, and generally achieves similar long range performance to Gremlin, while still having superior short and medium range contact precision.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: Left: Language modeling validation perplexity on holdout of Uniref50 vs. contact precision over the course of pre-training. ESM-1b was trained with different masking so perplexities between the versions are not comparable. Right: Long range $\mathrm { P @ L }$ performance distribution of ESM-1b vs. Gremlin. Each point is colored by the log of the number of sequences in the MSA used to train Gremlin.
|
| 132 |
+
|
| 133 |
+
# 5.2 ENSEMBLING OVER MSA
|
| 134 |
+
|
| 135 |
+
Transformer models are fundamentally single-sequence models, but we can further boost performance by ensembling predictions from multiple sequences in the alignment. To do so, we unalign each sequence in the alignment (removing any gaps), pass the resulting sequence through the Transformer and regression, and realign the resulting contact maps to the original aligned indices. For these experiments, we use the logistic regression weights trained on single-sequence inputs, rather than re-training the logistic regression on multi-sequence inputs. We also simply take the first $s$ sequences in the MSA. Table 2 shows performance improvements from averaging over 16, 32, and 64 sequences.
|
| 136 |
+
|
| 137 |
+
To better understand this result, we return to the single-sequence setting and study the change in prediction when switching between sequences in the alignment. We find that contact precision can vary significantly depending on the exact sequence input to the model, and that the initial query sequence of the MSA does not necessarily generate the highest contact precision (Fig. 9).
|
| 138 |
+
|
| 139 |
+
Lastly, Alley et al. (2019) presented a method of fine-tuning where a pretrained language model is further trained on the MSA of the sequence of interest (‘evotuning’). Previously this has only been investigated for function prediction and for relatively low-capacity models. We fine-tune the full ESM-1b model (which has $5 0 \mathrm { x }$ more parameters than UniRep) on 380 protein sequence families. We find that after 30 epochs of fine-tuning, long range $\mathrm { P @ L }$ increases only slightly, with an average of 1.6 percentage points (Fig. 16).
|
| 140 |
+
|
| 141 |
+
# 5.3 PERFORMANCE DISTRIBUTION
|
| 142 |
+
|
| 143 |
+
Although our model is, on average, better than Gremlin at detecting contacts, the performance distribution over all sequences in the dataset is still mixed. ESM-1b is consistently better at extracting short and medium range contacts (Fig. 7), but only slightly outperforms Gremlin on long range contacts when Gremlin has access to Uniref100 and metagenomic sequences. Fig. 2 shows the distribution of long range $\mathrm { P @ L }$ for ESM-1b vs. Gremlin. Overall, ESM-1b has higher long range $\mathrm { P @ L }$ on $55 \%$ of sequences in the test set.
|
| 144 |
+
|
| 145 |
+
In addition, we examine the relationship between MSA depth and precision for short, medium, and long range contacts (Fig. 3). Although our contact prediction pipeline does not make explicit use of MSAs, there is still some correlation between MSA depth and performance, since MSA depth is a measure of how many related sequences are present in the ESM-1b training set. We again see that ESM-1b consistently outperforms Gremlin at all MSA depths for short and medium range sequences. We also confirm that ESM-1b outperforms Gremlin for long range contact extraction for sequences with small MSAs (depth $< 1 0 0 0$ ). ESM-1b also outperforms Gremlin on sequences with the very largest MSAs (depth $> 1 6 0 0 0 \AA$ , which is consistent with prior work showing that Gremlin performance plateaus for very large MSAs and suggests that ESM-1b does not suffer from the same issues (Anishchenko et al., 2017).
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: Gremlin (trRosetta) performance binned by MSA depth. For comparison, ESM-1b performance is also shown for the sequences in each bin.
|
| 149 |
+
|
| 150 |
+
# 5.4 LOGISTIC REGRESSION WEIGHTS
|
| 151 |
+
|
| 152 |
+
In Section 5.1 we show that selecting only a sparse subset of the attention heads can yield good results for contact prediction. Overall, the $L _ { 1 }$ -regularized logistic regression identifies $1 0 2 / 6 6 0$ heads as being predictive of contacts (Fig. 6b). Additionally, we train separate logistic regressions to identify contacts at different ranges . These regressions identify an overlapping, but non-identical set of useful attention heads. Two attention heads have the top-10 highest weights for detecting contacts at all ranges. One attention head is highly positively correlated with local contacts, but highly negatively correlated with long range contacts. Lastly, we identify a total of 104 attention heads that are correlated (positively or negatively) with contacts at only one of the four ranges, suggesting that particular attention heads specialize in detecting certain types of contacts.
|
| 153 |
+
|
| 154 |
+
# 5.5 PERPLEXITY VS. CONTACT PRECISION
|
| 155 |
+
|
| 156 |
+
Fig. 2 explores the relationship between performance on the masked language modeling task (validataion perplexity) and contact prediction (Long Range $\mathrm { P } @ \mathrm { L }$ ). A linear relationship exists between validation perplexity and contact precision for each model. Furthermore, for the same perplexity, the 12-layer ESM-1 model achieves the same long range $\mathrm { P @ L }$ as the 34 layer ESM-1 model, suggesting that perplexity is a good proxy task for contact prediction. ESM-1 and ESM-1b models are trained with different masking patterns, so their perplexities cannot be directly compared, although a linear relationship is clearly visible in both. ESM-1 and ESM-1b have a similar number of parameters; the key difference is in their hyperparameters and architecture. The models shown have converged in pre-training, with minimal decrease in perplexity (or increase in contact precision) in the later epochs. This provides clear evidence that both model scale and hyperparameters play a significant role in a model’s ability to learn contacts.
|
| 157 |
+
|
| 158 |
+
# 5.6 CALIBRATION, FALSE POSITIVES, AND ROBUSTNESS
|
| 159 |
+
|
| 160 |
+
One concern with neural networks is that, while they may be accurate on average, they can also produce spurious results with high confidence. We investigate this possibility from several perspectives. First, we find that logistic regression probabilities are close to true contact probability (mean-squared error $= 0 . 0 1 4$ ) and can be used directly as a measure of the model’s confidence (Fig. 11).
|
| 161 |
+
|
| 162 |
+
Second, we analyze the false positives that the model does predict. We find that these are very likely to be within a Manhattan distance of 1-4 of a true contact (Fig. 13a). This suggests that false positives may arise due to the way a contact is defined (Cb-Cb distance within 8 angstroms), and could be marked as true contacts under a different definition (Zheng & Grigoryan, 2017). Further, when we explore an example where the model’s predictions are not near a true contact, we see that the example in question is a homodimer, and that the model is picking up on inter-chain interactions (Fig. 14a). While these do not determine the structure of the monomer, they are important for its function (Anishchenko et al., 2017).
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Logistic regression weights trained only on contacts in specific ranges: local [3, 6), short range [6, 12), medium range [12, 24), long range $[ 2 4 , \infty )$ .
|
| 166 |
+
|
| 167 |
+
Third, we test the robustness of the model to insertions by inserting consecutive alanines at the beginning, middle, or end of 1000 randomly chosen sequences. We find that ESM-1b can tolerate up to 256 insertions at the beginning or end of the sequence and up to 64 insertions in the middle of the sequence before performance starts to significantly degrade. This suggests that ESM-1b learns a robust implicit alignment of the protein sequence. See Appendix A.12 for more details.
|
| 168 |
+
|
| 169 |
+
# 5.7 MSA GENERATION
|
| 170 |
+
|
| 171 |
+
Wang & Cho (2019) note that Transformers trained with the MLM objective can be used generatively. Here, we consider whether generations from ESM-1b preserve contact information. The ability to generate sequences that preserve this information is a necessary condition for generation of biologically active proteins (Hawkins-Hooker et al., 2021). We perform this evaluation by taking an input protein, masking out several positions, and re-predicting them. This process is repeated 10000 times to generate a pseudo-MSA for the input sequence (Algorithm 1). We feed the resulting MSA into Gremlin to predict contacts. Over all sequences from our test set, this procedure results in a long range contact $\mathrm { P @ L }$ of 14.5. Fig. 17 shows one example where the procedure works well, with Gremlin on the pseudo-MSA having long range $\mathrm { P @ L }$ of 52.2.
|
| 172 |
+
|
| 173 |
+
# 6 DISCUSSION
|
| 174 |
+
|
| 175 |
+
Transformer protein language models trained with an unsupervised objective learn the tertiary structure of a protein sequence in their attention maps. Residue-residue contacts can be extracted from the attention by sparse logistic regression. Attention heads are found that specialize in different types of contacts. An ablation analysis confirms that the contacts are learned without supervision, and that the logistic regression is only necessary to extract the part of the model that represents contacts.
|
| 176 |
+
|
| 177 |
+
These results have implications for protein structure determination and design. The initial studies proposing Transformers for protein language modeling showed that representation learning could be used to derive state-of-the-art features across a variety of tasks, but were not able to show a benefit in the fully end-to-end setting (Rives et al., 2019; Rao et al., 2019; Elnaggar et al., 2020). For the first time, we show that protein language models can outperform state-of-the-art unsupervised structure learning methods that have been intensively researched and optimized over decades.
|
| 178 |
+
|
| 179 |
+
Finally, we establish a link between language modeling perplexity and unsupervised structure learning. A similar scaling law has been observed previously for supervised secondary structure prediction (Rives et al., 2019), and parallels observations in the NLP community (Kaplan et al., 2020; Brown et al., 2020). Evidence of scaling laws for protein language modeling support future promise as models and data continue to grow.
|
| 180 |
+
|
| 181 |
+
# ACKNOWLEDGMENTS
|
| 182 |
+
|
| 183 |
+
We thank Justas Dauparas for valuable input and initial analysis. Sergey Ovchinnikov was supported by NIH Grant DP5OD026389.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Badri Adhikari and Jianlin Cheng. Protein residue contacts and prediction methods. In Methods in Molecular Biology, volume 1415, pp. 463–476. Humana Press Inc., aug 2016. doi: 10.1007/ 978-1-4939-3572-7 24. URL https://pubmed.ncbi.nlm.nih.gov/27115648/.
|
| 188 |
+
|
| 189 |
+
Badri Adhikari and Arne Elofsson. DEEPCON: Protein contact prediction using dilated convolutional neural networks with dropout. Bioinformatics, 36(2):470–477, jan 2020. ISSN 14602059. doi: 10.1093/bioinformatics/btz593. URL https://academic.oup.com/ bioinformatics/article/36/2/470/5540673.
|
| 190 |
+
|
| 191 |
+
Ethan C. Alley, Grigory Khimulya, Surojit Biswas, Mohammed AlQuraishi, and George M. Church. Unified rational protein engineering with sequence-only deep representation learning. Nature Methods, 12:1315–1322, 3 2019. ISSN 15487105. doi: 10.1101/589333. URL https://www. biorxiv.org/content/10.1101/589333v1.
|
| 192 |
+
|
| 193 |
+
Mohammed AlQuraishi. End-to-end differentiable learning of protein structure. bioRxiv, pp. 265231, 8 2018. doi: 10.1101/265231. URL https://www.biorxiv.org/content/ early/2018/08/29/265231.
|
| 194 |
+
|
| 195 |
+
Ivan Anishchenko, Sergey Ovchinnikov, Hetunandan Kamisetty, and David Baker. Origins of coevolution between residues distant in protein 3D structures. Proceedings of the National Academy of Sciences of the United States of America, 114 (34):9122–9127, 8 2017. ISSN 10916490. doi: 10.1073/pnas.1702664114. URL https://www.pnas.org/content/early/2017/08/03/1702664114https: //www.pnas.org/content/early/2017/08/03/1702664114.abstract.
|
| 196 |
+
|
| 197 |
+
Sivaraman Balakrishnan, Hetunandan Kamisetty, Jaime G. Carbonell, Su-In Lee, and Christopher James Langmead. Learning generative models for protein fold families. Proteins: Structure, Function, and Bioinformatics, 79(4):1061–1078, 4 2011. ISSN 08873585. doi: 10.1002/prot.22934. URL http://doi.wiley.com/10.1002/prot.22934.
|
| 198 |
+
|
| 199 |
+
Tristan Bepler and Bonnie Berger. Learning protein sequence embeddings using information from structure, 2 2019. URL http://arxiv.org/abs/1902.08661https://arxiv.org/ abs/1902.08661.
|
| 200 |
+
|
| 201 |
+
Tomasz Blazejewski, Hsing-I Ho, and Harris H Wang. Synthetic sequence entanglement augments stability and containment of genetic information in cells. Science, 365(6453):595–598, 2019.
|
| 202 |
+
|
| 203 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 204 |
+
|
| 205 |
+
James A. Cuff and Geoffrey J. Barton. Evaluation and improvement of multiple sequence methods for protein secondary structure prediction. Proteins: Structure, Function and Genetics, 34 (4):508–519, 3 1999. ISSN 08873585. doi: 10.1002/(SICI)1097-0134(19990301)34:4h508:: AID-PROT10i3.0.CO;2-4. URL https://pubmed.ncbi.nlm.nih.gov/10081963/.
|
| 206 |
+
|
| 207 |
+
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 $\{ A \}$ merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, Minneapolis, Minnesota, 6 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL http://arxiv.org/abs/1810.04805.
|
| 208 |
+
|
| 209 |
+
S. D. Dunn, L. M. Wahl, and G. B. Gloor. Mutual information without the influence of phylogeny or entropy dramatically improves residue contact prediction. Bioinformatics, 24(3):333–340, 2 2008. ISSN 13674803. doi: 10.1093/bioinformatics/btm604.
|
| 210 |
+
|
| 211 |
+
Magnus Ekeberg, Cecilia Lovkvist, Yueheng Lan, Martin Weigt, and Erik Aurell. Improved contact ¨ prediction in proteins: Using pseudolikelihoods to infer potts models. Phys. Rev. E, 87:012707, Jan 2013. doi: 10.1103/PhysRevE.87.012707. URL https://link.aps.org/doi/10. 1103/PhysRevE.87.012707.
|
| 212 |
+
|
| 213 |
+
Ahmed Elnaggar, Michael Heinzinger, Christian Dallago, Ghalia Rihawi, Yu Wang, Llion Jones, Tom Gibbs, Tamas Feher, Christoph Angerer, Martin Steinegger, Debsindhu Bhowmik, and Burkhard Rost. ProtTrans: Towards Cracking the Language of Life’s Code Through SelfSupervised Deep Learning and High Performance Computing. 7 2020. URL http://arxiv. org/abs/2007.06225.
|
| 214 |
+
|
| 215 |
+
Roc´ıo Espada, R. Gonzalo Parra, Thierry Mora, Aleksandra M. Walczak, and Diego U. Ferreiro. Capturing coevolutionary signals inrepeat proteins. BMC Bioinformatics, 16(1):1, dec 2015. ISSN 14712105. doi: 10.1186/s12859-015-0648-3. URL http://bmcbioinformatics. biomedcentral.com/articles/10.1186/s12859-015-0648-3.
|
| 216 |
+
|
| 217 |
+
Robert D. Finn, Alex Bateman, Jody Clements, Penelope Coggill, Ruth Y. Eberhardt, Sean R. Eddy, Andreas Heger, Kirstie Hetherington, Liisa Holm, Jaina Mistry, Erik L.L. Sonnhammer, John Tate, and Marco Punta. Pfam: The protein families database, 1 2014. ISSN 03051048. URL https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3965110/.
|
| 218 |
+
|
| 219 |
+
Alex Hawkins-Hooker, Florence Depardieu, Sebastien Baur, Guillaume Couairon, Arthur Chen, and David Bikard. Generating functional protein variants with variational autoencoders. PLOS Computational Biology, 17(2):1–23, 02 2021. doi: 10.1371/journal.pcbi.1008736. URL https: //doi.org/10.1371/journal.pcbi.1008736.
|
| 220 |
+
|
| 221 |
+
Michael Heinzinger, Ahmed Elnaggar, Yu Wang, Christian Dallago, Dmitrii Nechaev, Florian Matthes, and Burkhard Rost. Modeling the language of life – Deep Learning Protein Sequences. bioRxiv, pp. 614313, 2019. doi: 10.1101/614313. URL https://www.biorxiv.org/ content/10.1101/614313v3.
|
| 222 |
+
|
| 223 |
+
John Ingraham, Adam Riesselman, Chris Sander, and Debora Marks. Learning protein structure with a differentiable simulator. 7th International Conference on Learning Representations, ICLR 2019, 0 2019.
|
| 224 |
+
|
| 225 |
+
L. Steven Johnson, Sean R. Eddy, and Elon Portugaly. Hidden Markov model speed heuristic and iterative HMM search procedure. BMC Bioinformatics, 11(1):431, 8 2010. ISSN 14712105. doi: 10.1186/1471-2105-11-431. URL https://bmcbioinformatics.biomedcentral. com/articles/10.1186/1471-2105-11-431.
|
| 226 |
+
|
| 227 |
+
David T. Jones and Shaun M. Kandathil. High precision in protein contact prediction using fully convolutional neural networks and minimal sequence features. Bioinformatics, 34(19): 3308–3315, oct 2018. ISSN 14602059. doi: 10.1093/bioinformatics/bty341. URL https: //academic.oup.com/bioinformatics/article/34/19/3308/4987145.
|
| 228 |
+
|
| 229 |
+
David T. Jones, Daniel W. A. Buchan, Domenico Cozzetto, and Massimiliano Pontil. PSICOV: precise structural contact prediction using sparse inverse covariance estimation on large multiple sequence alignments. Bioinformatics, 28(2):184–190, 11 2011. ISSN 1367-4803. doi: 10.1093/ bioinformatics/btr638. URL https://doi.org/10.1093/bioinformatics/btr638.
|
| 230 |
+
|
| 231 |
+
Hetunandan Kamisetty, Sergey Ovchinnikov, and David Baker. Assessing the utility of coevolutionbased residue–residue contact predictions in a sequence- and structure-rich era. Proceedings of the National Academy of Sciences, 110(39):15674–15679, 2013. ISSN 0027-8424. doi: 10.1073/ pnas.1314045110. URL https://www.pnas.org/content/110/39/15674.
|
| 232 |
+
|
| 233 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 234 |
+
|
| 235 |
+
Michael Schantz Klausen, Martin Closter Jespersen, Henrik Nielsen, Kamilla Kjærgaard Jensen, Vanessa Isabell Jurtz, Casper Kaae Sønderby, Morten Otto Alexander Sommer, Ole Winther, Morten Nielsen, Bent Petersen, and Paolo Marcatili. NetSurfP-2.0: Improved prediction of protein structural features by integrated deep learning. Proteins: Structure, Function, and Bioinformatics, 87(6):520–527, 6 2019. ISSN 0887-3585. doi: 10.1002/prot.25674. URL https://onlinelibrary.wiley.com/doi/abs/10.1002/prot.25674.
|
| 236 |
+
|
| 237 |
+
Tomasz Kosciolek and David T. Jones. De novo structure prediction of globular proteins aided by sequence variation-derived contacts. PLOS ONE, 9(3):1–15, 03 2014. doi: 10.1371/journal.pone. 0092197. URL https://doi.org/10.1371/journal.pone.0092197.
|
| 238 |
+
|
| 239 |
+
Alan S. Lapedes, Bertrand G. Giraud, LonChang Liu, and Gary D. Stormoo. Correlated mutations in models of protein sequences: Phylogenetic and structural effects. Lecture Notes-Monograph Series, 33:236–256, 1999. ISSN 07492170. URL http://www.jstor.org/stable/ 4356049.
|
| 240 |
+
|
| 241 |
+
Yang Liu, Perry Palmedo, Qing Ye, Bonnie Berger, and Jian Peng. Enhancing Evolutionary Couplings with Deep Convolutional Neural Networks. Cell Systems, 6(1):65–74.e3, jan 2018. ISSN 24054720. doi: 10.1016/j.cels.2017.11.014. URL https://pubmed.ncbi.nlm.nih. gov/29275173/.
|
| 242 |
+
|
| 243 |
+
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. 7 2019. URL http://arxiv.org/abs/1907.11692.
|
| 244 |
+
|
| 245 |
+
Amy X Lu, Haoran Zhang, Marzyeh Ghassemi, and Alan Moses. Self-Supervised Contrastive Learning of Protein Representations By Mutual Information Maximization. bioRxiv, pp. 2020.09.04.283929, 9 2020. doi: 10.1101/2020.09.04.283929. URL https://doi.org/ 10.1101/2020.09.04.283929.
|
| 246 |
+
|
| 247 |
+
Ali Madani, Bryan McCann, Nikhil Naik, Nitish Shirish Keskar, Namrata Anand, Raphael R. Eguchi, Po-Ssu Huang, and Richard Socher. ProGen: Language Modeling for Protein Generation. 3 2020. URL http://arxiv.org/abs/2004.03497.
|
| 248 |
+
|
| 249 |
+
Debora S. Marks, Lucy J. Colwell, Robert Sheridan, Thomas A. Hopf, Andrea Pagnani, Riccardo Zecchina, and Chris Sander. Protein 3d structure computed from evolutionary sequence variation. PLOS ONE, 6(12):1–20, 12 2011. doi: 10.1371/journal.pone.0028766. URL https://doi. org/10.1371/journal.pone.0028766.
|
| 250 |
+
|
| 251 |
+
Faruck Morcos, Andrea Pagnani, Bryan Lunt, Arianna Bertolino, Debora S. Marks, Chris Sander, Riccardo Zecchina, Jose N. Onuchic, Terence Hwa, and Martin Weigt. Direct-coupling analysis ´ of residue coevolution captures native contacts across many protein families. Proceedings of the National Academy of Sciences, 108(49):E1293–E1301, 2011. ISSN 0027-8424. doi: 10.1073/ pnas.1111471108. URL https://www.pnas.org/content/108/49/E1293.
|
| 252 |
+
|
| 253 |
+
Sergey Ovchinnikov, David E. Kim, Ray Yu-Ruei Wang, Yuan Liu, Frank DiMaio, and David Baker. Improved de novo structure prediction in casp11 by incorporating coevolution information into rosetta. Proteins: Structure, Function, and Bioinformatics, 84(S1):67–75, 2016. doi: 10.1002/prot.24974. URL https://onlinelibrary.wiley.com/doi/abs/10. 1002/prot.24974.
|
| 254 |
+
|
| 255 |
+
Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier ¨ Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, and Edouard Duches- ´ nay. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12(85): 2825–2830, 2011. ISSN 1533-7928. URL http://scikit-learn.sourceforge.net.
|
| 256 |
+
|
| 257 |
+
Roshan Rao, Nicholas Bhattacharya, Neil Thomas, Yan Duan, Xi Chen, John Canny, Pieter Abbeel, and Yun S. Song. Evaluating Protein Transfer Learning with TAPE. In Neural Information Processing Systems. Cold Spring Harbor Laboratory, 6 2019. doi: 10.1101/676825. URL https://doi.org/10.1101/676825http://arxiv.org/abs/1906.08230.
|
| 258 |
+
|
| 259 |
+
Michael Remmert, Andreas Biegert, Andreas Hauser, and Johannes Soding. HHblits: lightning-fast ¨ iterative protein sequence searching by HMM-HMM alignment. Nature Methods, 9(2):173–175, 2 2012. ISSN 1548-7091. doi: 10.1038/nmeth.1818. URL http://www.nature.com/ articles/nmeth.1818.
|
| 260 |
+
|
| 261 |
+
Adam J. Riesselman, John B. Ingraham, and Debora S. Marks. Deep generative models of genetic variation capture the effects of mutations. Nature Methods, 15(10):816–822, 10 2018. ISSN 15487105. doi: 10.1038/s41592-018-0138-4.
|
| 262 |
+
|
| 263 |
+
Alexander Rives, Siddharth Goyal, Joshua Meier, Demi Guo, Myle Ott, C. Lawrence Zitnick, Jerry Ma, and Rob Fergus. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. bioRxiv, 2019. doi: 10.1101/622803. URL https://www. biorxiv.org/content/early/2019/04/29/622803.
|
| 264 |
+
|
| 265 |
+
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Demi Guo, Myle Ott, C. Lawrence Zitnick, Jerry Ma, and Rob Fergus. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. bioRxiv, 2020. doi: 10.1101/622803. URL https://www.biorxiv.org/content/early/2020/08/31/ 622803.
|
| 266 |
+
|
| 267 |
+
William P Russ, Matteo Figliuzzi, Christian Stocker, Pierre Barrat-Charlaix, Michael Socolich, Peter Kast, Donald Hilvert, Remi Monasson, Simona Cocco, Martin Weigt, et al. An evolution-based model for designing chorismate mutase enzymes. Science, 369(6502):440–445, 2020.
|
| 268 |
+
|
| 269 |
+
Stefan Seemayer, Markus Gruber, and Johannes Soding. CCMpred—fast and precise pre- ¨ diction of protein residue–residue contacts from correlated mutations. Bioinformatics, 30(21):3128–3130, 11 2014. ISSN 1460-2059. doi: 10.1093/bioinformatics/btu500. URL http://www.ncbi.nlm.nih.gov/pubmed/25064567http://www. pubmedcentral.nih.gov/articlerender.fcgi?artid $=$ PMC4201158https: //academic.oup.com/bioinformatics/article-lookup/doi/10.1093/ bioinformatics/btu500.
|
| 270 |
+
|
| 271 |
+
Andrew W. Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Zˇ ´ıdek, Alexander W. R. Nelson, Alex Bridgland, Hugo Penedones, Stig Petersen, Karen Simonyan, Steve Crossan, Pushmeet Kohli, David T. Jones, David Silver, Koray Kavukcuoglu, and Demis Hassabis. Protein structure prediction using multiple deep neural networks in the 13th Critical Assessment of Protein Structure Prediction (CASP13). Proteins: Structure, Function, and Bioinformatics, 87(12):1141–1148, 12 2019. ISSN 0887-3585. doi: 10.1002/prot.25834. URL https://onlinelibrary.wiley.com/doi/abs/10. 1002/prot.25834.
|
| 272 |
+
|
| 273 |
+
Andrew W. Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Zˇ ´ıdek, Alexander W.R. Nelson, Alex Bridgland, Hugo Penedones, Stig Petersen, Karen Simonyan, Steve Crossan, Pushmeet Kohli, David T. Jones, David Silver, Koray Kavukcuoglu, and Demis Hassabis. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 1 2020. ISSN 14764687. doi: 10.1038/ s41586-019-1923-7. URL https://doi.org/10.1038/s41586-019-1923-7.
|
| 274 |
+
|
| 275 |
+
Hongyu Shen, Layne C. Price, Mohammad Taha Bahadori, and Franziska Seeger. Improving generalizability of protein sequence models via data augmentations, 2021. URL https: //openreview.net/forum?id ${ . } =$ Kkw3shxszSd.
|
| 276 |
+
|
| 277 |
+
Martin Steinegger, Milot Mirdita, and Johannes Soding. Protein-level assembly increases protein ¨ sequence recovery from metagenomic samples manyfold. Nature Methods, 16(7):603–606, 2019. ISSN 1548-7105. doi: 10.1038/s41592-019-0437-4. URL https://doi.org/10.1038/ s41592-019-0437-4.
|
| 278 |
+
|
| 279 |
+
J. I. Sulkowska, F. Morcos, M. Weigt, T. Hwa, and J. N. Onuchic. Genomics-aided structure prediction. Proceedings of the National Academy of Sciences, 109(26):10340–10345, 2012. doi: 10.1073/PNAS.1207864109. URL http://www.pnas.org/cgi/doi/10.1073/pnas. 1207864109.
|
| 280 |
+
|
| 281 |
+
Baris E. Suzek, Hongzhan Huang, Peter McGarvey, Raja Mazumder, and Cathy H. Wu. UniRef: Comprehensive and non-redundant UniProt reference clusters. Bioinformatics, 23(10):1282– 1288, 5 2007. ISSN 13674803. doi: 10.1093/bioinformatics/btm098. URL http://www. uniprot.org. UniRef50 database licensed under (CC BY 4.0).
|
| 282 |
+
|
| 283 |
+
Todd J. Taylor, Hongjun Bai, Chin Hsien Tai, and Byungkook Lee. Assessment of CASP10 contactassisted predictions. Proteins: Structure, Function and Bioinformatics, 82(SUPPL.2):84–97, 2 2014. ISSN 08873585. doi: 10.1002/prot.24367. URL https://www.ncbi.nlm.nih. gov/pmc/articles/PMC6961783/.
|
| 284 |
+
|
| 285 |
+
John Thomas, Naren Ramakrishnan, and Chris Bailey-Kellogg. Graphical models of residue coupling in protein families, apr 2008. ISSN 15455963. URL https://pubmed.ncbi.nlm. nih.gov/18451428/.
|
| 286 |
+
|
| 287 |
+
Pengfei Tian, John M Louis, James L Baber, Annie Aniana, and Robert B Best. Co-evolutionary fitness landscapes for sequence design. Angewandte Chemie International Edition, 57(20):5674– 5678, 2018.
|
| 288 |
+
|
| 289 |
+
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. URL https://papers.nips.cc/ paper/7181-attention-is-all-you-need.pdf.
|
| 290 |
+
|
| 291 |
+
Jesse Vig, Ali Madani, Lav R. Varshney, Caiming Xiong, Richard Socher, and Nazneen Fatema Rajani. BERTology Meets Biology: Interpreting Attention in Protein Language Models. bioRxiv, pp. 2020.06.26.174417, 6 2020. doi: 10.1101/2020.06.26.174417. URL http://arxiv. org/abs/2006.15222.
|
| 292 |
+
|
| 293 |
+
Alex Wang and Kyunghyun Cho. BERT has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model. 2 2019. URL http://arxiv.org/abs/1902.04094.
|
| 294 |
+
|
| 295 |
+
Sheng Wang, Siqi Sun, Zhen Li, Renyu Zhang, and Jinbo Xu. Accurate de novo prediction of protein contact map by ultra-deep learning model. PLOS Computational Biology, 13(1):1–34, 01 2017. doi: 10.1371/journal.pcbi.1005324. URL https://doi.org/10.1371/journal. pcbi.1005324.
|
| 296 |
+
|
| 297 |
+
Martin Weigt, Robert A. White, Hendrik Szurmant, James A. Hoch, and Terence Hwa. Identification of direct residue contacts in protein-protein interaction by message passing. Proceedings of the National Academy of Sciences of the United States of America, 106(1):67–72, jan 2009. ISSN 00278424. doi: 10.1073/pnas.0805923106. URL https://www.pnas.org/content/ 106/1/67https://www.pnas.org/content/106/1/67.abstract.
|
| 298 |
+
|
| 299 |
+
Jinbo Xu, Matthew Mcpartlon, and Jin Li. Improved protein structure prediction by deep learning irrespective of co-evolution information. bioRxiv, pp. 2020.10.12.336859, oct 2020. doi: 10.1101/2020.10.12.336859. URL https://www.biorxiv.org/content/10.1101/ 2020.10.12.336859v1https://www.biorxiv.org/content/10.1101/2020. 10.12.336859v1.abstract.
|
| 300 |
+
|
| 301 |
+
Jianyi Yang, Ivan Anishchenko, Hahnbeom Park, Zhenling Peng, Sergey Ovchinnikov, David Baker, and John Harvard. Improved protein structure prediction using predicted inter-residue orientations. bioRxiv, pp. 846279, 2019. doi: 10.1101/846279. URL https://www.biorxiv. org/content/10.1101/846279v1.
|
| 302 |
+
|
| 303 |
+
Chengxin Zhang, Wei Zheng, S M Mortuza, Yang Li, and Yang Zhang. DeepMSA: constructing deep multiple sequence alignment to improve contact prediction and fold-recognition for distant-homology proteins. Bioinformatics, 36(7):2105–2112, apr 2020. ISSN 1367-4803. doi: 10.1093/bioinformatics/btz863. URL https://doi.org/10.1093/bioinformatics/ btz863.
|
| 304 |
+
|
| 305 |
+
Fan Zheng and Gevorg Grigoryan. Sequence statistics of tertiary structural motifs reflect protein stability. PLoS ONE, 12(5):e0178272, 5 2017. ISSN 19326203. doi: 10.1371/journal.pone. 0178272. URL https://doi.org/10.1371/journal.pone.0178272.
|
| 306 |
+
|
| 307 |
+
Table 3: Major Architecture Differences in Protein Transformer Language Models
|
| 308 |
+
|
| 309 |
+
<table><tr><td>Name</td><td>Layers</td><td>Hidden Size</td><td>Attn Heads</td><td>Parameters</td><td>Dataset</td></tr><tr><td>TAPE</td><td>12</td><td>768</td><td>12</td><td>92M</td><td>Pfam</td></tr><tr><td>ProtBERT-BFD</td><td>30</td><td>1024</td><td>16</td><td>420M</td><td>BFD100</td></tr><tr><td>ESM-1 (6 layer)</td><td>6</td><td>768</td><td>12</td><td>43M</td><td>Uniref50</td></tr><tr><td>ESM-1 (12 layer)</td><td>12</td><td>768</td><td>12</td><td>85M</td><td>Uniref50</td></tr><tr><td>ESM-1 (34 layer)</td><td>34</td><td>1280</td><td>20</td><td>670M</td><td>Uniref50</td></tr><tr><td>ESM-1b</td><td>33</td><td>1280</td><td>20</td><td>650M</td><td>Uniref50</td></tr></table>
|
| 310 |
+
|
| 311 |
+
# A APPENDIX
|
| 312 |
+
|
| 313 |
+
# A.1 NOTATION
|
| 314 |
+
|
| 315 |
+
In the figures, we report contact precision in the range of 0.0 to 1.0. In the text and in the tables, we report contact precision in terms of percentages, in the range of 0 to 100.
|
| 316 |
+
|
| 317 |
+
# A.2 AVERAGE PRODUCT CORRECTION (APC)
|
| 318 |
+
|
| 319 |
+
In protein contact prediction, APC is commonly used to correct for background effects of entropy and phylogeny (Dunn et al., 2008). Given an $L \times L$ coupling matrix $F$ , APC is defined as
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
F _ { i j } ^ { \mathrm { A P C } } = F _ { i j } - { \frac { F _ { i } F _ { j } } { F } }
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Where $F _ { i } , F _ { j }$ , and $F$ are the sum over the $i$ -th row, $j$ -th column, and the full matrix respectively.
|
| 326 |
+
We apply APC independently to the symmetrized attention maps of each head in the Transformer.
|
| 327 |
+
These corrected attention maps are passed in as input to a logistic regression.
|
| 328 |
+
|
| 329 |
+
# A.3 GREMLIN IMPLEMENTATION DETAILS
|
| 330 |
+
|
| 331 |
+
Gremlin is trained by optimizing the pseudolikelihood of $W$ and $V$ , which correspond to pairwise and individual amino acid propensities. The pseudolikelihood approximation models the conditional distributions of the original joint distribution and can be written:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\log p ( x _ { i } ^ { d } = a | x _ { j \neq i } ^ { d } ; W _ { i } , V _ { i } ) = \log \frac { \exp \left( V _ { i a } + \sum _ { j = 1 , j \neq i } ^ { N } \sum _ { b = 1 } ^ { 2 0 } \mathbb { 1 } ( x _ { j } ^ { d } = b ) W _ { i j a b } \right) } { \sum _ { c = 1 } ^ { 2 0 } \exp \left( V _ { i c } + \sum _ { j = 1 , j \neq i } ^ { N } \sum _ { b = 1 } ^ { 2 0 } \mathbb { 1 } ( x _ { j } ^ { d } = b ) W _ { i j c b } \right) }
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
subject to the constraint that $W _ { i i } = 0$ for all $i$ , and that $W _ { i j a b }$ is symmetric in both sequence $( i , j )$ and amino acid $( a , b )$ . Additionally, Gremlin uses a regularization parameter that is adjusted based on the depth of the MSA.
|
| 338 |
+
|
| 339 |
+
# A.4 ESM-1 IMPLEMENTATION DETAILS
|
| 340 |
+
|
| 341 |
+
The original ESM-1 models were described in (Rives et al., 2019). ESM-1 is trained on Uniref50 in contrast to the TAPE model, which is trained on Pfam (Finn et al., 2014) and the ProtBERT-BFD model, which is trained on Uniref100 and BFD100 (Steinegger et al., 2019). ESM-1b is a new model, which is the result of an extensive hyperparameter sweep that was performed on smaller 12 layer models. ESM-1b is the result of scaling up that model to 33 layers.
|
| 342 |
+
|
| 343 |
+
Compared to ESM-1, the main changes in ESM-1b are: higher learning rate; dropout after word embedding; learned positional embeddings; final layer norm before the output; and tied input/output word embeddings. Weights for all ESM-1 and ESM-1b models can be found at https://github.com/facebookresearch/esm.
|
| 344 |
+
|
| 345 |
+
# A.5 JACKHMMER DETAILS
|
| 346 |
+
|
| 347 |
+
We use Jackhmmer version 3.3.1 with a bitscore threshold of 27 and 8 iterations to construct MSAs from the ESM training set. The failures on 126 sequences noted in Section 4.4 result from a segmentation fault in hmmbuild after several iterations (the number of successful iterations before the segmentation fault varies depending on the input sequence). Since we see this failure for less than $1 \%$ of the dataset we choose to ignore these sequences during evaluation.
|
| 348 |
+
|
| 349 |
+
Table 4: Average metrics on 15 CASP13 FM Targets. All baselines use MSAs generated via the trRosetta MSA generation approach.
|
| 350 |
+
|
| 351 |
+
<table><tr><td></td><td></td><td colspan="3">6≤sep<12</td><td colspan="3">12≤sep<24</td><td colspan="3">24≤sep</td></tr><tr><td>Model</td><td>Variant</td><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td><td>L</td><td>L/2</td><td>L/5</td></tr><tr><td rowspan="3">Baselines</td><td>mfDCA</td><td>11.0</td><td>13.6</td><td>19.7</td><td>12.8</td><td>17.9</td><td>26.2</td><td>14.4</td><td>19.4</td><td>26.6</td></tr><tr><td>PSICOV3</td><td>10.6</td><td>14.0</td><td>18.3</td><td>12.2</td><td>17.1</td><td>25.9</td><td>14.1</td><td>19.8</td><td>27.9</td></tr><tr><td>Gremlin</td><td>12.1</td><td>16.1</td><td>23.6</td><td>14.5</td><td>20.8</td><td>32.5</td><td>16.8</td><td>23.4</td><td>28.5</td></tr><tr><td rowspan="8">ESM-1b (attention)</td><td>top-1 heads</td><td>11.8</td><td>15.8</td><td>23.8</td><td>17.0</td><td>20.8</td><td>29.6</td><td>13.6</td><td>17.9</td><td>22.7</td></tr><tr><td>top-5 heads</td><td>15.3</td><td>20.9</td><td>29.6</td><td>18.7</td><td>27.0</td><td>33.0</td><td>14.6</td><td>20.6</td><td>26.8</td></tr><tr><td>top-10 heads</td><td>16.6</td><td>22.7</td><td>32.1</td><td>21.8</td><td>29.5</td><td>39.8</td><td>17.9</td><td>23.2</td><td>30.4</td></tr><tr><td>n=1,s=1</td><td>16.4</td><td>23.5</td><td>34.7</td><td>23.0</td><td>30.8</td><td>41.6</td><td>18.1</td><td>23.3</td><td>29.9</td></tr><tr><td>n=10, s=1</td><td>18.6</td><td>25.3</td><td>39.3</td><td>24.1</td><td>31.9</td><td>41.4</td><td>18.7</td><td>25.2</td><td>33.2</td></tr><tr><td>n=20, s=1</td><td>19.3</td><td>26.6</td><td>37.0</td><td>24.0</td><td>31.5</td><td>40.2</td><td>18.6</td><td>25.0</td><td>33.8</td></tr><tr><td>MSA, s=1</td><td>14.2</td><td>20.3</td><td>30.5</td><td>21.0</td><td>29.1</td><td>42.3</td><td>18.4</td><td>23.7</td><td>31.5</td></tr><tr><td>n=20</td><td>14.1</td><td>17.7</td><td>19.8</td><td>17.7</td><td>20.9</td><td>27.9</td><td>11.2</td><td>13.9</td><td>17.0</td></tr></table>
|
| 352 |
+
|
| 353 |
+
Additionally, we evaluated alternate MSAs by running Jackhmmer until a Neff of 128 was achieved (with a maximum of 8 iterations), a procedure described by Zhang et al. (2020). This resulted in very similar, but slightly worse results (average long range $\mathrm { P @ L }$ 29.3, versus 31.3 when always using the output of the eighth iteration). We therefore chose to report results using the 8 iteration maximum.
|
| 354 |
+
|
| 355 |
+
# A.6 RESULTS ON CASP13
|
| 356 |
+
|
| 357 |
+
In Table 4 we report results on the 15 CASP13 Free Modeling targets for which PDBs were publicly released. The specific domains evaluated are: T0950-D1, T0957s2-D1, T0960-D2, T0963-D2, T0968s1-D1, T0968s2-D1, T0969-D1, T0980s1-D1, T0986s2-D1, T0990-D1, T0990-D3, T1000- D2, T1021s3-D1, T1021s3-D2, T1022s1-D1. ESM-1b is able to outperform Gremlin, and simply averaging the top-10 heads of ESM-1b has comparable performance to Gremlin.
|
| 358 |
+
|
| 359 |
+
In addition, we compare our logistic regression model to the bilinear contact prediction model proposed by Rives et al. (2020). This model trains two separate linear projections of the final representation layer and computes contact probabilities via the outer product of the two projections plus a bias term, which generates the following unnormalized log probability:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\log p ( \mathrm { c o n t a c t } ) \propto ( x W _ { 1 } ) ( x W _ { 2 } ) ^ { T } + b
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
Here $x$ is a sequence-length vector of features in $\mathbb { R } ^ { L \times d }$ . Each $W _ { i }$ is a matrix in $\mathbb { R } ^ { d \times k }$ , where $k$ is a hyperparameter controlling the projection size.
|
| 366 |
+
|
| 367 |
+
We train this model in both the limited supervision $n = 2 0$ ) and full supervision $m = 1 4 2 5 7 ,$ ) setting. For the limited supervision setting, we use the same 20 proteins used to train the sparse logistic regression model. For the full supervision setting we generate a $9 5 / 5 \%$ random training/validation split of the 15008 trRosetta proteins with sequence length $\leq 1 0 2 4$ .
|
| 368 |
+
|
| 369 |
+
We performed independent grid searches over learning rate, weight decay, and hidden size for the two settings. For the $n = 2 0$ setting, we found a learning rate of 0.001, weight decay of 10.0, and projection size of 512 had best performance on the validation set. For the $n = 1 4 2 5 7$ setting we found a learning rate of 0.001, weight decay of 0.01, and projection size of 512 had best performance on the validation set. All models were trained to convergence to maximize validation long range $\mathrm { P @ L }$ with a patience of 10. The $n = 2 0$ models were trained with a batch size of 20 (i.e. 1 batch $=$ 1 epoch) and the $n = 1 4 2 5 7$ models were trained with a batch size of 128.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 5: Results on 15 CASP13 FM Domains colored by Neff.
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 6: (a) Gridsearch on logistic regression over number of training examples and number regularization penalty. Values shown are long range $\mathrm { P @ L }$ over a validation set of 20 proteins. (b) Per-head and layer weights of the logistic regression on the best ESM-1b model.
|
| 376 |
+
|
| 377 |
+
The bilinear model performs very poorly in the limited supervision setting, worse than simply taking the top-1 attention head. With full supervision, it moderately outperforms the logistic regression for an increase in long range $\mathrm { P @ L }$ of 1.5 while using $7 0 0 \mathbf { x }$ more data.
|
| 378 |
+
|
| 379 |
+
In Fig. 5 we display results on the $1 5 \mathrm { F M }$ targets colored by effective number of sequences. ESM-1b shows higher precision at $\mathrm { L }$ and L/5 on average, and is sometimes significantly higher for sequences with low Neff. Since ESM-1b training data was generated prior to CASP13, this suggests ESM-1b is able to generalize well to new sequences.
|
| 380 |
+
|
| 381 |
+
# A.7 LOGISTIC REGRESSION DETAILS
|
| 382 |
+
|
| 383 |
+
Given a model with $M$ layers, $H$ heads, and an input sequence $x$ of length $L$ , let $A _ { m h }$ be the $L \times L$ contact map from the $h$ -th head in the $m$ -th layer. We first symmetrize this map and apply APC and let $a _ { m h i j }$ be the coupling weight between sequence position $i$ and $j$ in the resulting map. Then we define the probability of a contact between positions $i$ and $j$ according to a logistic regression with parameters $\beta$ :
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
p ( c _ { i j } ^ { d } ; \beta ) = \frac { 1 } { 1 + \exp { \bigg ( - \beta _ { 0 } - \sum _ { m = 1 } ^ { M } \sum _ { h = 1 } ^ { H } \beta _ { m h } a _ { m h i j } ^ { d } \bigg ) } }
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
To fit $\beta$ , let $\mathcal { D }$ be a set of training proteins, $k$ be a minimum sequence separation, and $\lambda$ be a regularization weight. The objective can then be defined as follows:
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\mathcal { L } ( \mathcal { D } ; \beta ) = \prod _ { d \in \mathcal { D } } \prod _ { i = 1 } ^ { L _ { d } - k } \prod _ { j = i + k } ^ { L _ { d } } p ( c _ { i j } ^ { d } ; \beta )
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\hat { \beta } = \operatorname* { m a x } _ { \beta } \mathcal { L } ( \mathcal { D } ; \beta ) + \frac { 1 } { \lambda } \sum _ { m = 1 } ^ { M } \sum _ { h = 1 } ^ { H } | \beta _ { m h } |
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
We fit the parameters $\beta$ via scikit-learn (Pedregosa et al., 2011) and do not backpropagate the gradients through the attention weights. In total, our model learns $M H + 1$ parameters, many of which are zero thanks to the $L _ { 1 }$ regularization.
|
| 400 |
+
|
| 401 |
+
There are three hyperparameters in our training setup: the number of proteins in our training set $\mathcal { D }$ , the regularization parameter $\lambda$ , and the minimum sequence separation of training contacts $k$ . We find that performance improves significantly when increasing the $\mathcal { D }$ from 1 protein to 10 proteins, but that the performance gains drop off when $\mathcal { D }$ increases from 10 to 20 (Fig. 1). Through a hyperparameter sweep, we determined that the optimal $\lambda$ is 0.15. We find that ignoring local contacts $( | i - j | < 6 )$ is also helpful. Therefore, unless otherwise specified, all logistic regressions are trained with $| \mathcal { D } | =$ $2 0 , \lambda = 0 . 1 5 , k = 6$ . See Fig. 6a for a gridsearch over the number of training proteins and regression penalty. We used 20 training proteins and 20 validation proteins for this gridsearch. Fig. 6b shows the weights of the final logistic regression used for ESM-1b.
|
| 402 |
+
|
| 403 |
+
# A.8 PERFORMANCE DISTRIBUTION
|
| 404 |
+
|
| 405 |
+
Fig. 7 shows the full distribution of performance of ESM-1b compared with Gremlin. When we provide Gremlin access to Uniref100, along with metagenomic sequences, ESM-1b still consistenly outperforms Gremlin when extracting short and medium range contacts. For long range contacts, Gremlin is much more comparable, and has higher contact precision on $47 \%$ of sequences. With access to the same set of sequences, ESM-1b consistently outperforms Gremlin in detecting short, medium, and long range contacts. This suggests that ESM-1b can much better extract information from the same set of sequences and suggests that further scaling of training data may improve ESM1b even further.
|
| 406 |
+
|
| 407 |
+
This analysis is further borne out in Fig. 8. Given the same set of sequences, ESM-1b outperforms Gremlin on average for short, medium, and long-range contacts regardless of the depth of the MSA generated from the ESM-1b training set.
|
| 408 |
+
|
| 409 |
+
Additionally, we find that ESM-1b can provide varying contact maps for different sequences in the MSA (Fig. 9). This is not possible for Gremlin, which is a family-level model. We leverage this in a fairly simple way to provide a modest boost to the contact precision of ESM-1b (Section 5.2).
|
| 410 |
+
|
| 411 |
+
# A.9 SECONDARY STRUCTURE
|
| 412 |
+
|
| 413 |
+
In Section 5.4 we show that some heads that detect local contacts (which often correspond to secondary structure) are actually negatively correlated with long range contacts. We test ESM-1b’s ability to detect secondary structure via attention by training a separate logistic regression on the
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 7: Short, medium, and long range $\mathrm { P @ L }$ performance distribution of ESM-1b vs. Gremlin. Each point is colored by the $\log _ { 2 }$ of the number of sequences in the MSA.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 8: Gremlin performance binned by MSA depth using both ESM (top) and trRosetta (bottom) MSAs. For comparison, ESM-1b performance is also shown for the sequences in each bin.
|
| 420 |
+
|
| 421 |
+
Netsurf dataset (Klausen et al., 2019). As with the logistic regression on contacts, we compute attentions and perform $\mathrm { A P C } +$ symmetrization. To predict the secondary structure of amino acid $i$ , we feed as input the couplings $a _ { m h i j }$ for each layer $m$ , for each head $h$ , and for $j \in [ i - 5 , i + 5 ]$ , for a total of 7260 input features. Using just 100 of the 8678 training proteins, we achieve $7 9 . 3 \%$ accuracy on 3-class secondary structure prediction on the CB513 test set (Cuff & Barton, 1999). Figure 10 shows the importance of each layer to predicting the three secondary structure classes.
|
| 422 |
+
|
| 423 |
+

|
| 424 |
+
Figure 9: Distribution of contact perplexity when evaluating different sequences from the same MSA. The x-axis shows the index of each sequence, sorted in ascending order by hamming distance from the query sequence (query sequence is always index 0). The y-axis shows long range $\mathrm { P @ L }$ . The black line indicates Gremlin performance on that MSA.
|
| 425 |
+
|
| 426 |
+
There are spikes in different layers for all three classes, indicating that particular heads within those layers are specializing in detecting specific classes of secondary structure.
|
| 427 |
+
|
| 428 |
+
Fig. 10 shows importance of each Transformer layer to predicting each of the three secondary structure classes. We see that, as with contact prediction, the most important layers are in the middle layers (14-20) and the final layers (29-33). Some layers spike more heavily on particular contact classes (e.g. layer 33 is important for all classes, but particularly important for $\beta$ -strand prediction). This suggests that particular heads within these layers activate specifically for certain types of secondary structure.
|
| 429 |
+
|
| 430 |
+
# A.10 BOOTSTRAPPED LOW-N CONFIDENCE INTERVAL
|
| 431 |
+
|
| 432 |
+
Section 5.1 shows results from Low-N supervision on 1, 10, and 20 proteins. Since performance in this case depends on the particular proteins sampled we use bootstrapping to determine a confidence interval for each of these estimates. Using the full training, validation, and test set of 14882 proteins, we train 100 logistic regression models using a random sample of $N$ proteins, for $N = 1$ , 10, and 20. Each model is then evaluated on the remaining $1 4 8 8 2 - N$ proteins. The full distribution of samples can be seen in Fig. 12. The confidence interval estimates for long range precision at $\mathrm { L }$ with 1, 10, and 20 training proteins are: $3 5 . 6 \pm 1 . 8$ , $4 0 . 6 \pm 0 . 1$ , and $4 1 . 0 \pm 0 . 1$ respectively.
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 10: $L _ { 2 }$ norm of weights for 3-class secondary structure prediction by Transformer layer.
|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
Figure 11: Calibrated probability of a real contact given predicted probability of contact over all test proteins.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 12: Distribution of precision for all reported statistics using 100 different logistic regression models. Each regression model is trained on a random sample of $N = 1 , 1 0 , 2 0$ proteins.
|
| 442 |
+
|
| 443 |
+
# A.11 MODEL CALIBRATION AND FALSE POSITIVES
|
| 444 |
+
|
| 445 |
+
Vig et al. (2020) suggested that the attention probability from the TAPE Transformer was a wellcalibrated estimator for the probability of a contact. In Fig. 11 we examine the same with the logistic regression trained on the ESM-1 and ESM-1b models. We note that ESM-1b, in addition to being more accurate overall than Gremlin, also provides actual probabilities.
|
| 446 |
+
|
| 447 |
+
We find that as with model accuracy, model calibration increases with larger scale and better hyperparameters. The 6, 12, and 34 layer ESM-1 models have mean-squared error of 0.074, 0.028, and 0.020 between predicted and actual contact probabilities, respectively. ESM-1b has a mean squared error of 0.014. Mean squared error is computed between contact probabilites split into 20 bins according to the scikit-learn calibration curve function. It is therefore reasonable to use the logistic regression probability as a measure of the model’s confidence.
|
| 448 |
+
|
| 449 |
+
In the case of false positive contacts we attempt to measure the Manhattan distance between the coordinates of predicted contacts and the nearest true contact (Fig. 13a). We observe that the Manhattan distance between the coordinates of false positive contacts are often very close (Manhattan distance between 1-4) to real contacts, and that very few false positives have a Manhattan distance $\geq 1 0$ from a true contact. With a threshold contact probability of 0.5, $8 3 . 8 \%$ of proteins have at least one predict contact with Manhattan distance $> 4$ to the nearest contact. This drops to $7 1 . 7 \%$ with a threshold probability of 0.7, and to $5 2 . 5 \%$ with a threshold probability of 0.9.
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Figure 13: (a) Distribution of Manhattan distance between the coordinates of predicted contacts and the nearest true contact at various thresholds of minimum $p ( c o n t a c t )$ . A distance of zero corresponds to a true contact. (b) Actual counts of predictions by Manhattan distance across the full dataset (note y-axis is in log scale).
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
Figure 14: Illustration of two modes for ESM-1b where significant numbers of spurious contacts are predicted. (a) Predicted contacts which do occur in the full homodimer complex, but are not present as intra-chain contacts. (b) CTCF protein contacts. A small band of contacts near the 30-residue offdiagonal is predicted by ESM-1b. This band, along with additional similar bands are also predicted by Gremlin.
|
| 456 |
+
|
| 457 |
+
Fig. 14 highlights two modes for ESM-1b where signficant numbers of spurious contacts are predicted. Fig. 14a shows one example where the model does appear to hallucinate contacts around residues 215 and 415, which do not appear in the contact map for this protein. However, this protein is a homodimer and these contacts are present in the inter-chain contact map. This suggests that some ‘highly incorrect’ false positives may instead be picking up on inter-chain contacts. Fig. 14b shows an example of a repeat protein, for which evolutionary coupling methods are known to pick up on additional ‘bands’ of contacts (Espada et al., 2015; Anishchenko et al., 2017). Multiple bands are visible in the Gremlin contact map, while only the first band, closest to the diagonal, is visible in the ESM-1b contact map. More analysis would be necessary to determine the frequency of these modes, along with additional potential modes.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
Figure 15: Robustness of ESM-1b and TAPE models to insertions of Alanine at the beginning, middle, and end of sequence
|
| 461 |
+
|
| 462 |
+
# A.12 ALIGNMENT
|
| 463 |
+
|
| 464 |
+
One hypothesis as to the benefit of large language models as opposed to simpler Potts models is that they may be able to learn an implicit alignment due to their learned positional embedding. For a Potts Model, an alignment enables a model to relate positions in the sequence given evolutionary context despite the presence of insertions or deletions. We test the robustness of the model to insertions by inserting consecutive alanines at the beginning, middle, or end of 1000 randomly chosen sequences with initial sequence length $< 5 1 2$ (we limit initial sequence length in order to avoid out-of-memory issues after insertion). We find that ESM-1b can tolerate up to 256 insertions at the beginning or end of the sequence and up to 64 insertions in the middle of the sequence before performance starts to significantly degrade. This suggests that ESM-1b learns a robust implicit alignment of the protein sequence.
|
| 465 |
+
|
| 466 |
+
On the other hand, we find that the TAPE Transformer is less robust to insertions. On one sequence (pdbid: 1a27), we find the TAPE Transformer drops in precision by 12 percentage points after adding just 8 alanines to the beginning of the sequence, while ESM-1b sees minimal degradation until 256 alanines are inserted. We hypothesize that, because TAPE was trained on protein domains, it did not learn to deal with mis-alignments in the input sequence.
|
| 467 |
+
|
| 468 |
+
# A.13 EVOLUTIONARY FINETUNING DETAILS
|
| 469 |
+
|
| 470 |
+
We finetuned each model using a learning rate of 1e-4, 16k warmup updates, an inverse square root learning rate schedule, and a maximum of 30 epochs. This resulted in a varying number of total updates depending on the size of the MSA, with larger MSAs being allowed to train for more updates. This should ideally help prevent the model from overfitting too quickly on very small MSAs. We use a variable batch size based on the length of the input proteins, fixing a maximum of 16384 tokens per batch (so for a length 300 protein this would correspond to a batch size of 54). We use MSAs from trRosetta for finetuning all proteins with the exception of avGFP, where we use the same set of sequences from Alley et al. (2019).
|
| 471 |
+
|
| 472 |
+

|
| 473 |
+
Figure 16: Left: Average change in contact precision vs. number of finetuning epochs over 380 proteins. Right: Real and predicted contacts before and after evolutionary finetuning for 1a3a and avGFP. For 1a3a, long range $\mathrm { P @ L }$ improves from 54.5 to 61.4. For avGFP, long range $\mathrm { P @ L }$ improves from 7.9 to 11.4.
|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
Figure 17: Contacts for 3qhp from Gremlin trained on pseudo-MSA generated by ESM-1b, compared to real and ESM-1b predicted contacts. The generated MSA achieves a long-range $\mathrm { P @ L }$ of 52.2 while the attention maps achieve a precision of 76.7.
|
| 477 |
+
Algorithm 1: Quickly generate a pseudo-MSA from an input sequence.
|
| 478 |
+
|
| 479 |
+
# A.14 MSA GENERATION
|
| 480 |
+
|
| 481 |
+
Result: Generated MSA
|
| 482 |
+
input $/ /$ protein sequence
|
| 483 |
+
curr $=$ input $/ /$ optionally, the input can be repeated for batching
|
| 484 |
+
for $0 \leq i < 1 0 0 0 0$ do masked $=$ mask $20 \%$ of positions in curr; pred $=$ model(masked); curr[masked positions] $=$ pred[masked positions]; MSA.append(curr); if random $. ( ) < 0 . 1$ then curr $=$ input; end
|
| 485 |
+
end
|
| 486 |
+
|
| 487 |
+
Algorithm 1 presents the algorithm used to generate pseudo-MSAs from ESM-1b. Each pseudoMSA is passed to GREMLIN in order to evaluate the preservation of contact information (Fig. 17).
|
md/train/l2UWXn5iBQI/l2UWXn5iBQI.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Exponential Graph is Provably Efficient for Decentralized Deep Training
|
| 2 |
+
|
| 3 |
+
Bicheng $\mathbf { Y i n g ^ { 1 , 3 } }$ ∗, $\mathbf { K u n \ Y u a n ^ { 2 * } }$ , Yiming $\mathbf { C h e n ^ { 2 * } }$ , Hanbin $\mathbf { H } \mathbf { u } ^ { 4 }$ , Pan $\mathbf { P a n } ^ { 2 }$ , Wotao $\mathbf { Y i n ^ { 2 } }$
|
| 4 |
+
|
| 5 |
+
1 University of California, Los Angeles 2 DAMO Academy, Alibaba Group 3 Google Inc. 4 University of California, Santa Barbara ybc@ucla.edu, {kun.yuan, charles.cym}@alibaba-inc.com, hanbinhu@ucsb.edu, {panpan.pp, wotao.yin}@alibaba-inc.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Decentralized SGD is an emerging training method for deep learning known for its much less (thus faster) communication per iteration, which relaxes the averaging step in parallel SGD to inexact averaging. The less exact the averaging is, however, the more the total iterations the training needs to take. Therefore, the key to making decentralized SGD efficient is to realize nearly-exact averaging using little communication. This requires a skillful choice of communication topology, which is an under-studied topic in decentralized optimization.
|
| 10 |
+
|
| 11 |
+
In this paper, we study so-called exponential graphs where every node is connected to $O ( \log ( n ) )$ neighbors and $n$ is the total number of nodes. This work proves such graphs can lead to both fast communication and effective averaging simultaneously. We also discover that a sequence of $\log ( n )$ one-peer exponential graphs, in which each node communicates to one single neighbor per iteration, can together achieve exact averaging. This favorable property enables one-peer exponential graph to average as effective as its static counterpart but communicates more efficiently. We apply these exponential graphs in decentralized (momentum) SGD to obtain the state-of-the-art balance between per-iteration communication and iteration complexity among all commonly-used topologies. Experimental results on a variety of tasks and models demonstrate that decentralized (momentum) SGD over exponential graphs promises both fast and highquality training. Our code is implemented through BlueFog and available at https://github.com/Bluefog-Lib/NeurIPS2021-Exponential-Graph.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Efficient distributed training methods across multiple computing nodes are critical for large-scale modern deep learning tasks. Parallel stochastic gradient descent (SGD) is a widely-used approach, which, at each iteration, computes a globally averaged gradient either using Parameter-Server [28] or All-Reduce [47]. Such global coordination across all nodes in parallel SGD results in either significant bandwidth cost or high latency, which can notably hamper the training scalability.
|
| 16 |
+
|
| 17 |
+
Decentralized SGD [45, 11, 30, 3] based on partial averaging has been one of the promising alternatives to parallel SGD in distributed deep training. Partial averaging, as opposed to the global averaging exploited in parallel SGD, only requires each node to compute the locally averaged model within its neighborhood. Decentralized SGD does not involve any global operations, so it has much lower communication overhead per iteration. The fewer neighbors each node needs to communicate, the more efficient the per-iteration communication is in decentralized SGD.
|
| 18 |
+
|
| 19 |
+
Table 1: Comparison between decentralized (momentum) SGD over (some) various commonly-used topologes. The table assumes homogeneous data distributions across all nodes (which is practical for deep training within a data-center). The comparison for data-heterogeneous scenarios, and with more other topologies, is listed in Appendix C. The smaller the transient iteration complexity is, the faster decentralized algorithms will converge.
|
| 20 |
+
|
| 21 |
+
<table><tr><td>Topology</td><td>Ring</td><td>Grid</td><td>Rand-Graph</td><td>Rand-Match</td><td>Static Exp</td><td> One-peer Exp</td></tr><tr><td>Per-iter Comm.</td><td>(2)</td><td>2(4)</td><td>()</td><td>(1)</td><td>Ω(log2(n))</td><td>(1)</td></tr><tr><td>Trans. Iters.</td><td>Ω(n7)</td><td>Ω(n5)</td><td>(n3)</td><td>1</td><td>Ω(n³ log2(n))</td><td>Ω(n³log²2(n))</td></tr></table>
|
| 22 |
+
|
| 23 |
+
The reduced communication in decentralized SGD comes with a cost: slower convergence. While it can asymptotically achieve the same convergence linear speedup as parallel SGD [30, 3, 25, 64], i.e., the training speed increases proportionally to the number of computing nodes (see the definition in Sec. 2), decentralized SGD requires more iterations to reach that stage due to the ineffectiveness to aggregate information using partial averaging. We refer those iterations before decentralized SGD reaches its linear speedup stage as transient iterations (see the definition in Sec. 2), which is an important metric to measure the influence of partial-averaging [48, 65] on convergence rate of decentralized SGD. The less effective the partial averaging is, the more transient iterations decentralized SGD needs to take. Fig. 1 illustrates the transient iterations of decentralized SGD for the logistic regression problem. It is observed that decentralized SGD can asymptotically converge as fast as parallel SGD, but it requires more iterations (i.e., transient iterations) to reach that stage.
|
| 24 |
+
|
| 25 |
+
Per-iteration communication and transient iterations in decentralized SGD are determined by the network topology (we also use graph interchangeably with topology). The maximum degree of the graph decides the communication cost while the connectivity influences the transient iteration complexity. Generally speaking, a sparsely-connected topology communicates cheaply but endows decentralized SGD with more transient iterations due to the less effective information aggregation. A skillful choice of network topology, which is critical to achieve balance between periteration communication and transient iteration complexity, is under-studied in literature.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Illustration of transient iters. Experimental setting is in Appendix D.5.
|
| 29 |
+
|
| 30 |
+
This work studies exponential graphs which are empirically successful [3, 61, 27, 14, 67] but less theoretically understood in deep training. Exponential graphs have two variants. In a static exponential graph, each node communicates to $\lceil \log _ { 2 } ( n ) \rceil$ neighbors (see Sec. 3 and Fig. 2). In one-peer exponential graph, however, each node cycles through all its neighbors, communicating, only, to a single neighbor per iteration (see Sec. 4 and Fig. 2). This paper will first clarify the connectivity and averaging effectiveness of these exponential graphs, and then apply them to decentralized momentum SGD to obtain the state-of-the-art balance between per-iteration communication and transient iteration complexity among all commonly-used topologies. Our main results (as well as our contributions) are:
|
| 31 |
+
|
| 32 |
+
• We prove that the spectral gap, which is used to measure the connectivity of the graph (see the definition in Sec. 2), of the static exponential graph is upper bounded by $O ( 1 / \log _ { 2 } ( n ) )$ . Before us, many literatures (e.g. [27]) claimed its upper bound to be $O ( 1 )$ incorrectly. Since one-peer exponential graphs are time-varying, it is difficult to derive their spectral gaps. However, we establish that any $\log _ { 2 } ( n )$ consecutive sequence of one-peer exponential graphs can together achieve exact averaging when $n$ is a power of 2. • With the above results, we establish that one-peer exponential graph, though much sparser than its static counterpart, surprisingly endows decentralized momentum SGD with the same convergence rate as static exponential graph in terms of the best-known bounds. • We derive that exponential graphs achieve $\tilde { \Omega } ( 1 ) ^ { 2 }$ per-iteration communication and $\tilde { \Omega } ( n ^ { 3 } )$ transient iterations, both of which are nearly the best among other known topologies, see Table 1. The one-peer exponential graph is particularly recommended for decentralized deep training. • We conduct extensive industry-level experiments across different tasks and models with various decentralized methods, graphs, and network size to validate our theoretical results.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Illustration of the static and one-peer exponential graph.
|
| 36 |
+
|
| 37 |
+
2 Revisit Decentralized Momentum SGD and Related Works
|
| 38 |
+
|
| 39 |
+
This section reviews basic concepts and existing results on decentralized momentum SGD.
|
| 40 |
+
|
| 41 |
+
Problem. Suppose $n$ computing nodes cooperate to solve the distributed optimization problem:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } f _ { i } ( x ) \quad { \mathrm { w h e r e } } \quad f _ { i } ( x ) : = \mathbb { E } _ { \xi _ { i } \sim D _ { i } } F ( x ; \xi _ { i } ) .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Function $f _ { i } ( x )$ is local to node $i$ , and random variable $\xi _ { i }$ denotes the local data that follows distribution $D _ { i }$ . We do not assume each distribution $D _ { i }$ is the same across all nodes.
|
| 48 |
+
|
| 49 |
+
Network topology and weights. Decentralized methods are based on partial averaging within neighborhood that is defined by the network topology (see the figure 2 as an example of six nodes). We assume all computing nodes are connected by a (directed or undirected) network topology. We define $w _ { i j }$ , the weight to scale information flowing from node $j$ to node $i$ , as follows:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
w _ { i j } \left\{ { \begin{array} { l l } { > 0 } & { { \mathrm { ~ i f ~ n o d e ~ } } j { \mathrm { ~ i s } } } \\ { = 0 } & { { \mathrm { ~ o t h e r w i s e . } } } \end{array} } \right.
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
$\mathcal { N } _ { i } : = \{ j | w _ { i j } > 0 \}$ is defined as the set of neighbors of node $i$ which also includes node $i$ itself and the weight matrix $W : = [ w _ { i j } ] _ { i , j = 1 } ^ { n } \in \mathbb { R } ^ { n \times n } .$ are denoted as a matrix that stacks the weights of all nodes. This matrix $W$ characterizes the sparsity and connectivity of the underlying network topology.
|
| 56 |
+
|
| 57 |
+
Decentralized momentum SGD $\mathbf { ( D m S G D ) }$ . There are many variants of decentralized momentum SGD [3, 20, 32, 67]. This paper will focus on the one proposed by [64] (listed in Algorithm 1), which imposes an additional partialaveraging over the momentum to achieve further speed up. The topology is allowed to change with iterations. When ${ \check { W } } ^ { k } \equiv W$ , topology and weight matrix will remain static.
|
| 58 |
+
|
| 59 |
+
Assumptions. We introduce several standard assumptions to facilitate future analysis:
|
| 60 |
+
|
| 61 |
+
# Algorithm 1 DmSGD
|
| 62 |
+
|
| 63 |
+
Initialize $\gamma _ { - }$ , x(0)i ; let m(0i $m _ { i } ^ { ( 0 ) } = 0 , \beta \in ( 0 , 1 )$ For $k = 0 , 1 , 2 , . . . , T - 1$ , every node $i$ do Sample weight matrix $W ^ { ( k ) }$ ; Update gradient $g _ { i } ^ { ( k ) } = \nabla F ( x _ { i } ^ { ( k ) } ; \xi _ { i } ^ { ( k ) } )$ ; $\begin{array} { r } { m _ { i } ^ { ( k + 1 ) } = \sum _ { j \in \mathcal { N } _ { i } } w _ { i j } ^ { ( k ) } \big ( \beta m _ { j } ^ { ( k ) } + g _ { j } ^ { ( k ) } \big ) } \end{array}$ ; $\begin{array} { r } { x _ { i } ^ { ( k + 1 ) } = \sum _ { j \in \mathcal { N } _ { i } } w _ { i j } ^ { ( k ) } \big ( x _ { j } ^ { ( k ) } - \gamma m _ { j } ^ { ( k ) } \big ) } \end{array}$ ;
|
| 64 |
+
|
| 65 |
+
A.1 [SMOOTHNESS] Each $f _ { i } ( x )$ is $L$ -smooth, i.e., $\| \nabla f _ { i } ( x ) - \nabla f _ { i } ( y ) \| \leq L \| x - y \|$ for any $x , y \in \mathbb { R } ^ { d }$
|
| 66 |
+
|
| 67 |
+
A.2 [GRADIENT NOISE] The random sample $\xi _ { i } ^ { ( k ) }$ is independent of each other for any $k$ and $i$ . We also assume $\mathbb { E } [ \nabla F ( x ; \xi _ { i } ) ] = \nabla f _ { i } ( x )$ and $\begin{array} { r } { \hat { \mathbb { E } } \| \nabla \dot { F } ( x ; \xi _ { i } ) - \mathbf { \bar { \nabla } } f _ { i } ( x ) \| ^ { 2 } \leq \sigma ^ { 2 } } \end{array}$ .
|
| 68 |
+
|
| 69 |
+
A.3 [DATA HETEROGENEITY] It holds that $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \| \nabla f _ { i } ( x ) - \nabla f ( x ) \| ^ { 2 } \leq b ^ { 2 } } \end{array}$ for any $\boldsymbol { x } \in \mathbb { R } ^ { d }$
|
| 70 |
+
|
| 71 |
+
A.4 [WEIGHT MATRIX] The weight matrix $W ^ { ( k ) }$ is doubly-stochastic, i.e. $W ^ { ( k ) } \mathbb { 1 } ~ = ~ \mathbb { 1 }$ and $\mathbb { 1 } ^ { T } W ^ { ( k ) } = \mathbb { 1 } ^ { T }$ . If $W ^ { ( k ) } \equiv W$ , we assume $\begin{array} { r } { \rho ( W ) : = \operatorname* { m a x } _ { \lambda _ { i } ( W ) \neq 1 } \{ | \lambda _ { i } ( W ) | \} \in ( 0 , 1 ) } \end{array}$ , where $\lambda _ { i } ( W )$ is the $i -$ th eigenvalue of the matrix $W$ . 3
|
| 72 |
+
|
| 73 |
+
The quantity $1 - \rho$ , which is also referred to as the spectral gap of the weight matrix $W$ , measures how well the topology is connected [53]. In the large and sparse topology which is most valuable to deep training, it typically holds that $1 - \rho \to 0$ .
|
| 74 |
+
|
| 75 |
+
Communication overhead. According to [5], global averaging across $n$ nodes either incurs $\Omega ( n )$ bandwidth cost via Parameter-Server, or $\Omega ( n )$ latency via Ring-Allreduce. In either way, it takes $\Omega ( n )$ per-iteration communication time, which is proportional to the network size $n$ . As to decentralized methods, we will similarly assume the per-iteration communication time to be $\Omega$ (maximum degree). Convergence. Under Assumptions A.1–A.4, DmSGD with static topology will converge at [64, 25]:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\frac { 1 } { T } \sum _ { k = 1 } ^ { T } \mathbb { E } \| \nabla f ( \bar { \mathbf { x } } ^ { ( k ) } ) \| ^ { 2 } = O \left( \frac { \sigma ^ { 2 } } { \sqrt { n T } } + \frac { n \sigma ^ { 2 } } { T ( 1 - \rho ) } + \frac { n b ^ { 2 } } { T ( 1 - \rho ) ^ { 2 } } \right)
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
in which $\begin{array} { r } { \bar { x } ^ { ( k ) } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } x _ { i } ^ { ( k ) } } \end{array}$ . It is worth noting that no analysis in literature, to our knowledge, exists for DmSGD over time-varying topologies with non-convex costs.
|
| 82 |
+
|
| 83 |
+
Linear speedup. When $T$ is sufficiently large, the first term $1 / \sqrt { n T }$ dominates (3). This also applies to parallel SGD. Decentralized and parall SGDs all require $T = \Omega ( 1 / ( n \epsilon ^ { 2 } ) )$ iterations to reach a desired accuracy $\epsilon$ , which is inversely proportional to $n$ . Therefore, an algorithm is in its linear-speedup stage at $T$ th iteration if, for this $T$ , the term involving $n T$ is dominating the rate.
|
| 84 |
+
|
| 85 |
+
Transient iterations. Transient iterations are referred to those iterations before an algorithm reaches linear-speedup stage, that is when $T$ is relatively small so non- $\mathbf { \nabla } \cdot n T$ terms still dominate the rate (see illustration in Appendix C). To reach linear speedup, $T$ has to satisfy (derivation in Appendix C)
|
| 86 |
+
|
| 87 |
+
Homogeneous dat $ \mathrm { 1 : } \quad T = \Omega \left( { \frac { n ^ { 3 } } { ( 1 - \rho ) ^ { 2 } } } \right) \qquad { \mathrm { H e t e r o g e n e o u s ~ d a t a : } } \quad T = \Omega \left( { \frac { n ^ { 3 } } { ( 1 - \rho ) ^ { 4 } } } \right)$
|
| 88 |
+
|
| 89 |
+
which corresponds to the transient iteration complexity in the homo/hetero-geneous data scenarios.
|
| 90 |
+
|
| 91 |
+
# 2.1 Related Works
|
| 92 |
+
|
| 93 |
+
Decentralized deep training. Decentralized optimization originates from the control and signal processing community. The first decentralized algorithms on general optimization problems include decentralized gradient descent [45], diffusion [11, 51] and dual averaging [18]. In the deep learning regime, decentralize SGD, which was established in [30] to achieve the same linear speedup as parallel SGD in convergence rate, has attracted a lot of attentions. Many efforts have been made to extend the algorithm to directed topologies [3, 42], time-varying topologies [25, 42], asynchronous settings [31], and data-heterogeneous scenarios [57, 62, 32, 67]. Techniques such as quantization/compression [2, 8, 26, 24, 58, 36], periodic updates [55, 25, 64], and lazy communication [37, 38, 13] were also integrated into decentralized SGD to further reduce communiation overheads.
|
| 94 |
+
|
| 95 |
+
Topology influence. The influence of network topology on decentralized SGD was extensively studied in [25, 51, 66, 45, 42, 27]. All these works indicate that a well-connected topology will significantly accelerate decentralized SGD. Two directions have been explored to relieve the influence of network topology. One line of research proposes new algorithms that are less sensitive to topologies. For example, [66, 23, 65, 57, 1] removed data heterogeneity with bias-correction techniques in [68, 29, 62, 40, 69], and [14, 61, 7, 27] utilized periodic global averaging or multiple partial averaging steps. All these methods have improved topology dependence. The other line is to investigate topologies that enable communication-efficient decentralized optimization. [43, 15] examined various topologies (such as ring, grid, torus, expander, etc.) on averaging effectiveness, which, however, are either communication-costly or averaging-ineffective compared to exponential graphs studied in this paper. [41, 6, 9, 10] studied random graphs (such as Erdos-Renyi random graph and random geometric graph) in which each edge is activated randomly. The randomness of the edge activation can cause a highly unbalanced degrees of each node in the graph, which may significantly affect the efficiency in per-iteration communication.
|
| 96 |
+
|
| 97 |
+
Algorithms with time-varying topologies. Many previous works have studied decentralized algorithms with time-varying topologies. [42] and [44] examined the convergence of decentralized (deterministic) gradient descent and gradient tracking under convex scenarios. [17, 52] investigated gradient tracking under non-convex scenarios, but it did not clarify the influence of the time-varying graphs on convergence rate. In the stochastic scenario, [25] illustrates how decentralized SGD is influenced by time-varying topologies in the non-convex scenario. However, its analysis cannot be directly extended to the decentralized momentum SGD studied in this work.
|
| 98 |
+
|
| 99 |
+
Another related work is the Matcha method [60] based on disjoint matching decomposition sampling. While similar to Matcha, decentralized SGD over one-peer exponential graphs has several fundamental differences. First, one-peer exponential graph is directed while Matcha only supports undirected and symmetric matching decomposition. Second, the favorable periodic exact-average property of one-peer exponential graphs only holds when sampled cyclicly. However, Matcha only supports independent and random matching samples in analysis. For these reasons, Matcha cannot cover one-peer exponential graphs (especially when momentum is utilized in decentralized SGD).
|
| 100 |
+
|
| 101 |
+
Note. This paper considers deep training within high-performance data-center clusters, in which all GPUs are connected with high-bandwidth channels and the network topology can be fully controlled. It is not for the wireless network setting in which the topology cannot be changed freely.
|
| 102 |
+
|
| 103 |
+
# 3 Spectral Gap of Static Exponential Graph
|
| 104 |
+
|
| 105 |
+
As discussed above, the graph maximum degree decides the per-iteration communication cost while the spectral gap determines the transient iteration complexity (see (4)). It is critical to seek topologies that are both sparse and with large spectral gap $1 - \rho$ simultaneously. In this section, we will establish that the static exponential graph, which was first introduced in [3, 30], is one of such topologies.
|
| 106 |
+
|
| 107 |
+
In a static exponential graph, each node is assigned an index from 0 to $n - 1$ and will communicate to neighbors that are $2 ^ { \bar { 0 } } , 2 ^ { \bar { 1 } } , \cdot \cdot \cdot , 2 ^ { \lfloor \log _ { 2 } ( n - 1 ) \rfloor }$ hops away. The left plot in Fig. 2 illustrates a directed 6-node exponential network topology. With maximum degree $\lceil \log _ { 2 } ^ { - } ( n ) \rceil$ neighbors, partial averaging over the static exponential graph will take $\Omega ( \log _ { 2 } ( n ) )$ communication time per iteration. However, it remains unclear what the spectral gap is for this topology.
|
| 108 |
+
|
| 109 |
+
# Weight matrix associated with static exponential graph is defined as follows:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
w _ { i j } ^ { \mathrm { e x p } } = \left\{ \begin{array} { l l } { \frac { 1 } { \lceil \log _ { 2 } ( n ) \rceil + 1 } } & { \mathrm { i f ~ } \log _ { 2 } ( \bmod ( j - i , n ) ) \mathrm { ~ i s ~ a n ~ i n t e g e r ~ o r ~ } i = j } \\ { 0 } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
An example weight matrix associated with the static exponential graph in Fig. 2 is in Appendix A.1 The following proposition evaluates the spectral gap $1 - \rho$ for weight matrix in (5).
|
| 116 |
+
|
| 117 |
+
Proposition 1 (SPECTRAL GAP OF STATIC EXPO) The spectral gap of matrix (5), which can also be interpreted as the second largest magnitude of eigenvalues, satisfies (Proof is in Appendix A.2)
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
1 - \rho ( W ^ { \mathrm { e x p } } ) \left\{ \begin{array} { l l } { \displaystyle = \frac { 2 } { 1 + \lceil \log _ { 2 } ( n ) \rceil } , w h e n n i s e \nu e n n u m b e r } \\ { \displaystyle < \frac { 2 } { 1 + \lceil \log _ { 2 } ( n ) \rceil } , w h e n n i s o d d n u m b e r } \end{array} \right.
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
In addition, we have $\begin{array} { r } { \| W ^ { \mathrm { e x p } } - \frac { 1 } { n } \mathbb { 1 } \mathbb { 1 } ^ { T } \| _ { 2 } = \rho ( W ^ { \mathrm { e x p } } ) } \end{array}$ .
|
| 124 |
+
|
| 125 |
+
Remark 1 For a general non-symmetric matrix $W$ , it typically holds that $\begin{array} { r } { \| W - \frac { 1 } { n } \pm \Im \Im ^ { T } \| _ { 2 } \neq \rho ( W ) } \end{array}$ Proposition 1 establishes $\begin{array} { r } { \| W ^ { \mathrm { e x p } } - \frac { 1 } { n } \mathbb { 1 } \mathbb { 1 } ^ { T } \| _ { 2 } = \rho ( W ^ { \mathrm { e x p } } ) } \end{array}$ for exponential graph.
|
| 126 |
+
|
| 127 |
+
Remark 2 The hypercube graph is established in $I 5 9$ , Chapter 16] to have the spectral gap as $1 - \rho ( W ^ { \mathrm { H y p e r C u b e } } ) = 2 / ( 1 + \log _ { 2 } ( n ) )$ . While such spectral gap is on the same order as the exponential graph, there are two fundamental differences between these two graphs: (a) the hypercube graph has to be undirected and the corresponding $W$ is symmetric; (b) the number of vertices of hypercube must be a power of 2, i.e., $n = 2 ^ { \tau }$ for some positive integer $\tau$ . In comparision, the exponential graph is more flexible in the size of the graph structure.
|
| 128 |
+
|
| 129 |
+
Remark 3 Proposition 1 clarifies the spectral gap of the static exponential graph. Many literatures before this work (such as [27]) claimed the spectral gap to be $O ( 1 )$ , which is not accurate.
|
| 130 |
+
|
| 131 |
+
The theoretical analysis of Proposition 1 is non-trivial. To evaluate the spectral gap, for any network size $n$ , we have to derive the analytical expression for each eigenvalue using Fourier transform and calculate the magnitudes. The most tricky part is to assert which eigenvalue expression attains the second largest value.
|
| 132 |
+
|
| 133 |
+
We now numerically validate the established spectral gap. In Fig. 3, we plotted the spectral gap of the static exponential graph with $n$ ranging from 4 to 290. It is observed that the derived gap $\rho = 1 - 2 / ( 1 + \lceil \log _ { 2 } ( n ) \rceil )$ is very tight (see the black dashed line). In fact, it exactly matches the numerical spectral gap when $n$ is even. Moreover, it is also observed the spectral gap of static exponential graph is much smaller than that of ring or grid.
|
| 134 |
+
|
| 135 |
+
Finally, we compare the spectral gap and maximum degree of the static exponential graph with all other common graphs in Appendix A.3. It is observed that static exponential graph, while with a sightly larger maximum degree, has a significantly smaller spectral gap than ring and grid.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 3: Spectral gap of some topologies.
|
| 139 |
+
|
| 140 |
+
# 4 One-Peer Exponential Graph Achieves Periodic Exact-Averaging
|
| 141 |
+
|
| 142 |
+
Static exponential graph incurs $\Omega ( \log _ { 2 } ( n ) )$ communication overhead per iteration. To overcome this issue, [3] proposes to decompose the static exponential graph into a sequence of one-peer graphs, in which each node cycles through all its neighbors, communicating, only, to a single neighbor per iteration, see the right plot in Fig. 2. Apparently, each one-peer realization incurs $\Omega ( 1 ) { \bar { } }$ communication cost, which matches with ring or grid. Since each realization is sparser than the static graph, one may expect DmSGD with one-peer exponential graphs are less effective in aggregating information. In the following, we will establish an interesting result: one-peer is very effective in averaging.
|
| 143 |
+
|
| 144 |
+
Time-varying weight matrix. We let $\tau = \lceil \log _ { 2 } ( n ) \rceil$ . The weight matrix at iteration $k$ is
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
w _ { i j } ^ { ( k ) } = \left\{ \begin{array} { l l } { \frac { 1 } { 2 } } & { \mathrm { i f } \log _ { 2 } ( \bmod ( j - i , n ) ) = \bmod ( k , \tau ) } \\ { \frac { 1 } { 2 } } & { \mathrm { i f } i = j } \\ { 0 } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
The weight matrix for each realization of the one-peer exponential graphs in Fig. 2 is in Appendix B.1. Since each node communicates to one single neighbor per iteration, the resulting weight matrix is very sparse, with only one non-zero element in the non-diagonal positions per row and column.
|
| 151 |
+
|
| 152 |
+
Periodic exact-averaging. The periodic exact-averaging property, which was observed by [3] without theoretical justifications, is fundamental to clarify the averaging effectiveness of one-peer exponential graphs. The following lemma proves that the property holds when $n$ is a power of 2.
|
| 153 |
+
|
| 154 |
+
Lemma 1 (PERIODIC EXACT AVERAGING) Suppose $\tau = \log _ { 2 } ( n )$ is a positive integer. If $W ^ { ( k ) }$ is the weight matrix generated by (7) over the one-peer exponential graphs, it then holds that each $W ^ { ( k ) }$ is doubly-stochastic, i.e. $\mathbf { \dot { W } } ^ { ( \dot { k } ) } \mathbb { 1 } = \mathbb { 1 }$ and $\mathbb { 1 } ^ { \dot { T } } W ^ { ( k ) } \dot { = } \mathbb { 1 } ^ { T }$ . Furthermore, it holds that
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
W ^ { ( k + \ell ) } W ^ { ( k + \ell - 1 ) } \cdot \cdot \cdot W ^ { ( k + 1 ) } W ^ { ( k ) } = \frac { 1 } { n } \mathbb { 1 } \mathbb { 1 } ^ { T }
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
for any integer $k \geq 0$ and $\ell \geq \tau$ . And equivalently, the consensus residue form holds that
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\left( W ^ { ( k + \ell ) } - { \frac { 1 } { n } } \mathbb { 1 } \mathbb { 1 } ^ { T } \right) \left( W ^ { ( k + \ell - 1 ) } - { \frac { 1 } { n } } \mathbb { 1 } \mathbb { 1 } ^ { T } \right) \cdots \left( W ^ { ( k ) } - { \frac { 1 } { n } } \mathbb { 1 } \mathbb { 1 } ^ { T } \right) = 0
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
(Proof is in Appendix B.2).
|
| 167 |
+
|
| 168 |
+
Remark 4 The assumption that $\log _ { 2 } ( n )$ is a positive integer seems necessary. We numerically tested various one-peer exponential graphs with non-integer $\log _ { 2 } ( n )$ . None of them is endowed with the periodic exact-average property.
|
| 169 |
+
|
| 170 |
+
Remark 5 When $\log _ { 2 } ( n )$ is a positive integer and each realization of the one-peer exponential graph is sampled without replacement, it is easy to verify that the periodic exact-averaging property still holds. However, if each realization is sampled with replacement, the periodic exact-averaging property generally does not hold unless all realizations are occasionally sampled without repeating.
|
| 171 |
+
|
| 172 |
+
Remark 6 It is worth noting that an one-peer variant of the hypercube graph is established to achieve exact averaging with $\tau = \log _ { n } ( n )$ steps [54]. Such one-peer hypercube is undirected and symmetric, which is different from the one-peer exponential graph which is directed and asymmetric.
|
| 173 |
+
|
| 174 |
+
We now numerically validate Lemma 1. To this end, we initialize a vector $\bar { x _ { \mathrm { ~ \in ~ } } } \mathbb { R } ^ { d }$ arbitrarily, and examine how $\begin{array} { r } { \| ( \Pi _ { \ell = 0 } ^ { k } W ^ { ( \ell ) } - \frac { 1 } { n } \pmb { 1 } \pmb { 1 } \| ^ { T } ) x \| } \end{array}$ decreases with iteration $k$ . The weight matrix $W ^ { ( k ) }$ is either static or samples from onepeer exponential graph or bipartite random match graph. In Fig. 4, it is observed that one-peer exponential graphs can achieve exact average after $\log _ { 2 } ( n )$ steps, which coincides with the results in Lemma 1. In contrast, the static exponential and bipartite random match graphs can only achieve the global average asymptotically. The justification for Remarks 4 and 5 is in Appendix B.3.
|
| 175 |
+
|
| 176 |
+
# 5 DmSGD with Exponential Graphs
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 4: Illustration of how consensus residues decay with iterations for various graphs. O.E. and S.E. denote one-peer and static exponential graphs, and R.M. denotes bipartite random match graph.
|
| 180 |
+
|
| 181 |
+
With the derived property in Sec. 3 and 4, this section will examine the convergence of DmSGD with static and one-peer exponential graphs.
|
| 182 |
+
|
| 183 |
+
DmSGD with static exponential graph. Based on Proposition 1, we can achieve the convergence rate and transient iterations, by following analysis in [64], of DmSGD with static exponential graph.
|
| 184 |
+
|
| 185 |
+
Corollary 1 Under Assumptions A.1–A.4, if γ = n(1−β)3√ , DmSGD (Algorithm 1) will converge at
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\frac { 1 } { T } \sum _ { k = 1 } ^ { T } \mathbb { E } \| \nabla f ( \bar { \mathbf { x } } ^ { ( k ) } ) \| ^ { 2 } = O \left( \frac { \sigma ^ { 2 } } { \sqrt { ( 1 - \beta ) n T } } + \frac { n \log _ { 2 } ( n ) ( 1 - \beta ) \sigma ^ { 2 } } { T } + \frac { n ( 1 - \beta ) b ^ { 2 } \log _ { 2 } ^ { 2 } ( n ) } { T } \right)
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
Furthermore, the transient iteration complexity of DmSGD over static exponential graph is $O ( n ^ { 3 } \log _ { 2 } ^ { 2 } ( n ) )$ for data-homogeneous scenario and $O ( n ^ { 3 } \log _ { 2 } ^ { 4 } ( n ) )$ for data-heterogeneous scenario.
|
| 192 |
+
|
| 193 |
+
DmSGD with one-peer exponential graph. With each realization being sparser than its static counterpart, one-peer exponential graph is believed to converge slower. However, the periodic exactaveraging property can help DmSGD achieve the same convergence rate as its static counterpart. Note that DmSGD with one-peer exponential graph is an one-loop algorithm, see Algorithm 1. The DmSGD updates start immediately after sampling one weight matrix.
|
| 194 |
+
|
| 195 |
+
Theorem 1 We assume $\tau = \log _ { 2 } ( n )$ is a positive integer, and the time-varying weight matrix is√ generated by (7) over one-peer exponential graphs. Under Assumptions A.1–A.4 and $\begin{array} { r } { \gamma = \frac { \sqrt { n ( 1 - \beta ) ^ { 3 } } } { \sqrt { T } } } \end{array}$ DmSGD (Algorithm $^ { l }$ ) will converge at (Proof is in Appendix D.1-D.3).
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\frac { 1 } { T } \sum _ { k = 1 } ^ { T } \mathbb { E } \| \nabla f ( \bar { \mathbf { x } } ^ { ( k ) } ) \| ^ { 2 } = O \left( \frac { \sigma ^ { 2 } } { \sqrt { ( 1 - \beta ) n T } } + \frac { n ( 1 - \beta ) \sigma ^ { 2 } \tau } { T } + \frac { n ( 1 - \beta ) b ^ { 2 } \tau ^ { 2 } } { T } \right) .
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
Furthermore, the transient iteration complexity of DmSGD over one-peer exponential graph is $O ( n ^ { 3 } \log _ { 2 } ^ { 2 } ( n ) )$ for data-homogeneous scenario and $O ( n ^ { 3 } \log _ { 2 } ^ { 4 } ( n ) )$ for data-heterogeneous scenario.
|
| 202 |
+
|
| 203 |
+
Remark 7 Comparing (11) with (10), and noting that $\tau = \log _ { 2 } ( n )$ , we conclude that DmSGD with one-peer graphs converge exactly as fast as with the static counterpart in terms of the established rate bounds. In addition, both graphs endow DmSGD with the same transient iteration complexity.
|
| 204 |
+
|
| 205 |
+
Remark 8 We can also achieve the convergence rate for decentralized SGD (i.e., DSGD without momentum acceleration) with one-peer exponential graph by setting $\beta = 0$ . It is easy to verify that DSGD with one-peer graphs can also converge as fast as with the static exponential graph.
|
| 206 |
+
|
| 207 |
+
Remark 9 The convergence rate and transient iteration complexity of DSGD with general mixing matrices sampling strategy are also studied in [25]. However, the results in reference [25] does not cover the scenario with momentum acceleration. As we show in the proof details, it is highly non-trivial to handle momentum.
|
| 208 |
+
|
| 209 |
+
It is worth noting that the analysis for the above theorem is non-trivial. While it targets on the one-peer exponential graph, the analysis techniques can be extended to the general time-varying topologies. To our best knowledge, it establishes the first result for DSGD with momentum acceleration, over the time-varying topologies, and in the non-convex settings. Existing analysis either focuses on DSGD without momentum [25], or DmSGD with static topologies [64]. In addition, the last two terms in (11), actually, can be further tightened by the spectral gap of one-peer exponential graphs. Since the tightened terms are rather complicated, we leave them to the discussion in Appendix D.4.
|
| 210 |
+
|
| 211 |
+
State-of-the-art balance between communication and convergence. Table 1 (and tables in Appendix D.5) summarize the per-iteration communication time and transient iteration complexity for all commonly-used topologies. When $n$ is sufficiently large, the term $\log _ { 2 } ( n )$ can be ignored. In this scenario, the exponential graphs (including both static and one-peer variants) achieve state-of-the-art $\tilde { \Omega } ( 1 )$ per-iteration communication and $\tilde { \Omega } ( n ^ { 3 } )$ transient iterations, in which $\tilde { \Omega } ( \cdot )$ hides all logarithm factors. In Appendix D.5, we numerically validate that exponential graphs have smaller transient iteration complexity than ring or grid graph as predicted in Table 1. The comparison between exponential graph with random graphs [41, 6, 9, 10] (such as the Erdos-Renyi graph and geometric random graph) is discussed in Appendix A.3.3.
|
| 212 |
+
|
| 213 |
+
One-peer exponential graph is recommended for decentralized deep training. It is because onepeer exponential graph endows DmSGD with the same convergence rate as its static counterpart, but incurs strictly less communication overhead per iteration.
|
| 214 |
+
|
| 215 |
+
# 6 Experiments
|
| 216 |
+
|
| 217 |
+
This section will validate our theoretical results by extensive deep learning experiments. First, we evaluate how DmSGD with exponential graphs perform against other commonly-used graphs with varying network size. Second, we examine whether one-peer exponential graphs achieve the same convergence rate and accuracy as its static counterpart across different tasks, models, and algorithms.
|
| 218 |
+
|
| 219 |
+
Metrics. Training time and validation accuracy are two critical metrics to examine the effectiveness of a distributed training algorithm in deep learning. These two metrics are typically evaluated after the algorithm completes a fixed number of epochs (say, 90 epochs). Training time can reflect the communication efficiency while accuracy, though might not be precise, can roughly measure the convergence rate (or iteration complexity). These two metrics are used in most of our experiments.
|
| 220 |
+
|
| 221 |
+
# 6.1 Setup
|
| 222 |
+
|
| 223 |
+
We implement all decentralized algorithms with PyTorch [46] 1.8.0 using NCCL 2.8.3 (CUDA 10.1) as the communication backend. For parallel SGD, we used PyTorch’s native Distributed Data Parallel (DDP) module. For the implementation of decentralized methods, we utilize BlueFog [63], which is a high-performance decentralized deep training framework, to facilitate the topology organization, weight matrix generation, and efficient partial averaging. We also follow DDP’s design to enable computation and communication overlap. Each server contains 8 V100 GPUs in our cluster and is treated as one node. The inter-node network fabrics are 25 Gbps TCP as default, which is a common distributed training platform setting.
|
| 224 |
+
|
| 225 |
+
# 6.2 Exponential graphs enable efficient and high-quality training
|
| 226 |
+
|
| 227 |
+
In this subsection we evaluate how DmSGD with exponential graphs perform against other commonlyused topologies in the task of image classification.
|
| 228 |
+
|
| 229 |
+
Implementation. We conduct a series of image classification experiments with the ImageNet-1K [16], which consists of 1,281,167 training images and 50,000 validation images in 1000 classes. We train classification models with different topologies and numbers of nodes to verify our theoretical findings. The training protocol in [21] is used. In details, we train total 90 epochs. The learning rate is warmed up in the first 5 epochs and is decayed by a factor of 10 at 30, 60 and 80-th epoch. The momentum SGD optimizer is used with linear learning rate scaling by default. Experiments are trained in the mixed precision using Pytorch native amp module. We implement DmSGD with all graphs listed in Table 1. The details of each graph is described in Appendix E. For each graph, we test the training time and validation accuracy for DmSGD with GPU numbers ranging from 32 to 256.
|
| 230 |
+
|
| 231 |
+
Experiment results. The comparison between different graphs (with varying size) in top-1 validation accuracy and training time after 90 epochs is listed in Table 2. Major observations are:
|
| 232 |
+
|
| 233 |
+
Table 2: Comparison of top-1 validation accuracy $\% )$ and training time (hours) with different topologies.
|
| 234 |
+
|
| 235 |
+
<table><tr><td rowspan="2">NODES TOPOLOGY</td><td colspan="2">4(4x8 GPUs)</td><td colspan="2">8(8x8 GPUs)</td><td colspan="2">16(16x8 GPUs)</td><td colspan="2">32(32x8 GPUs)</td></tr><tr><td>ACC.</td><td>TIME</td><td>ACC.</td><td>TIME</td><td>ACC.</td><td>TIME</td><td>ACC.</td><td>TIME</td></tr><tr><td>RING</td><td>76.13 ±0.023</td><td>11.6</td><td>76.07 ±0.013</td><td>6.5</td><td>76.08 ±0.026</td><td>3.3</td><td>75.58 ±0.021</td><td>1.8</td></tr><tr><td>GRID</td><td>76.08 ±0.007</td><td>11.6</td><td>76.35 ±0.037</td><td>6.7</td><td>75.88 ±0.011</td><td>3.4</td><td>75.76 ±0.022</td><td>2.0</td></tr><tr><td>BI-RAND.MATCH.</td><td>75.96 ±0.032</td><td>11.1</td><td>76.26 ±0.027</td><td>5.7</td><td>76.07 ±0.012</td><td>2.8</td><td>75.83 ±0.029</td><td>1.5</td></tr><tr><td>RANDOM GRAPH</td><td>75.97 ±0.028</td><td>11.5</td><td>76.01 ±0.033</td><td>7.1</td><td>76.18 ±0.008</td><td>6.7</td><td>76.24 ±0.018</td><td>4.7</td></tr><tr><td>STATIC EXP.</td><td>76.21 ±0.028</td><td>11.6</td><td>76.32 ±0.037</td><td>6.9</td><td>76.30 ±0.007</td><td>4.1</td><td>76.28 ±0.020</td><td>2.5</td></tr><tr><td>ONE-PEER EXP.</td><td>76.28 ±0.063</td><td>11.1</td><td>76.47 ±0.035</td><td>5.7</td><td>76.42 ±0.030</td><td>2.8</td><td>76.30 ±0.062</td><td>1.5</td></tr></table>
|
| 236 |
+
|
| 237 |
+
[1] All graphs (except the random graph) endows DmSGD with training time linear speedup. Among them, bipartite random matching and one-peer exponential graphs achieve the best linear speedup due to their efficient per-iteration communication. However, the accuracy of the matching graph cannot match one-peer exponential graph. The random graph fails to achieve linear speedup because of its extremely expensive communication overheads.
|
| 238 |
+
|
| 239 |
+
[2] In the $3 2 \times 8$ GPUs scenario, the training time to finish all 90 epochs can be sorted as follows: one-peer $\approx$ Bi-RandMatch $< \mathrm { R i n g } < \mathrm { G r i d } <$ static exponential $<$ random graph, which coincides with the per-iteration communication time listed in Table 1.
|
| 240 |
+
|
| 241 |
+
[3] In the $3 2 \times 8$ GPUs scenario, the training accuracy achieved by each graph after 90 epochs is sorted as follows: random graph $\approx$ static exponential $\approx$ one-peer $>$ Bi-RandMatch $> \mathrm { G r i d } > \mathrm { R i n g }$ which coincides with the transient iteration complexity listed in Table 1. Note that the random graph is rather dense (see the detail in Appendix A.3.1) so it has good accuracy but consumes significant wall-clock time in training.
|
| 242 |
+
|
| 243 |
+
With the second and third observations, we can find exponential graphs (especially the one-peer exponential graph) can enable both fast and high-quality training performance. We also examined the performance of exponential graphs when $n$ is not a power of 2, see Appendix E.2.
|
| 244 |
+
|
| 245 |
+
# 6.3 One-peer exponential graph v.s. static exponential graph
|
| 246 |
+
|
| 247 |
+
In this subsection we will focus on the two exponential graphs studied in this paper. In particular, we will validate that one-peer exponential graph endows DmSGD with the same convergence rate as its static counterpart (i.e., the conclusion in Remark 7) across different tasks, models, and algorithms.
|
| 248 |
+
|
| 249 |
+
Comparison across models and algorithms. Now we compare one-peer and static exponential graphs with different neural network architectures and algorithms. The task is image classification and the setting is the same as in Sec. 6.2. We test both graphs for ResNet [22], MobileNetv2 [50] and EfficientNet [56], which are widely-used models in industry. In addition to the DmSGD algorithm (Algorithm 1) studied in this paper, we also examine how exponential graphs perform with other commonly-used decentralized momentum method: the vanilla DmSGD [3] which does not exchange momentum between neighbors, and QG-DmSGD [32] which adds a quasi-global momentum to relieve the influence of data heterogeneity. We do not examine DecentLaM [67] and $\mathrm { D ^ { 2 } }$ [57] because both methods require symmetric weight matrix during the training process which exponential graphs cannot provide. We also list the performance of parallel SGD using global averaging as one baseline.
|
| 250 |
+
|
| 251 |
+
Table 3 lists the top-1 validation accuracy comparison across all models and algorithms. In all scenarios, it is observed that both graphs can lead to roughly the same accuracy across models and algorithms. The accuracy difference (DIFF) is marginal. We also depict the convergence curves in training loss and accuracy for DmSGD with both graphs in Fig. 5. It shows both
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 5: Convergence curves on the ImageNet (ResNet-50) in terms of training loss and validation top-1 accuracy . Network size is $8 \times 8$ GPUs.
|
| 255 |
+
|
| 256 |
+
curves evolve closely to each other, indicating that one-peer exponential graph enables $\mathrm { D m } \mathrm { S G D }$ with the same convergence rate as its static counterpart. This is consistent with Theorem 1 and Remark 7. Since one-peer is more communication-efficient than static exponential graph (see Table 2), it is recommended to utilize one-peer exponential graph in decentralized deep training. In addition, we observe that decentralized methods, while utilizing partial-averaging during training process, has no significant accuracy degradation compared parallel SGD. Decentralized SGD can even be superior sometimes.
|
| 257 |
+
|
| 258 |
+
Table 3: Top-1 validation accuracy and wall-clock time (in hours) comparison with different models and algorithms on ImageNet dataset over static/one-peer exponential graphs (8x8 GPUs).
|
| 259 |
+
|
| 260 |
+
<table><tr><td rowspan="2">MODEL TOPOLOGY</td><td colspan="2">REsNET-50</td><td colspan="2">MOBILENET-V2</td><td colspan="2">EFFICIENTNET</td></tr><tr><td>STATIC</td><td>ONE-PEER</td><td>STATIC</td><td>ONE-PEER</td><td>STATIC</td><td>ONE-PEER</td></tr><tr><td>PARALLEL SGD</td><td>76.21 (7.0)</td><td></td><td>70.12 (5.8)</td><td></td><td>77.63 (9.0)</td><td></td></tr><tr><td>VANILLA DMSGD</td><td>76.14 (6.6)</td><td>76.06 (5.5)</td><td>69.98 (5.6)</td><td>69.81 (4.6)</td><td>77.62 (8.4)</td><td>77.48 (6.9)</td></tr><tr><td>DMSGD</td><td>76.50 (6.9)</td><td>76.52(5.7)</td><td>69.62 (5.7)</td><td>69.98 (4.8)</td><td>77.44 (8.7)</td><td>77.51 (7.1)</td></tr><tr><td>QG-DMSGD</td><td>76.43 (6.6)</td><td>76.35(5.6)</td><td>69.83 (5.6)</td><td>69.81 (4.6)</td><td>77.60 (8.4)</td><td>77.72 (6.9)</td></tr></table>
|
| 261 |
+
|
| 262 |
+
Comparison across different tasks. We next compare the aforementioned algorithms with onepeer and static exponential graphs in another well-known task: object detection. We will test the following widely-used models: Faster-RCNN [49] and RetinaNet [34] on popular PASCAL VOC [19] and COCO [35] datasets. We adopt the MMDetection [12] framework as the building blocks and utilize ResNet-50 with FPN [33] as the backbone network. We choose mean Average Precision (mAP) as the evaluation metric for both datesets. We used 8 GPUs (which are connected by the static or dynamic exponential topology) and set the total batch size as 64 in all detection experiments.
|
| 263 |
+
|
| 264 |
+
Table 4 compares the performance of decentralized training across different object detection models and datasets. Similar to the above experiment, it is observed that both graphs enable decentralized algorithms with almost the same performance in each scenario. This again illustrates the value of one-peer exponential graph in deep learning tasks - it endows decentralized deep training with both fast training speed and satisfactory accuracy.
|
| 265 |
+
|
| 266 |
+
Table 4: Comparison of different methods and models on PASCAL VOC and COCO datasets.
|
| 267 |
+
|
| 268 |
+
<table><tr><td rowspan="3">DATASET MODEL TOPOLOGY</td><td colspan="4">PASCAL VOC</td><td colspan="4">CoCo</td></tr><tr><td colspan="2">RETINANET</td><td colspan="2">FASTER RCNN</td><td colspan="2">RETINANET</td><td colspan="2">FASTER RCNN</td></tr><tr><td>STATIC</td><td>ONE-PEER</td><td>STATIC</td><td>ONE-PEER</td><td>STATIC</td><td>ONE-PEER</td><td>STATIC</td><td>ONE-PEER</td></tr><tr><td>PARALLEL SGD</td><td>79.0</td><td>-</td><td>80.3</td><td>=</td><td>36.2</td><td>=</td><td>37.2</td><td>=</td></tr><tr><td>VANILLA DMSGD</td><td>79.0</td><td>79.1</td><td>80.7</td><td>80.5</td><td>36.3</td><td>36.1</td><td>37.3</td><td>37.2</td></tr><tr><td>DMSGD</td><td>79.1</td><td>79.0</td><td>80.4</td><td>80.5</td><td>36.4</td><td>36.4</td><td>37.1</td><td>37.0</td></tr><tr><td>QG-DMSGD</td><td>79.2</td><td>79.1</td><td>80.8</td><td>80.4</td><td>36.3</td><td>36.2</td><td>37.2</td><td>37.1</td></tr></table>
|
| 269 |
+
|
| 270 |
+
# 7 Conclusion and Future Works
|
| 271 |
+
|
| 272 |
+
In this paper, we establish the spectral gap of static exponential graph and prove that any $\log _ { 2 } ( n )$ consecutive one-peer exponential graphs can together achieve exact averaging when $n$ is a power of 2. With these results, we reveal that one-peer exponential graphs endow DmSGD with the same convergence rate as their static counterpart. We also establish that exponential graphs achieve nearly minimum per-iteration communication time and transient iteration complexity simultaneously when $n$ is large. All conclusions are thoroughly examined with industrial-standard benchmarks. As the future work, we will investigate symmetric time-varying graphs that can perform as well as one-peer exponential graph. Symmetric graphs are critical for $\mathrm { D } ^ { \beth }$ and DecentLaM algorithms.
|
| 273 |
+
|
| 274 |
+
# Acknowledgements
|
| 275 |
+
|
| 276 |
+
The authors are grateful to Dr. Sai Praneeth Karimireddy from EPFL for the helpful discussions on the hypercube graph.
|
| 277 |
+
|
| 278 |
+
# References
|
| 279 |
+
|
| 280 |
+
[1] Sulaiman A Alghunaim and Kun Yuan. A unified and refined convergence analysis for non-convex decentralized learning. arXiv preprint arXiv:2110.09993, 2021.
|
| 281 |
+
[2] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communicationefficient sgd via gradient quantization and encoding. In Advances in Neural Information Processing Systems, pages 1709–1720, 2017. ng. 2019. [4] Aditya Balu, Zhanhong Jiang, Sin Yong Tan, Chinmay Hedge, Young M Lee, and Soumik Sarkar. Decentralized deep learning using momentum-accelerated consensus. arXiv preprint arXiv:2010.11166, 2020. [5] Tal Ben-Nun and Torsten Hoefler. Demystifying parallel and distributed deep learning: An in-depth concurrency analysis. ACM Computing Surveys (CSUR), 52(4):1–43, 2019. [6] Itai Benjamini, Gady Kozma, and Nicholas Wormald. The mixing time of the giant component of a random graph. Random Structures & Algorithms, 45(3):383–407, 2014. [7] Albert S Berahas, Raghu Bollapragada, Nitish Shirish Keskar, and Ermin Wei. Balancing communication and computation in distributed optimization. IEEE Transactions on Automatic Control, 64(8):3141–3155, 2018. [8] Jeremy Bernstein, Jiawei Zhao, Kamyar Azizzadenesheli, and Anima Anandkumar. signsgd with majority vote is communication efficient and fault tolerant. arXiv preprint arXiv:1810.05291, 2018. [9] Andrew Beveridge and Jeanmarie Youngblood. The best mixing time for random walks on trees. Graphs and Combinatorics, 32(6):2211–2239, 2016.
|
| 282 |
+
[10] Stephen P Boyd, Arpita Ghosh, Balaji Prabhakar, and Devavrat Shah. Mixing times for random walks on geometric random graphs. In ALENEX/ANALCO, pages 240–249, 2005.
|
| 283 |
+
[11] Jianshu Chen and Ali H Sayed. Diffusion adaptation strategies for distributed optimization and learning over networks. IEEE Transactions on Signal Processing, 60(8):4289–4305, 2012.
|
| 284 |
+
[12] Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, et al. Mmdetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155, 2019.
|
| 285 |
+
[13] Tianyi Chen, Georgios Giannakis, Tao Sun, and Wotao Yin. LAG: Lazily aggregated gradient for communication-efficient distributed learning. In Advances in Neural Information Processing Systems, pages 5050–5060, 2018.
|
| 286 |
+
[14] Yiming Chen, Kun Yuan, Yingya Zhang, Pan Pan, Yinghui Xu, and Wotao Yin. Accelerating gossip SGD with periodic global averaging. In International Conference on Machine Learning, 2021.
|
| 287 |
+
[15] Yat-Tin Chow, Wei Shi, Tianyu Wu, and Wotao Yin. Expander graph and communication-efficient decentralized optimization. In 2016 50th Asilomar Conference on Signals, Systems and Computers, pages 1715–1720. IEEE, 2016.
|
| 288 |
+
[16] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248–255. Ieee, 2009.
|
| 289 |
+
[17] P. Di Lorenzo and G. Scutari. Next: In-network nonconvex optimization. IEEE Transactions on Signal and Information Processing over Networks, 2(2):120–136, 2016.
|
| 290 |
+
[18] John C Duchi, Alekh Agarwal, and Martin J Wainwright. Dual averaging for distributed optimization: Convergence analysis and network scaling. IEEE Transactions on Automatic control, 57(3):592–606, 2011.
|
| 291 |
+
[19] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2):303–338, 2010.
|
| 292 |
+
[20] Hongchang Gao and Heng Huang. Periodic stochastic gradient descent with momentum for decentralized training. arXiv preprint arXiv:2008.10435, 2020.
|
| 293 |
+
[21] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 294 |
+
[22] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 295 |
+
[23] Kun Huang and Shi Pu. Improving the transient times for distributed stochastic gradient methods. arXiv preprint arXiv:2105.04851, 2021.
|
| 296 |
+
[24] Anastasia Koloskova, Tao Lin, Sebastian U Stich, and Martin Jaggi. Decentralized deep learning with arbitrary communication compression. In International Conference on Learning Representations, 2019.
|
| 297 |
+
[25] Anastasia Koloskova, Nicolas Loizou, Sadra Boreiri, Martin Jaggi, and Sebastian U Stich. A unified theory of decentralized sgd with changing topology and local updates. In International Conference on Machine Learning (ICML), pages 1–12, 2020.
|
| 298 |
+
[26] Anastasia Koloskova, Sebastian Stich, and Martin Jaggi. Decentralized stochastic optimization and gossip algorithms with compressed communication. In International Conference on Machine Learning, pages 3478–3487, 2019.
|
| 299 |
+
[27] Lingjing Kong, Tao Lin, Anastasia Koloskova, Martin Jaggi, and Sebastian U Stich. Consensus control for decentralized deep learning. In International Conference on Machine Learning, 2021.
|
| 300 |
+
[28] Mu Li, David G Andersen, Jun Woo Park, Alexander J Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J Shekita, and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In 11th {USENIX} Symposium on Operating Systems Design and Implementation $\{ O \bar { S } D I \} ~ I 4 )$ , pages 583–598, 2014.
|
| 301 |
+
[29] Z. Li, W. Shi, and M. Yan. A decentralized proximal-gradient method with network independent step-sizes and separated convergence rates. IEEE Transactions on Signal Processing, July 2019. early acces. Also available on arXiv:1704.07807.
|
| 302 |
+
[30] Xiangru Lian, Ce Zhang, Huan Zhang, Cho-Jui Hsieh, Wei Zhang, and Ji Liu. Can decentralized algorithms outperform centralized algorithms? A case study for decentralized parallel stochastic gradient descent. In Advances in Neural Information Processing Systems, pages 5330–5340, 2017.
|
| 303 |
+
[31] Xiangru Lian, Wei Zhang, Ce Zhang, and Ji Liu. Asynchronous decentralized parallel stochastic gradient descent. In International Conference on Machine Learning, pages 3043–3052, 2018.
|
| 304 |
+
[32] Tao Lin, Sai Praneeth Karimireddy, Sebastian U Stich, and Martin Jaggi. Quasi-global momentum: Accelerating decentralized deep learning on heterogeneous data. In International Conference on Machine Learning, 2021.
|
| 305 |
+
[33] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117–2125, 2017.
|
| 306 |
+
[34] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980–2988, 2017.
|
| 307 |
+
[35] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014.
|
| 308 |
+
[36] Xiaorui Liu, Yao Li, Rongrong Wang, Jiliang Tang, and Ming Yan. Linear convergent decentralized optimization with compression. arXiv preprint arXiv:2007.00232, 2020.
|
| 309 |
+
[37] Yanli Liu, Yuejiao Sun, and Wotao Yin. Decentralized learning with lazy and approximate dual gradients. IEEE Transactions on Signal Processing, 69:1362–1377, 2021.
|
| 310 |
+
[38] Yaohua Liu, Wei Xu, Gang Wu, Zhi Tian, and Qing Ling. Communication-censored admm for decentralized consensus optimization. IEEE Transactions on Signal Processing, 67(10):2565–2579, 2019.
|
| 311 |
+
[39] Nicolas Loizou and Peter Richtárik. Momentum and stochastic momentum for stochastic gradient, newton, proximal point and subspace descent methods. Computational Optimization and Applications, 77(3):653– 710, 2020.
|
| 312 |
+
[40] Songtao Lu and Chai Wah Wu. Decentralized stochastic non-convex optimization over weakly connected time-varying digraphs. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5770–5774. IEEE, 2020.
|
| 313 |
+
[41] Asaf Nachmias and Yuval Peres. Critical random graphs: diameter and mixing time. The Annals of Probability, 36(4):1267–1286, 2008.
|
| 314 |
+
[42] Angelia Nedic and Alex Olshevsky. Distributed optimization over time-varying directed graphs. ´ IEEE Transactions on Automatic Control, 60(3):601–615, 2014.
|
| 315 |
+
[43] Angelia Nedic, Alex Olshevsky, and Michael G Rabbat. Network topology and communication- ´ computation tradeoffs in decentralized optimization. Proceedings of the IEEE, 106(5):953–976, 2018.
|
| 316 |
+
[44] A. Nedic, A. Olshevsky, and W. Shi. Achieving geometric convergence for distributed optimization over time-varying graphs. SIAM Journal on Optimization, 27(4):2597–2633, 2017.
|
| 317 |
+
[45] Angelia Nedic and Asuman Ozdaglar. Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control, 54(1):48–61, 2009.
|
| 318 |
+
[46] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), pages 8024–8035, 2019.
|
| 319 |
+
[47] Pitch Patarasuk and Xin Yuan. Bandwidth optimal all-reduce algorithms for clusters of workstations. Journal of Parallel and Distributed Computing, 69(2):117–124, 2009.
|
| 320 |
+
[48] Shi Pu, Alex Olshevsky, and Ioannis Ch Paschalidis. A sharp estimate on the transient time of distributed stochastic gradient descent. arXiv preprint arXiv:1906.02702, 2019.
|
| 321 |
+
[49] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence, 39(6):1137– 1149, 2016.
|
| 322 |
+
[50] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
|
| 323 |
+
[51] Ali H Sayed. Adaptive networks. Proceedings of the IEEE, 102(4):460–497, 2014.
|
| 324 |
+
[52] Gesualdo Scutari and Ying Sun. Distributed nonconvex constrained optimization over time-varying digraphs. Mathematical Programming, 176(1):497–544, 2019.
|
| 325 |
+
[53] E. Seneta. Non-negative matrices and markov chains (2nd ed.). 1981.
|
| 326 |
+
[54] Guodong Shi, Bo Li, Mikael Johansson, and Karl Henrik Johansson. Finite-time convergent gossiping. IEEE/ACM Transactions on Networking, 24(5):2782–2794, 2015.
|
| 327 |
+
[55] Sebastian Urban Stich. Local sgd converges fast and communicates little. In International Conference on Learning Representations (ICLR), 2019.
|
| 328 |
+
[56] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
|
| 329 |
+
[57] Hanlin Tang, Xiangru Lian, Ming Yan, Ce Zhang, and Ji Liu. $d ^ { 2 }$ : Decentralized training over decentralized data. In International Conference on Machine Learning, pages 4848–4856, 2018.
|
| 330 |
+
[58] Hanlin Tang, Chen Yu, Xiangru Lian, Tong Zhang, and Ji Liu. Doublesqueeze: Parallel stochastic gradient descent with double-pass error-compensated compression. In International Conference on Machine Learning, pages 6155–6165. PMLR, 2019.
|
| 331 |
+
[59] Luca Trevisan. Lecture notes on graph partitioning, expanders and spectral methods. University of California, Berkeley, https://people. eecs. berkeley. edu/˜ luca/books/expanders-2016. pdf, 2017.
|
| 332 |
+
[60] Jianyu Wang, Anit Kumar Sahu, Zhouyi Yang, Gauri Joshi, and Soummya Kar. MATCHA: Speeding up decentralized SGD via matching decomposition sampling. arXiv preprint arXiv:1905.09435, 2019.
|
| 333 |
+
[61] Jianyu Wang, Vinayak Tantia, Nicolas Ballas, and Michael Rabbat. Slowmo: Improving communicationefficient distributed sgd with slow momentum. In International Conference on Learning Representations, 2019.
|
| 334 |
+
[62] Ran Xin, Usman A Khan, and Soummya Kar. An improved convergence analysis for decentralized online stochastic non-convex optimization. arXiv preprint arXiv:2008.04195, 2020.
|
| 335 |
+
[63] Bicheng Ying, Kun Yuan, Hanbin Hu, Yiming Chen, and Wotao Yin. Bluefog: Make decentralized algorithms practical for optimization and deep learning. arXiv preprint arXiv:2111.04287, 2021.
|
| 336 |
+
[64] Hao Yu, Rong Jin, and Sen Yang. On the linear speedup analysis of communication efficient momentum sgd for distributed non-convex optimization. In International Conference on Machine Learning, pages 7184–7193. PMLR, 2019.
|
| 337 |
+
[65] Kun Yuan and Sulaiman A Alghunaim. Removing data heterogeneity influence enhances network topology dependence of decentralized sgd. arXiv preprint arXiv:2105.08023, 2021.
|
| 338 |
+
[66] Kun Yuan, Sulaiman A Alghunaim, Bicheng Ying, and Ali H Sayed. On the influence of bias-correction on distributed stochastic optimization. IEEE Transactions on Signal Processing, 2020.
|
| 339 |
+
[67] Kun Yuan, Yiming Chen, Xinmeng Huang, Yingya Zhang, Pan Pan, Yinghui Xu, and Wotao Yin. DecentLaM: Decentralized momentum SGD for large-batch deep training. arXiv preprint arXiv:2104.11981, 2021.
|
| 340 |
+
[68] K. Yuan, B. Ying, X. Zhao, and A. H. Sayed. Exact dffusion for distributed optimization and learning – Part I: Algorithm development. IEEE Transactions on Signal Processing, 67(3):708 – 723, 2019.
|
| 341 |
+
[69] Jiaqi Zhang and Keyou You. Decentralized stochastic gradient tracking for non-convex empirical risk minimization. arXiv preprint arXiv:1909.02712, 2019.
|
md/train/n4IMHNb8_f/n4IMHNb8_f.md
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFERENTIABLE SPATIAL PLANNING USING TRANSFORMERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We consider the problem of spatial path planning. In contrast to the classical solutions which optimize a new plan from scratch and assume access to the full map with ground truth obstacle locations, we learn a planner from the data in a differentiable manner that allows us to leverage statistical regularities from past data. We propose Spatial Planning Transformers (SPT), which given an obstacle map learns to generate actions by planning over long-range spatial dependencies, unlike prior data-driven planners that propagate information locally via convolutional structure in an iterative manner. In the setting where the ground truth map is not known to the agent, we leverage pre-trained SPTs to in an end-to-end framework that has the structure of mapper and planner built into it which allows seamless generalization to out-of-distribution maps and goals. SPTs outperform prior stateof-the-art across all the setups for both manipulation and navigation tasks, leading to an absolute improvement of $7 . 1 9 \%$ .
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The problem of path planning has been a bedrock of robotics. Given an obstacle map of an environment and a goal location in the map, the task is to output a shortest path to the goal location starting from any position in the map. We consider path planning with spatial maps. Building a top-down spatial map is common practice in robotic navigation as it provides a natural representation of physical space (Durrant-Whyte & Bailey, 2006). In fact, even Observations robotic manipulation can also be naturally phrased via spatial map using the formalism of configuration spaces (Lozano-Perez, 1990), as shown in Figure 1. This problem has been studied in robotics for several decades, and classic goto planning algorithms involve Dijkstra et al. (1959), PRM (Kavraki et al., 1996), RRT (LaValle & Kuffner Jr, 2001), RRT\* (Karaman & Frazzoli, 2011), etc.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: Spatial Path Planning: The raw obserPerception Planning Map Actionsvations (top left) and obstacles can be represented spatially via top-down map in navigation (left) and 3via configuration space in manipulation (right).
|
| 15 |
+
|
| 16 |
+
Our objective is to develop methods that can learn to plan from data. However, a natural question is why do we need learning for a problem which has stable classical solutions? There are two key reasons. First, classical methods do not capture statistical regularities present in the natural world, (for e.g., walls are mostly parallel or perpendicular to each other), because they optimize a plan from scratch for each new setup. This also makes analytical planning methods to be often slow at inference time which is an issue in dynamic scenarios where a more reactive policy might be required for fast adaptation from failures. A learned planner represented via a neural network can not only capture regularities but is also efficient at inference as the plan is just a result of forward-pass through the network. Second, a critical assumption of classical algorithms is that a global ground-truth obstacle space must be known to the agent ahead of time. This is in stark contrast to biological agents where cognitive maps are not pixel-accurate ground truth location of agents, but built through actions in the environment, e.g., rats build an implicit map of the environment incrementally through trajectories enabling them to take shortcuts (Tolman, 1948). A learned solution could not only provides the ability to deal with partial, noisy maps and but also help build maps on the fly while acting in the environment by backpropagating through the generated long-range plans.
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 2: Local vs Long-distance value propagation. Figure showing an example of number of iterations required to propagate distance values over a map using local and long-distance value propagation. The obstacle map and goal location shown on the left and the distance value predictions over 5 iterations is shown on the right (distance values increase from blue to yellow). Prior methods based on convolutional networks use local value propagation and require many iterations to propagate values accurately over the whole map (top right). Our method is based on long-distance value propagation between points without any obstacle between them. This type of value propagation can cover the whole map in 3 iterations in this example (bottom right).
|
| 20 |
+
|
| 21 |
+
Several recent works have proposed data-driven path planning models (Tamar et al., 2016; Karkus et al., 2017; Nardelli et al., 2018; Lee et al., 2018). Similar to how classical algorithms, like Dijkstra et al. (1959), move outward from the goal one cell at a time to predict distances iteratively based on the obstacles in the map, current learning-based spatial planning models propagate distance values in only a local neighborhood using convolutional networks. This kind of local value propagation requires $\mathcal { O } ( M )$ iterations, where $M$ is the map dimension. In theory, however, the optimal paths can be computed much more efficiently with total iterations that are on the order of number of obstacles rather than the map size. For instance, consider two points with no obstacle between, an efficient planner could directly connect them with interpolated distance. Nonetheless, this is possible only if the model can perform long-range reasoning in the obstacle space which is a challenge.
|
| 22 |
+
|
| 23 |
+
In this work, our goal is to capture this long-range spatial relationship. Transformers (Vaswani et al., 2017) are well suited for this kind of computation as they treat the inputs as sets and propagate information across all the points within the set. Building on this, we propose Spatial Planning Transformers (SPT) which consists of attention heads that can attend to any part of the input. The key idea behind the design of the proposed model is that value can be propagated between distant points if there are no obstacles between them. This would reduce the number of required iterations to $\mathcal { O } ( n _ { O } )$ where $n _ { O }$ is the number of obstacles in the map. Figure 2 shows a simple example where long-distance value propagation can cover the entire map within 3 iterations while local value propagation takes more than 5 iterations – this difference grows with the complexity of the obstacle space and map size. We compare the performance of SPTs with prior state-of-the-art learned planning approaches, VIN (Tamar et al., 2016) and GPPN (Lee et al., 2018), across both navigation as well as manipulation setups. SPTs achieve significantly higher accuracy than these prior methods for the same inference time and show over $1 0 \%$ absolute improvement when the maps are large.
|
| 24 |
+
|
| 25 |
+
Next, we turn to the case when the map is not known apriori. This is a practical setting when the agent either has access to a partially known map or just know it through the trajectories. In psychology, this is known as going from route knowledge to survey knowledege (Golledge et al., 1995) where animals aggregate the knowledge from trajectories into a cognitive map. We operationalize this setup by formulating an end-to-end differentiable framework, which in contrast to having a generic parametric policy learning (Glasmachers, 2017), has the structure of mapper and planner built into it. We first pre-train the SPT planner to capture a generic data-driven prior, and then backpropagate through it to learn a mapper that maps raw observations to obstacle map. This allows us to learn without requiring map supervision or interaction. Learned mapper and planner not only allow us to plan for new goal locations at inference but also generalize to unseen maps.
|
| 26 |
+
|
| 27 |
+
Our end-to-end mapping and planning approach provides a unified solution for both navigation and manipulation. We perform thorough experiments in both manipulation and real-world navigation maps as well as manipulation. Our approach outperforms prior state-of-the-art by a margin on both mapping and planning accuracy without assuming access to the map at training or inference.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 3: Spatial Planning Transformer (SPT). Figure showing an overview of the proposed Spatial Planning Transformer model. It consists of 3 modules: an Encoder $E$ to encode the input, a Transformer network $T$ responsible for planning, and a Decoder $D$ decoding the output of the Transformer into action distances.
|
| 31 |
+
|
| 32 |
+
# 2 PRELIMINARIES AND PROBLEM DEFINITION
|
| 33 |
+
|
| 34 |
+
We represent the input spatial map as a matrix, $m$ , of size $M \times M$ with each element being 1, denoting obstacles, or 0, denoting free space. The goal location is also represented as a matrix, $g$ , of size $M \times M$ with exactly one element being 1, denoting the goal location, and rest 0s. The input to the spatial planning model, $x$ , consists of matrices $m$ and $g$ stacked, $x = [ m , g ]$ , where $x$ is of size $2 \times M \times M$ . The objective of the planning model is to predict $y$ which is of size $M \times M$ , consisting of action distances of corresponding locations from the goal. Here, action distance is defined to be the minimum number of actions required to reach the goal.
|
| 35 |
+
|
| 36 |
+
For navigation, $m$ is a top-down obstacle map, and $g$ represents the goal position on this map. For manipulation, $m$ represents the obstacles in the configuration space of 2-dof planar arm with joint angles denoted by $\theta _ { 1 }$ and $\theta _ { 2 }$ . Each element $( i , j )$ in $m$ indicate whether the configuration of the arm with joint angles $\theta _ { 1 } = i$ and $\theta _ { 2 } = j$ , would lead to a collision. $g$ represents the goal configuration of the arm. In the first set of experiments, we will assume that $m$ is known and in the second set of experiments, $m$ is not known and the agent receives observations, $o$ , from its sensors instead.
|
| 37 |
+
|
| 38 |
+
# 3 METHODS
|
| 39 |
+
|
| 40 |
+
We design a spatial planning model capable of long-distance information propagation. We first describe the design of this spatial planning module, called Spatial Planning Transformer(SPT), shown in Figure 3, which takes in a map and a goal as input and predict the distance to the goal from all locations. We then describe how the SPT model can be used as a planning module to train end-to-end learning models, which take in raw sensory observations and goal location as input and predict action distances without having access to the map.
|
| 41 |
+
|
| 42 |
+
# 3.1 SPT: SPATIAL PLANNING TRANSFORMERS
|
| 43 |
+
|
| 44 |
+
To propogate information over distant points, we use the Transformer (Vaswani et al., 2017) architecture. The self-attention mechanism in a Transformer can learn to attend to any element of the input. The allows the model to learn spatial reasoning over the whole map concurrently. Figure 3 shows an overview of the SPT model, which consists of three modules, an Encoder $E$ to encode the input, a Transformer network $T$ responsible for spatial planning, and a Decoder $D$ decoding the output of the Transformer into action distances.
|
| 45 |
+
|
| 46 |
+
Encoder. The Encoder $E$ computes the encoding of the input $x$ : $x _ { I } ~ = ~ E ( x )$ . The input x ∈ {0, 1}2×M×M consisting of the map and goal is first passed through a 2-layer convolutional network (LeCun et al., 1998) with ReLU activations to compute an embedding for each input element. Both layers have a kernel size of $1 \times 1$ , which ensures that the embedding of all the obstacles is identical to each other, and the same holds true for free space and the goal location. The output of this convolutional network is of size $d \times M \times M$ , where $d$ is the embedding size. This output is then flattened to get $x _ { I }$ of size $d \times M ^ { 2 }$ and passed into the Transformer network.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 4: End-to-end Mapping and Planning. Figure showing an overview of end-to-end mapping and planning model for both the navigation and manipulation tasks.
|
| 50 |
+
|
| 51 |
+
Transformer. The Transformer network $T$ converts the input encoding into the output encoding: $x _ { O } = T ( x _ { I } )$ . It first adds the positional encoding to the input encoding. The positional encoding enables the Transformer model to distinguish between the obstacles at different locations. We use a constant sinusoidal positional encoding (Vaswani et al., 2017):
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
p _ { ( 2 i , j ) } = \sin ( j / C ^ { 2 i / d } ) , \qquad p _ { ( 2 i + 1 , j ) } = \cos ( j / C ^ { 2 i / d } )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $p \in \mathcal { R } ^ { d \times M ^ { 2 } }$ is the positional encoding, $j \in \{ 1 , 2 , \dots , M ^ { 2 } \}$ is the position of the input, $i \in \{ 1 , 2 , \ldots , d / 2 \}$ , and $C \bar { = } M ^ { 2 }$ is a constant.
|
| 58 |
+
|
| 59 |
+
The positional encoding of each element is added to their corresponding input encoding to get $Z = x _ { I } + p . Z$ is then passed through $N = 5$ identical Transformer layers $( f _ { \mathrm { T L } } )$ to get $x _ { O }$ .
|
| 60 |
+
|
| 61 |
+
Decoder. The Decoder $D$ computes the distance prediction $\hat { y }$ from $x _ { O }$ using a position-wise fully connected layer:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\hat { y } _ { i } = W _ { D } ^ { T } x _ { T , i } + b _ { D }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\boldsymbol { x } _ { T , i } \in \mathcal { R } ^ { d \times 1 }$ is the input at position $i \in { 1 , 2 , \dots , M ^ { 2 } }$ , $W _ { D } \in \mathcal { R } ^ { d \times 1 } , b _ { D } \in \mathcal { R }$ are parameters of the Decoder shared across all positions $i$ and $\hat { y } _ { i } \in \mathcal { R }$ is the distance prediction at position $i$ . The distance prediction at all position are reshaped into a matrix to get the final prediction $\hat { y } \in \mathcal { R } ^ { M , M }$ . The entire model is trained using pairs of input $x$ and output $y$ datapoints with mean-squared error as the loss function.
|
| 68 |
+
|
| 69 |
+
# 3.2 END-TO-END MAPPING AND PLANNING
|
| 70 |
+
|
| 71 |
+
The SPT model described above is designed to predict action distances given a map as input. However, in many applications, the map of the environment is often not known. In such cases, an autonomous agent working in a realistic environment needs to predict the map from raw sensory observations. While it is possible to train a separate mapper model to predict maps from observations, this often requires map annotations which are expensive to obtain and often inaccurate. In contrast, demonstration trajectories consisting of observations and optimal actions are more readily available or easier to obtain in many robotics applications. One of the key benefits of learning-based differentiable spatial planning is that it can be used to learn mapping just from action supervision in an end-to-end fashion without having access to ground-truth maps. To demonstrate this benefit, we train an endto-end mapping and planning model to predict action distances from sensor observations for both navigation and manipulation tasks.
|
| 72 |
+
|
| 73 |
+
The end-to-end mapping and planning model consists of two modules, a Mapper $( f _ { M } )$ and a Planner $( f _ { P } )$ , as illustrated in Figure 4. The Mapper is used to predict the map $\hat { m }$ from sensor observations $o$ and the Planner is a spatial planning model to predict action distances, $\hat { y }$ , from the predicted map $\hat { m }$ :
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\hat { y } = f _ { P } ( \hat { m } ) = f _ { P } ( f _ { M } ( o ) )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
For navigation, $o$ is the set of first-person RGB camera images each of size $3 \times H \times W$ . We sample 4 images, one for each orientation, at each valid location in the map. For invalid locations, we pass an empty image of 0s for all orientations. Thus, for a map of size $M \times M$ , observation $o$ consist of $4 M ^ { 2 }$ images for all locations and 4 orientations similar to the setup in Lee et al. (2018). For manipulation, $o$ is a top-down view of the operational space with obstacles of size $P \times P$ , where each element is 1 or 0 denoting obstacles or free space. We use different Mapper architectures for navigation and manipulation experiments.
|
| 80 |
+
|
| 81 |
+
The Navigation Mapper module predicts a single value between 0 and 1 for each image in $o$ indicating whether the cell in the front of the image is an obstacle or not. The architecture of the Navigation mapper consists of ResNet18 convolutional layers followed by fully-connected layers (see Appendix for details). Each cell can have upto 4 predictions (from images corresponding to the four neighboring cells facing the current cell), which are aggregated using max pooling to get a single prediction. This map prediction consisting of continuous values is passed to the Planner module.
|
| 82 |
+
|
| 83 |
+
The Manipulation Mapper module needs to predict which configurations of the arm would lead to a collision. To predict whether a particular configuration $( \theta _ { 1 } , \theta _ { 2 } )$ , the mapper module needs to check whether any point in this configuration consists of an obstacle. A Transformer-based model is well suited to learn this function as well as it can attend to arbitrary locations in the operational space to predict the obstacles in the configuration space. We use the same architecture of the SPT model as the Manipulation Mapper as well, with the only difference being the encoder consisting of $3 \times 3$ kernel size convolutional layers instead of $1 \times 1$ to encode the $P \times P$ observation space to a $M \times M$ representation.
|
| 84 |
+
|
| 85 |
+
The Planner module is the entire SPT model with encoder, transformer and decoder units as described in the previous subsection. It is pretrained on synthetic maps and its weights are frozen during end-to-end training. We train the entire end-to-end Mapping and Planning model with pairs of input observations $o$ and output action distances $y$ using standard supervised learning with the meansquared error as the loss function: $\begin{array} { r } { \mathcal { L } = M S E ( y , \hat { y } ) = 1 / | L | \sum _ { i \in L } ( y _ { i } - \hat { y } _ { i } ) ^ { 2 } } \end{array}$ , where $L$ is the set of navigable locations. Since the planning module is pretrained and it expects a structured map input, the mapper model needs to predict the map accurately such that the predicted map, when passed through the planner, minimizes the action level loss.
|
| 86 |
+
|
| 87 |
+
# 4 EXPERIMENTS & RESULTS: SPATIAL PLANNING
|
| 88 |
+
|
| 89 |
+
Datasets. We generate synthetic datasets for training the spatial planning models for both navigation and manipulation settings. For the navigation setting, we perform experiments with $M \times M$ maps with three different map sizes, $M \in \{ 1 5 , 3 0 , 5 0 \}$ . For manipulation, we experiment with two map sizes, $M \in \{ 1 8 , 3 6 \}$ , corresponding to $2 0 ^ { \circ }$ and $1 0 ^ { \circ }$ bins for each link. In each map, we randomly generate $o _ { m i n } = 0$ to $o _ { m a x } = 5$ obstacles. Dataset generation details are provided in the Appendix.
|
| 90 |
+
|
| 91 |
+
For both the settings, we generate training, validation, and test sets of size $1 0 0 K / 5 K / 5 K$ maps. The set of maps in each set are distinct. For each map, we choose a random free space cell as the goal location. The action space consists of 4 actions: north, south, east, west. For the navigation task, the map boundaries are considered as obstacles, while for the manipulation task the cells on the left and right boundaries and top and bottom boundaries are connected to each other since angles are circular. The ground truth shortest path distances are calculated using the Dijkstra algorithm (Dijkstra et al., 1959). Unreachable locations and obstacles are denoted by $- 1$ in the ground truth.
|
| 92 |
+
|
| 93 |
+
In addition to testing on unseen maps with the same distribution, we also test the spatial planning models on two types of out-of-distribution datasets: More Obstacles where we generate $o _ { m i n } = 1 5$ to $o _ { m a x } = 2 0$ obstacles per map, and Real-world where the top-down maps are generated from reconstructions of real-world scenes in Gibson dataset (Xia et al., 2018).
|
| 94 |
+
|
| 95 |
+
Hyperparameters and Training. For training the SPT model, we use Stochastic Gradient Descent (Bottou, 2010) for optimization with a starting learning rate of 1.0 and a learning rate decay of 0.9 per epoch. We train the model for 40 epochs with a batch size of 20. We use $N = 5$ Transformer layers each with $h = 8$ attention heads and a embedding size of $d = 6 4$ . The inner dimension of the fully connected layers in the transformer is $d _ { f c } = 5 1 2$ . We use the same architecture with the same hyperparameters for training the SPT model for both navigation and manipulation for all map sizes. We will open-source the code including dataset generation, model implementation and training.
|
| 96 |
+
|
| 97 |
+
<table><tr><td></td><td colspan="3">Navigation</td><td colspan="2">Manipulation</td><td rowspan="2">Overall</td></tr><tr><td>Method</td><td>M=15</td><td>M=30</td><td>M=50</td><td>M=18</td><td>M=36</td></tr><tr><td>VIN</td><td>86.19</td><td>83.62</td><td>80.84</td><td>75.06</td><td>74.27</td><td>80.00</td></tr><tr><td>GPPN</td><td>97.10</td><td>96.17</td><td>91.97</td><td>89.06</td><td>87.23</td><td>92.31</td></tr><tr><td>SPT</td><td>99.07</td><td>99.56</td><td>99.42</td><td>99.24</td><td>99.78</td><td>99.41</td></tr></table>
|
| 98 |
+
|
| 99 |
+
Table 1: Generalization to in-distribution maps. Table showing the average planning accuracy of the proposed model Spatial Planning Transformer (SPT) as compared to the baselines on in-distribution test sets for both the navigation and manipulation experiments.
|
| 100 |
+
|
| 101 |
+
<table><tr><td></td><td colspan="6">Navigation</td><td colspan="2">Manipulation</td><td>Overall</td></tr><tr><td></td><td colspan="3">More Obstacles</td><td colspan="3">Real-World</td><td colspan="2">More Obstacles</td><td></td></tr><tr><td>Method</td><td>M=15</td><td>M=30</td><td>M=50</td><td>M=15</td><td>M=30</td><td>M=50</td><td>M=18</td><td>M=36</td><td></td></tr><tr><td>VIN</td><td>49.05</td><td>62.05</td><td>70.64</td><td>49.91</td><td>56.67</td><td>71.16</td><td>65.27</td><td>59.81</td><td>60.57</td></tr><tr><td>GPPN</td><td>90.68</td><td>89.93</td><td>84.86</td><td>90.11</td><td>91.07</td><td>88.32</td><td>79.86</td><td>80.79</td><td>86.95</td></tr><tr><td>SPT</td><td>93.34</td><td>92.71</td><td>92.03</td><td>95.96</td><td>94.70</td><td>95.39</td><td>98.16</td><td>99.18</td><td>95.18</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 2: Generalization to out-of-distribution maps. Table showing the average planning accuracy of the proposed model Spatial Planning Transformer (SPT) as compared to the baselines on out-of-distribution test sets for both the navigation and manipulation experiments.
|
| 104 |
+
|
| 105 |
+
Baselines. We use prior spatial planning models as baselines. These include Value Iteration Networks (VIN) (Tamar et al., 2016) and Gated Path-Planning Networks (GPPN) (Lee et al., 2018). For tuning the hyperparameter $( K )$ for the number of iterations in both the baselines, we consider all values of $K$ in multiples of 10 such that the inference time of the baseline is comparable to the inference time of the SPT model $\leq 1 . 1$ times). For each setting, we tune $K$ and the learning rate to maximize performance on the validation set.
|
| 106 |
+
|
| 107 |
+
Metrics. We use average action prediction accuracy as the metric. Distance prediction is converted to actions by finding the minimum distance cell among the 4 neighboring cells for each location. When multiple actions are optimal, predicting any optimal action is considered to be a correct prediction. The accuracy is averaged over all free space locations over all maps in the test set.
|
| 108 |
+
|
| 109 |
+
Results. The planning accuracy of all the methods for both the navigation and manipulation tasks on the in-distribution test sets are shown in Table 1 and on the out-of-distribution test sets are shown in Table 2. The proposed SPT model outperforms both the baselines across all settings achieving an overall accuracy of $9 9 . 4 1 \%$ vs $9 2 . 3 1 \%$ (in-distribution) and $9 5 . 1 8 \%$ vs $8 6 . 9 5 \%$ (out-of-distribution) as compared to the best baseline. The performance of the SPT model is stable as the map size increases while the performance of the baselines drop considerably. We believe this is because both the baselines need to use a larger number of iterations to cover a larger map ( $K = 6 0$ iterations for GPPN and $K = 9 0$ iterations for VIN for $M = 5 0$ ) since the information propagation is local in VIN and GPPN. The optimization becomes difficult for such deep models. In contrast, the SPT model uses a constant $N = 5$ layers for all map sizes.
|
| 110 |
+
|
| 111 |
+
The improvement in the performance of SPT over the baselines is larger in the manipulation task because the baselines based on convolution operations are not well suited for propagating information looping over the edges of the map. In contrast, the SPT model can use self-attention to attend to any part of the map and learn to propagate information over the map edges.
|
| 112 |
+
|
| 113 |
+
Visualizations. In Figure 5, we show examples of predictions of the SPT model as compared to the baselines for 3 different input maps and goals from 3 different test sets. The examples show that the baselines are not able to predict the distances of distant cells accurately. This is because they propagate information in a local neighborhood that can not reach distant cells in the limited inference time budget $K = 3 0$ for VIN and $K = 2 0$ for GPPN). In contrast, the SPT is able to predict distances of distant cells more accurately with $N = 5$ layers indicating that it learns long-range information propagation. Additional examples are provided in the Appendix.
|
| 114 |
+
|
| 115 |
+
<table><tr><td colspan="3">Runtime j permapi in ms</td></tr><tr><td>Method</td><td>M=15 M=30</td><td>M=50</td></tr><tr><td>Dijkstra</td><td>4.17</td><td>43.82 371.05</td></tr><tr><td>A</td><td>3.02 35.38</td><td>294.70</td></tr><tr><td>SPT</td><td>2.44 4.72</td><td>18.35</td></tr></table>
|
| 116 |
+
|
| 117 |
+
Table 3: Runtime comparison. Comparison of average runtime per map in milli seconds for different methods. All values are averaged over 10000 maps.
|
| 118 |
+
|
| 119 |
+
Runtime Comparison. To demonstrate one of the benefits of learning-based planners over classical planning algorithms, we compare the runtime of SPT to Dijkstra (Dijkstra et al., 1959) and $\mathbf { A } ^ { * }$ (Hart et al., 1968) algorithms in Table 3. The results indicate that SPT is $1 . 2 4 \times$ to $2 0 . 2 2 \times$ faster than classical planning algorithms with the runtime benefit improving with the increase in map size.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 5: Spatial Planning Examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for map size $M = 3 0$ . The obstacles are shown in blue, free space in purple and goal in yellow in the leftmost input column. The predictions and ground truth in the rest of the column are color-coded from blue to yellow to represent increasing action distance.
|
| 123 |
+
|
| 124 |
+
# 5 EXPERIMENTS & RESULTS: END-TO-END MAPPING AND PLANNING
|
| 125 |
+
|
| 126 |
+
In the above experiments, we compared the planning performance of different methods under perfect knowledge of the map $m$ . In this section, we test the efficacy of spatial planning methods when map $m$ is unknown and needs to be predicted from sensor observations $o$ .
|
| 127 |
+
|
| 128 |
+
Datasets. For manipulation, we generate synthetic datasets of size $M = 1 8$ using the same process as described in Section 4. We discretize the operation space into a $P \times P$ image with $P = 9 0$ which is used as the observation $o$ . The train/test sets are of size 100K/5K.
|
| 129 |
+
|
| 130 |
+
For navigation, we use the Gibson dataset (Xia et al., 2018) to sample maps of size $M = 1 5$ where each cell is $0 . 2 5 m ^ { 2 }$ area. We get the camera images at the navigable locations in all 4 orientations using the Habitat simulator (Savva et al., 2019). The set of camera images each of size $3 \times H \times W$ act as the observation $o$ for the navigation task, where $H = W = 1 2 8$ . The train and test sets consist of 72 and 14 distinct scenes identical to the standard train and val splits in the Habitat simulator. We sample 500 maps in each scene creating training/test sets of size 36K/7K. Each sampled map is rotated to a random orientation.
|
| 131 |
+
|
| 132 |
+
Training. We load the weights of different models trained on synthetic data from the previous section. We then train the end-to-end model using the same action distance prediction loss while keeping the planner weights frozen. The architecture of the mapper module is identical across different planning methods. Metrics. We report both map accuracy and planning accuracy for both the tasks.
|
| 133 |
+
|
| 134 |
+
Baselines. In addition to using VIN and GPPN as baselines, we also use a classical mapping and planning baseline for the navigation task. Since there is no depth input available, we used Monocular depth estimation model from Hu et al. (2019) for predicting the map which is then used for planning using Dijkstra as suggested by Mishkin et al. (2019).
|
| 135 |
+
|
| 136 |
+
Results. Table 4 shows the end-to-end mapping and planning results. SPT outperforms both GPPN and VIN by a large margin across both the tasks achieving an overall plan accuracy of $8 2 . 2 9 \%$ vs $6 3 . 9 1 \%$ . Table 4 also shows that the mapper learnt using end-to-end training with a pretrained SPT model is able to achieve an accuracy of $9 8 . 9 6 \%$ for manipulation and $8 2 . 5 8 \%$ for navigation, without receiving any map-level supervision. SPT also outperforms the classical mapping and planning baseline. These results demonstrate a key benefit of learning-based differentiable planners as compared to classical analytical planning algorithms. As SPT outperforms VIN and GPPN at spatial planning, it also leads to a better map accuracy $( 9 0 . 7 7 \%$ vs $7 7 . 3 1 \%$ ).
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td colspan="2">Navigation</td><td colspan="2">Manipulation</td><td colspan="2">Overall</td></tr><tr><td>Method</td><td>Map Acc</td><td>Plan Acc</td><td>Map Acc</td><td>Plan Acc</td><td>Map Acc</td><td>Plan Acc</td></tr><tr><td>Classical</td><td>64.43</td><td>45.20</td><td></td><td>=</td><td>1</td><td>=</td></tr><tr><td>VIN</td><td>60.92</td><td>47.77</td><td>81.25</td><td>66.45</td><td>71.08</td><td>57.11</td></tr><tr><td>GPPN</td><td>69.06</td><td>45.70</td><td>85.57</td><td>82.13</td><td>77.31</td><td>63.91</td></tr><tr><td>SPT</td><td>82.58</td><td>66.16</td><td>98.96</td><td>98.42</td><td>90.77</td><td>82.29</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 4: End-to-End Mapping and Planning Results. Table showing the average mapping and planning accuracy of the proposed model Spatial Planning Transformer (SPT) as compared to the baselines for end-to-end mapping and planning experiments.
|
| 141 |
+
|
| 142 |
+
# 5.1 SPARSE AND NOISY SUPERVISION
|
| 143 |
+
|
| 144 |
+
In the above experiments, we assumed access to perfect and dense action-distance supervision. In practice, if we were to get supervision from human trajectories, the supersion could be sparse, as we might not have access to the optimal distance from all locations in the map, and noisy as humans might not take the optimal actions always and computing distances from human trajectories might be noisy. To study the effect of not having dense and perfect supervision for training the end-to-end mapping and planning model, we consider three settings:
|
| 145 |
+
|
| 146 |
+
Noisy supervision: We add zero mean gaussian noise to all ground-truth distance values with standard deviation, $\sigma = 1$ .
|
| 147 |
+
|
| 148 |
+
Sparse supervision: Instead of providing distances from all navigable locations in the ground truth, we provide distances for only 5 trajectories to the same goal in the training maps.
|
| 149 |
+
|
| 150 |
+
oisy and Sparse supervision: We provide noisy distances for only 5 trajectories as supervision
|
| 151 |
+
|
| 152 |
+
Figure 6 shows an example of noisy and sparse supervision. The results are shown in Table 5. The SPT model maintains performance benefits over the baselines under all the settings. Interestingly, under sparse supervision, the map prediction accuracy drops, but the planning accuracy does not drop as much. This is because the model learns to predict minimum map required to predict the action distances of all valid locations accurately as seen in examples shown in Figure 15 in the Appendix.
|
| 153 |
+
|
| 154 |
+
# 6 RELATED WORK
|
| 155 |
+
|
| 156 |
+
Path planning in known or inferred maps, also known as motion planning in robotics, is a well explored problem led by the seminal papers (Canny, 1988; Kavraki et al., 1996; LaValle & Kuffner Jr, 2001; Karaman & Frazzoli, 2011). Although there are learned variants of motion planners proposed in the literature using gaussian processes (Ijspeert et al., 2013; Ratliff et al., 2018), data-driven motion planners using neural networks is a recent direction (Qureshi et al., 2019; Bhardwaj et al., 2020; Qureshi et al., 2020). Prior work has also studied the use of neural networks to learn the heuristics and sampling stratergies in classical planners Ichter et al. (2018); Guez et al. (2018); Satorras & Welling (2020); Khan et al. (2020). Learning for planning is more common in Markov Decision Process (MDPs) for computing value function via dynamic programming based value iterations (Bellman, 1966; Bertsekas et al., 1995). Planning and learning in neural networks has been explored (Ilin et al., 2007) with a successful general formulation provided by value iteration networks (VIN) (Tamar et al., 2016) with follow-ups to improve scalability and efficiency (Lee et al., 2018; Karkus et al., 2017; Nardelli et al., 2018; Schleich et al., 2019; Khan et al., 2018; Chen et al., 2020). However, these models only capture local value propagation using CNNs and are mostly applied in navigation setups. In contrast, proposed SPTs capture long-range spatial dependency and easily scale to both navigation and manipulation.
|
| 157 |
+
|
| 158 |
+
Differentiable planning structure has also been explored in reinforcement learning with model-free methods (Silver et al., 2017; Oh et al., 2017; Zhu et al., 2017; Farquhar et al., 2018) as well as off-policy RL (Eysenbach et al., 2019; Laskin et al., 2020). Recent works also backpropagate through learned planners to train the policy (Pathak et al., 2018; Srinivas et al., 2018; Amos et al., 2018) and use imagined rollouts of a learned world model for long-term plans (Racaniere et al. \` , 2017; Hafner et al., 2019; Sekar et al., 2019). Unlike our work, these works lack the structure of a spatial planner.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 6: Sparse and Noisy Supervision. Figure showing examples of a map and goal with different levels of supervision. Noisy supervision adds gaussian noise to the ground truth distance values, and sparse supervision samples 5 trajectories for random starting locations to the goal location.
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td colspan="2">Dense and Perfect supervision</td><td colspan="2">Noisy supervision</td><td colspan="2">Sparse supervision</td><td colspan="2">Noisy and Sparse supervision</td></tr><tr><td>Method</td><td>Map Acc</td><td>Plan Acc</td><td>Map Acc</td><td>Plan Acc</td><td>Map Acc</td><td>Plan Acc</td><td>Map Acc</td><td>Plan Acc</td></tr><tr><td>VIN</td><td>81.25</td><td>66.45</td><td>75.68</td><td>60.78</td><td>70.16</td><td>60.23</td><td>70.22</td><td>58.97</td></tr><tr><td>GPPN</td><td>85.57</td><td>82.13</td><td>80.13</td><td>76.11</td><td>72.73</td><td>75.13</td><td>70.08</td><td>72.85</td></tr><tr><td>SPT</td><td>98.96</td><td>98.42</td><td>96.35</td><td>95.83</td><td>80.15</td><td>97.18</td><td>77.17</td><td>94.34</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 5: Sparse and Noisy Supervision Results. Table showing the average mapping and planning accuracy of the proposed model Spatial Planning Transformer (SPT) as compared to the baselines for end-to-end mapping and planning experiments under noisy and sparse supervision settings for the manipulation task.
|
| 166 |
+
|
| 167 |
+
Decomposing learning a controller into mapping and planning is common in robot navigation (Khatib, 1986; Elfes, 1987). Some works have explored joint mapping and planning (Elfes, 1989; Fraundorfer et al., 2012). Maps can also be built from vision (Konolige et al., 2010; Fuentes-Pacheco et al., 2015) with a learned mapper (Parisotto & Salakhutdinov, 2017; Karkus et al., 2020). There has been some work on learning maps without using map annotations as well (Gregor et al., 2019). For navigation specific applications, recent works proposed joint mapping and planning for navigation (Gupta et al., 2017; Zhang et al., 2017; Savinov et al., 2018; Chaplot et al., 2020). However, most of these works either require access to ground truth map or assume interaction. Hence, they will first need to be trained in simulation. In contrast, we show results when the map is not known to the agent by learning just from trajectories and can be directly learned from data collected in the real-world.
|
| 168 |
+
|
| 169 |
+
# 7 DISCUSSION
|
| 170 |
+
|
| 171 |
+
The SPT model is designed to learn long-range spatial planning and it outperforms baselines across multiple experimental settings on both navigation and manipulation tasks. End-to-end learning experiments demonstrate that the SPT model can deal with unknown maps by learning mapping without any map-supervision. However, there are some limitations that need to be addressed before learning-based planning methods can be used for large-scale applications. We showed that the SPT model scales much better with increasing map sizes as compared to the baselines, however larger map sizes lead to a high inference time. In the future, we plan to tackle larger map sizes by learning an encoding which reduces the size of the map before spatial planning. The action space was limited to 4 actions in our experiments. Actions can be more fine-grained with smaller cells in the map, which can also be incorporated by tackling larger map sizes in the future.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Brandon Amos, Ivan Jimenez, Jacob Sacks, Byron Boots, and J Zico Kolter. Differentiable mpc for end-to-end planning and control. In NeurIPS, 2018.
|
| 176 |
+
|
| 177 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 178 |
+
|
| 179 |
+
Richard Bellman. Dynamic programming. Science, 1966.
|
| 180 |
+
|
| 181 |
+
Dimitri P Bertsekas, Dimitri P Bertsekas, Dimitri P Bertsekas, and Dimitri P Bertsekas. Dynamic programming and optimal control. Athena scientific Belmont, MA, 1995.
|
| 182 |
+
|
| 183 |
+
Mohak Bhardwaj, Byron Boots, and Mustafa Mukadam. Differentiable gaussian process motion planning. In International Conference on Robotics and Automation (ICRA), 2020.
|
| 184 |
+
|
| 185 |
+
Leon Bottou. Large-scale machine learning with stochastic gradient descent. In ´ Proceedings of COMPSTAT’2010. Springer, 2010.
|
| 186 |
+
|
| 187 |
+
John Canny. The complexity of robot motion planning. MIT press, 1988.
|
| 188 |
+
|
| 189 |
+
Devendra Singh Chaplot, Dhiraj Gandhi, Saurabh Gupta, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural slam. arXiv preprint arXiv:2004.05155, 2020.
|
| 190 |
+
|
| 191 |
+
Binghong Chen, Bo Dai, Qinjie Lin, Guo Ye, Han Liu, and Le Song. Learning to plan in high dimensions via neural exploration-exploitation trees. In ICLR, 2020.
|
| 192 |
+
|
| 193 |
+
Edsger W Dijkstra et al. A note on two problems in connexion with graphs. Numerische mathematik, 1959.
|
| 194 |
+
|
| 195 |
+
Hugh Durrant-Whyte and Tim Bailey. Simultaneous localization and mapping: part i. IEEE robotics & automation magazine, 2006.
|
| 196 |
+
|
| 197 |
+
Alberto Elfes. Sonar-based real-world mapping and navigation. IEEE Journal on Robotics and Automation, 1987.
|
| 198 |
+
|
| 199 |
+
Alberto Elfes. Using occupancy grids for mobile robot perception and navigation. Computer, 1989.
|
| 200 |
+
|
| 201 |
+
Ben Eysenbach, Russ R Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. In NeurIPS, 2019.
|
| 202 |
+
|
| 203 |
+
Gregory Farquhar, Tim Rocktaschel, Maximilian Igl, and Shimon Whiteson. Treeqn and atreec: ¨ Differentiable tree-structured models for deep reinforcement learning. In ICLR, 2018.
|
| 204 |
+
|
| 205 |
+
Friedrich Fraundorfer, Lionel Heng, Dominik Honegger, Gim Hee Lee, Lorenz Meier, Petri Tanskanen, and Marc Pollefeys. Vision-based autonomous mapping and exploration using a quadrotor mav. In International Conference on Intelligent Robots and Systems, 2012.
|
| 206 |
+
|
| 207 |
+
Jorge Fuentes-Pacheco, Jose Ruiz-Ascencio, and Juan Manuel Rend ´ on-Mancha. Visual simultaneous ´ localization and mapping: a survey. Artificial intelligence review, 2015.
|
| 208 |
+
|
| 209 |
+
Tobias Glasmachers. Limits of end-to-end learning. arXiv preprint arXiv:1704.08305, 2017.
|
| 210 |
+
|
| 211 |
+
Reginald G Golledge, Valerie Dougherty, and Scott Bell. Acquiring spatial knowledge: Survey versus route-based knowledge in unfamiliar environments. Annals of the association of American geographers, 1995.
|
| 212 |
+
|
| 213 |
+
Karol Gregor, Danilo Jimenez Rezende, Frederic Besse, Yan Wu, Hamza Merzic, and Aaron van den Oord. Shaping belief states with generative environment models for rl. Advances in Neural Information Processing Systems, 32:13475–13487, 2019.
|
| 214 |
+
|
| 215 |
+
Arthur Guez, Theophane Weber, Ioannis Antonoglou, Karen Simonyan, Oriol Vinyals, Daan Wierstra, Remi Munos, and David Silver. Learning to search with mctsnets. In International Conference on Machine Learning, pp. 1822–1831, 2018.
|
| 216 |
+
|
| 217 |
+
Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 218 |
+
|
| 219 |
+
Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In ICML, 2019.
|
| 220 |
+
|
| 221 |
+
Peter E Hart, Nils J Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE transactions on Systems Science and Cybernetics, 4(2):100–107, 1968.
|
| 222 |
+
|
| 223 |
+
Junjie Hu, Mete Ozay, Yan Zhang, and Takayuki Okatani. Revisiting single image depth estimation: Toward higher resolution maps with accurate object boundaries. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1043–1051. IEEE, 2019.
|
| 224 |
+
|
| 225 |
+
Brian Ichter, James Harrison, and Marco Pavone. Learning sampling distributions for robot motion planning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7087–7094. IEEE, 2018.
|
| 226 |
+
|
| 227 |
+
Auke Jan Ijspeert, Jun Nakanishi, Heiko Hoffmann, Peter Pastor, and Stefan Schaal. Dynamical movement primitives: learning attractor models for motor behaviors. Neural computation, 2013.
|
| 228 |
+
|
| 229 |
+
Roman Ilin, Robert Kozma, and Paul J Werbos. Efficient learning in cellular simultaneous recurrent neural networks-the case of maze navigation problem. In 2007 IEEE International Symposium on Approximate Dynamic Programming and Reinforcement Learning, 2007.
|
| 230 |
+
|
| 231 |
+
Sertac Karaman and Emilio Frazzoli. Sampling-based algorithms for optimal motion planning. The international journal of robotics research, 2011.
|
| 232 |
+
|
| 233 |
+
Peter Karkus, David Hsu, and Wee Sun Lee. Qmdp-net: Deep learning for planning under partial observability. In Advances in Neural Information Processing Systems, 2017.
|
| 234 |
+
|
| 235 |
+
Peter Karkus, Anelia Angelova, Vincent Vanhoucke, and Rico Jonschkowski. Differentiable mapping networks: Learning structured map representations for sparse visual localization. arXiv preprint arXiv:2005.09530, 2020.
|
| 236 |
+
|
| 237 |
+
Lydia E Kavraki, Petr Svestka, J-C Latombe, and Mark H Overmars. Probabilistic roadmaps for path planning in high-dimensional configuration spaces. IEEE transactions on Robotics and Automation, 1996.
|
| 238 |
+
|
| 239 |
+
Arbaaz Khan, Clark Zhang, Nikolay Atanasov, Konstantinos Karydis, Vijay Kumar, and Daniel D Lee. Memory augmented control networks. In ICLR, 2018.
|
| 240 |
+
|
| 241 |
+
Arbaaz Khan, Alejandro Ribeiro, Vijay Kumar, and Anthony G Francis. Graph neural networks for motion planning. arXiv preprint arXiv:2006.06248, 2020.
|
| 242 |
+
|
| 243 |
+
Oussama Khatib. Real-time obstacle avoidance for manipulators and mobile robots. In Autonomous robot vehicles. Springer, 1986.
|
| 244 |
+
|
| 245 |
+
Kurt Konolige, James Bowman, JD Chen, Patrick Mihelich, Michael Calonder, Vincent Lepetit, and Pascal Fua. View-based maps. The International Journal of Robotics Research, 2010.
|
| 246 |
+
|
| 247 |
+
Michael Laskin, Scott Emmons, Ajay Jain, Thanard Kurutach, Pieter Abbeel, and Deepak Pathak. Sparse graphical memory for robust planning. arXiv preprint arXiv:2003.06417, 2020.
|
| 248 |
+
|
| 249 |
+
Steven M LaValle and James J Kuffner Jr. Randomized kinodynamic planning. The international journal of robotics research, 2001.
|
| 250 |
+
|
| 251 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 1998.
|
| 252 |
+
|
| 253 |
+
Lisa Lee, Emilio Parisotto, Devendra Singh Chaplot, Eric Xing, and Ruslan Salakhutdinov. Gated path planning networks. In ICML, 2018.
|
| 254 |
+
|
| 255 |
+
Tomas Lozano-Perez. Spatial planning: A configuration space approach. In Autonomous robot vehicles. Springer, 1990.
|
| 256 |
+
|
| 257 |
+
Dmytro Mishkin, Alexey Dosovitskiy, and Vladlen Koltun. Benchmarking classic and learned navigation in complex 3d environments. arXiv preprint arXiv:1901.10915, 2019.
|
| 258 |
+
|
| 259 |
+
Nantas Nardelli, Gabriel Synnaeve, Zeming Lin, Pushmeet Kohli, Philip HS Torr, and Nicolas Usunier. Value propagation networks. arXiv preprint arXiv:1805.11199, 2018.
|
| 260 |
+
|
| 261 |
+
Junhyuk Oh, Satinder Singh, and Honglak Lee. Value prediction network. In Advances in Neural Information Processing Systems, 2017.
|
| 262 |
+
|
| 263 |
+
Emilio Parisotto and Ruslan Salakhutdinov. Neural map: Structured memory for deep reinforcement learning. arXiv preprint arXiv:1702.08360, 2017.
|
| 264 |
+
|
| 265 |
+
Deepak Pathak, Parsa Mahmoudieh, Guanghao Luo, Pulkit Agrawal, Dian Chen, Yide Shentu, Evan Shelhamer, Jitendra Malik, Alexei A Efros, and Trevor Darrell. Zero-shot visual imitation. In ICLR, 2018.
|
| 266 |
+
|
| 267 |
+
Ahmed H Qureshi, Anthony Simeonov, Mayur J Bency, and Michael C Yip. Motion planning networks. In International Conference on Robotics and Automation (ICRA), 2019.
|
| 268 |
+
|
| 269 |
+
Ahmed H Qureshi, Jiangeng Dong, Austin Choe, and Michael C Yip. Neural manipulation planning on constraint manifolds. IEEE Robotics and Automation Letters, 5(4):6089–6096, 2020.
|
| 270 |
+
|
| 271 |
+
Sebastien Racani ´ ere, Th \` eophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo Jimenez ´ Rezende, Adria Puigdomenech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, et al. Imaginationaugmented agents for deep reinforcement learning. In NIPS, 2017.
|
| 272 |
+
|
| 273 |
+
Nathan D Ratliff, Jan Issac, Daniel Kappler, Stan Birchfield, and Dieter Fox. Riemannian motion policies. arXiv preprint arXiv:1801.02854, 2018.
|
| 274 |
+
|
| 275 |
+
Victor Garcia Satorras and Max Welling. Neural enhanced belief propagation on factor graphs. arXiv preprint arXiv:2003.01998, 2020.
|
| 276 |
+
|
| 277 |
+
Nikolay Savinov, Alexey Dosovitskiy, and Vladlen Koltun. Semi-parametric topological memory for navigation. In ICLR, 2018.
|
| 278 |
+
|
| 279 |
+
Manolis Savva, Abhishek Kadian, Oleksandr Maksymets, Yili Zhao, Erik Wijmans, Bhavana Jain, Julian Straub, Jia Liu, Vladlen Koltun, Jitendra Malik, et al. Habitat: A platform for embodied ai research. In ICCV, 2019.
|
| 280 |
+
|
| 281 |
+
Daniel Schleich, Tobias Klamt, and Sven Behnke. Value iteration networks on multiple levels of abstraction. arXiv preprint arXiv:1905.11068, 2019.
|
| 282 |
+
|
| 283 |
+
Ramanan Sekar, Oleh Rybkin, Kostas Daniilidis, Pieter Abbeel, Danijar Hafner, and Deepak Pathak. Planning to explore via self-supervised world models. In ICML, 2019.
|
| 284 |
+
|
| 285 |
+
David Silver, Hado Hasselt, Matteo Hessel, Tom Schaul, Arthur Guez, Tim Harley, Gabriel DulacArnold, David Reichert, Neil Rabinowitz, Andre Barreto, et al. The predictron: End-to-end learning and planning. In International Conference on Machine Learning. PMLR, 2017.
|
| 286 |
+
|
| 287 |
+
Aravind Srinivas, Allan Jabri, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Universal planning networks. ICML, 2018.
|
| 288 |
+
|
| 289 |
+
Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. In NIPS, 2016.
|
| 290 |
+
|
| 291 |
+
Edward C Tolman. Cognitive maps in rats and men. Psychological review, 1948.
|
| 292 |
+
|
| 293 |
+
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.
|
| 294 |
+
|
| 295 |
+
Fei Xia, Amir R. Zamir, Zhi-Yang He, Alexander Sax, Jitendra Malik, and Silvio Savarese. Gibson Env: real-world perception for embodied agents. In CVPR, 2018.
|
| 296 |
+
|
| 297 |
+
Jingwei Zhang, Lei Tai, Joschka Boedecker, Wolfram Burgard, and Ming Liu. Neural slam: Learning to explore with external memory. arXiv preprint arXiv:1706.09520, 2017.
|
| 298 |
+
|
| 299 |
+
Yuke Zhu, Daniel Gordon, Eric Kolve, Dieter Fox, Li Fei-Fei, Abhinav Gupta, Roozbeh Mottaghi, and Ali Farhadi. Visual semantic planning using deep successor representations. In ICCV, 2017.
|
| 300 |
+
|
| 301 |
+
# A BACKGROUND: TRANSFORMERS
|
| 302 |
+
|
| 303 |
+
The proposed spatial planning method is based on the Transformer model (Vaswani et al., 2017). A Transformer layer, denoted by $f _ { \mathrm { T L } }$ , takes a tensor $X \in \mathcal { R } ^ { d \times S }$ as input, where $d$ is the embedding size and $S$ is the size of the input. It consists of two sublayers, a multi-head self-attention layer $( f _ { \mathrm { S A } } )$ and a position-wise fully connected layer $( f _ { \mathrm { F C } } )$ . There is a residual connection around each sublayer, followed by layer normalization (Ba et al., 2016) (LN):
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
R = \operatorname { L N } ( f _ { \operatorname { S A } } ( X ) + X ) , \quad Y = f _ { \operatorname { T L } } ( X ) = \operatorname { L N } ( f _ { \operatorname { F C } } ( R ) + R )
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
where $R , Y \in \mathcal { R } ^ { d \times S }$ are the intermediate and final representations, respectively.
|
| 310 |
+
|
| 311 |
+
The multi-head self-attention $( f _ { \mathrm { S A } } )$ layer has $h$ attention heads, each computes a scaled dot-product attention over queries $Q$ , keys $K$ and values $V$ , which are all different projections of the input $X$ :
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
Q _ { i } = W _ { Q , i } ^ { T } X , \quad K _ { i } = W _ { K , i } ^ { T } X , \quad V = W _ { V , i } ^ { T } X
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
Z _ { i } = \mathrm { A t t e n t i o n } ( Q _ { i } , K _ { i } , V _ { i } ) = \mathrm { s o f t m a x } \left( \frac { Q _ { i } K _ { i } ^ { T } } { \sqrt { d _ { k } } } \right) V _ { i }
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $Q , K \in \mathcal { R } ^ { d _ { k } \times S }$ , $V \in \mathcal { R } ^ { d _ { v } \times S }$ , $i \in { 1 , 2 , \dots , h \ d _ { k } }$ and $d _ { v }$ are hyper-parameters and all $W \mathrm { { s } }$ are parameters. The output of all attention heads, $Z _ { i } \mathrm { s }$ , are concatenated and projected to the same dimension as the input. Finally, the position-wise fully connected $( f _ { \mathrm { F C } } )$ layer applies two linear transformations to each position with a ReLU activations to the output of the multi-head attention.
|
| 322 |
+
|
| 323 |
+
# B DATASET DETAILS
|
| 324 |
+
|
| 325 |
+
We generate synthetic datasets for training the spatial planning models for both navigation and manipulation settings. For the navigation setting, we perform experiments with $M \times M$ maps with two different map sizes, $M \in \{ 1 5 , 3 0 \}$ . We randomly generate $o _ { m i n } = 0$ to $o _ { m a x } = 5$ obstacles in each map, where each obstacle is an rectangle at a random location with each side being a random length from 1 to $M / 2$ . All the rectangular obstacles are rotated in two random orientations.
|
| 326 |
+
|
| 327 |
+
For the manipulation setting, we consider a reacher task using a planar arm with 2 degrees of freedom. We use an operational space of size $P \times P$ . Each link of the arm is of size $P / 4$ . The arm is centered at the center of the operational space. Let the orientation of two links be denoted by $\theta _ { 1 }$ and $\theta _ { 2 }$ . We assume both the links can freely rotate in a plane, $\theta _ { 1 } , \theta _ { 2 } \in [ 0 , 2 \pi )$ . For each environment, we generate $o _ { m i n } = 0$ to $o _ { m a x } = 5$ circular obstacles centered at a random location $0 . 2 5 P$ to $0 . 7 5 P$ distance away from the center, with a random radius between $0 . 0 5 P$ and $D - 0 . 1 5 P$ where $D$ is the distance of the center of the obstacle from the center of the operational space. We convert each environment to a configuration space map of size $M \times M$ , where each cell $( i , j )$ denotes whether the arm will collide with an obstacle when $\theta _ { 1 } = 2 \pi i / M$ and $\theta _ { 2 } = 2 \pi j / M$ . We experiment with two map sizes, $M \in \{ 1 8 , 3 6 \}$ , corresponding to $2 0 ^ { \circ }$ and $1 0 ^ { \circ }$ bins for each link. The choice of $P$ does not affect the map as the collision check for each cell in the configuration space is performed in the continuous operational space where all distances are relative to $P$ .
|
| 328 |
+
|
| 329 |
+
# C NAVIGATION MAPPER ARCHITECTURE DETAILS
|
| 330 |
+
|
| 331 |
+
The Navigation Mapper module predicts a single value between 0 and 1 for each image in $o$ indicating whether the cell in the front of the image is an obstacle or not. The architecture of the Navigation mapper consists of ResNet18 convolutional layers followed by 3 fully-connected layers of size 256, 128 and 1 as shown in Figure 7. Each cell can have upto 4 predictions (from images corresponding to the four neighboring cells facing the current cell), which are aggregated using max pooling to get a single prediction.
|
| 332 |
+
|
| 333 |
+
# D HIGHER DIMENSIONAL STATE AND ACTION SPACES
|
| 334 |
+
|
| 335 |
+
To test whether SPT maintains performance benefits in higher dimensional state and action spaces, we conducted some experiments for the navigation task. We relaxed the action space from 4 actions to 100 actions by just allowing the agent to take any action in a $1 0 \mathrm { x } 1 0$ grid around it (and using a low-level controller to go to any cell). The state space used for planning is discretized but the agent moves in a continuous state space in the Habitat simulator. We compute the continuous ground truth distance using Fast Marching Method (instead of Dijkstra) for training with a larger action space, which allows us to accurately compute distance for all locations and not be constrained by axis-aligned actions and distances.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 7: Navigation Mapper Architecture. Figure showing the architecture of the Navigation Mapper.
|
| 339 |
+
|
| 340 |
+
SPT and the baselines are trained only on synthetic navigation mazes for this experiment. During evaluation, we assume perfect map based on part of the environment seen in the observations so far for planning. If the overall map size at this level of discretization is higher than planning map size, we simply use greedy planning in a window around the agent resulting in an “anytime” variant just like the classical RRT algorithms. This setup results in much finer-grained action space as shown in the demo example here 1. SPT achieve navigation success rate of $7 8 . 0 \%$ as compared to $4 7 . 2 \%$ for GPPN and $4 3 . 5 \%$ for VIN baselines.
|
| 341 |
+
|
| 342 |
+
# E ATTENTION VISUALIZATION
|
| 343 |
+
|
| 344 |
+
We show the visualization of attention map corresponding to two different locations in Figure 8. Interestingly, we noticed three consistent patterns: a) at least one of the attention head out of eight captures obstacles (left), b) one of the attention heads focuses on goal location (middle), and c) some attention maps focus on nearby obstacles to get accurate planning distance (right).
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 8: Attention Visualization. Visualization of the attention heads learned by Spatial Planning Transformers. SPTs learn an attention for each location in the map with respect to every other location.
|
| 348 |
+
|
| 349 |
+
# F EXAMPLES
|
| 350 |
+
|
| 351 |
+
We show additional examples for navigation task for in-distribution test set (in Figure 9), out-ofdistribution More Obstacles test set (in Figure 10) and Real-World test set (in Figure 11) each with map size $M = 3 0$ . Additional examples for manipulation task are shown for in-distribution test set (in Figure 12) and for out-of-distribution More Obstacles test set (in Figure 13).
|
| 352 |
+
|
| 353 |
+
We also visualize examples for the end-to-end mapping and planning experiments for the manipulation task. We show examples of map and action distance predictions using the SPT model trained with dense and perfect supervision in Figure 14 and with noisy and sparse supervision in Figure 15.
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure 9: Navigation in-distribution test set examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for the Navigation in-distribution test set for map size $M = 3 0$ .
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 10: Navigation out-of-distribution More Obstacles test set examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for the Navigation out-of-distribution More Obstacles test set for map size $M = 3 0$ .
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 11: Navigation out-of-distribution Real-World test set examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for the Navigation out-of-distribution Real-World test set for map size $M = 3 0$ .
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 12: Manipulation in-distribution test set examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for the Manipulation indistribution test set for map size $M = 3 6$ .
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 13: Manipulation out-of-distribution More Obstacles test set examples. Figure showing 3 examples of the input, the predictions using the proposed SPT model and the baselines, and the ground truth for the Manipulation out-of-distribution More Obstacles test set for map size $M = 3 6$ .
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
Figure 14: Dense and Perfect Supervision. Figure showing examples of map and distance predictions using the SPT model trained with dense and perfect action-level supervision.
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
Figure 15: Sparse and Noisy Supervision. Figure showing examples of map and distance predictions using the SPT model trained with sparse and noisy action-level supervision.
|
md/train/pbXQtKXwLS/pbXQtKXwLS.md
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GUIDING NEURAL NETWORK INITIALIZATION VIA MARGINAL LIKELIHOOD MAXIMIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a simple approach to help guide hyperparameter selection for neural network initialization. We leverage the relationship between neural network and Gaussian process models having corresponding activation and covariance functions to infer the hyperparameter values desirable for model initialization. Our experiment shows that marginal likelihood maximization provides recommendations that yield near-optimal prediction performance on MNIST classification task under experiment constraints. Furthermore, our empirical results indicate consistency in the proposed technique, suggesting that computation cost for the procedure could be significantly reduced with smaller training sets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Training deep neural networks successfully can be challenging. However, with proper initialization trained models could improve their prediction performance. Various initialization strategies in neural network have been discussed extensively in numerous research works. Glorot and Bengio (2010) focused on linear cases and proposed the normalized initialization scheme (also known as Xavier-initialization). Their derivation was obtained by considering activation variances in the forward path and the gradient variance in back-propagation. He-initialization (He et al., 2015) was developed for very deep networks with rectifier nonlinearities. Their approach imposed a condition on the weight variances to control the variation in the input magnitudes. Because of its success, He-initialization has become the de facto choice for deep ReLU networks. While Glorot- and Heinitialization schemes recognize the importance of and make use of the hidden layer widths in their formulation, other methods were also suggested to improve training in deep neural networks.
|
| 12 |
+
|
| 13 |
+
Mishkin and Matas (2016) demonstrated that pre-initialization with orthonormal matrices followed by output variance normalization produces prediction performance comparable to, if not better than, standard techniques. Additionally, Schoenholz et al. (2017) developed the bound on the network depth based on the principle of ’Edge of Chaos’ given a particular set of initialization hyperparameters. Furthermore, Hayou et al. (2019) showed that theoretically and in practice proper initialization parameter tuning with appropriate activation function is important to model training for improved performance.
|
| 14 |
+
|
| 15 |
+
Neal (1996) showed that as a fully-connected, single-hidden-layer feedforward untrained neural network becomes infinitely wide, Gaussian prior distributions over the network hidden-to-output weights and biases converge to a Gaussian process, under the assumption that the parameters are independent. In other words, the untrained infinite neural network and its induced Gaussian process counterpart are equivalent. Also, as a result of the central limit theorem, the covariance between network output evaluated at different inputs can be represented as a function of the hidden node activation function. Intuitively, we could therefore relate the prediction performance of an untrained, finite-width, single-hidden-layer, fully-connected feedforward neural network to a Gaussian process model with a covariance function corresponding to the network’s activation function.
|
| 16 |
+
|
| 17 |
+
In this work we propose a simple and efficient method that learns from training data to guide the selection of initialization hyperparameters in neural networks. Marginal likelihood is a popular tool for choosing kernel hyperparameters in model selection. Its applications in convolutional Gaussian processes and deep kernel learning are discussed, respectively, in (van der Wilk et al., 2017; Wilson et al., 2016). Our method aims to synergize this powerful functionality of marginal likelihood and the relationship between untrained neural networks and Gaussian process models to make recommendations for neural network initialization. We first derive the covariance function corresponding to the activation function of the network whose prediction performance we wish to evaluate. We then employ marginal likelihood optimization for the Gaussian process model to learn hyperparameters from data. We hypothesize that the optimal set of hyperparameter values could improve initialization of the neural network.
|
| 18 |
+
|
| 19 |
+
# 2 APPROACH
|
| 20 |
+
|
| 21 |
+
To assess our proposed method, we build a neural network and a Gaussian process model with corresponding activation and covariance functions. With the Gaussian process we estimate the covariance hyperparameters from training data. These hyperparameter values are then applied in the neural network to evaluate and compare its prediction accuracy among various hyperparameter sets.
|
| 22 |
+
|
| 23 |
+
We first describe the structure of the neural network, followed by the Gaussian process model and the underlying reason for employing the marginal likelihood. Then, given the network activation function we proceed to derive a closed form representation of its counterpart covariance function.
|
| 24 |
+
|
| 25 |
+
# 2.1 SINGLE-HIDDEN-LAYER NEURAL NETWORKS
|
| 26 |
+
|
| 27 |
+
Our neural network model is a fully-connected, single-hidden-layer feedforward network with 2000 hidden nodes and rectified linear unit (ReLU) activation function. Following (Lee et al., 2018), we conduct our empirical study by considering classifying MNIST images as regression prediction. Inasmuch as the network is designed for regression, we choose the mean square error (MSE) loss as its objective function, along with Adam optimizer, and accuracy as the performance metric. In addition, one-hot encoding is utilized to generate class labels, where an incorrectly labeled class is designated -0.1, and a correctly labeled class 0.9 . For example, the one-hot representation of the integer 7 is given by [-0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, 0.9, -0.1, -0.1].
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: A single-hidden-layer, fully-connected feedforward neural network for regression prediction. Left panel: Structural diagram of the neural network. Right panel: ReLU activation function: $\phi ( a ) : = ( \bar { a } ) _ { + } = \operatorname* { m a x } ( 0 , a ) = \bar { a }$ for $a \geq 0 ; \phi ( a ) = 0$ otherwise.
|
| 31 |
+
|
| 32 |
+
As shown in the left panel of Figure (1), the single-hidden-layer neural network has a set of inputs denoted by $x = \{ x _ { k } ^ { 0 } \} , k \in \{ 1 , 2 , \cdots , d _ { i n } \}$ with input layer width $d _ { i n } = N _ { 0 } = 2 8 { \mathrm { x } } 2 8 = 7 8 4 .$ . The model’s weight and bias parameters from $k ^ { t h }$ input node to $j ^ { t h }$ hidden node are $W _ { j k } ^ { 0 }$ iid∼ $\begin{array} { r } { \mathcal N ( 0 , \frac { \sigma _ { w } ^ { 2 } } { N _ { 0 } } ) , b _ { j } ^ { 0 } \overset { \mathrm { i i d } } { \sim } \mathcal N ( 0 , \sigma _ { b } ^ { 2 } ) } \end{array}$ , and $W _ { j k } ^ { 0 } \perp \perp b _ { j } ^ { 0 }$ . Similarly, the weight and bias parameters from $j ^ { t h }$ hid0den node to $i ^ { t h }$ output node with hidden layer width $N _ { 1 } = d _ { i n } = 2 0 0 0$ are $\begin{array} { r } { W _ { i j } ^ { 1 } \stackrel { \mathrm { i i d } } { \sim } \mathcal N ( 0 , \frac { \sigma _ { w } ^ { 2 } } { N _ { 1 } } ) , b _ { i } ^ { 1 } } \end{array}$ iid∼ $\mathcal { N } ( 0 , \sigma _ { b } ^ { 2 } )$ , and $W _ { i j } ^ { 1 } \perp \perp b _ { i } ^ { 1 }$ . For regression models the output layer has a single node, and therefore $i \in \{ 1 \}$ . The ReLU nonlinearity is depicted in the right panel of Figure (1).
|
| 33 |
+
|
| 34 |
+
The input to each hidden node nonlinearity (the pre-activation) is represented by $z _ { j } ^ { 0 } ( x ) = b _ { j } ^ { 0 } +$ $\textstyle \sum _ { k = 1 } ^ { d _ { i n } } W _ { j k } ^ { 0 } x _ { k } ^ { 0 }$ , while the hidden unit output after the nonlinearity (the post-activation) is denoted by $x _ { j } ^ { 1 } ( x ) = \phi ( z _ { j } ^ { 0 } ( x ) )$ , $j \in \{ 1 , 2 , \cdots , N _ { 1 } \}$ . Since we typically apply linear activation function in the output stage of a regression model, the model output is simply $\begin{array} { r } { z _ { i } ^ { 1 } ( x ) = b _ { i } ^ { 1 } + \sum _ { j = 1 } ^ { N _ { 1 } } W _ { i j } ^ { 1 } x _ { j } ^ { 1 } ( x ) } \end{array}$ .
|
| 35 |
+
|
| 36 |
+
# 2.2 GAUSSIAN PROCESSES
|
| 37 |
+
|
| 38 |
+
A Gaussian process (MacKay, 1998; Neal, 1998; Williams and Rasmussen, 2006; Bishop, 2006) is a set of random variables any finite collection of which follows a multivariate normal distribution. A Guassian process prediction model exploits this unique property and offers a Bayesian approach to solving machine learning problems. The model is completely specified by its mean function and covariance function.
|
| 39 |
+
|
| 40 |
+
By choosing a particular covariance function, a prior distribution over functions is induced which, together with observed inputs and targets, can be used to generate prediction distribution for making predictions and uncertainty measures on unknown test points. These capabilities allow Gaussian processes to be used effectively in many important machine learning applications such as human pose inference (Urtasun and Darrell, 2008) and object classification (Kapoor et al., 2010). Recent research works also apply Gaussian processes in deep structures for image classification (van der Wilk et al., 2017) and regression tasks (Wilson et al., 2016).
|
| 41 |
+
|
| 42 |
+
To help achieve optimal performance for Guassian process prediction we select a suitable covariance function and tune the model by adjusting hyperparameters characterizing the covariance function. This can be accomplished by applying the marginal likelihood which is a crucial feature that enables Gaussian processes to learn proper hyperparameter values from training data.
|
| 43 |
+
|
| 44 |
+
# 2.3 HYPERPARAMETERS AND MARGINAL LIKELIHOOD OPTIMIZATION
|
| 45 |
+
|
| 46 |
+
We briefly describe the procedure for estimating optimal hyperparamter values via maximizing the Gaussian process marginal likelihood function.
|
| 47 |
+
|
| 48 |
+
Consider a set of $N$ multidimensional input data $X ~ = ~ \{ x _ { i } \} _ { i = 1 } ^ { N }$ , $x _ { i } \in \mathcal { R } ^ { D }$ , and target set $y =$ $\{ y _ { i } \} _ { i = 1 } ^ { N }$ , $y _ { i } \in \mathcal R$ . For each input $x _ { i }$ we have a corresponding input-output pair $( x _ { i } , y _ { i } )$ , where the observed output target is given by $y _ { i } = f ( x _ { i } ) + \epsilon _ { i }$ , with data noise $\epsilon _ { i } \sim \mathcal { N } ( 0 , \sigma _ { n } ^ { 2 } )$ . We model the input-output latent function $f$ as a Gaussian process :
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
f ( \boldsymbol { x } _ { i } ) \sim \mathcal { G P } \big ( \mu ( \boldsymbol { x } _ { i } ) , k ( \boldsymbol { x } _ { i } , \boldsymbol { x } _ { j } ) \big ) ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where we customarily set the mean function $\mu ( x _ { i } ) : = E [ f ( x _ { i } ) ] = 0$ , and denote $k ( x _ { i } , x _ { j } )$ as the covariance function.
|
| 55 |
+
|
| 56 |
+
The marginal likelihood (or evidence) (Williams and Rasmussen, 2006; Bishop, 2006) measures the probability of observed targets given input data and can be expressed as the integral of the product of likelihood and the prior, marginalized over the latent function $f$ :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
p ( y | X ) = \int p ( y , f | X ) d f = \int p ( y | f , X ) p ( f | X ) d f .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
$\{ y _ { i } \} _ { i = 1 } ^ { N } \stackrel { \smile } { = } \{ f ( x _ { i } ) + \epsilon _ { i } \} _ { i = 1 } ^ { N }$ can be obtaine, which gives us $y | \dot { X } \sim \mathcal { N } ( 0 , \mathcal { K } + \sigma _ { n } ^ { 2 } I )$ the iwhere $\mathcal { K } \breve { = } [ k ( x _ { i } , x _ { j } ) ] _ { i , j = 1 } ^ { \tilde { N } }$ ticinand $I$ $_ \mathrm { N }$ $\mathbf { N }$
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
p ( y | X ) = \frac { 1 } { ( 2 \pi ) ^ { N / 2 } | K + \sigma _ { n } ^ { 2 } I | ^ { 1 / 2 } } \exp \Big ( - \frac { 1 } { 2 } y ^ { T } ( K + \sigma _ { n } ^ { 2 } I ) ^ { - 1 } y \Big ) .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
To facilitate computation, we evaluate the log marginal likelihood which is given by
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\log p ( y | X ) = - \frac { 1 } { 2 } { y } ^ { T } \bigl ( K + \sigma _ { n } ^ { 2 } I \bigr ) ^ { - 1 } y - \frac { 1 } { 2 } \mathrm { l o g } \left| K + \sigma _ { n } ^ { 2 } I \right| - \frac { N } { 2 } \mathrm { l o g } 2 \pi .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
We are reminded here that the marginal likelihood is applied directly on the entire training dataset, rather than a validation subset. In addition, Cholesky decomposition (Neal, 1998) can be employed to calculate the term $\left( \boldsymbol { \mathcal { K } } + \sigma _ { n } ^ { 2 } \boldsymbol { I } \right) ^ { - 1 }$ in equation (2).
|
| 75 |
+
|
| 76 |
+
# 2.4 RELU COVARIANCE FUNCTION
|
| 77 |
+
|
| 78 |
+
With the structure of the single-hidden-layer ReLU neural network defined, we proceed to study its corresponding ReLU Gaussian process.
|
| 79 |
+
|
| 80 |
+
The ReLU covariance function is developed to estimate the covariance at the output of the ReLU neural network model. Our alternative derivation was inspired by the work on arc-cosine family of kernels developed in (Cho and Saul, 2009). In our work we first derive the expectation of the product of post-activations, instead of on the input to the nonlinearity (Lee et al., 2018). Then, we apply the output layer activation function on the post-activation expected value. It can be shown that the resulting representations are equivalent. The complete derivation of our expression is provided in the Appendix 5.
|
| 81 |
+
|
| 82 |
+
Referring to Figure 1, we consider input vectors $x ^ { 0 } , y ^ { 0 } \in \mathcal { R } ^ { d _ { i n } }$ . The initial weight value is drawn randomly from the Gaussian distribution fW 0jk = N (0, σ2wdin ) and bias value from fb0j = N (0, σ2b ). The expected value of the product of post-activations at the output of the $j ^ { t h }$ hidden node is computed as
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r l } & { E [ \mathbf { X } _ { j } ( { x } ^ { 0 } ) \mathbf { X } _ { j } ( { y } ^ { 0 } ) ] } \\ & { \ = \displaystyle \int \cdots \int _ { - \infty } ^ { \infty } \operatorname* { m a x } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { x } ^ { 0 } ) \operatorname* { m a x } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { y } ^ { 0 } ) f _ { b _ { j } ^ { 0 } , W _ { j } ^ { 0 } } ( b , w ) d w _ { j } ^ { 0 } d b _ { j } ^ { 0 } } \\ & { \ = \displaystyle \int \cdots \int _ { - \infty } ^ { \infty } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { x } ^ { 0 } ) _ { + } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { y } ^ { 0 } ) _ { + } f _ { b _ { j } ^ { 0 } , W _ { j } ^ { 0 } } ( b , w ) d w _ { j } ^ { 0 } d b } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Suppose we denote the pre-activations as
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { l } { { U = b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot x ^ { 0 } = b _ { j } ^ { 0 } + \displaystyle \sum _ { k = 1 } ^ { d _ { i n } } W _ { j k } ^ { 0 } x _ { k } ^ { 0 } \sim \mathcal N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } ) , } } \\ { { \displaystyle V = b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot y ^ { 0 } = b _ { j } ^ { 0 } + \displaystyle \sum _ { k ^ { \prime } = 1 } ^ { d _ { i n } } W _ { j k ^ { \prime } } ^ { 0 } y _ { k ^ { \prime } } ^ { 0 } \sim \mathcal N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } ) . } } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
It can be shown that the random variables $U , V$ have a joint Gaussian distribution:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
{ \binom { U } { V } } \sim { \mathcal { N } } ( 0 , \Sigma ) , { \mathrm { ~ w h e r e ~ } } \Sigma = { \binom { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) } } \quad \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \quad ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
for simplicity we let $x = x ^ { 0 } , y = y ^ { 0 }$ . We can therefore write expression (3) as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\iint _ { 0 } ^ { \infty } u v \frac { 1 } { 2 \pi | \Sigma | ^ { \frac { 1 } { 2 } } } \exp \big ( - \frac { 1 } { 2 } ( u , v ) \Sigma ^ { - 1 } ( u , v ) ^ { T } \big ) d u d v .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { l } { { \displaystyle \Sigma ^ { - 1 } = \binom { a _ { 1 1 } } { a _ { 2 1 } } \mathrm { , ~ w h e r e ~ } a _ { 1 1 } = \frac { 1 } { D } ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } ) \mathrm { , ~ } a _ { 2 2 } = \frac { 1 } { D } ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } ) \mathrm { , ~ } } } \\ { { \displaystyle a _ { 1 2 } = a _ { 2 1 } = \frac { - 1 } { D } ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) ) . } } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
With polar coordinate transformation: $\begin{array} { r } { u \ = \ \frac { r } { \sqrt { a _ { 1 1 } } } \cos \alpha , v \ = \ \frac { r } { \sqrt { a _ { 2 2 } } } \sin \alpha . } \end{array}$ , expression (3) can be further reduced to
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { r l } & { \frac { 1 } { 4 \pi \mathcal { D } ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } } \displaystyle \int _ { \alpha = 0 } ^ { \frac { \pi } { 2 } } \frac { 2 \sin 2 \alpha } { \left( 1 - \cos \phi \sin 2 \alpha \right) ^ { 2 } } d \alpha } \\ & { = \frac { 1 } { 2 \pi \mathcal { D } ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } \sin ^ { 3 } \phi } \Big ( \sin ( \phi ) + ( \pi - \phi ) \cos ( \phi ) \Big ) , \mathrm { ~ w h e r e ~ } \phi = \cos ^ { - 1 } \Big ( \frac { - a _ { 1 2 } } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } \Big ) . } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
With some algebraic operations and after computing the entries in $\Sigma ^ { - 1 }$ , we arrive at
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { l } { { \displaystyle E [ { \bf X } _ { j } ( x ) { \bf X } _ { j } ( y ) ] } } \\ { { \displaystyle = \frac { 1 } { 2 \pi } \Big ( \sigma _ { b } ^ { 2 } + \| x \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sigma _ { b } ^ { 2 } + \| y \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sin \phi + ( \pi - \phi ) \cos \phi \Big ) } } \\ { { \displaystyle \mathrm { w h e r e ~ } \phi = \cos ^ { - 1 } \left\{ \frac { \sigma _ { b } ^ { 2 } + ( x \cdot y ) \sigma _ { w } ^ { 2 } } { \Big ( \sigma _ { b } ^ { 2 } + \| x \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { 1 / 2 } \Big ( \sigma _ { b } ^ { 2 } + \| y \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { 1 / 2 } } \right\} . } } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
To compute the expected value, $\begin{array} { r } { E [ \mathbf { X } _ { j } ( x ) ] \ = \ \int \operatorname* { m a x } ( b + w \cdot x ) f _ { b _ { j } ^ { 0 } , W _ { j k } ^ { 0 } } ( b , w ) d w d b } \end{array}$ , we denote $U = b + w \cdot x \sim N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } )$ , and apply the change in variable ${ \frac { 1 } { 2 \sigma ^ { 2 } } } u ^ { 2 } = t$ , where $\sigma ^ { 2 } = $ $\sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \lVert x \rVert ^ { 2 }$ to obtain
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\begin{array} { l } { { \displaystyle E [ { \bf X } _ { j } ( x ) ] = \int _ { - \infty } ^ { \infty } \left( u \right) + f _ { U } \left( u \right) d u } } \\ { ~ } \\ { { \displaystyle = \int _ { 0 } ^ { \infty } u \frac { 1 } { \sqrt { 2 \pi } \sigma } e ^ { - \frac { 1 } { 2 \sigma ^ { 2 } } u ^ { 2 } } d u } } \\ { { \displaystyle = \int _ { 0 } ^ { \infty } \sigma ^ { 2 } d u \frac { 1 } { \sqrt { 2 \pi } \sigma } e ^ { - t } } } \\ { { \displaystyle = \frac { \sigma } { \sqrt { 2 \pi } } } } \\ { { \displaystyle = \frac { \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } } \left| x \right| / 2 } { \sqrt { 2 \pi } } } } \end{array}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
The covariance function at the network output is therefore determined to be
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { l } { { \displaystyle E \Big [ \big ( b _ { i } ^ { 1 } + \sum _ { j = 1 } ^ { N _ { 1 } } W _ { i j } ^ { 1 } \mathbf { X } _ { j } ( x ) \big ) \big ( b _ { i } ^ { 1 } + \sum _ { k = 1 } ^ { N _ { 1 } } W _ { i k } ^ { 1 } \mathbf { X } _ { k } ( y ) \big ) \Big ] - E \Big [ b _ { i } ^ { 1 } + \sum _ { j = 1 } ^ { N _ { 1 } } W _ { i j } ^ { 1 } \mathbf { X } _ { j } ( x ) \Big ] \Big [ b _ { i } ^ { 1 } + \sum _ { k = 1 } ^ { N _ { 1 } } W _ { i k } ^ { 1 } \mathbf { X } _ { k } ( y ) \Big ] } } \\ { { \displaystyle = E [ ( b _ { i } ^ { 1 } ) ^ { 2 } ] + \sum _ { j = 1 } ^ { N _ { 1 } } E [ ( W _ { i j } ^ { 1 } ) ^ { 2 } ] E [ \mathbf { X } _ { j } ( x ) \mathbf { X } _ { j } ( y ) ] - \frac { 1 } { 2 \pi } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \frac { \sigma _ { w } ^ { 2 } } { N _ { 1 } } N _ { 1 } E [ \mathbf { X } _ { j } ( x ) \mathbf { X } _ { j } ( y ) ] - \frac { 1 } { 2 \pi } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \frac { \sigma _ { w } ^ { 2 } } { 2 \pi } \Big ( \sigma _ { b } ^ { 2 } + \| x \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sigma _ { b } ^ { 2 } + \| y \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sin \phi + ( \pi - \phi ) \cos \phi - 1 \Big ) . } } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
# 2.5 GAUSSIAN PROCESS PREDICTION: A SIMULATION
|
| 135 |
+
|
| 136 |
+
Performing simulations allows us to explore and understand some properties of the models we wish to study. Simulation results also offer the opportunity for evaluating model precision and insight into observed events.
|
| 137 |
+
|
| 138 |
+
To demonstrate making predictions with Gaussian process regression model, we borrow equations from (Williams and Rasmussen, 2006) where the formulation of Gaussian process predictive distribution is treated in great detail.
|
| 139 |
+
|
| 140 |
+
Given the design matrix $X = \{ x _ { i } \} _ { i = 1 } ^ { N }$ , $\boldsymbol { x } _ { i } \in \mathcal { R } ^ { D }$ , observed targets $y = \{ y _ { i } \} _ { i = 1 } ^ { N }$ , $y _ { i } \in \mathcal { R }$ , unknown test data $X _ { * }$ , and their function values $f _ { * } : = f ( X _ { * } )$ , the joint distribution of the target and function values is computed as
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\biggl [ \mathop { y } _ { * } \biggr ] \sim N \biggl ( 0 , \left[ \begin{array} { c c } { K ( X , X ) + \sigma _ { n } ^ { 2 } I } & { K ( X , X _ { * } } \\ { K ( X _ { * } , X ) } & { K ( X _ { * } , X _ { * } ) } \end{array} \right] \biggr ) ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $K ( X , X )$ represents the covariance matrix of all pairs of training points, $K ( X , X _ { * } )$ denotes that of pairs of training and test points, and $K ( X _ { * } , X _ { * } )$ gives the covariance matrix of pairs of test points.
|
| 147 |
+
|
| 148 |
+
The prediction distribution is the conditional distribution
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
f _ { * } | X , y , X _ { * } \sim N ( \mu _ { * } , \Sigma _ { * } )
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { l } { \operatorname { i o n } \mu _ { \ast } = K ( X _ { \ast } , X ) \big [ K ( X , X ) + \sigma _ { n } ^ { 2 } I \big ] ^ { - 1 } y } \\ { \Sigma _ { \ast } = K ( X _ { \ast } , X _ { \ast } ) - K ( X _ { \ast } , X ) \big [ K ( X , X ) + \sigma _ { n } ^ { 2 } I \big ] ^ { - 1 } K ( X , X _ { \ast } ) . } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
The simulation starts out with setting the hyperparameters of the ReLU covariance function to (3.6, 0.02), chosen from $\sigma _ { w } ^ { 2 } \in [ 0 . 4 , 1 . 2 , 2 . 0 , \hat { 2 . } 8 , \hat { 3 . } 6 ]$ , and $\sigma _ { b } ^ { 2 } \in [ 0 . 0 0 0 1 , 0 . 0 1 , 0 . 0 2 ]$ . We randomly select a set of 70 training and 30 test location points from 100 values evenly spaced in the interval [0.0, 1.0]. Ten sample paths, as shown in the top left panel of Figure (2), are generated from the design Gaussian process model. Their sample mean produces 70 training target and 30 test values. We then estimate the optimal hyperparameters from the training targets via evaluating the marginal likelihood, equation (2), over the design ranges of $\sigma _ { w } ^ { 2 }$ and $\sigma _ { b } ^ { 2 }$ .
|
| 159 |
+
|
| 160 |
+
The maximum marginal likelihood is obtained at $\{ \tilde { \sigma } _ { w } ^ { 2 } , \tilde { \sigma } _ { b } ^ { 2 } \} = \{ 3 . 6 , 0 . 0 2 \}$ which is the design hyperparameter pair. The minimum marginal likelihood is obtained at $\{ \hat { \sigma } _ { w } ^ { 2 } , \hat { \sigma } _ { b } ^ { 2 } \} = \{ 3 . 6 , 0 . 0 0 0 \bar { 1 } \}$ . A Gaussian process model is then built with the optimal hyperparameter pair to make predictions for the 30 test location points. The model accuracy is assessed with a RMSE of 0.00051. Additionally we overlay the predicted and true test target values, as shown in the top middle panel of Figure (2), to detect any prediction errors. We plot the line of equality to further validate the estimated hyperparameters, as depicted in the top right panel of the figure.
|
| 161 |
+
|
| 162 |
+
The evaluation process is repeated applying the hyperparameter pair $\big \{ \hat { \sigma } _ { w } ^ { 2 } , \hat { \sigma } _ { b } ^ { 2 } \big \}$ which produces a prediction RMSE of 0.00188, over 3 times as large as the optimal case. The accuracy plots shown in the bottom panels of Figure (2) indicate some prediction errors.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Gaussian process regression prediction on simulated data. Top left: 10 sample paths generated from a Gaussian process model with hyperparameters $( \sigma _ { w } ^ { 2 } , \sigma _ { b } ^ { 2 } ) \overset { - } { = } ( 3 . 6 , 0 . 0 2 )$ . Top middle: Point-wise visual comparison between predicted and true target values for the optimal hyperparameter pair $\{ 3 . 6 , 0 . 0 \bar { 2 } \}$ , showing good prediction results. Top right: The line of equality further confirming the prediction accuracy. Bottom left: Point-wise visual comparison for hyperparameter pair $\lbrace 3 . 6 , 0 . 0 0 0 1 \rbrace$ . Bottom right: Prediction errors revealed with the line of equality.
|
| 166 |
+
|
| 167 |
+
Our simulation results agree with the principle that through optimizing the marginal likelihood of the Gaussian process model, we could estimate from training data the hyperparameter values most appropriate for its chosen covariance function.
|
| 168 |
+
|
| 169 |
+
# 3 MNIST CLASSIFICATION EXPERIMENT
|
| 170 |
+
|
| 171 |
+
We conduct a classification experiment on the MNIST handwritten digit dataset (LeCun, 1998) making use of corresponding ReLU neural network and Gaussian process models. As in (Lee et al., 2018), the classification task on the class labels is treated as Gaussian process regression (also known as kriging in spatial statistics (Cressie, 1993)).
|
| 172 |
+
|
| 173 |
+
It is necessary to point out that the goal of this work is to examine using the marginal likelihood to estimate the best available initial hyperparameter setting for neural networks, rather than determining the networks’ optimal structure.
|
| 174 |
+
|
| 175 |
+
Our experiment consists of three main steps: (A) searching within a given grid of hyperparameter values for the pair $\big \{ \tilde { \sigma } _ { w } ^ { 2 } , \tilde { \sigma } _ { b } ^ { 2 } \big \}$ that maximizes the log marginal likelihood function of the Gaussian procepoint $\{ \sigma _ { w } ^ { 2 } , \sigma _ { b } ^ { 2 } \}$ (B) evaluaincluding $\{ \tilde { \sigma _ { w } ^ { 2 } } , \tilde { \sigma } _ { b } ^ { 2 } \}$ ction accuracy of the corresponding neural network at each grid, and (C) assessing neural network performance over all tested
|
| 176 |
+
|
| 177 |
+
# 3.1 PROCEDURE
|
| 178 |
+
|
| 179 |
+
The workflow for the experiment is as follows: we set up a grid map of $\sigma _ { w } ^ { 2 } \in \{ 0 . 4 , 1 . 2 , 2 . 0 , 2 . 8 , 3 . 6 \}$ , $\sigma _ { b } ^ { 2 } \in \{ 0 . 0 , 1 . 0 , 2 . 0 \}$ . Then, $_ \mathrm { N }$ samples are randomly selected from the MNIST training set to form a training subset, where $\mathbf { N }$ is the training size. This is followed by computing the log marginal likelihood (equation 2) at each grid point. This allows us to identify the hyperparameter pair $\big \{ \tilde { \sigma } _ { w } ^ { 2 } , \tilde { \sigma } _ { b } ^ { 2 } \big \}$ that yields the maximum log marginal likelihood value.
|
| 180 |
+
|
| 181 |
+
On the neural network side, we build a fully-connected feedforward neural network with a single hidden layer width, hidden width, of 2000 nodes, Adam optimizer, and mse loss function. Since the network model is fully connected, the size of the input layer $d _ { i n }$ is 28(pixels) $\mathrm { ~ x ~ } 2 8 ( \mathrm { p i x e l s } ) = 7 8 4$ . Prior to training, the initialization parameters $\{ w , b \}$ are set by sampling the distributions $\mathcal { N } ( 0 , \sigma _ { w } ^ { 2 } / d _ { i n } )$ and $\bar { \mathcal { N } } ( 0 , \bar { \sigma _ { b } ^ { 2 } } )$ for weights and biases from the input to the hidden layer, and $\mathcal { N } ( 0 , \sigma _ { w } ^ { 2 } / 2 0 0 0 )$ and $\mathcal { N } ( 0 , \sigma _ { b } ^ { 2 } )$ for weights and biases from the hidden to the output layer. The neural network is then trained with the training subset generated previously. We compute the model classification accuracy on the MNIST test set and repeat the procedure over the entire grid map of hyperparameter pairs.
|
| 182 |
+
|
| 183 |
+
To investigate the usefulness of our proposed approach for assisting model initialization, we employ He-initialization approach as a benchmark to measure numerically and graphically our neural network performance over all tested hyperparameter pairs. Additionally, we check for recommendation consistency.
|
| 184 |
+
|
| 185 |
+
# 3.2 RESULTS
|
| 186 |
+
|
| 187 |
+
Applying the method described in Section 2.3 for estimating model hyperparameter pair we obtain a consistent recommendation of $( \sigma _ { w } ^ { 2 } , \sigma _ { b } ^ { 2 } ) = ( 3 . 6 , 0 . 0 )$ .
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 3: Comparing MNIST training accuracy over various training sizes. We observe that the convergence rate based on our method approaches that using He-initialization as the training size increases. This suggests that our technique may potentially be efficient for guiding deep neural network initialization. Left: train size $= 1 0 0 0$ . Middle: train size $\scriptstyle = 3 0 0 0$ . Right: train size $\mathord { = } 5 0 0 0$ .
|
| 191 |
+
|
| 192 |
+
After running 250 training epochs, convergence of the neural network model and its prediction accuracy are studied for different training sizes. We observe that training based on our initialization approach converges to that based on He-initialization as the size of training samples increases, as shown in Figure 3. This seems to suggest that our approach may be used as an efficient tool for recommending initialization in deep learning.
|
| 193 |
+
|
| 194 |
+
It is worth noting that the Gaussian process model marginal likelihood consistently suggests the hyperparameter pair $( \sigma _ { w } ^ { 2 } , \sigma _ { b } ^ { 2 } ) = ( 3 . \dot { 6 } , 0 )$ . The fact that the bias variance $\sigma _ { b } ^ { 2 }$ is estimated to be 0 coincides with the assumption that bias vector being 0 in (He et al., 2015).
|
| 195 |
+
|
| 196 |
+
Table 1 lists neural network model prediction accuracy based on, respectively, our approach and He-initialization scheme, against the best and the worst performers. The results indicate that more frequently our approach achieves slightly better accuracy than based on He-initialization. However, neither approach reliably gives an estimate of weight variance close to that for the best case.
|
| 197 |
+
|
| 198 |
+
Table 1: Single-hidden-layer fully-connected neural network model prediction accuracy on MNIST test set, and associated hyperparameter pair.
|
| 199 |
+
|
| 200 |
+
<table><tr><td rowspan="2">Size</td><td colspan="2">Best Case</td><td colspan="2">Worst Case</td><td colspan="2">He-Init</td><td colspan="2">Ours</td></tr><tr><td>Acc.</td><td>(,)</td><td>Acc.</td><td>(,0)</td><td>Acc.</td><td>(²,0)</td><td>Acc.</td><td>(,0)</td></tr><tr><td>10000</td><td>96.85</td><td>(2,0)</td><td>96.04</td><td>(0.4,2)</td><td>96.85</td><td>(2,0)</td><td>96.60</td><td>(3.6, 0)</td></tr><tr><td>20000</td><td>97.25</td><td>(2.8,0)</td><td>96.70</td><td>(3.6, 1)</td><td>97.01</td><td>(2,0)</td><td>97.09</td><td>(3.6,0)</td></tr><tr><td>30000</td><td>97.50</td><td>(1.2, 0)</td><td>96.91</td><td>(2,2)</td><td>97.07</td><td>(2,0)</td><td>97.29</td><td>(3.6,0)</td></tr><tr><td>40000</td><td>97.43</td><td>(0.4,0)</td><td>97.16</td><td>(0.4,2)</td><td>97.35</td><td>(2,0)</td><td>97.42</td><td>(3.6,0)</td></tr><tr><td>50000</td><td>97.71</td><td>(3.6,0)</td><td>97.29</td><td>(0.4,2)</td><td>97.50</td><td>(2,0)</td><td>97.71</td><td>(3.6,0)</td></tr></table>
|
| 201 |
+
|
| 202 |
+
# 4 DISCUSSION AND FUTURE WORK
|
| 203 |
+
|
| 204 |
+
In this work we propose a simple, consistent, and time-efficient method to guide the selection of initial hyperparameters for neural networks. We show that through maximizing the log marginal likelihood we can learn from training data hyperparameter setting that leads to accurate and efficient initialization in neural networks.
|
| 205 |
+
|
| 206 |
+
We develop an alternative representation of the ReLU covariance function to estimate the covariance at the output of the ReLU neural network model. We first derive the expectation of the product of post-activations. Then, we apply the output layer activation function on the post-activation expected value to generate the output covariance function. Utilizing marginal likelihood optimization with the derived ReLU covariance function we perform a simulation to demonstrate the effectiveness of Gaussian process regression.
|
| 207 |
+
|
| 208 |
+
We train a fully-connected single-hidden-layer neural network model to perform classification (treated as regression) on MNIST data set. The empirical results indicate that applying the recommended hyperparameter setting for initialization the neural network model performs well, with He-initialization scheme as the benchmark method.
|
| 209 |
+
|
| 210 |
+
A further examination of the results reveals consistency of the process. This implies that smaller training subsets could be used to provide reasonable recommendation for neural network initialization on sizable training data sets, reducing the computation time which is otherwise required for inverting considerably large covariance matrices.
|
| 211 |
+
|
| 212 |
+
The main goal of our future research is to investigate if our proposed method is adequate for deep neural networks with complicated data sets. We wish to ascertain if consistent recommendation could be attained by learning from larger data sets of color images via marginal likelihood maximization. We will attempt to derive or approximate multilayer covariance functions corresponding to various activation functions. Deep fully-connected neural network models will be built to perform classification on CIFAR-10 data set. Our hypothesis is that learning directly from training data helps to improve neural network initialization strategy.
|
| 213 |
+
|
| 214 |
+
# REFERENCES
|
| 215 |
+
|
| 216 |
+
Christopher Bishop. Pattern recognition and machine learning. 2006.
|
| 217 |
+
|
| 218 |
+
Youngmin Cho and Lawrence K. Saul. Kernel Methods for Deep Learning. In Y. Bengio, D. Schuurmans, J. D. Lafferty, C. K. I. Williams, and A. Culotta, editors, Advances in Neural Information Processing Systems 22, pages 342–350. Curran Associates, Inc., 2009. URL http://papers. nips.cc/paper/3628-kernel-methods-for-deep-learning.pdf.
|
| 219 |
+
|
| 220 |
+
Noel AC Cressie. Statistics for spatial data. John Willy and Sons. Inc., New York, 1993.
|
| 221 |
+
|
| 222 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. AISTATS, page 8, 2010.
|
| 223 |
+
|
| 224 |
+
Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. On the Impact of the Activation Function on Deep Neural Networks Training. ICML, May 2019. URL http://arxiv.org/abs/1902. 06853. arXiv: 1902.06853.
|
| 225 |
+
|
| 226 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. arXiv:1502.01852 [cs], February 2015. URL http://arxiv.org/abs/1502.01852. arXiv: 1502.01852.
|
| 227 |
+
|
| 228 |
+
Ashish Kapoor, Kristen Grauman, Raquel Urtasun, and Trevor Darrell. Gaussian Processes for Object Categorization. International Journal of Computer Vision, 88(2):169–188, June 2010. ISSN 1573-1405. doi: 10.1007/s11263-009-0268-3. URL https://doi.org/10.1007/ s11263-009-0268-3.
|
| 229 |
+
|
| 230 |
+
Yann LeCun. THE MNIST DATABASE of handwritten digits, 1998. URL http://yann. lecun.com/exdb/mnist/.
|
| 231 |
+
|
| 232 |
+
Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S. Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep Neural Networks as Gaussian Processes. arXiv:1711.00165 [cs, stat], March 2018. URL http://arxiv.org/abs/1711.00165. arXiv: 1711.00165.
|
| 233 |
+
|
| 234 |
+
David MacKay. Introduction to Gaussian processes. Citeseer, 1998.
|
| 235 |
+
|
| 236 |
+
Dmytro Mishkin and Jiri Matas. All you need is a good init. ICLR, February 2016. URL http: //arxiv.org/abs/1511.06422. arXiv: 1511.06422.
|
| 237 |
+
|
| 238 |
+
Radford M. Neal. Bayesian Learning for Neural Networks, volume 118 of Lecture Notes in Statistics. Springer New York, New York, NY, 1996. ISBN 978-0-387-94724-2 978-1-4612-0745- 0. doi: 10.1007/978-1-4612-0745-0. URL http://link.springer.com/10.1007/ 978-1-4612-0745-0.
|
| 239 |
+
|
| 240 |
+
Radford M. Neal. Regression and classification using Gaussian process priors. Bayesian statistics, 6:475, 1998.
|
| 241 |
+
|
| 242 |
+
Samuel S. Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep Information Propagation. ICLR, April 2017. URL http://arxiv.org/abs/1611.01232. arXiv: 1611.01232.
|
| 243 |
+
|
| 244 |
+
Raquel Urtasun and Trevor Darrell. Sparse probabilistic regression for activity-independent human pose inference. CVPR, 2008.
|
| 245 |
+
|
| 246 |
+
Mark van der Wilk, Carl Edward Rasmussen, and James Hensman. Convolutional Gaussian Processes. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 2849–2858. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 6877-convolutional-gaussian-processes.pdf.
|
| 247 |
+
|
| 248 |
+
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning, 2006.
|
| 249 |
+
|
| 250 |
+
Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P. Xing. Deep kernel learning. In Artificial Intelligence and Statistics, pages 370–378, 2016.
|
| 251 |
+
|
| 252 |
+
# 5 APPENDIX
|
| 253 |
+
|
| 254 |
+
# Covariance Function at the Output of ReLU Neural Network
|
| 255 |
+
|
| 256 |
+
Our derivation follows the work on arc-cosine family of kernels developed in (Cho and Saul, 2009). However, instead of applying coplanar vector rotation in calculating the kernel integral, we recognize that the integrand can be written in terms of two jointly normal random variables. This helps to facilitate the computation which becomes more involved when both the weight and bias parameters are included.
|
| 257 |
+
|
| 258 |
+
The derivation is also made to conform to the arc-cosine kernel by utilizing the identities (Cho and Saul, 2009, equation (17), (18)) to give us
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { l } { { \displaystyle { \int _ { \eta = 0 } ^ { \frac { \pi } { 2 } } \frac { 1 } { 1 - \cos \phi \cos \eta } d \eta = \frac { \pi - \phi } { \sin \phi } } , } } \\ { { \displaystyle { \int _ { \theta = 0 } ^ { \frac { \pi } { 2 } } \frac { \sin 2 \theta } { \left( 1 - \cos \phi \sin 2 \theta \right) ^ { 2 } } d \theta } } } \\ { { = \displaystyle { \frac { 1 } { \sin ^ { 3 } \phi } \Big ( \sin ( \phi ) + ( \pi - \phi ) \cos ( \phi ) \Big ) } . } } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
Equation (4) is derived, with the substitution $\eta = 2 ( \theta - \frac { \pi } { 4 } )$ ) , as follow:
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\begin{array} { r l } & { \displaystyle \int _ { \theta = 0 } ^ { \frac { \pi } { 2 } } \frac { \sin 2 \theta } { \left( 1 - \cos \phi \sin 2 \theta \right) ^ { 2 } } d \theta } \\ & { = \displaystyle \int _ { \eta = 0 } ^ { \frac { \pi } { 2 } } \frac { \cos \eta } { \left( 1 - \cos \phi \cos \eta \right) ^ { 2 } } d \eta } \\ & { = \displaystyle \frac { \partial } { \partial \cos \phi } \int _ { \eta = 0 } ^ { \frac { \pi } { 2 } } \frac { 1 } { 1 - \cos \phi \cos \eta } d \eta } \\ & { = \displaystyle \frac { \partial } { \partial \cos \phi } \left( \frac { \pi - \phi } { \sin \phi } \right) = \frac { - 1 } { \sin ( \phi ) } \frac { \partial } { \partial \phi } \left( \frac { \pi - \phi } { \sin \phi } \right) } \\ & { = \displaystyle \frac { 1 } { \sin ^ { 3 } \phi } \left( \sin ( \phi ) + ( \pi - \phi ) \cos ( \phi ) \right) . } \end{array}
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
Denote the input layer (layer 0) weight and bias parameters as $b _ { j } ^ { 0 } \sim \mathcal { N } ( 0 , \sigma _ { b } ^ { 2 } )$ and $\begin{array} { r } { W _ { j k } ^ { 0 } \overset { \mathrm { i i d } } { \sim } \mathcal { N } ( 0 , \frac { \sigma _ { w } ^ { 2 } } { d _ { i n } } ) } \end{array}$ where $b _ { j } ^ { 0 } \underline { { 1 } } \perp W _ { j k } ^ { 0 }$ for all $k \in \{ 1 , \cdots , d _ { i n } \} , j \in \{ 1 , \cdots , N _ { 1 } \}$ .
|
| 271 |
+
|
| 272 |
+
The expected value of the product of post-activations at the output of the $j ^ { t h }$ hidden node is computed as
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { r l } & { E [ \mathbf { X } _ { j } ( { x } ^ { 0 } ) \mathbf { X } _ { j } ( { y } ^ { 0 } ) ] } \\ & { \ = \displaystyle \int \cdots \int _ { - \infty } ^ { \infty } \operatorname* { m a x } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { x } ^ { 0 } ) \operatorname* { m a x } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { y } ^ { 0 } ) f _ { b _ { j } ^ { 0 } , W _ { j } ^ { 0 } } ( b , w ) d w _ { j } ^ { 0 } d b _ { j } ^ { 0 } } \\ & { \ = \displaystyle \int \cdots \int _ { - \infty } ^ { \infty } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { x } ^ { 0 } ) _ { + } ( b _ { j } ^ { 0 } + w _ { j } ^ { 0 } \cdot { y } ^ { 0 } ) _ { + } f _ { b _ { j } ^ { 0 } , W _ { j } ^ { 0 } } ( b , w ) d w _ { j } ^ { 0 } d b } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Each pre-activation can be written in terms of a random variable:
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\begin{array} { l } { { U = b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot x ^ { 0 } = b _ { j } ^ { 0 } + \displaystyle \sum _ { k = 1 } ^ { d _ { i n } } W _ { j k } ^ { 0 } x _ { k } ^ { 0 } \sim \mathcal N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } ) , } } \\ { { \displaystyle V = b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot y ^ { 0 } = b _ { j } ^ { 0 } + \displaystyle \sum _ { k ^ { \prime } = 1 } ^ { d _ { i n } } W _ { j k ^ { \prime } } ^ { 0 } y _ { k ^ { \prime } } ^ { 0 } \sim \mathcal N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } ) . } } \end{array}
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
Since $E [ U ] = E [ V ] = 0$ , their covariance can be expressed as
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { l } { { \displaystyle \mathrm { c o v } ( U , V ) = E \big [ ( b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot x ^ { 0 } ) ( b _ { j } ^ { 0 } + W _ { j } ^ { 0 } \cdot y ^ { 0 } ) \big ] } } \\ { { \displaystyle = E \big [ ( b _ { j } ^ { 0 } ) ^ { 2 } \big ] + E \bigg [ \displaystyle \sum _ { k = 1 } ^ { d _ { i n } } \sum _ { k ^ { \prime } = 1 } ^ { d _ { i n } } W _ { j k } ^ { 0 } W _ { j k ^ { \prime } } ^ { 0 } x _ { k } ^ { 0 } y _ { k ^ { \prime } } ^ { 0 } \bigg ] } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \displaystyle \sum _ { k = 1 } ^ { d _ { i n } } \sum _ { k ^ { \prime } = 1 } ^ { d _ { i n } } E \Big [ W _ { j k } ^ { 0 } W _ { j k ^ { \prime } } ^ { 0 } \Big ] x _ { k } ^ { 0 } y _ { k ^ { \prime } } ^ { 0 } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \sigma _ { b } ^ { 2 } \sum _ { k = 1 } ^ { d _ { i n } } x _ { k } ^ { 0 } y _ { k } ^ { 0 } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) ~ } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) ~ \mathrm { ( F o r ~ s i m p l i c i t y ~ w e ~ s e t ~ } x ^ { 0 } , y = y ^ { 0 } ) } } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
This implies that the random variables $U , V$ have a joint Gaussian distribution:
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array}{c} \binom { U } { V } \sim { \mathcal N } ( 0 , \Sigma ) , \mathrm { w h e r e } \Sigma = \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \lVert x \rVert ^ { 2 } \right. \left. \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) \\ { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \ \left. \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \lVert y \rVert ^ { 2 } . \right) } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
We can, therefore, rewrite equation (5) as
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\iint _ { 0 } ^ { \infty } u v \frac { 1 } { 2 \pi | \Sigma | ^ { \frac { 1 } { 2 } } } \exp \big ( - \frac { 1 } { 2 } ( u , v ) \Sigma ^ { - 1 } ( u , v ) ^ { T } \big ) d u d v
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
Denote $D : = | \Sigma | = \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \right) \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \right) - \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) ^ { 2 }$ , and
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\Sigma ^ { - 1 } = { \binom { a _ { 1 1 } } { a _ { 2 1 } } } a _ { 2 2 } ) ,
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
with $\begin{array} { l } { \displaystyle { a _ { 1 1 } = \frac { 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) , a _ { 2 2 } = \frac { 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) , } } \\ { \displaystyle { = a _ { 2 1 } = \frac { - 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \big ) . } } \end{array}$ and
|
| 309 |
+
|
| 310 |
+
We therefore have:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { l } { { \displaystyle { D \big ( a _ { 1 1 } a _ { 2 2 } - a _ { 1 2 } ^ { 2 } \big ) = D \Big ( \frac { 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) \frac { 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) - \big ( \frac { - 1 } { D } \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \big ( x \cdot y \big ) \big ) ^ { 2 } \Big ) } } } \\ { { \displaystyle \qquad = \frac { 1 } { D } \Big ( \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) - \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \big ( x \cdot y \big ) \big ) ^ { 2 } \Big ) } } \\ { { \displaystyle \qquad = 1 . \quad \quad \mathrm { ( b y ~ d e f i n i t i o n ) } } } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
The exponential term in equation (6) then becomes:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
- \frac { 1 } { 2 } ( u , v ) \Sigma ^ { - 1 } ( u , v ) ^ { T } = - \frac { 1 } { 2 } \big ( a _ { 1 1 } u ^ { 2 } + 2 a _ { 1 2 } u v + a _ { 2 2 } v ^ { 2 } \big ) .
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
We now make use of the transformation from Cartesian to polar coordinates by setting
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
{ \begin{array} { r l } & { u = { \frac { r } { \sqrt { a _ { 1 1 } } } } \cos \alpha , v = { \frac { r } { \sqrt { a _ { 2 2 } } } } \sin \alpha } \\ & { \qquad \implies a _ { 1 1 } u ^ { 2 } = r ^ { 2 } { \cos ^ { 2 } } \alpha , a _ { 2 2 } v ^ { 2 } = r ^ { 2 } { \sin ^ { 2 } } \alpha . } \end{array} }
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
The Jacobian $\mathcal { I }$ is calculated as
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\big | \frac { \partial ( u , v ) } { \partial ( r , \alpha ) } \big | = \frac { r } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } .
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Equation (6) can in turn be expressed as
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r l } & { \frac { 1 } { 2 \pi D ^ { 1 / 2 } } \int _ { \alpha = 0 } ^ { \frac { \pi } { 2 } } \int _ { r = 0 } ^ { \infty } \frac { r ^ { 2 } \sin 2 \alpha } { 2 \sqrt { a _ { 1 1 } a _ { 2 2 } } } \mathrm { e x p } \Big ( \frac { - 1 } { 2 } [ r ^ { 2 } \cos ^ { 2 } \alpha + \frac { 2 a _ { 1 2 } r ^ { 2 } \sin \alpha \cos \alpha } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } + r ^ { 2 } \sin ^ { 2 } \alpha ] \Big ) \frac { r d r d \alpha } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } } \\ & { = \frac { 1 } { 4 \pi D ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } } \int _ { \alpha = 0 } ^ { \frac { \pi } { 2 } } \sin 2 \alpha d \alpha \int _ { r = 0 } ^ { \infty } r ^ { 3 } \mathrm { e x p } \Big ( \frac { - r ^ { 2 } } { 2 } [ 1 + \frac { a _ { 1 2 } \sin 2 \alpha } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } ] \Big ) d r \qquad \quad ( \cot 2 ) } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Next, we need to show that $\mathcal { H } : = 1 + \frac { a _ { \mathrm { 1 2 } } \sin 2 \alpha } { \sqrt { a _ { \mathrm { 1 1 } } a _ { \mathrm { 2 2 } } } } \ge 0$ to ensure the expression in (8) is bounded.
|
| 341 |
+
|
| 342 |
+
First, since $\| x - y \| ^ { 2 } = \| x \| ^ { 2 } + \| y \| ^ { 2 } - 2 ( x \cdot y ) \geq 0 \implies \| x \| ^ { 2 } + \| y \| ^ { 2 } \geq 2 ( x \cdot y )$ , and let the angle between the vectors $x , y$ be $\theta = \cos ^ { - 1 } \Bigl ( \frac { x \cdot y } { \| x \| \| y \| } \Bigr )$ , we have
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\begin{array} { r l } & { \frac { \Big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \Big ) ^ { 2 } } { \Big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \Big ) \Big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \Big ) } } \\ & { = \frac { \sigma _ { b } ^ { 4 } + ( \sigma _ { w } ^ { 2 } ) ^ { 2 } ( x \cdot y ) ^ { 2 } + 2 \sigma _ { b } ^ { 2 } ( \sigma _ { w } ^ { 2 } ) ( x \cdot y ) } { \sigma _ { b } ^ { 4 } + ( \sigma _ { w } ^ { 2 } ) ^ { 2 } \left( \| x \| ^ { 2 } \| y \| ^ { 2 } \right) + \sigma _ { b } ^ { 2 } ( \sigma _ { w } ^ { 2 } ) \left( \| x \| ^ { 2 } + \| y \| ^ { 2 } \right) } } \\ & { = \frac { \sigma _ { b } ^ { 4 } + ( \sigma _ { w } ^ { 2 } ) ^ { 2 } ( \| x \| \| y \| \cos \theta ) ^ { 2 } + \sigma _ { b } ^ { 2 } ( \sigma _ { w } ^ { 2 } ) 2 ( x \cdot y ) } { \sigma _ { b } ^ { 4 } + ( \sigma _ { w } ^ { 2 } ) ^ { 2 } \left( \| x \| ^ { 2 } \| y \| ^ { 2 } \right) + \sigma _ { b } ^ { 2 } ( \sigma _ { w } ^ { 2 } ) \left( \| x \| ^ { 2 } + \| y \| ^ { 2 } \right) } } \\ & { < 1 . } \end{array}
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
This means that we can define a quantity $\phi$ as
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\begin{array} { l } { \displaystyle \phi = \cos ^ { - 1 } \frac { \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) } { \left( \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \right) \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \right) \right) ^ { 1 / 2 } } } \\ { \displaystyle = \cos ^ { - 1 } \frac { \frac { 1 } { D } \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) } { \frac { 1 } { D } \left( \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \right) \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \right) \right) } } \\ { = \cos ^ { - 1 } \Big ( \frac { - a _ { 1 2 } } { \sqrt { u _ { 1 } u _ { 2 2 } } } \Big ) } \\ { \displaystyle \implies \cos \phi = \left( \frac { - a _ { 1 2 } } { \sqrt { u _ { 1 } u _ { 2 2 } } } \right) } \end{array}
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
This also leads to
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
\begin{array} { l } { \mathcal { H } : = 1 + \frac { a _ { 1 2 } \sin 2 \alpha } { \sqrt { a _ { 1 } \sin 2 \alpha } } } \\ { \displaystyle = 1 + \frac { \frac { - 1 } { D } \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) \sin 2 \alpha } { \frac { 1 } { D } \left( ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | x | ^ { 2 } ) \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | y | | y | ^ { 2 } \right) \right) } } \\ { \displaystyle = 1 - \frac { ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) ) \sin 2 \alpha } { \left( ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | x | ^ { 2 } ) ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | y | | y | ^ { 2 } ) \right) ^ { 1 / 2 } } } \\ { \geq 1 - \frac { \left( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \right) } { \left( ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | x | ^ { 2 } ) ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | y | | y | ^ { 2 } ) \right) ^ { 1 / 2 } } } \\ { \displaystyle \geq 0 \ \frac { 1 } { 8 } \left( ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | x | ^ { 2 } ) ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } | y | | y | ^ { 2 } ) \right) ^ { 1 / 2 } } \end{array}
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
With a change of variables, we now evaluate the integral involving the parameter $r$ in expression (8) as follows.
|
| 361 |
+
|
| 362 |
+
Let $\eta = \frac { r ^ { 2 } } { 2 } \mathcal { H }$ . Then $r = \sqrt { \frac { 2 \eta } { \mathcal { H } } } \implies d r = \frac { 1 } { 2 } \sqrt { \frac { 2 } { \mathcal { H } } } \eta ^ { - 1 / 2 } d \eta .$ −1/2 d η. We have
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r l } & { \int _ { n = 0 } ^ { \infty } \left( \frac { 2 } { \mathcal { H } } \right) ^ { \frac { 2 } { 3 } } \eta ^ { \frac { 2 } { 2 } } \hat { \mathbf { z } } ^ { - \nu } \frac { 1 } { 2 } \sqrt { \frac { 2 } { \mathcal { H } } \eta ^ { \frac { 2 } { 2 } } } \vec { \mathbf { z } } ^ { \frac { 1 } { 2 } } \ d \eta } \\ & { = \int _ { n = 0 } ^ { \infty } \frac { 2 2 } { \mathcal { H } ^ { 2 } } \frac { 1 } { 2 } \mathbf { z } ^ { \nu - \nu } \ d \eta } \\ & { = \frac { 2 } { \mathcal { H } ^ { 2 } } \int _ { n = 0 } ^ { \infty } \eta \ c ^ { - \nu } d \eta } \\ & { = \frac { 2 } { \mathcal { H } ^ { 2 } } \mathbf { z } ^ { \nu } [ ( 2 ) = \frac { 2 } { \mathcal { H } ^ { 2 } } } \\ & { = \frac { 2 } { \left( 1 + \frac { \operatorname { d r } _ { 1 } \sqrt { \operatorname { d r } _ { 1 } \log 2 } } { \sqrt { \operatorname { d r } _ { 1 } \log 2 } } \right) ^ { 2 } } } \\ & { = \frac { 2 } { \left( 1 - \frac { 2 } { \sqrt { \operatorname { d r } _ { 1 } \operatorname { d r } _ { 2 } \mathcal { H } } } \right) ^ { 2 } } . \quad \mathrm { ( f r o m ~ e q u a t i o n ~ \mathcal { O } ) } \big ) } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
The complete expression (8) becomes
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\begin{array} { r l } & { \frac { 1 } { 4 \pi D ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } } \displaystyle \int _ { \alpha = 0 } ^ { \frac { \pi } { 2 } } \frac { 2 \sin 2 \alpha } { \left( 1 - \cos \phi \sin 2 \alpha \right) ^ { 2 } } d \alpha } \\ & { = \frac { 1 } { 2 \pi D ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } \sin ^ { 3 } \phi } \Big ( \sin ( \phi ) + ( \pi - \phi ) \cos ( \phi ) \Big ) . \quad \mathrm { ( f r o m ~ e q u a t i o n ~ ( 4 ) ) } } \end{array}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
where $\phi = \cos ^ { - 1 } \Big ( \frac { - a _ { 1 2 } } { \sqrt { a _ { 1 1 } a _ { 2 2 } } } \Big )$
|
| 375 |
+
|
| 376 |
+
Finally,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } & { 2 \pi \mathcal { D } ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } \sin ^ { 3 } \phi } \\ & { = 2 \pi \mathcal { D } ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } \left( 1 - \cos ^ { 2 } \phi \right) ^ { 3 / 2 } } \\ & { = 2 \pi \mathcal { D } ^ { 1 / 2 } a _ { 1 1 } a _ { 2 2 } \left( 1 - \frac { a _ { 1 2 } ^ { 2 } } { a _ { 1 1 } a _ { 2 2 } } \right) ^ { 3 / 2 } } \\ & { = 2 \pi \mathcal { D } ^ { 1 / 2 } \Big ( a _ { 1 1 } a _ { 2 2 } \Big ) ^ { - 1 / 2 } \Big ( a _ { 1 1 } a _ { 2 2 } - a _ { 1 2 } ^ { 2 } \Big ) ^ { 3 / 2 } } \\ & { = 2 \pi \Big ( \mathcal { D } ^ { 2 } a _ { 1 1 } a _ { 2 2 } \Big ) ^ { - 1 / 2 } \Big ( \mathcal { D } \big ( a _ { 1 1 } a _ { 2 2 } - a _ { 1 2 } ^ { 2 } \big ) \Big ) ^ { 3 / 2 } } \\ & { = 2 \pi \Big ( \big ( o _ { b } ^ { 2 } + o _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) \big ( o _ { b } ^ { 2 } + o _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) \Big ) ^ { - 1 / 2 } \Big ( 1 \Big ) ^ { 3 / 2 } \quad \mathrm { ( f r o m e q u a t i o n ~ ( 7 ) ) } } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
The expected value of the product of post-activations at the output of the $j ^ { t h }$ hidden node in the first hidden layer is therefore determined to be
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\begin{array} { r l } & { E [ { \bf X } _ { j } ( x ) { \bf X } _ { j } ( y ) ] } \\ & { = \displaystyle \frac { 1 } { 2 \pi } \Big ( \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) \Big ) ^ { 1 / 2 } \Big ( \sin ( \phi ) + \big ( \pi - \phi \big ) \cos ( \phi ) \Big ) , } \\ & { \mathrm { w h e r e \ } \phi = \cos ^ { - 1 } \Bigg \{ \frac { \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } ( x \cdot y ) \big ) } { \Big ( \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } \big ) \big ( \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } \big ) \Big ) ^ { 1 / 2 } } \Bigg \} . } \end{array}
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
To compute the expected value, $\begin{array} { r } { E [ \mathbf { X } _ { j } ( x ) ] \ = \ \int \operatorname* { m a x } ( b + w \cdot x ) f _ { b _ { j } ^ { 0 } , W _ { j k } ^ { 0 } } ( b , w ) d w d b } \end{array}$ , we denote $U = b + w \cdot x \sim N ( 0 , \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } )$ , and apply the change in variables: ${ \frac { 1 } { 2 \sigma ^ { 2 } } } u ^ { 2 } = t$ , where $\sigma ^ { 2 } = $ $\sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \lVert x \rVert ^ { 2 }$ to obtain
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\begin{array} { l } { \displaystyle E [ \mathbf { X } _ { j } ( x ) ] = \int _ { - \infty } ^ { \infty } \left( u \right) + f _ { U } ( u ) d u } \\ { \displaystyle = \int _ { 0 } ^ { \infty } u \frac { 1 } { \sqrt { 2 \pi } \sigma } e ^ { - \frac { 1 } { 2 \sigma ^ { 2 } } u ^ { 2 } } d u } \\ { \displaystyle = \int _ { 0 } ^ { \infty } \sigma ^ { 2 } d t \frac { 1 } { \sqrt { 2 \pi } \sigma } e ^ { - t } } \\ { \displaystyle = \frac { \sigma } { \sqrt { 2 \pi } } } \\ { \displaystyle = \frac { \sqrt { \sigma _ { b } ^ { 2 } } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } { \sqrt { 2 \pi } } } \end{array}
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
The covariance function at the network output is therefore determined to be
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\begin{array} { l } { { \displaystyle E \Big [ \big ( b _ { i } ^ { 1 } + \sum _ { j = 1 } ^ { N _ { 1 } } W _ { i j } ^ { 1 } \mathbf { X } _ { j } ( x ) \big ) \big ( b _ { i } ^ { 1 } + \sum _ { k = 1 } ^ { N _ { 1 } } W _ { i k } ^ { 1 } \mathbf { X } _ { k } ( y ) \big ) \Big ] - E \Big [ b _ { i } ^ { 1 } + \sum _ { j = 1 } ^ { N _ { 1 } } W _ { i j } ^ { 1 } \mathbf { X } _ { j } ( x ) \Big ] \Big [ b _ { i } ^ { 1 } + \sum _ { k = 1 } ^ { N _ { 1 } } W _ { i k } ^ { 1 } \mathbf { X } _ { k } ( y ) \Big ] } } \\ { { \displaystyle = E [ ( b _ { i } ^ { 1 } ) ^ { 2 } ] + \sum _ { j = 1 } ^ { N _ { 1 } } E [ ( W _ { i j } ^ { 1 } ) ^ { 2 } ] E [ \mathbf { X } _ { j } ( x ) \mathbf { X } _ { j } ( y ) ] - \frac { 1 } { 2 \pi } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \frac { \sigma _ { w } ^ { 2 } } { N _ { 1 } } N _ { 1 } E [ \mathbf { X } _ { j } ( x ) \mathbf { X } _ { j } ( y ) ] - \frac { 1 } { 2 \pi } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| x \| ^ { 2 } } \sqrt { \sigma _ { b } ^ { 2 } + \sigma _ { w } ^ { 2 } \| y \| ^ { 2 } } } } \\ { { \displaystyle = \sigma _ { b } ^ { 2 } + \frac { \sigma _ { w } ^ { 2 } } { 2 \pi } \Big ( \sigma _ { b } ^ { 2 } + \| x \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sigma _ { b } ^ { 2 } + \| y \| ^ { 2 } \sigma _ { w } ^ { 2 } \Big ) ^ { \frac { 1 } { 2 } } \Big ( \sin \phi + ( \pi - \phi ) \cos \phi - 1 \Big ) . } } \end{array}
|
| 398 |
+
$$
|
md/train/r1q7n9gAb/r1q7n9gAb.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/r1xCMyBtPS/r1xCMyBtPS.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTILINGUAL ALIGNMENT OF CONTEXTUAL WORD REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Steven Cao, Nikita Kitaev & Dan Klein
|
| 4 |
+
Computer Science Division
|
| 5 |
+
University of California, Berkeley
|
| 6 |
+
{stevencao,kitaev,klein}@berkeley.edu
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We propose procedures for evaluating and strengthening contextual embedding alignment and show that they are useful in analyzing and improving multilingual BERT. In particular, after our proposed alignment procedure, BERT exhibits significantly improved zero-shot performance on XNLI compared to the base model, remarkably matching pseudo-fully-supervised translate-train models for Bulgarian and Greek. Further, to measure the degree of alignment, we introduce a contextual version of word retrieval and show that it correlates well with downstream zero-shot transfer. Using this word retrieval task, we also analyze BERT and find that it exhibits systematic deficiencies, e.g. worse alignment for open-class parts-of-speech and word pairs written in different scripts, that are corrected by the alignment procedure. These results support contextual alignment as a useful concept for understanding large multilingual pre-trained models.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
Figure 1: t-SNE (Maaten & Hinton, 2008) visualization of the embedding space of multilingual BERT for English-German word pairs (left: pre-alignment, right: post-alignment). Each point is a different instance of the word in the Europarl corpus. This figure suggests that BERT begins already somewhat aligned out-of-the-box but becomes much more aligned after our proposed procedure.
|
| 16 |
+
|
| 17 |
+
Embedding alignment was originally studied for word vectors with the goal of enabling cross-lingual transfer, where the embeddings for two languages are in alignment if word translations, e.g. cat and Katze, have similar representations (Mikolov et al., 2013a; Smith et al., 2017). Recently, large pretrained models have largely subsumed word vectors based on their accuracy on downstream tasks, partly due to the fact that their word representations are context-dependent, allowing them to more richly capture the meaning of a word (Peters et al., 2018; Howard & Ruder, 2018; Radford et al., 2018; Devlin et al., 2018). Therefore, with the same goal of cross-lingual transfer but for these more complex models, we might consider contextual embedding alignment, where we observe whether word pairs within parallel sentences, e.g. cat in “The cat sits” and Katze in “Die Katze sitzt,” have similar representations.
|
| 18 |
+
|
| 19 |
+
One model relevant to these questions is multilingual BERT, a version of BERT pre-trained on 104 languages that achieves remarkable transfer on downstream tasks. For example, after the model is fine-tuned on the English MultiNLI training set, it achieves $7 4 . 3 \%$ accuracy on the test set in Spanish, which is only $7 . 1 \%$ lower than the English accuracy (Devlin et al., 2018; Conneau et al., 2018b). Furthermore, while the model transfers better to languages similar to English, it still achieves reasonable accuracies even on languages with different scripts.
|
| 20 |
+
|
| 21 |
+
However, given the way that multilingual BERT was pre-trained, it is unclear why we should expect such high zero-shot performance. Compared to monolingual BERT which exhibits no zero-shot transfer, multilingual BERT differs only in that (1) during pre-training (i.e. masked word prediction), each batch contains sentences from all of the languages, and (2) it uses a single shared vocabulary, formed by WordPiece on the concatenated monolingual corpora (Devlin et al., 2019). Therefore, we might wonder: (1) How can we better understand BERT’s multilingualism? (2) Can we further improve BERT’s cross-lingual transfer?
|
| 22 |
+
|
| 23 |
+
In this paper, we show that contextual embedding alignment is a useful concept for addressing these questions. First, we propose a contextual version of word retrieval to evaluate the degree of alignment, where a model is presented with two parallel corpora, and given a word within a sentence in one corpus, it must find the correct word and sentence in the other. Using this metric of alignment, we show that multilingual BERT achieves zero-shot transfer because its embeddings are partially aligned, as depicted in Figure 1, with the degree of alignment predicting the degree of downstream transfer.
|
| 24 |
+
|
| 25 |
+
Next, using between 10K and 250K sentences per language from the Europarl corpus as parallel data (Koehn, 2005), we propose a fine-tuning-based alignment procedure and show that it significantly improves BERT as a multilingual model. Specifically, on zero-shot XNLI, where the model is trained on English MultiNLI and tested on other languages (Conneau et al., 2018b), the aligned model improves accuracies by $2 . 7 8 \%$ on average over the base model, and it remarkably matches translate-train models for Bulgarian and Greek, which approximate the fully-supervised setting.
|
| 26 |
+
|
| 27 |
+
To put our results in the context of past work, we also use word retrieval to compare our finetuning procedure to two alternatives: (1) fastText augmented with sentence and aligned using rotations (Bojanowski et al., 2017; Ruckl ¨ e et al., 2018; Artetxe et al., 2018), and (2) BERT aligned using ´ rotations (Aldarmaki & Diab, 2019; Schuster et al., 2019; Wang et al., 2019). We find that when there are multiple occurences per word, fine-tuned BERT outperforms fastText, which outperforms rotation-aligned BERT. This result supports the intuition that contextual alignment is more difficult than its non-contextual counterpart, given that a rotation, at least when applied naively, is no longer sufficient to produce strong alignments. In addition, when there is only one occurrence per word, fine-tuned BERT matches the performance of fastText. Given that context disambiguation is no longer necessary, this result suggests that our fine-tuning procedure is able to align BERT at the type level to a degree that matches non-contextual approaches.
|
| 28 |
+
|
| 29 |
+
Finally, we use the contextual word retrieval task to conduct finer-grained analysis of multilingual BERT, with the goal of better understanding its strengths and shortcomings. Specifically, we find that base BERT has trouble aligning open-class compared to closed-class parts-of-speech, as well as word pairs that have large differences in usage frequency, suggesting insight into the pre-training procedure that we explore in Section 5. Together, these experiments support contextual alignment as an important task that provides useful insight into large multilingual pre-trained models.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Word vector alignment. There has been a long line of works that learn aligned word vectors from varying levels of supervision (Ruder et al., 2019). One popular family of methods starts with word vectors learned independently for each language (using a method like skip-gram with negative sampling (Mikolov et al., 2013b)), and it learns a mapping from source language vectors to target language vectors with a bilingual dictionary as supervision (Mikolov et al., 2013a; Smith et al., 2017; Artetxe et al., 2017). When the mapping is constrained to be an orthogonal linear transformation, the optimal mapping that minimizes distances between word pairs can be solved in closed form (Artetxe et al., 2016; Schonemann, 1966). Alignment is evaluated using bilingual lexicon induction, so these papers also propose ways to mitigate the hubness problem in nearest neighbors, e.g. by using alternate similarity functions like CSLS (Conneau et al., 2018a). A recent set of works has also shown that the mapping can be learned with minimal to no supervision by starting with some minimal seed dictionary and alternating between learning the linear map and inducing the dictionary (Artetxe et al., 2018; Conneau et al., 2018a; Hoshen & Wolf, 2018; Xu et al., 2018; Chen & Cardie, 2018).
|
| 34 |
+
|
| 35 |
+
Incorporating context into alignment. One key challenge in making alignment context aware is that the embeddings are now different across multiple occurrences of the same word. Past papers have handled this issue by removing context and aligning the “average sense” of a word. In one such study, Schuster et al. (2019) learn a rotation to align contextual ELMo embeddings (Peters et al., 2018) with the goal of improving zero-shot multilingual dependency parsing, and they handle context by taking the average embedding for a word in all of its contexts. In another paper, Aldarmaki & Diab (2019) learn a rotation on sentence vectors, produced by taking the average word vector over the sentence, and they show that the resulting alignment also works well for word-level tasks. In a contemporaneous work, Wang et al. (2019) align not only the word but also the context by learning a linear transformation using word-aligned parallel data to align multilingual BERT, with the goal of improving zero-shot dependency parsing numbers. In this paper, we similarly align not only the word but also the context, and we also depart from these past works by using more expressive alignment methods than rotation.
|
| 36 |
+
|
| 37 |
+
Incorporating parallel texts into pre-training. Instead of performing alignment post-hoc, another line of works proposes contextual pre-training procedures that are more cross-lingually-aware. Wieting et al. (2019) pre-train sentence embeddings using parallel texts by maximizing similarity between sentence pairs while minimizing similarity with negative examples. Lample & Conneau (2019) propose a cross-lingual pre-training objective that incorporates parallel data in addition to monolingual corpora, leading to improved downstream cross-lingual transfer. In contrast, our method uses less parallel data and aligns existing pre-trained models rather than requiring pretraining from scratch.
|
| 38 |
+
|
| 39 |
+
Analyzing multilingual BERT. Pires et al. (2019) present a series of probing experiments to better understand multilingual BERT, and they find that transfer is possible even between dissimilar languages, but that it works better between languages that are typologically similar. They conclude that BERT is remarkably multilingual but falls short for certain language pairs.
|
| 40 |
+
|
| 41 |
+
# 3 METHODS
|
| 42 |
+
|
| 43 |
+
# 3.1 MULTILINGUAL PRE-TRAINING
|
| 44 |
+
|
| 45 |
+
We first briefly describe multilingual BERT (Devlin et al., 2018). Like monolingual BERT, multilingual BERT is pre-trained on sentences from Wikipedia to perform two tasks: masked word prediction, where it must predict words that are masked within a sentence, and next sentence prediction, where it must predict whether the second sentence follows the first one. The model is trained on 104 languages, with each batch containing training sentences from each language, and it uses a shared vocabulary formed by WordPiece on the 104 Wikipedias concatenated (Wu et al., 2016).
|
| 46 |
+
|
| 47 |
+
# 3.2 DEFINING AND EVALUATING CONTEXTUAL ALIGNMENT
|
| 48 |
+
|
| 49 |
+
In the following sections, we describe how to define, evaluate, and improve contextual alignment. Given two languages, a model is in contextual alignment if it has similar representations for word pairs within parallel sentences. More precisely, suppose we have $N$ parallel sentences $C = \{ ( \mathbf { s } ^ { 1 ^ { \prime } } , \mathbf { t } ^ { 1 } ) , . . . , ( \mathbf { s } ^ { N ^ { \prime } } , \mathbf { t } ^ { N } ) \}$ , where $( \mathbf { s } , \mathbf { t } )$ is a source-target sentence pair. Also, let each sentence pair $( \mathbf { s } , \mathbf { t } )$ have word pairs, denoted $a ( \mathbf { s } , \mathbf { t } ) = \{ ( i _ { 1 } , j _ { 1 } ) , . . . , ( i _ { m } , j _ { m } ) \}$ , containing position tuples $( i , j )$ such that the words $\mathbf { s } _ { i }$ and $\mathbf { t } _ { j }$ are translations of each other.1 We will use $f$ to represent a pre-trained model such that $f ( i , { \bf s } )$ is the contextual embedding for the ith word in s.
|
| 50 |
+
|
| 51 |
+
As an example, we might have the following sentence pair:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { c } { { { \bf s } = \{ { \stackrel { 0 } { I } } { } _ { a t e t h e a p p l e } ^ { 3 } { } _ { \cdot } \} \quad { \bf t } = \{ I c h { \stackrel { 1 } { h a b e } } d e n A p { \stackrel { 3 } { f } } e l g e g e s s e n { } ^ { 4 } \} } } \\ { { a ( { \bf s } , { \bf t } ) = \{ ( 0 , 0 ) , ( 1 , 4 ) , ( 2 , 2 ) , ( 3 , 3 ) , ( 4 , 5 ) \} } } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Then, using the parallel corpus $C$ , we can measure the contextual alignment of the model $f$ using its accuracy in contextual word retrieval. In this task, the model is presented with two parallel corpora, and given a word within a sentence in one corpus, it must find the correct word and sentence in the other. Specifically, we can define a nearest neighbor retrieval function
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathrm { n e i g h b o r } ( i , \mathbf { s } ; f , C ) = \underset { \mathbf { t } \in C , 0 \leq j \leq \mathrm { l e n } ( \mathbf { t } ) } { \mathrm { a r g m a x } } \ \mathrm { s i m } ( f ( i , \mathbf { s } ) , f ( j , \mathbf { t } ) ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $i$ and $j$ denote the position within a sentence and sim is a similarity function. The accuracy is then given by the percentage of exact matches over the entire corpus, or
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
A ( f ; C ) = \frac { 1 } { N } \sum _ { ( \mathbf { s } , \mathbf { t } ) \in C } \sum _ { ( i , j ) \in a ( \mathbf { s } , \mathbf { t } ) } \mathbb { I } ( \mathrm { n e i g h b o r } ( i , \mathbf { s } ; f , C ) = ( j , \mathbf { t } ) ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbb { I }$ represents the indicator function. We can perform the same procedure in the other direction, where we pull target words given source words, so we report the average between the two directions. As our similarity function, we use CSLS, a modified version of cosine similarity that mitigates the hubness problem, with neighborhood size 10 (Conneau et al., 2018a). One additional point is that this procedure can be made more or less contextual based on the corpus: a corpus with more occurrences for each word type requires better representations of context. Therefore, we also test non-contextual word retrieval by removing all but the first occurrence of each word type.
|
| 70 |
+
|
| 71 |
+
Given parallel data, these word pairs can be procured in an unsupervised fashion using standard techniques developed by the machine translation community (Brown et al., 1993). While these methods can be noisy, by running the algorithm in both the source-target and target-source directions and only keeping word pairs in their intersection, we can trade-off coverage for accuracy, producing a reasonably high-precision dataset (Och & Ney, 2003).
|
| 72 |
+
|
| 73 |
+
# 3.3 ALIGNING PRE-TRAINED CONTEXTUAL EMBEDDINGS
|
| 74 |
+
|
| 75 |
+
To improve the alignment of the model $f$ with respect to the corpus $C$ , we can encapsulate alignment in the loss function
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
L ( f ; C ) = - \sum _ { ( \mathbf { s } , \mathbf { t } ) \in C } \sum _ { ( i , j ) \in a ( \mathbf { s } , \mathbf { t } ) } \sin ( f ( i , \mathbf { s } ) , f ( j , \mathbf { t } ) ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where we sum the similarities between word pairs. Because the CSLS metric is not easily optimized, we instead use the squared error loss, or $\mathrm { s i m \bar { ( } } f ( i , \mathbf { s ) } , f ( j , \mathbf { t } ) ) = - | | f ( i , \mathbf { s } ) - f ( j , \mathbf { t } ) | | _ { 2 } ^ { 2 }$ .
|
| 82 |
+
|
| 83 |
+
However, note that this loss function does not account for the informativity of $f$ ; for example, it is zero if $f$ is constant. Therefore, at a high level, we would like to minimize $L ( f ; C )$ while maintaining some aspect of $f$ that makes it useful, e.g. its high accuracy when fine-tuned on downstream tasks. Letting $f _ { 0 }$ denote the initial pre-trained model before alignment, we achieve this goal by defining a regularization term
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
R ( f ; C ) = \sum _ { \mathbf { t } \in C } \sum _ { i = 1 } ^ { \mathrm { l e n } ( \mathbf { t } ) } \vert \vert f ( j , \mathbf { t } ) - f _ { 0 } ( j , \mathbf { t } ) \vert \vert _ { 2 } ^ { 2 } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
which imposes a penalty if the target language embeddings stray from their initialization. Then, we sample minibatches $B \subset C$ and take gradient steps of the function $L ( f ; B ) + \lambda R ( f ; B )$ directly on the weights of $f$ , which moves the source embeddings toward the target embeddings while preventing the latter from drifting too far. In our experiments, we set $\lambda = 1$ .
|
| 90 |
+
|
| 91 |
+
In the multilingual case, suppose we have $k$ parallel corpora $C ^ { 1 } , . . . , C ^ { k }$ , where each corpus has a different source language with the target language as English. Then, we sample equal-sized batches $B ^ { i } \subset C ^ { i }$ from each corpus and take gradient steps on $\begin{array} { r } { \sum _ { i = 1 } ^ { k } L ( f ; B ^ { i } ) + \lambda R ( f ; B ^ { i } ) } \end{array}$ , which moves all of the non-English embeddings toward English.
|
| 92 |
+
|
| 93 |
+
Note that this alignment method departs from prior work, in which each non-English language is rotated to match the English embedding space through individual learned matrices. Specifically, the most widely used post-hoc alignment method learns a rotation $W$ applied to the source vectors to minimize the distance between parallel word pairs, or
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\operatorname* { m i n } _ { W } \sum _ { ( \mathbf { s } , \mathbf { t } ) \in C } \sum _ { ( i , j ) \in a ( \mathbf { s } , \mathbf { t } ) } | | W f ( i , \mathbf { s } ) - f ( j , \mathbf { t } ) | | _ { 2 } ^ { 2 } \quad s . t . \quad W ^ { \top } W = I .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
This problem is known as the Procrustes problem and can be solved in closed form (Schonemann, 1966). This approach has the nice property that the vectors are only rotated, preserving distances and therefore the semantic information captured by the embeddings (Artetxe et al., 2016). However, rotation requires the strong assumption that the embedding spaces are roughly isometric (Søgaard et al., 2018), an assumption that may not hold for contextual pre-trained models because they represent more aspects of a word than just its type, i.e. context and syntax, which are less likely to be isomorphic between languages. Given that past work has also found independent alignment per language pair to be inferior to joint training (Heyman et al., 2019), another advantage of our method is that the alignment for all languages is done simultaneously.
|
| 100 |
+
|
| 101 |
+
As our dataset, we use the Europarl corpora for English paired with Bulgarian, German, Greek, Spanish, and French, the languages represented in both Europarl and XNLI (Koehn, 2005). After tokenization (Koehn et al., 2007), we produce word pairs using fastAlign and keep the one-to-one pairs in the intersection (Dyer et al., 2013). We use the most recent 1024 sentences as the test set, the previous 1024 sentences as the development set, and the following 250K sentences as the training set. Furthermore, we modify the test set accuracy calculation to only include word pairs not seen in the training set. We also remove any exact matches, e.g. punctuation and numbers, because BERT is already aligned for these pairs due to its shared vocabulary. Given that parallel data may be limited for low-resource language pairs, we also report numbers for 10K and 50K parallel sentences.
|
| 102 |
+
|
| 103 |
+
# 3.4 SENTENCE-AUGMENTED NON-CONTEXTUAL BASELINE
|
| 104 |
+
|
| 105 |
+
Given that there has been a long line of work on word vector alignment (Artetxe et al., 2018; Conneau et al., 2018a; Smith et al., 2017, inter alia), we also compare BERT to a sentence-augmented fastText baseline (Bojanowski et al., 2017). Following Artetxe et al. (2018), we first normalize, then mean-center, then normalize the word vectors, and we then learn a rotation with the same parallel data as in the contextual case, as described in Equation 1. We also strengthen this baseline by including sentence information: specifically, during word retrieval, we concatenate each word vector with a vector representing its sentence. Following Ruckl ¨ e et al. (2018), we compute the sentence ´ vector by concatenating the average, maximum, and minimum vector over all of the words in the sentence, a method that was shown to be state-of-the-art for a suite of cross-lingual tasks. We also experimented with other methods, such as first retrieving the sentence and then the word, but found this method resulted in the highest accuracy. As a result, the fastText vectors are 1200-dimensional, while the BERT vectors are 768-dimensional.
|
| 106 |
+
|
| 107 |
+
# 3.5 TESTING ZERO-SHOT TRANSFER
|
| 108 |
+
|
| 109 |
+
The next step is to determine whether better alignment improves cross-lingual transfer. As our downstream task, we use the XNLI dataset, where the English MultiNLI development and test sets are human-translated into multiple languages (Conneau et al., 2018b; Williams et al., 2018). Given a pair of sentences, the task is to predict whether the first sentence implies the second, where there are three labels: entailment, neutral, or contradiction. Starting from either the base or aligned multilingual BERT, we train on English and evaluate on Bulgarian, German, Greek, Spanish, and French, the XNLI languages represented in Europarl.
|
| 110 |
+
|
| 111 |
+
As our architecture, following Devlin et al. (2018), we apply a linear layer followed by softmax on the [CLS] embedding of the sentence pair, producing scores for each of the three labels. The model is trained using cross-entropy loss and selected based on its development set accuracy averaged across all of the languages. As a fully-supervised ceiling, we also compare to models trained and tested on the same language, where for the non-English training data, we use the machine translations of the English MultiNLI training data provided by Conneau et al. (2018b). While the quality of the training data is affected by the quality of the MT system, this comparison nevertheless serves as a good approximation for the fully-supervised setting.
|
| 112 |
+
|
| 113 |
+
<table><tr><td></td><td>English</td><td>Bulgarian</td><td>German</td><td>Greek</td><td>Spanish</td><td>French</td><td>Average</td></tr><tr><td colspan="8">Translate-Train</td></tr><tr><td>Base BERT</td><td>81.9</td><td>73.6</td><td>75.9</td><td>71.6</td><td>77.8</td><td>76.8</td><td>76.3</td></tr><tr><td colspan="8">Zero-Shota</td></tr><tr><td>Base BERT</td><td>80.4</td><td>68.7</td><td>70.4</td><td>67.0</td><td>74.5</td><td>73.4</td><td>72.4</td></tr><tr><td>Sentence-aligned BERT (rotation)</td><td>81.1</td><td>68.9</td><td>71.2</td><td>66.7</td><td>74.9</td><td>73.5</td><td>72.7</td></tr><tr><td>Word-aligned BERT (rotation)</td><td>78.8</td><td>69.0</td><td>71.3</td><td>67.1</td><td>74.3</td><td>73.0</td><td>72.2</td></tr><tr><td>Word-aligned BERT (fine-tuned)</td><td>80.1</td><td>73.4</td><td>73.1</td><td>71.4</td><td>75.5</td><td>74.5</td><td>74.7</td></tr><tr><td>XLM (MLM + TLM)</td><td>85.0</td><td>77.4</td><td>77.8</td><td>76.6</td><td>78.9</td><td>78.7</td><td>79.1</td></tr></table>
|
| 114 |
+
|
| 115 |
+
Table 1: Accuracy on the XNLI test set, where we compare to base BERT (Devlin et al., 2018) and two rotation-based methods, sentence alignment (Aldarmaki & Diab, 2019) and word alignment (Wang et al., 2019). We also include the current state-of-the-art zero-shot achieved by XLM (Lample & Conneau, 2019). Rotation-based methods provide small gains on some languages but not others. On the other hand, after fine-tuning-based alignment, Bulgarian and Greek match the translate-train ceiling, while German, Spanish, and French close roughly one-third of the gap.
|
| 116 |
+
|
| 117 |
+
aNote that the zero-shot Base BERT numbers are slightly different from those reported in Devlin et al. (2019) because we select a single model using the average accuracy across the six languages. This selection method also accounts for the varying English accuracies across the zero-shot methods.
|
| 118 |
+
Table 2: Zero-shot accuracy on the XNLI test set, where we align BERT with varying amounts of parallel data. The method scales with the amount of data but achieves a large fraction of the gains with 50K sentences per language pair.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Sentences</td><td>English</td><td>Bulgarian</td><td>German</td><td>Greek</td><td>Spanish</td><td>French</td><td>Average</td></tr><tr><td>None</td><td>80.4</td><td>68.7</td><td>70.4</td><td>67.0</td><td>74.5</td><td>73.4</td><td>72.4</td></tr><tr><td>10K</td><td>79.2</td><td>71.0</td><td>71.8</td><td>67.5</td><td>75.3</td><td>74.1</td><td>73.2</td></tr><tr><td>50K</td><td>81.1</td><td>73</td><td>72.6</td><td>69.6</td><td>75</td><td>74.5</td><td>74.3</td></tr><tr><td>250K</td><td>80.1</td><td>73.4</td><td>73.1</td><td>71.4</td><td>75.5</td><td>74.5</td><td>74.7</td></tr></table>
|
| 121 |
+
|
| 122 |
+
# 4 RESULTS
|
| 123 |
+
|
| 124 |
+
# 4.1 ZERO-SHOT XNLI TRANSFER
|
| 125 |
+
|
| 126 |
+
First, we test whether alignment improves multilingual BERT by applying the models to zero-shot XNLI, as displayed in Table 1. We see that our alignment procedure greatly improves accuracies, with all languages seeing a gain of at least $1 \%$ . In particular, the Bulgarian and Greek zero-shot numbers are boosted by almost $5 \%$ each and match the translate-train numbers, suggesting that the alignment procedure is especially effective for languages that are initially difficult for BERT. We also run alignment for more distant language pairs (Chinese, Arabic, Urdu) and find similar results, which we report in the appendix.
|
| 127 |
+
|
| 128 |
+
Comparing to rotation-based methods (Aldarmaki & Diab, 2019; Wang et al., 2019), we find that a rotation produces small gains for some languages, namely Bulgarian, German, and Spanish, but is sub-optimal overall, providing evidence that the increased expressivity of our proposed procedure is beneficial for contextual alignment. We explore this comparison more in Section 5.1.
|
| 129 |
+
|
| 130 |
+
# 4.2 ALIGNMENT WITH LESS DATA
|
| 131 |
+
|
| 132 |
+
Given that our goal is zero-shot transfer, we cannot expect to always have large amounts of parallel data. Therefore, we also characterize the performance of our alignment method with varying amounts of data, as displayed in Table 2. We find that it improves transfer with as little as 10K sentences per language, making it a promising approach for low-resource languages.
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td>bg-en</td><td>de-en</td><td>el-en</td><td>es-en</td><td>fr-en</td><td>Average</td></tr><tr><td colspan="7">Contextual</td></tr><tr><td>Aligned fastText + sentence</td><td>44.0</td><td>46.4</td><td>42.0</td><td>48.6</td><td>44.5</td><td>45.1</td></tr><tr><td>Base BERT</td><td>19.5</td><td>26.1</td><td>13.9</td><td>32.5</td><td>28.3</td><td>24.1</td></tr><tr><td>Word-aligned BERT (rotation)</td><td>29.8</td><td>31.6</td><td>20.8</td><td>36.8</td><td>31.0</td><td>30.0</td></tr><tr><td>Word-aligned BERT (fine-tuned)</td><td>50.7</td><td>51.3</td><td>49.8</td><td>51.0</td><td>48.6</td><td>50.3</td></tr><tr><td colspan="7">Non-Contextual</td></tr><tr><td>Aligned fastText + sentence</td><td>61.3</td><td>65.4</td><td>61.6</td><td>71.1</td><td>64.8</td><td>64.8</td></tr><tr><td>Base BERT</td><td>29.1</td><td>37.0</td><td>22.3</td><td>46.5</td><td>41.8</td><td>35.3</td></tr><tr><td>Word-aligned BERT (rotation)</td><td>39.6</td><td>43.6</td><td>32.4</td><td>51.4</td><td>46.1</td><td>42.6</td></tr><tr><td>Word-aligned BERT (fine-tuned)</td><td>62.8</td><td>64.3</td><td>67.5</td><td>68.4</td><td>66.3</td><td>65.9</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 3: Word retrieval accuracy for the aligned sentence-augmented fastText baseline and BERT pre- and post-alignment. Across languages, base BERT has variable accuracy while fine-tuningaligned BERT is consistently effective. Fine-tuned BERT also matches fastText in a version of the task where context is not necessary, suggesting that our method matches the type-level alignment of fastText while also aligning context.
|
| 137 |
+
|
| 138 |
+
# 5 ANALYSIS
|
| 139 |
+
|
| 140 |
+
# 5.1 WORD RETRIEVAL
|
| 141 |
+
|
| 142 |
+
In the following sections, we present word retrieval results to both compare our method to past work and better understand the strengths and weaknesses of multilingual BERT. Table 3 displays the word retrieval accuracies for the aligned sentence-augmented fastText baseline and BERT pre- and postalignment. First, we find that in contextual retrieval, fine-tuned BERT outperforms fastText, which outperforms rotation-aligned BERT. This result supports the intuition that aligning large pre-trained models is more difficult than aligning word vectors, given that a rotation, at least when applied naively, produces sub-par alignments. In addition, fine-tuned BERT matches the performance of fastText in non-contextual retrieval, suggesting that our alignment procedure overcomes these challenges and achieves type-level alignment that matches non-contextual approaches. In the appendix, we also provide examples of aligned BERT disambiguating between different meanings of a word, giving qualitative evidence of the benefit of context alignment.
|
| 143 |
+
|
| 144 |
+
We also find that before alignment, BERT’s performance varies greatly between languages, while after alignment it is consistently effective. In particular, Bulgarian and Greek initially have very low accuracies. This phenomenon is also reflected in the XNLI numbers (Table 1), where Bulgarian and Greek receive the largest boosts from alignment. Examining the connection between alignment and zero-shot more closely, we find that the word retrieval accuracies are highly correlated with downstream zero-shot performance (Figure 2), supporting our evaluation measure as predictive of cross-lingual transfer.
|
| 145 |
+
|
| 146 |
+
The language discrepancies are also consistent with a hypothesis by Pires et al. (2019) to explain BERT’s multilingualism. They posit that due to the shared vocabulary, shared words between languages, e.g. numbers and names, are forced to have the same representation. Then, due to the masked word prediction task, other words that co-occur with these shared words also receive similar representations. If this hypothesis is true, then languages with higher lexical overlap with English are likely to experience higher transfer. As an extreme form of this phenomenon, Bulgarian and Greek have completely different scripts and should experience worse transfer than the common-script languages, an intuition that is confirmed by the word retrieval and XNLI accuracies. The fact that all languages are equally aligned with English post-alignment suggests that the pre-training procedure is suboptimal for these languages.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Lexical Overlap</td><td>Numeral</td><td>Punctuation</td><td>Proper Noun</td><td></td><td></td><td>Average</td></tr><tr><td>Base BERT</td><td>0.90</td><td>0.88</td><td>0.80</td><td></td><td></td><td>0.86</td></tr><tr><td>Aligned BERT</td><td>0.97</td><td>0.96</td><td>0.95</td><td></td><td></td><td>0.96</td></tr><tr><td>Closed-Class</td><td>Determiner</td><td>Preposition</td><td>Conjunction</td><td>Pronoun</td><td>Auxiliary</td><td>Average</td></tr><tr><td>Base BERT Aligned BERT</td><td>0.76 0.91</td><td>0.72</td><td>0.71 0.89</td><td>0.70</td><td>0.61 0.84</td><td>0.70 0.88</td></tr><tr><td></td><td></td><td>0.86</td><td></td><td>0.89</td><td></td><td></td></tr><tr><td>Open-Class</td><td>Noun</td><td>Adverb</td><td> Adjective</td><td>Verb</td><td></td><td>Average</td></tr><tr><td>Base BERT</td><td>0.61</td><td>0.57</td><td>0.50</td><td>0.49</td><td></td><td>0.54</td></tr><tr><td>Aligned BERT</td><td>0.90</td><td>0.88</td><td>0.90</td><td>0.89</td><td></td><td>0.89</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 4: Accuracy by part-of-speech tag for non-contextual word retrieval. To achieve better word type coverage, we do not remove word pairs seen in the training set. The tags are grouped into lexically overlapping, closed-class, and open-class groups. The “Particle,” “Symbol,” “Interjection,” and “Other” tags are omitted.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 2: XNLI zero-shot versus word retrieval accuracy for base BERT, where each point is a language paired with English. This plot suggests that alignment correlates well with cross-lingual transfer.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 3: Contextual word retrieval accuracy plotted against difference in frequency rank between source and target. The accuracy of base BERT plummets for larger differences, suggesting that its alignment depends on word pairs having similar usage statistics.
|
| 157 |
+
|
| 158 |
+
# 5.2 WORD RETRIEVAL PART-OF-SPEECH ANALYSIS
|
| 159 |
+
|
| 160 |
+
Next, to gain insight into the multilingual pre-training procedure, we analyze the accuracy broken down by part-of-speech using the Universal Part-of-Speech Tagset (Petrov et al., 2012), annotated using polyglot (Al-Rfou et al., 2013) for Bulgarian and spaCy (Honnibal & Montani, 2017) for the other languages, as displayed in Table 4. Unsurprisingly, multilingual BERT has high alignment out-of-the-box for groups with high lexical overlap, e.g. numerals, punctuation, and proper nouns, due to its shared vocabulary. We further divide the remaining tags into closed-class and open-class, where closed-class parts-of-speech correspond to fixed sets of words serving grammatical functions (e.g. determiner, preposition, conjunction, pronoun, and auxiliary), while open-class parts-of-speech correspond to lexical words (e.g. noun, adverb, adjective, verb). Interestingly, we see that base BERT has consistently lower accuracy for closed-class versus open-class categories (0.70 vs 0.54), but that this discrepancy disappears after alignment (0.88 vs 0.89).
|
| 161 |
+
|
| 162 |
+
# 5.3 USAGE HYPOTHESIS FOR ALIGNMENT
|
| 163 |
+
|
| 164 |
+
From this closed-class vs open-class difference, we hypothesize that BERT’s alignment of a particular word pair is influenced by the similarity of their usage statistics. Specifically, given that BERT is trained through masked word prediction, its embeddings are in large part determined by the co-occurrences between words. Therefore, two words that are used in similar contexts should be better aligned. This hypothesis provides an explanation of the closed-class vs open-class difference: closed-class words are typically grammatical, so they are used in similar ways across typologically similar languages. Furthermore, these words cannot be substituted for one another due to their grammatical function. Therefore, their usage statistics are a strong signature that can be used for alignment. On the other hand, open-class words can be substituted for one another: for example, in most sentences, the noun tokens could be replaced by a wide range of semantically dissimilar nouns with the sentence remaining syntactically well-formed. By this effect, many nouns have similar co-occurrences, making them difficult to align through masked word prediction alone.
|
| 165 |
+
|
| 166 |
+
To further test this hypothesis, we plot the word retrieval accuracy versus the difference between the frequency rank of the target and source word, where this difference measures discrepancies in usage, as depicted in Figure 3. We see that accuracy drops off significantly as the source-target difference increases, supporting our hypothesis. Furthermore, this shortcoming is remedied by alignment, revealing another systematic deficiency of multilingual pre-training.
|
| 167 |
+
|
| 168 |
+
# 6 CONCLUSION
|
| 169 |
+
|
| 170 |
+
Given that the degree of alignment is causally predictive of downstream cross-lingual transfer, contextual alignment proves to be a useful concept for understanding and improving multilingual pretrained models. Given small amounts of parallel data, our alignment procedure improves multilingual BERT and corrects many of its systematic deficiencies. Contextual word retrieval also provides useful new insights into the pre-training procedure, opening up new avenues for analysis.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. Polyglot: Distributed word representations for multilingual nlp. In Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pp. 183–192, Sofia, Bulgaria, August 2013. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/W13-3520.
|
| 175 |
+
|
| 176 |
+
Hanan Aldarmaki and Mona Diab. Context-aware cross-lingual mapping. 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), pp. 3906–3911, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1391. URL https://www.aclweb.org/anthology/N19-1391.
|
| 177 |
+
|
| 178 |
+
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. Learning principled bilingual mappings of word embeddings while preserving monolingual invariance. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2289–2294, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1250. URL https: //www.aclweb.org/anthology/D16-1250.
|
| 179 |
+
|
| 180 |
+
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. Learning bilingual word embeddings with (almost) no bilingual data. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 451–462, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1042. URL https://www.aclweb. org/anthology/P17-1042.
|
| 181 |
+
|
| 182 |
+
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. A robust self-learning method for fully unsupervised cross-lingual mappings of word embeddings. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 789–798, Melbourne, Australia, July 2018. Association for Computational Linguistics. URL https: //www.aclweb.org/anthology/P18-1073.
|
| 183 |
+
|
| 184 |
+
Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135– 146, 2017. doi: 10.1162/tacl a 00051. URL https://www.aclweb.org/anthology/ Q17-1010.
|
| 185 |
+
|
| 186 |
+
Peter F. Brown, Vincent J. Della Pietra, Stephen A. Della Pietra, and Robert L. Mercer. The mathematics of statistical machine translation: Parameter estimation. Comput. Linguist., 19(2): 263–311, June 1993. ISSN 0891-2017. URL http://dl.acm.org/citation.cfm?id= 972470.972474.
|
| 187 |
+
|
| 188 |
+
Xilun Chen and Claire Cardie. Unsupervised multilingual word embeddings. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 261–270, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/ v1/D18-1024. URL https://www.aclweb.org/anthology/D18-1024.
|
| 189 |
+
|
| 190 |
+
Alexis Conneau, Guillaume Lample, Marc’Aurelio Ranzato, Ludovic Denoyer, and Herve J’egou. Word translation without parallel data. In Proceedings of the 6th International Conference on Learning Representations (ICLR 2018), 2018a. URL https://arxiv.org/pdf/1710. 04087.pdf.
|
| 191 |
+
|
| 192 |
+
Alexis Conneau, Ruty Rinott, Guillaume Lample, Adina Williams, Samuel Bowman, Holger Schwenk, and Veselin Stoyanov. XNLI: Evaluating cross-lingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2475–2485, Brussels, Belgium, October-November 2018b. Association for Computational Linguistics. doi: 10.18653/v1/D18-1269. URL https://www.aclweb.org/anthology/ D18-1269.
|
| 193 |
+
|
| 194 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv:1810.04805 [cs.CL], October 2018. URL http://arxiv.org/abs/1810.04805.
|
| 195 |
+
|
| 196 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. https://github.com/ google-research/bert/blob/master/multilingual.md, 2019.
|
| 197 |
+
|
| 198 |
+
Chris Dyer, Victor Chahuneau, and Noah A. Smith. A simple, fast, and effective reparameterization of IBM model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 644–648, Atlanta, Georgia, June 2013. Association for Computational Linguistics. URL https://www. aclweb.org/anthology/N13-1073.
|
| 199 |
+
|
| 200 |
+
Andreas Eisele and Yu Chen. MultiUN: A multilingual corpus from united nation documents. In Proceedings of the Seventh International Conference on Language Resources and Evaluation (LREC’10), Valletta, Malta, May 2010. European Language Resources Association (ELRA). URL http://www.lrec-conf.org/proceedings/lrec2010/pdf/686_ Paper.pdf.
|
| 201 |
+
|
| 202 |
+
Geert Heyman, Bregt Verreet, Ivan Vulic, and Marie-Francine Moens. Learning unsupervised mul- ´ tilingual word embeddings with incremental multilingual hubs. 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), pp. 1890–1902, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1188. URL https://www.aclweb.org/anthology/N19-1188.
|
| 203 |
+
|
| 204 |
+
Matthew Honnibal and Ines Montani. spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing. To appear, 2017.
|
| 205 |
+
|
| 206 |
+
Yedid Hoshen and Lior Wolf. Non-adversarial unsupervised word translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 469–478, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/ v1/D18-1043. URL https://www.aclweb.org/anthology/D18-1043.
|
| 207 |
+
|
| 208 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 328–339. Association for Computational Linguistics, 2018. URL http://aclweb.org/anthology/P18-1031.
|
| 209 |
+
|
| 210 |
+
Philipp Koehn. Europarl: A parallel corpus for statistical machine translation. In Conference Proceedings: The Tenth Machine Translation Summit, pp. 79–86, Phuket, Thailand, 2005. AAMT.
|
| 211 |
+
|
| 212 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondˇrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open source toolkit for statistical machine translation. In Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics Companion Volume Proceedings of the Demo and Poster Sessions, pp. 177–180, Prague, Czech Republic, June 2007. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/P07-2045.
|
| 213 |
+
|
| 214 |
+
Guillame Lample and Alexis Conneau. Cross-lingual language model pretraining. 2019. URL https://arxiv.org/pdf/1901.07291.pdf.
|
| 215 |
+
|
| 216 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9:2579–2605, 2008. URL http://www.jmlr.org/papers/v9/ vandermaaten08a.html.
|
| 217 |
+
|
| 218 |
+
Tomas Mikolov, Quoc V Le, and Ilya Sutskever. Exploiting similarities among languages for machine translation. 2013a. URL https://arxiv.org/pdf/1309.4168.pdf.
|
| 219 |
+
|
| 220 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Proceedings of the 26th International Conference on Neural Information Processing Systems - Volume 2, NIPS’13, pp. 3111–3119, USA, 2013b. Curran Associates Inc. URL http://dl.acm.org/citation.cfm?id $=$ 2999792.2999959.
|
| 221 |
+
|
| 222 |
+
Franz Josef Och and Hermann Ney. A systematic comparison of various statistical alignment models. Comput. Linguist., 29(1):19–51, March 2003. ISSN 0891-2017. doi: 10.1162/ 089120103321337421. URL http://dx.doi.org/10.1162/089120103321337421.
|
| 223 |
+
|
| 224 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227–2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1202. URL https://www.aclweb.org/anthology/N18-1202.
|
| 225 |
+
|
| 226 |
+
Slav Petrov, Dipanjan Das, and Ryan McDonald. A universal part-of-speech tagset. In Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC2012), pp. 2089–2096, Istanbul, Turkey, May 2012. European Languages Resources Association (ELRA). URL http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_ Paper.pdf.
|
| 227 |
+
|
| 228 |
+
Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual BERT? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4996–5001, Florence, Italy, July 2019. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/P19-1493.
|
| 229 |
+
|
| 230 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. URL https: //s3-us-west-2.amazonaws.com/openai-assets/research-covers/ language-unsupervised/language_understanding_paper.pdf.
|
| 231 |
+
|
| 232 |
+
Andreas Ruckl ¨ e, Steffen Eger, Maxime Peyrard, and Iryna Gurevych. Concatenated p-mean word ´ embeddings as universal cross-lingual sentence representations. arXiv:1803.01400 [cs.CL], 2018. URL http://arxiv.org/abs/1803.01400.
|
| 233 |
+
|
| 234 |
+
Sebastian Ruder, Ivan Vulic, and Anders Søgaard. A survey of cross-lingual word embedding mod-´ els. J. Artif. Int. Res., 65(1):569–630, May 2019. ISSN 1076-9757. doi: 10.1613/jair.1.11640. URL https://doi.org/10.1613/jair.1.11640.
|
| 235 |
+
|
| 236 |
+
Peter H. Schonemann. A generalized solution of the orthogonal procrustes problem. Psychometrika, 31(1):1–10, 1966.
|
| 237 |
+
|
| 238 |
+
Tal Schuster, Ori Ram, Regina Barzilay, and Amir Globerson. Cross-lingual alignment of contextual word embeddings, with applications to zero-shot dependency parsing. 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), pp. 1599–1613, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1162. URL https://www.aclweb.org/anthology/N19-1162.
|
| 239 |
+
|
| 240 |
+
Samuel L. Smith, David H. P. Turban, Steven Hamblin, and Nils Y. Hammerla. Offline bilingual word vectors, orthogonal transformations and the inverted softmax. In Proceedings of the 5th International Conference on Learning Representations (ICLR 2017), 2017. URL https:// openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ r1Aab85gg.
|
| 241 |
+
|
| 242 |
+
Anders Søgaard, Sebastian Ruder, and Ivan Vulic. On the limitations of unsupervised bilin- ´ gual dictionary induction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 778–788, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-1072. URL https: //www.aclweb.org/anthology/P18-1072.
|
| 243 |
+
|
| 244 |
+
Jorg Tiedemann. Parallel data, tools and interfaces in OPUS. In ¨ Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC’12), pp. 2214–2218, Istanbul, Turkey, May 2012. European Language Resources Association (ELRA). URL http: //www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf.
|
| 245 |
+
|
| 246 |
+
Yuxuan Wang, Wanxiang Che, Jiang Guo, Yijia Liu, and Ting Liu. Cross-lingual BERT transformation for zero-shot dependency parsing. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 5725–5731, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1575. URL https://www.aclweb.org/anthology/D19-1575.
|
| 247 |
+
|
| 248 |
+
John Wieting, Kevin Gimpel, Graham Neubig, and Taylor Berg-Kirkpatrick. Simple and effective paraphrastic similarity from parallel translations. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4602–4608, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1453. URL https: //www.aclweb.org/anthology/P19-1453.
|
| 249 |
+
|
| 250 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 1112–1122, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1101. URL https://www.aclweb. org/anthology/N18-1101.
|
| 251 |
+
|
| 252 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv:1609.08144 [cs.CL], 2016.
|
| 253 |
+
|
| 254 |
+
Ruochen Xu, Yiming Yang, Naoki Otani, and Yuexin Wu. Unsupervised cross-lingual transfer of word embedding spaces. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2465–2474, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1268. URL https://www.aclweb. org/anthology/D18-1268.
|
| 255 |
+
|
| 256 |
+
<table><tr><td></td><td>English</td><td>Bulgarian</td><td>German</td><td>Greek</td><td>Spanish</td><td>French</td><td>Arabic</td><td>Chinese</td><td>Urdu</td><td>Average</td></tr><tr><td>Translate-Train</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Base BERT</td><td>81.9</td><td>73.6</td><td>75.9</td><td>71.6</td><td>77.8</td><td>76.8</td><td>70.7</td><td>76.6</td><td>61.6</td><td>74.1</td></tr><tr><td>Zero-Shot</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Base BERT</td><td>80.4</td><td>68.7</td><td>70.4</td><td>67.0</td><td>74.5</td><td>73.4</td><td>65.6</td><td>70.6</td><td>60.3</td><td>70.1</td></tr><tr><td>Aligned BERT (2OK sent)</td><td>80.8</td><td>71.6</td><td>72.5</td><td>68.1</td><td>74.7</td><td>73.6</td><td>66.3</td><td>71.5</td><td>61.1</td><td>71.1</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Table 5: Zero-shot accuracy on the XNLI test set with more languages, where we use 20K parallel sentences for each language paired with English. This result confirms that the alignment method works for distant languages and a variety of parallel corpora, including Europarl, MultiUN, and Tanzil, which contains sentences from the Quran (Koehn, 2005; Eisele & Chen, 2010; Tiedemann, 2012).
|
| 259 |
+
|
| 260 |
+
# A APPENDIX
|
| 261 |
+
|
| 262 |
+
# A.1 OPTIMIZATION HYPERPARAMETERS
|
| 263 |
+
|
| 264 |
+
For both alignment and XNLI optimization, we use a learning rate of $5 \times 1 0 ^ { - 5 }$ with Adam hyperparameters $\beta = ( 0 . 9 , 0 . 9 8 )$ , $\epsilon = 1 \bar { 0 } ^ { - 9 }$ and linear learning rate warmup for the first $1 0 \%$ of the training data. For alignment, the model is trained for one epoch, with each batch containing 2 sentence pairs per language. For XNLI, each model is trained for 3 epochs with 32 examples per batch, and $1 0 \%$ dropout is applied to the BERT embeddings.
|
| 265 |
+
|
| 266 |
+
# A.2 ALIGNMENT OF CHINESE, ARABIC, AND URDU
|
| 267 |
+
|
| 268 |
+
In Table 5, we report numbers for additional languages, where we align a single BERT model for all eight languages and then fine-tune on XNLI. We use 20K sentences per language, where we use the MultiUN corpus for Arabic and Chinese (Eisele & Chen, 2010), the Tanzil corpus for Urdu (Tiedemann, 2012), and the Europarl corpus for the other five languages (Koehn, 2005). This result confirms that the alignment method works for a variety of languages and corpora. Furthermore, the Tanzil corpus consists of sentences from the Quran, suggesting that the method works even when the parallel corpus and downstream task contain sentences from entirely different domains.
|
| 269 |
+
|
| 270 |
+
A.3 EXAMPLES OF CONTEXT-AWARE RETRIEVAL
|
| 271 |
+
|
| 272 |
+
In this section, we qualitatively show that aligned BERT is able to disambiguate between different occurences of a word.
|
| 273 |
+
|
| 274 |
+
First, we find two meanings of the word “like” occurring in the English-German Europarl test set.
|
| 275 |
+
Note also that in the second and third example, the two senses of “like” occur in the same sentence.
|
| 276 |
+
• This empire did not look for colonies far from home or overseas, like most Western European States, but close by. Dieses Reich suchte seine Kolonien nicht weit von zu Hause und in bersee wie die meisten westeuropaischen Staaten, sondern in der unmittelbaren Umgebung. ¨ Like other speakers, I would like to support the call for the arms embargo to remain. Wie andere Sprecher, so mochte auch ich den Aufruf zur Aufrechterhaltung des Waffen-¨ embargos untersttzen.
|
| 277 |
+
• Like other speakers, I would like to support the call for the arms embargo to remain. Wie andere Sprecher, so mochte ¨ auch ich den Aufruf zur Aufrechterhaltung des Waffenembargos untersttzen.
|
| 278 |
+
• I would also like, although they are absent, to mention the Commission and the Council. Ich mochte ¨ mir sogar erlauben, die Kommission und den Rat zu nennen, auch wenn sie nicht anwesend sind.
|
| 279 |
+
|
| 280 |
+
Multiple meanings of “order”:
|
| 281 |
+
|
| 282 |
+
• Moreover, the national political elite had to make a detour in Ambon in order to reach the civil governor’s residence by warship. In Ambon mußte die politische Spitze des Landes auch noch einen Umweg machen, um mit einem Kriegsschiff die Residenz des Provinzgouverneurs zu erreichen. Although the European Union has an interest in being surrounded by large, stable regions, the tools it has available in order to achieve this are still very limited. Der Europaischen Union ist zwar an großen stabilen Regionen in ihrer Umgebung gelegen, ¨ aber sie verfgt nach wie vor nur ber recht begrenzte Instrumente, um das zu erreichen.
|
| 283 |
+
• We could reasonably expect the new Indonesian government to take action in three fundamental areas: restoring public order, prosecuting and punishing those who have blood on their hands and entering into a political dialogue with the opposition. Von der neuen indonesischen Regierung darf man mit Fug und Recht drei elementare Maß- nahmen erwarten: die Wiederherstellung der offentlichen ¨ Ordnung, die Verfolgung und Bestrafung derjenigen, an deren Handen Blut klebt, und die Aufnahme des politischen Di- ¨ alogs mit den Gegnern. Firstly, I might mention the fact that the army needs to be reformed, secondly that a stable system of law and order needs to be introduced. Ich nenne hier an erster Stelle die notwendige Reform der Armee, ferner die Einfhrung eines stabilen Systems rechtsstaatlicher Ordnung.
|
| 284 |
+
|
| 285 |
+
Multiple meanings of “support”:
|
| 286 |
+
|
| 287 |
+
• Financial support is needed to enable poor countries to take part in these court activities. Arme Lander m ¨ ussen finanziell ¨ unterstutzt ¨ werden, damit auch sie sich an der Arbeit des Gerichtshofs beteiligen konnen. ¨
|
| 288 |
+
• We must help them and ensure that a proper action plan is implemented to support their work. Es gilt einen wirklichen Aktionsplan auf den Weg zu bringen, um die Arbeit dieser Organisationen zu unterstutzen ¨ .
|
| 289 |
+
• So I hope that you will all support this resolution condemning the abominable conditions of prisoners and civilians in Djibouti. Ich hoffe daher, daß Sie alle diese Entschließung befurworten ¨ , die die entsetzlichen Bedingungen von Inhaftierten und Zivilpersonen in Dschibuti verurteilt. It would be difficult to support a subsidy scheme that channelled most of the aid to the large farms in the best agricultural regions. Es ware auch problematisch, ein Beihilfesystem zu ¨ befurworten ¨ , das die meisten Beihilfen in die großen Betriebe in den besten landwirtschaftlichen Gebieten lenkt.
|
| 290 |
+
|
| 291 |
+
Multiple meanings of “close”:
|
| 292 |
+
|
| 293 |
+
• This empire did not look for colonies far from home or overseas, like most Western European States, but close by. Dieses Reich suchte seine Kolonien nicht weit von zu Hause und in bersee wie die meisten westeuropaischen Staaten, sondern in der unmittelbaren ¨ Umgebung.
|
| 294 |
+
In addition, if we are to shut down or refuse investment from every company which may have an association with the arms industry, then we would have to close virtually every American and Japanese software company on the island of Ireland with catastrophic consequences. Wenn wir zudem jedes Unternehmen, das auf irgendeine Weise mit der Rstungsindustrie verbunden ist, schließen oder Investitionen dieser Unternehmen unterbinden, dann mßten wir so ziemlich alle amerikanischen und japanischen Softwareunternehmen auf der irischen Insel schließen, was katastrophale Auswirkungen hatte. ¨
|
| 295 |
+
|
| 296 |
+
• On the other hand, the deployment of resources left over in the Structural Funds from the programme planning period 1994 to 1999 is hardly worth considering as the available funds have already been allocated to specific measures, in this case in close collaboration with the relevant French authorities. Die Verwendung verbliebener Mittel der Strukturfonds aus dem Programmplanungszeitraum 1994 bis 1999 ist dagegen kaum in Erwagung zu ziehen, da die verfgbaren ¨ Mittel bereits bestimmten Maßnahmen zugewiesen sind, und zwar im konkreten Fall im engen Zusammenwirken mit den zustandigen franz ¨ osischen Beh ¨ orden. ¨ This is particularly justified given that, as already stated, many Member States have very close relations with Djibouti. Zumal, wie erwahnt, viele Mitgliedstaaten sehr ¨ enge Beziehungen zu Dschibuti unterhalten. Mr President, it is regrettable that, at the close of the 20th century, a century symbolised so positively by the peaceful women’s revolution, there are still countries, such as Kuwait and Afghanistan, where half the population, women that is, is still denied fundamental human rights. Herr Prasident! Es ist wirklich bedauerlich, daß es am ¨ Ende des 20. Jahrhunderts, eines so positiv von der friedlichen Revolution der Frauen gepragten Jahrhunderts, noch immer ¨ Lander wie Kuwait und Afghanistan gibt, in denen der H ¨ alfte der Bev ¨ olkerung, den Frauen, ¨ die elementaren Menschenrechte verweigert werden.
|
md/train/rkYTTf-AZ/rkYTTf-AZ.md
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED MACHINE TRANSLATION USING MONOLINGUAL CORPORA ONLY
|
| 2 |
+
|
| 3 |
+
Guillaume Lample † ‡ , Alexis Conneau $\dagger$ , Ludovic Denoyer $^ \ddag$ , Marc’Aurelio Ranzato † † Facebook AI Research, ‡ Sorbonne Universites, UPMC Univ Paris 06, LIP6 UMR 7606, CNRS ´ {gl,aconneau,ranzato}@fb.com,ludovic.denoyer@lip6.fr
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Machine translation has recently achieved impressive performance thanks to recent advances in deep learning and the availability of large-scale parallel corpora. There have been numerous attempts to extend these successes to low-resource language pairs, yet requiring tens of thousands of parallel sentences. In this work, we take this research direction to the extreme and investigate whether it is possible to learn to translate even without any parallel data. We propose a model that takes sentences from monolingual corpora in two different languages and maps them into the same latent space. By learning to reconstruct in both languages from this shared feature space, the model effectively learns to translate without using any labeled data. We demonstrate our model on two widely used datasets and two language pairs, reporting BLEU scores of 32.8 and 15.1 on the Multi30k and WMT English-French datasets, without using even a single parallel sentence at training time.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Thanks to recent advances in deep learning (Sutskever et al., 2014; Bahdanau et al., 2015) and the availability of large-scale parallel corpora, machine translation has now reached impressive performance on several language pairs (Wu et al., 2016). However, these models work very well only when provided with massive amounts of parallel data, in the order of millions of parallel sentences. Unfortunately, parallel corpora are costly to build as they require specialized expertise, and are often nonexistent for low-resource languages. Conversely, monolingual data is much easier to find, and many languages with limited parallel data still possess significant amounts of monolingual data.
|
| 12 |
+
|
| 13 |
+
There have been several attempts at leveraging monolingual data to improve the quality of machine translation systems in a semi-supervised setting (Munteanu et al., 2004; Irvine, 2013; Irvine & Callison-Burch, 2015; Zheng et al., 2017). Most notably, Sennrich et al. (2015a) proposed a very effective data-augmentation scheme, dubbed “back-translation”, whereby an auxiliary translation system from the target language to the source language is first trained on the available parallel data, and then used to produce translations from a large monolingual corpus on the target side. The pairs composed of these translations with their corresponding ground truth targets are then used as additional training data for the original translation system.
|
| 14 |
+
|
| 15 |
+
Another way to leverage monolingual data on the target side is to augment the decoder with a language model (Gulcehre et al., 2015). And finally, Cheng et al. (2016); He et al. (2016) have proposed to add an auxiliary auto-encoding task on monolingual data, which ensures that a translated sentence can be translated back to the original one. All these works still rely on several tens of thousands parallel sentences, however.
|
| 16 |
+
|
| 17 |
+
Previous work on zero-resource machine translation has also relied on labeled information, not from the language pair of interest but from other related language pairs (Firat et al., 2016; Johnson et al., 2016; Chen et al., 2017) or from other modalities (Nakayama & Nishida, 2017; Lee et al., 2017). The only exception is the work by Ravi & Knight (2011); Pourdamghani & Knight (2017), where the machine translation problem is reduced to a deciphering problem. Unfortunately, their method is limited to rather short sentences and it has only been demonstrated on a very simplistic setting comprising of the most frequent short sentences, or very closely related languages.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Toy illustration of the principles guiding the design of our objective function. Left (autoencoding): the model is trained to reconstruct a sentence from a noisy version of it. $x$ is the target, $C ( x )$ is the noisy input, $\hat { x }$ is the reconstruction. Right (translation): the model is trained to translate a sentence in the other domain. The input is a noisy translation (in this case, from source-to-target) produced by the model itself, $M$ , at the previous iteration $( t )$ , $y = M ^ { ( t ) } ( x )$ . The model is symmetric, and we repeat the same process in the other language. See text for more details.
|
| 21 |
+
|
| 22 |
+
In this paper, we investigate whether it is possible to train a general machine translation system without any form of supervision whatsoever. The only assumption we make is that there exists a monolingual corpus on each language. This set up is interesting for a twofold reason. First, this is applicable whenever we encounter a new language pair for which we have no annotation. Second, it provides a strong lower bound performance on what any good semi-supervised approach is expected to yield.
|
| 23 |
+
|
| 24 |
+
The key idea is to build a common latent space between the two languages (or domains) and to learn to translate by reconstructing in both domains according to two principles: (i) the model has to be able to reconstruct a sentence in a given language from a noisy version of it, as in standard denoising auto-encoders (Vincent et al., 2008). (ii) The model also learns to reconstruct any source sentence given a noisy translation of the same sentence in the target domain, and vice versa. For (ii), the translated sentence is obtained by using a back-translation procedure (Sennrich et al., 2015a), i.e. by using the learned model to translate the source sentence to the target domain. In addition to these reconstruction objectives, we constrain the source and target sentence latent representations to have the same distribution using an adversarial regularization term, whereby the model tries to fool a discriminator which is simultaneously trained to identify the language of a given latent sentence representation (Ganin et al., 2016). This procedure is then iteratively repeated, giving rise to translation models of increasing quality. To keep our approach fully unsupervised, we initialize our algorithm by using a na¨ıve unsupervised translation model based on a word by word translation of sentences with a bilingual lexicon derived from the same monolingual data (Conneau et al., 2017). As a result, and by only using monolingual data, we can encode sentences of both languages into the same feature space, and from there, we can also decode/translate in any of these languages; see Figure 1 for an illustration.
|
| 25 |
+
|
| 26 |
+
While not being able to compete with supervised approaches using lots of parallel resources, we show in section 4 that our model is able to achieve remarkable performance. For instance, on the WMT dataset we can achieve the same translation quality of a similar machine translation system trained with full supervision on 100,000 sentence pairs. On the Multi30K-Task1 dataset we achieve a BLEU above 22 on all the language pairs, with up to 32.76 on English-French.
|
| 27 |
+
|
| 28 |
+
Next, in section 2, we describe the model and the training algorithm. We then present experimental results in section 4. Finally, we further discuss related work in section 5 and summarize our findings in section 6.
|
| 29 |
+
|
| 30 |
+
# 2 UNSUPERVISED NEURAL MACHINE TRANSLATION
|
| 31 |
+
|
| 32 |
+
In this section, we first describe the architecture of the translation system, and then we explain how we train it.
|
| 33 |
+
|
| 34 |
+
2.1 NEURAL MACHINE TRANSLATION MODEL
|
| 35 |
+
|
| 36 |
+
The translation model we propose is composed of an encoder and a decoder, respectively responsible for encoding source and target sentences to a latent space, and to decode from that latent space to the source or the target domain. We use a single encoder and a single decoder for both domains (Johnson et al., 2016). The only difference when applying these modules to different languages is the choice of lookup tables.
|
| 37 |
+
|
| 38 |
+
Let us denote by $\mathcal { W } _ { S }$ the set of words in the source domain associated with the (learned) words embeddings $\mathcal { Z } ^ { S } = ( z _ { 1 } ^ { s } , . . . . , z _ { | \mathcal { W } _ { S } | } ^ { s } )$ , and by $\mathcal { W } _ { T }$ the set of words in the target domain associated with the embeddings $\mathcal { Z } ^ { T } = ( z _ { 1 } ^ { t } , . . . , z _ { | \mathcal { W } _ { T } | } ^ { t } )$ , $\mathcal { Z }$ being the set of all the embeddings. Given an input sentence of $m$ words $\pmb { x } = ( x _ { 1 } , x _ { 2 } , . . . , x _ { m } )$ in a particular language \`, $\ell \in \{ s r c , t g t \}$ , an encoder $e _ { \theta _ { \mathrm { { e n c } } } , z } ( { \pmb x } , { \pmb \ell } )$ computes a sequence of $m$ hidden states $\boldsymbol { z } = ( z _ { 1 } , z _ { 2 } , . . . , z _ { m } )$ by using the corresponding word embeddings, i.e. ${ \mathcal { Z } } _ { S }$ if $\ell = s r c$ and ${ \mathcal { Z } } _ { T }$ if $\ell = t g t$ ; the other parameters $\theta _ { \mathrm { e n c } }$ are instead shared between the source and target languages. For the sake of simplicity, the encoder will be denoted as $e ( { \pmb x } , { \pmb \ell } )$ in the following. These hidden states are vectors in $\mathbb { R } ^ { n }$ , $n$ being the dimension of the latent space.
|
| 39 |
+
|
| 40 |
+
A decoder $d _ { \theta _ { \mathrm { d e c } } , \mathcal { Z } } ( z , \ell )$ takes as input $_ z$ and a language $\ell$ , and generates an output sequence ${ \textbf { \em y } } =$ $\left( y _ { 1 } , y _ { 2 } , . . . , y _ { k } \right)$ , where each word $y _ { i }$ is in the corresponding vocabulary $\mathcal { W } ^ { \ell }$ . This decoder makes use of the corresponding word embeddings, and it is otherwise parameterized by a vector $\theta _ { \mathrm { d e c } }$ that does not depend on the output language. It will thus be denoted $d ( z , \ell )$ in the following. To generate an output word $y _ { i }$ , the decoder iteratively takes as input the previously generated word $y _ { i - 1 }$ $y _ { 0 }$ being a start symbol which is language dependent), updates its internal state, and returns the word that has the highest probability of being the next one. The process is repeated until the decoder generates a stop symbol indicating the end of the sequence.
|
| 41 |
+
|
| 42 |
+
In this article, we use a sequence-to-sequence model with attention (Bahdanau et al., 2015), without input-feeding. The encoder is a bidirectional-LSTM which returns a sequence of hidden states $\boldsymbol { z } = ( z _ { 1 } , z _ { 2 } , . . . , z _ { m } )$ . At each step, the decoder, which is also an LSTM, takes as input the previous hidden state, the current word and a context vector given by a weighted sum over the encoder states. In all the experiments we consider, both encoder and decoder have 3 layers. The LSTM layers are shared between the source and target encoder, as well as between the source and target decoder. We also share the attention weights between the source and target decoder. The embedding and LSTM hidden state dimensions are all set to 300. Sentences are generated using greedy decoding.
|
| 43 |
+
|
| 44 |
+
# 2.2 OVERVIEW OF THE METHOD
|
| 45 |
+
|
| 46 |
+
We consider a dataset of sentences in the source domain, denoted by $\mathcal { D } _ { s r c }$ , and another dataset in the target domain, denoted by $\mathcal { D } _ { t g t }$ . These datasets do not correspond to each other, in general. We train the encoder and decoder by reconstructing a sentence in a particular domain, given a noisy version of the same sentence in the same or in the other domain.
|
| 47 |
+
|
| 48 |
+
At a high level, the model starts with an unsupervised na¨ıve translation model obtained by making word-by-word translation of sentences using a parallel dictionary learned in an unsupervised way (Conneau et al., 2017). Then, at each iteration, the encoder and decoder are trained by minimizing an objective function that measures their ability to both reconstruct and translate from a noisy version of an input training sentence. This noisy input is obtained by dropping and swapping words in the case of the auto-encoding task, while it is the result of a translation with the model at the previous iteration in the case of the translation task. In order to promote alignment of the latent distribution of sentences in the source and the target domains, our approach also simultaneously learns a discriminator in an adversarial setting. The newly learned encoder/decoder are then used at the next iteration to generate new translations, until convergence of the algorithm. At test time and despite the lack of parallel data at training time, the encoder and decoder can be composed into a standard machine translation system.
|
| 49 |
+
|
| 50 |
+
# 2.3 DENOISING AUTO-ENCODING
|
| 51 |
+
|
| 52 |
+
Training an autoencoder of sentences is a trivial task, if the sequence-to-sequence model is provided with an attention mechanism like in our work 1. Without any constraint, the auto-encoder very quickly learns to merely copy every input word one by one. Such a model would also perfectly copy sequences of random words, suggesting that the model does not learn any useful structure in the data. To address this issue, we adopt the same strategy of Denoising Auto-encoders (DAE) (Vincent et al., 2008)), and add noise to the input sentences (see Figure 1-left), similarly to Hill et al. (2016). Considering a domain $\ell = s r c$ or $\ell = t g t$ , and a stochastic noise model denoted by $C$ which operates on sentences, we define the following objective function:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathcal { L } _ { a u t o } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , \ell ) = \mathbb { E } _ { x \sim \mathcal { D } _ { \ell } , \hat { x } \sim d ( e ( C ( x ) , \ell ) , \ell ) } \left[ \Delta ( \hat { x } , x ) \right]
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\hat { x } \sim d ( e ( C ( x ) , \ell ) , \ell )$ means that $\hat { x }$ is a reconstruction of the corrupted version of $x$ , with $x$ sampled from the monolingual dataset $\mathcal { D } _ { \ell }$ . In this equation, $\Delta$ is a measure of discrepancy between the two sequences, the sum of token-level cross-entropy losses in our case.
|
| 59 |
+
|
| 60 |
+
Noise model $C ( x )$ is a randomly sampled noisy version of sentence $x$ . In particular, we add two different types of noise to the input sentence. First, we drop every word in the input sentence with a probability $p _ { w d }$ . Second, we slightly shuffle the input sentence. To do so, we apply a random permutation $\sigma$ to the input sentence, verifying the condition $\forall i \in \{ 1 , n \} , | \sigma ( i ) - i | \tilde { \leq k }$ where $n$ is the length of the input sentence, and $k$ is a tunable parameter.
|
| 61 |
+
|
| 62 |
+
To generate a random permutation verifying the above condition for a sentence of size $n$ , we generate a random vector $q$ of size $n$ , where $q _ { i } = i + U ( 0 , \alpha )$ , and $U$ is a draw from the uniform distribution in the specified range. Then, we define $\sigma$ to be the permutation that sorts the array $q$ . In particular, $\alpha < 1$ will return the identity, $\alpha = + \infty$ can return any permutation, and $\alpha = k + 1$ will return permutations $\sigma$ verifying $\forall i \ \in \ \{ 1 , n \} , | \sigma ( i ) - i | \ \leq \ k$ . Although biased, this method generates permutations similar to the noise observed with word-by-word translation.
|
| 63 |
+
|
| 64 |
+
In our experiments, both the word dropout and the input shuffling strategies turned out to have a critical impact on the results, see also section 4.5, and using both strategies at the same time gave us the best performance. In practice, we found $p _ { w d } = 0 . 1$ and $k = 3$ to be good parameters.
|
| 65 |
+
|
| 66 |
+
# 2.4 CROSS DOMAIN TRAINING
|
| 67 |
+
|
| 68 |
+
The second objective of our approach is to constrain the model to be able to map an input sentence from a the source/target domain $\ell _ { 1 }$ to the target/source domain $\ell _ { 2 }$ , which is what we are ultimately interested in at test time. The principle here is to sample a sentence $x \in \mathcal { D } _ { \ell _ { 1 } }$ , and to generate a corrupted translation of this sentence in $\ell _ { 2 }$ . This corrupted version is generated by applying the current translation model denoted $M$ to $x$ such that $y = M ( x )$ . Then a corrupted version $C ( y )$ is sampled (see Figure 1-right). The objective is thus to learn the encoder and the decoder such that they can reconstruct $x$ from $C ( y )$ . The cross-domain loss can be written as:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathcal { L } _ { c d } \left( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , \ell _ { 1 } , \ell _ { 2 } \right) = \mathbb { E } _ { x \sim \mathcal { D } _ { \ell _ { 1 } } , \hat { x } \sim d \left( e \left( C \left( M \left( x \right) \right) , \ell _ { 2 } \right) , \ell _ { 1 } \right) } \left[ \Delta \left( \hat { x } , x \right) \right]
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\Delta$ is again the sum of token-level cross-entropy losses.
|
| 75 |
+
|
| 76 |
+
# 2.5 ADVERSARIAL TRAINING
|
| 77 |
+
|
| 78 |
+
Intuitively, the decoder of a neural machine translation system works well only when its input is produced by the encoder it was trained with, or at the very least, when that input comes from a distribution very close to the one induced by its encoder. Therefore, we would like our encoder to output features in the same space regardless of the actual language of the input sentence. If such condition is satisfied, our decoder may be able to decode in a certain language regardless of the language of the encoder input sentence.
|
| 79 |
+
|
| 80 |
+
Note however that the decoder could still produce a bad translation while yielding a valid sentence in the target domain, as constraining the encoder to map two languages in the same feature space does not imply a strict correspondence between sentences. Fortunately, the previously introduced loss for cross-domain training in equation 2 mitigates this concern. Also, recent work on bilingual lexical induction has shown that such a constraint is very effective at the word level, suggesting that it may also work at the sentence level, as long as the two latent representations exhibit strong structure in feature space.
|
| 81 |
+
|
| 82 |
+
In order to add such a constraint, we train a neural network, which we will refer to as the discriminator, to classify between the encoding of source sentences and the encoding of target sentences (Ganin et al., 2016). The discriminator operates on the output of the encoder, which is a sequence of latent vectors $\left( z _ { 1 } , . . . , z _ { m } \right)$ , with $z _ { i } \in \mathbb { R } ^ { n }$ , and produces a binary prediction about the language of the encoder input sentence: $p _ { D } ( l | z _ { 1 } , . . . , z _ { m } ) \propto \prod _ { j = 1 } ^ { m } p _ { D } ( \ell | z _ { j } )$ , with $p _ { D } : \mathbb { R } ^ { n } [ 0 ; 1 ]$ , where 0 corresponds to the source domain, and 1 to the target domain.
|
| 83 |
+
|
| 84 |
+
The discriminator is trained to predict the language by minimizing the following cross-entropy loss: $\mathcal { L } _ { \mathcal { D } } ( \theta _ { D } | \theta , \mathcal { Z } ) = - \mathbb { E } _ { ( x _ { i } , \ell _ { i } ) } [ \log p _ { D } ( \ell _ { i } | e ( x _ { i } , \ell _ { i } ) ) ]$ , where $( x _ { i } , \ell _ { i } )$ corresponds to sentence and language id pairs uniformly sampled from the two monolingual datasets, $\theta _ { D }$ are the parameters of the discriminator, $\theta _ { \mathrm { e n c } }$ are the parameters of the encoder, and $\mathcal { Z }$ are the encoder word embeddings.
|
| 85 |
+
|
| 86 |
+
The encoder is trained instead to fool the discriminator:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { L } _ { a d v } ( \theta _ { \mathrm { e n c } } , \mathcal { Z } | \theta _ { D } ) = - \mathbb { E } _ { ( x _ { i } , \ell _ { i } ) } [ \log p _ { D } ( \ell _ { j } | e ( x _ { i } , \ell _ { i } ) ) ]
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
with $\ell _ { j } = \ell _ { 1 }$ if $\ell _ { i } = \ell _ { 2 }$ , and vice versa.
|
| 93 |
+
|
| 94 |
+
Final Objective function The final objective function at one iteration of our learning algorithm is thus:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r l } & { \mathcal { L } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } ) = \lambda _ { a u t o } [ \mathcal { L } _ { a u t o } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , s r c ) + \mathcal { L } _ { a u t o } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , t g t ) ] + } \\ & { \qquad \lambda _ { c d } [ \mathcal { L } _ { c d } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , s r c , t g t ) + \mathcal { L } _ { c d } ( \theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } , t g t , s r c ) ] + } \\ & { \qquad \lambda _ { a d v } \mathcal { L } _ { a d v } ( \theta _ { \mathrm { e n c } } , \mathcal { Z } | \theta _ { D } ) } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\lambda _ { a u t o }$ , $\lambda _ { c d }$ , and $\lambda _ { a d v }$ are hyper-parameters weighting the importance of the auto-encoding, cross-domain and adversarial loss. In parallel, the discriminator loss $\mathcal { L } _ { D }$ is minimized to update the discriminator.
|
| 101 |
+
|
| 102 |
+
# 3 TRAINING
|
| 103 |
+
|
| 104 |
+
In this section we describe the overall training algorithm and the unsupervised criterion we used to select hyper-parameters.
|
| 105 |
+
|
| 106 |
+
# 3.1 ITERATIVE TRAINING
|
| 107 |
+
|
| 108 |
+
The final learning algorithm is described in Algorithm 1 and the general architecture of the model is shown in Figure 2. As explained previously, our model relies on an iterative algorithm which starts from an initial translation model $M ^ { ( 1 ) }$ (line 3). This is used to translate the available monolingual data, as needed by the cross-domain loss function of Equation 2. At each iteration, a new encoder and decoder are trained by minimizing the loss of Equation 4 – line 7 of the algorithm. Then, a new translation model $M ^ { ( t + 1 ) }$ is created by composing the resulting encoder and decoder, and the process repeats.
|
| 109 |
+
|
| 110 |
+
To jump start the process, $M ^ { ( 1 ) }$ simply makes a word-by-word translation of each sentence using a parallel dictionary learned using the unsupervised method proposed by Conneau et al. (2017), which only leverages monolingual data.
|
| 111 |
+
|
| 112 |
+
The intuition behind our algorithm is that as long as the initial translation model $M ^ { ( 1 ) }$ retains at least some information of the input sentence, the encoder will map such translation into a representation in feature space that also corresponds to a cleaner version of the input, since the encoder is trained to denoise. At the same time, the decoder is trained to predict noiseless outputs, conditioned on noisy features. Putting these two pieces together will produce less noisy translations, which will enable better back-translations at the next iteration, and so on so forth.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 2: Illustration of the proposed architecture and training objectives. The architecture is a sequence to sequence model, with both encoder and decoder operating on two languages depending on an input language identifier that swaps lookup tables. Top (auto-encoding): the model learns to denoise sentences in each domain. Bottom (translation): like before, except that we encode from another language, using as input the translation produced by the model at the previous iteration (light blue box). The green ellipses indicate terms in the loss function.
|
| 116 |
+
|
| 117 |
+
# Algorithm 1 Unsupervised Training for Machine Translation
|
| 118 |
+
|
| 119 |
+
1: procedure TRAINING $\mathcal { D } _ { s r c }$ , $\mathcal { D } _ { t g t } , T )$
|
| 120 |
+
2: Infer bilingual dictionary using monolingual data (Conneau et al., 2017)
|
| 121 |
+
3: $M ^ { ( 1 ) } \gets$ unsupervised word-by-word translation model using the inferred dictionary
|
| 122 |
+
4: for $t = 1 , T$ do
|
| 123 |
+
5: using ${ \bf \nabla } _ { M } ( t )$ , translate each monolingual dataset
|
| 124 |
+
6: $/ /$ discriminator training $\&$ model training as in eq. 4
|
| 125 |
+
7: $\theta _ { \mathrm { d i s c r } } \arg \operatorname* { m i n } \mathcal { L } _ { D }$ , $\theta _ { \mathrm { e n c } } , \theta _ { \mathrm { d e c } } , \mathcal { Z } \gets \arg \operatorname* { m i n } \mathcal { L }$
|
| 126 |
+
8: $M ^ { ( t + 1 ) } \gets \breve { e } ^ { ( t ) } \circ d ^ { ( t ) } / /$ update MT model
|
| 127 |
+
9: end for
|
| 128 |
+
10: return M (T +1)
|
| 129 |
+
11: end procedure
|
| 130 |
+
|
| 131 |
+
# 3.2 UNSUPERVISED MODEL SELECTION CRITERION
|
| 132 |
+
|
| 133 |
+
In order to select hyper-parameters, we wish to have a criterion correlated with the translation quality. However, we do not have access to parallel sentences to judge how well our model translates, not even at validation time. Therefore, we propose the surrogate criterion which we show correlates well with BLEU (Papineni et al., 2002), the metric we care about at test time.
|
| 134 |
+
|
| 135 |
+
For all sentences $x$ in a domain $\ell _ { 1 }$ , we translate these sentences to the other domain $\ell _ { 2 }$ , and then translate the resulting sentences back to $\ell _ { 1 }$ . The quality of the model is then evaluated by computing the BLEU score over the original inputs and their reconstructions via this two-step translation process. The performance is then averaged over the two directions, and the selected model is the one with the highest average score.
|
| 136 |
+
|
| 137 |
+
Given an encoder $e$ , a decoder $d$ and two non-parallel datasets $\mathcal { D } _ { s r c }$ and $\mathcal { D } _ { t g t }$ , we denote $M _ { s r c t g t } ( x ) = d ( e ( x , s r c ) , t g t )$ the translation model from src to tgt, and $M _ { t g t s r c }$ the model in the opposite direction. Our model selection criterion $M S ( e , d , \mathcal { D } _ { s r c } , \mathcal { D } _ { t g t } )$ is:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r c l } { { M S ( e , d , \mathcal { D } _ { s r c } , \mathcal { D } _ { t g t } ) } } & { { = } } & { { \displaystyle \frac { 1 } { 2 } \mathbb { E } _ { x \sim \mathcal { D } _ { s r c } } [ \mathrm { B L E U } ( x , M _ { s r c t g t } \circ M _ { t g t s r c } ( x ) ) ] + } } \\ { { } } & { { } } & { { \displaystyle \frac { 1 } { 2 } \mathbb { E } _ { x \sim \mathcal { D } _ { t g t } } [ \mathrm { B L E U } ( x , M _ { t g t s r c } \circ M _ { s r c t g t } ( x ) ) ] } } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
Figure 3 shows a typical example of the correlation between this measure and the final translation model performance (evaluated here using a parallel dataset).
|
| 144 |
+
|
| 145 |
+
The unsupervised model selection criterion is used both to a) determine when to stop training and b) to select the best hyper-parameter setting across different experiments. In the former case, the
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: Unsupervised model selection. BLEU score of the source to target and target to source models on the Multi30k-Task1 English-French dataset as a function of the number of passes through the dataset at iteration $\mathbf { \Omega } ( t ) \ = \ 1$ of the algorithm (training $M ( 2 )$ given $M ( 1 ) ,$ ). BLEU correlates very well with the proposed model selection criterion, see Equation 5.
|
| 149 |
+
|
| 150 |
+
Spearman correlation coefficient between the proposed criterion and BLEU on the test set is 0.95 in average. In the latter case, the coefficient is in average 0.75, which is fine but not nearly as good. For instance, the BLEU score on the test set of models selected with the unsupervised criterion are sometimes up to 1 or 2 BLEU points below the score of models selected using a small validation set of 500 parallel sentences.
|
| 151 |
+
|
| 152 |
+
# 4 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
In this section, we first describe the datasets and the pre-processing we used, then we introduce the baselines we considered, and finally we report the extensive empirical validation proving the effectiveness of our method. We will release the code to the public once the revision process is over.
|
| 155 |
+
|
| 156 |
+
# 4.1 DATASETS
|
| 157 |
+
|
| 158 |
+
In our experiments, we consider the English-French and English-German language pairs, on three different datasets.
|
| 159 |
+
|
| 160 |
+
WMT’14 English-French We use the full training set of 36 million pairs, we lower-case them and remove sentences longer than 50 words, as well as pairs with a source/target length ratio above 1.5, resulting in a parallel corpus of about 30 million sentences. Next, we build monolingual corpora by selecting the English sentences from 15 million random pairs, and selecting the French sentences from the complementary set. The former set constitutes our English monolingual dataset. The latter set is our French monolingual dataset. The lack of overlap between the two sets ensures that there is not exact correspondence between examples in the two datasets.
|
| 161 |
+
|
| 162 |
+
The validation set is comprised of 3,000 English and French sentences extracted from our monolingual training corpora described above. These sentences are not the translation of each other, and they will be used by our unsupervised model selection criterion, as explained in 3.2. Finally, we report results on the full newstest2014 dataset.
|
| 163 |
+
|
| 164 |
+
WMT’16 English-German We follow the same procedure as above to create monolingual training and validation corpora in English and German, which results in two monolingual training corpora of 1.8 million sentences each. We test our model on the newstest2016 dataset.
|
| 165 |
+
|
| 166 |
+
Multi30k-Task1 The task 1 of the Multi30k dataset (Elliott et al., 2016) has 30,000 images, with annotations in English, French and German, that are translations of each other. We consider the English-French and English-German pairs. We disregard the images and only consider the parallel annotations, with the provided training, validation and test sets, composed of 29,000, 1,000 and 1,000 pairs of sentences respectively. For both pairs of languages and similarly to the WMT datasets above, we split the training and validation sets into monolingual corpora, resulting in 14,500 monolingual source and target sentences in the training set, and 500 sentences in the validation set.
|
| 167 |
+
|
| 168 |
+
Table 1: Multi30k-Task1 and WMT datasets statistics. To limit the vocabulary size in the WMT en-fr and WMT de-en datasets, we only considered words with more than 100 and 25 occurrences, respectively.
|
| 169 |
+
|
| 170 |
+
<table><tr><td></td><td>MMT1 en-fr</td><td>MMT1 de-en</td><td>WMT en-fr</td><td>WMT de-en</td></tr><tr><td>Monolingual sentences</td><td>14.5k</td><td>14.5k</td><td>15M</td><td>1.8M</td></tr><tr><td>Vocabulary size</td><td>10k/11k</td><td>19k/10k</td><td>67k/78k</td><td>80k/46k</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 1 summarizes the number of monolingual sentences in each dataset, along with the vocabulary size. To limit the vocabulary size on the WMT en-fr and WMT de-en datasets, we only considered words with more than 100 and 25 occurrences, respectively.
|
| 173 |
+
|
| 174 |
+
# 4.2 BASELINES
|
| 175 |
+
|
| 176 |
+
Word-by-word translation (WBW) The first baseline is a system that performs word-by-word translations of the input sentences using the inferred bilingual dictionary (Conneau et al., 2017). This baseline provides surprisingly good results for related language pairs, like English-French, where the word order is similar, but performs rather poorly on more distant pairs like English-German, as can be seen in Table 2.
|
| 177 |
+
|
| 178 |
+
Word reordering (WR) After translating word-by-word as in WBW, here we reorder words using an LSTM-based language model trained on the target side. Since we cannot exhaustively score every possible word permutation (some sentences have about 100 words), we consider all pairwise swaps of neighboring words, we select the best swap, and iterate ten times. We use this baseline only on the WMT dataset that has a large enough monolingual data to train a language model.
|
| 179 |
+
|
| 180 |
+
Oracle Word Reordering (OWR) Using the reference, we produce the best possible generation using only the words given by WBW. The performance of this method is an upper-bound of what any model could do without replacing words.
|
| 181 |
+
|
| 182 |
+
Supervised Learning We finally consider exactly the same model as ours, but trained with supervision, using the standard cross-entropy loss on the original parallel sentences.
|
| 183 |
+
|
| 184 |
+
# 4.3 UNSUPERVISED DICTIONARY LEARNING
|
| 185 |
+
|
| 186 |
+
To implement our baseline and also to initialize the embeddings $\mathcal { Z }$ of our model, we first train word embeddings on the source and target monolingual corpora using fastText (Bojanowski et al., 2017), and then we apply the unsupervised method proposed by Conneau et al. (2017) to infer a bilingual dictionary which can be use for word-by-word translation.
|
| 187 |
+
|
| 188 |
+
Since WMT yields a very large-scale monolingual dataset, we obtain very high-quality embeddings and dictionaries, with an accuracy of $8 4 . { \bar { 4 } } 8 \%$ and $7 7 . 2 9 \%$ on French-English and GermanEnglish, which is on par with what could be obtained using a state-of-the-art supervised alignment method (Conneau et al., 2017).
|
| 189 |
+
|
| 190 |
+
On the Multi30k datasets instead, the monolingual training corpora are too small to train good word embeddings (more than two order of magnitude smaller than WMT). We therefore learn word vectors on Wikipedia using fastText2.
|
| 191 |
+
|
| 192 |
+
Table 2: BLEU score on the Multi30k-Task1 and WMT datasets using greedy decoding.
|
| 193 |
+
|
| 194 |
+
<table><tr><td></td><td colspan="4">Multi30k-Task1</td><td colspan="4">WMT</td></tr><tr><td></td><td>en-fr</td><td>fr-en</td><td>de-en</td><td>en-de</td><td>en-fr</td><td>fr-en</td><td>de-en</td><td>en-de</td></tr><tr><td>Supervised</td><td>56.83</td><td>50.77</td><td>38.38</td><td>35.16</td><td>27.97</td><td>26.13</td><td>25.61</td><td>21.33</td></tr><tr><td>word-by-word</td><td>8.54</td><td>16.77</td><td>15.72</td><td>5.39</td><td>6.28</td><td>10.09</td><td>10.77</td><td>7.06</td></tr><tr><td>word reordering</td><td>-</td><td>-</td><td>1</td><td>-</td><td>6.68</td><td>11.69</td><td>10.84</td><td>6.70</td></tr><tr><td>oracle word reordering</td><td>11.62</td><td>24.88</td><td>18.27</td><td>6.79</td><td>10.12</td><td>20.64</td><td>19.42</td><td>11.57</td></tr><tr><td>Our model: 1st iteration</td><td>27.48</td><td>28.07</td><td>23.69</td><td>19.32</td><td>12.10</td><td>11.79</td><td>11.10</td><td>8.86</td></tr><tr><td>Our model: 2nd iteration</td><td>31.72</td><td>30.49</td><td>24.73</td><td>21.16</td><td>14.42</td><td>13.49</td><td>13.25</td><td>9.75</td></tr><tr><td>Our model: 3rd iteration</td><td>32.76</td><td>32.07</td><td>26.26</td><td>22.74</td><td>15.05</td><td>14.31</td><td>13.33</td><td>9.64</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 4.4 EXPERIMENTAL DETAILS
|
| 197 |
+
|
| 198 |
+
Discriminator Architecture The discriminator is a multilayer perceptron with three hidden layers of size 1024, Leaky-ReLU activation functions and an output logistic unit. Following Goodfellow (2016), we include a smoothing coefficient $s = 0 . 1$ in the discriminator predictions.
|
| 199 |
+
|
| 200 |
+
Training Details The encoder and the decoder are trained using Adam (Kingma & Ba, 2014), with a learning rate of 0.0003, $\beta _ { 1 } = 0 . 5$ , and a mini-batch size of 32. The discriminator is trained using RMSProp (Tieleman & Hinton, 2012) with a learning rate of 0.0005. We evenly alternate between one encoder-decoder and one discriminator update. We set $\lambda _ { a u t o } = \lambda _ { c d } = \lambda _ { a d v } = 1$ .
|
| 201 |
+
|
| 202 |
+
# 4.5 EXPERIMENTAL RESULTS
|
| 203 |
+
|
| 204 |
+
Table 2 shows the BLEU scores achieved by our model and the baselines we considered. First, we observe that word-by-word translation is surprisingly effective when translating into English, obtaining a BLEU score of 16.77 and 10.09 for $f r$ -en on respectively Multi30k-Task1 and WMT datasets. Word-reordering only slightly improves upon word-by-word translation. Our model instead, clearly outperforms these baselines, even on the WMT dataset which has more diversity of topics and sentences with much more complicated structure. After just one iteration, we obtain a BLEU score of 27.48 and 12.10 for the en-fr task. Interestingly, we do even better than oracle reordering on some language pairs, suggesting that our model not only reorders but also correctly substitutes some words. After a few iterations, our model obtains BLEU of 32.76 and 15.05 on Multi30k-Task1 and WMT datasets for the English to French task, which is rather remarkable.
|
| 205 |
+
|
| 206 |
+
Comparison with supervised approaches Here, we assess how much labeled data are worth our two large monolingual corpora. On WMT, we trained the very same NMT architecture on both language pairs, but with supervision using various amounts of parallel data. Figure 4-right shows the resulting performance. Our unsupervised approach obtains the same performance than a supervised NMT model trained on about 100,000 parallel sentences, which is impressive. Of course, adding more parallel examples allows the supervised approach to outperform our method, but the good performance of our unsupervised method suggests that it could be very effective for low-resources languages where no parallel data are available. Moreover, these results open the door to the development of semi-supervised translation models, which will be the focus of future investigation. With a phrase-based machine translation system, we obtain 21.6 and 22.4 BLEU on WMT en- ${ \mathcal { f } } { \mathit { r } }$ and $f r { - } e n$ , which is better than the supervised NMT baseline we report for that same amount of parallel sentences, which is 16.8 and 16.4 respectively. However, if we train the same supervised NMT model with BPE (Sennrich et al., 2015b), we obtain 22.6 BLEU for en-fr, suggesting that our results on unsupervised machine translation could also be improved by using BPE, as this removes unknown words (about $9 \%$ of the words in de-en are replaced by the unknown token otherwise).
|
| 207 |
+
|
| 208 |
+
Iterative Learning Figure 4-left illustrates the quality of the learned model after each iteration of the learning process in the language pairs of Multi30k-Task1 dataset, other results being provided in Table 2. One can see that the quality of the obtained model is high just after the first iteration of the process. Subsequent iterations yield significant gains although with diminishing returns. At iteration 3, the performance gains are marginal, showing that our approach quickly converges.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 4: Left: BLEU as a function of the number of iterations of our algorithm on the Multi30kTask1 datasets. Right: The curves show BLEU as a function of the amount of parallel data on WMT datasets. The unsupervised method which leverages about 15 million monolingual sentences in each language, achieves performance (see horizontal lines) close to what we would obtain by employing 100,000 parallel sentences.
|
| 212 |
+
|
| 213 |
+
Table 3: Unsupervised translations. Examples of translations on the French-English pair of the Multi30k-Task1 dataset. Iteration 0 corresponds to word-by-word translation. After 3 iterations, the model generates very good translations.
|
| 214 |
+
|
| 215 |
+
<table><tr><td>Source Iteration O Iteration 1 Iteration 2 Iteration 3 Reference</td><td>un homme est debout pres d'une série de jeux vidéo dans un bar . a man is seated neara series of games video in a bar. a man is standing nearacloseup of other games in a bar . a man is standing near a bunch of video video game in a bar . a man is standing neara bunch of video games ina bar. a man is standing by a group of video games in a bar.</td></tr><tr><td>Source Iteration O</td><td>une femme aux cheveux roses habillée en noir parle ä un homme . a woman at hair roses dressed in black speaks to a man .</td></tr><tr><td>Iteration 1</td><td>a woman at glasses dressed in black talking to a man.</td></tr><tr><td>Iteration 2</td><td>a woman at pink hair dressed in black speaks to a man.</td></tr><tr><td>Iteration 3 Reference</td><td>a woman with pink hair dressed in black is talking to a man.</td></tr><tr><td></td><td>a woman with pink hair dressed in black talks to a man.</td></tr><tr><td>Source</td><td>une photo d'une rue bondée en ville .</td></tr><tr><td>Iteration O</td><td>a photo a street crowded in city .</td></tr><tr><td>Iteration 1</td><td>a picture of a street crowded in a city .</td></tr><tr><td>Iteration 2</td><td></td></tr><tr><td>Iteration 3</td><td>a picture of a crowded city street.</td></tr><tr><td></td><td>a picture of a crowded street in a city .</td></tr><tr><td>Reference</td><td>aview of acrowded citystreet.</td></tr><tr><td></td><td></td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 3 shows examples of translations of three sentences on the Multi30k dataset, as we iterate. Iteration 0 corresponds to the word-by-word translation obtained with our cross-lingual dictionary, which clearly suffers from word order issues. We can observe that the quality of the translations increases at every iteration.
|
| 218 |
+
|
| 219 |
+
Ablation Study We perform an ablation study to understand the importance of the different components of our system. To this end, we have trained multiple versions of our model with some missing components: the discriminator, the cross-domain loss, the auto-encoding loss, etc. Table 4 shows that the best performance is obtained with the simultaneous use of all the described elements.
|
| 220 |
+
|
| 221 |
+
Table 4: Ablation study on the Multi30k-Task1 dataset.
|
| 222 |
+
|
| 223 |
+
<table><tr><td></td><td>en-fr</td><td>fr-en</td><td>de-en</td><td>en-de</td></tr><tr><td>Xcd=0</td><td>25.44</td><td>27.14</td><td>20.56</td><td>14.42</td></tr><tr><td>Without pretraining</td><td>25.29</td><td>26.10</td><td>21.44</td><td>17.23</td></tr><tr><td>Without pretraining, Xcd = 0</td><td>8.78</td><td>9.15</td><td>7.52</td><td>6.24</td></tr><tr><td>Without noise,C(x) = x</td><td>16.76</td><td>16.85</td><td>16.85</td><td>14.61</td></tr><tr><td>Xauto=0</td><td>24.32</td><td>20.02</td><td>19.10</td><td>14.74</td></tr><tr><td>Aadu =0</td><td>24.12</td><td>22.74</td><td>19.87</td><td>15.13</td></tr><tr><td>Full</td><td>27.48</td><td>28.07</td><td>23.69</td><td>19.32</td></tr></table>
|
| 224 |
+
|
| 225 |
+
The most critical component is the unsupervised word alignment technique, either in the form of a back-translation dataset generated using word-by-word translation, or in the form of pretrained embeddings which enable to map sentences of different languages in the same latent space.
|
| 226 |
+
|
| 227 |
+
On the English-French pair of Multi30k-Task1, with a back-translation dataset but without pretrained embeddings, our model obtains a BLEU score of 25.29 and 26.10, which is only a few points below the model using all components. Similarly, when the model uses pretrained embeddings but no back-translation dataset (when $\lambda _ { c d } = 0$ ), it obtains 25.44 and 27.14. On the other hand, a model that does not use any of these components only reaches 8.78 and 9.15 BLEU.
|
| 228 |
+
|
| 229 |
+
The adversarial component also significantly improves the performance of our system, with a difference of up to 5.33 BLEU in the French-English pair of Multi30k-Task1. This confirms our intuition that, to really benefit from the cross-domain loss, one has to ensure that the distribution of latent sentence representations is similar across the two languages. Without the auto-encoding loss (when $\lambda _ { a u t o } = 0$ ), the model only obtains 20.02, which is 8.05 BLEU points below the method using all components. Finally, performance is greatly degraded also when the corruption process of the input sentences is removed, as the model has much harder time learning useful regularities and merely learns to copy input data.
|
| 230 |
+
|
| 231 |
+
# 5 RELATED WORK
|
| 232 |
+
|
| 233 |
+
A similar work to ours is the style transfer method with non-parallel text by Shen et al. (2017). The authors consider a sequence-to-sequence model, where the latent state given to the decoder is also fed to a discriminator. The encoder is trained with the decoder to reconstruct the input, but also to fool the discriminator. The authors also found it beneficial to train two discriminators, one for the source and one for the target domain. Then, they trained the decoder so that the recurrent hidden states during the decoding process of a sentence in a particular domain are not distinguishable according to the respective discriminator. This algorithm, called Professor forcing, was initially introduced by Lamb et al. (2016) to encourage the dynamics of the decoder observed during inference to be similar to the ones observed at training time.
|
| 234 |
+
|
| 235 |
+
Similarly, Xie et al. (2017) also propose to use an adversarial training approach to learn representations invariant to specific attributes. In particular, they train an encoder to map the observed data to a latent feature space, and a model to make predictions based on the encoder output. To remove bias existing in the data from the latent codes, a discriminator is also trained on the encoder outputs to predict specific attributes, while the encoder is jointly trained to fool the discriminator. They show that the obtained invariant representations lead to better generalization on classification and generation tasks.
|
| 236 |
+
|
| 237 |
+
Before that, Hu et al. (2017) trained a variational autoencoder (Kingma & Welling, 2013) where the decoder input is the concatenation of an unstructured latent vector, and a structured code representing the attribute of the sentence to generate. A discriminator is trained on top of the decoder to classify the labels of generated sentences, while the decoder is trained to satisfy this discriminator. Because of the non-differentiability of the decoding process, at each step, their decoder takes as input the probability vector predicted at the previous step.
|
| 238 |
+
|
| 239 |
+
Perhaps, the most relevant prior work is by He et al. (2016), who essentially optimizes directly for the model selection metric we propose in section 3.2. One drawback of their approach, which has not been applied to the fully unsupervised setting, is that it requires to back-propagate through the sequence of discrete predictions using reinforcement learning-based approaches which are notoriously inefficient. In this work, we instead propose to a) use a symmetric architecture, and b) freeze the translator from source to target when training the translator from target to source, and vice versa. By alternating this process we operate with a fully differentiable model and we efficiently converge.
|
| 240 |
+
|
| 241 |
+
In the vision domain, several studies tackle the unsupervised image translation problem, where the task consists in mapping two image domains A and B, without paired supervision. For instance, in the CoGAN architecture (Liu & Tuzel, 2016), two generators are trained to learn a common representation space between two domains, by sharing some of their convolutional layers. This is similar to our strategy of sharing the LSTM weights across the source and target encoders and decoders. Liu et al. (2017) propose a similar approach, based on variational autoencoders, and generative adversarial networks (Goodfellow et al., 2014). Taigman et al. (2016) use similar approaches for emoji generation, and apply a regularization term to the generator so that it behaves like an identity mapping when provided with input images from the target domain. Zhu et al. (2017) introduced a cycle consistency loss, to capture the intuition that if an image is mapped from A to B, then from B to A, then the resulting image should be identical to the input one.
|
| 242 |
+
|
| 243 |
+
Our approach is also reminiscent of the Fader Networks architecture (Lample et al., 2017), where a discriminator is used to remove the information related to specific attributes from the latent states of an autoencoder of images. The attribute values are then given as input to the decoder. The decoder is trained with real attributes, but at inference, it can be fed with any attribute values to generate variations of the input images. The model presented in this paper can be seen as an extension to the text domain of the Fader Networks, where the attribute is the language itself.
|
| 244 |
+
|
| 245 |
+
# 6 CONCLUSION
|
| 246 |
+
|
| 247 |
+
We presented a new approach to neural machine translation where a translation model is learned using monolingual datasets only, without any alignment between sentences or documents. The principle of our approach is to start from a simple unsupervised word-by-word translation model, and to iteratively improve this model based on a reconstruction loss, and using a discriminator to align latent distributions of both the source and the target languages. Our experiments demonstrate that our approach is able to learn effective translation models without any supervision of any sort.
|
| 248 |
+
|
| 249 |
+
# REFERENCES
|
| 250 |
+
|
| 251 |
+
D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 252 |
+
Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5: 135–146, 2017.
|
| 253 |
+
Y. Chen, Y. Liu, Y. Cheng, and V.O.K. Li. A teacher-student framework for zero-resource neural machine translation. In ACL, 2017.
|
| 254 |
+
Y. Cheng, W. Xu, Z. He, W. He, H. Wu, M. Sun, and Y. Liu. Semi-supervised learning for neural machine translation. arXiv:1606.04596, 2016.
|
| 255 |
+
A. Conneau, G. Lample, M. Ranzato, L. Denoyer, and H. Jegou. Word translation without parallel ´ data. arXiv:1710.04087, 2017.
|
| 256 |
+
D.L. Donoho. Compressed sensing. IEEE Transactions on Information Theory, 2006.
|
| 257 |
+
Desmond Elliott, Stella Frank, Khalil Sima’an, and Lucia Specia. Multi30k: Multilingual englishgerman image descriptions. arXiv preprint arXiv:1605.00459, 2016.
|
| 258 |
+
O. Firat, B. Sankaran, Y. Al-Onaizan, F.T.Y. Vural, and K. Cho. Zero-resource translation with multi-lingual neural machine translation, 2016.
|
| 259 |
+
Y. Ganin, E. Ustinova, h. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. JMLR, 2016.
|
| 260 |
+
Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 261 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 262 |
+
Caglar Gulcehre, Orhan Firat, Kelvin Xu, Kyunghyun Cho, Loic Barrault, Huei-Chi Lin, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. On using monolingual corpora in neural machine translation. arXiv preprint arXiv:1503.03535, 2015.
|
| 263 |
+
Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems, pp. 820–828, 2016.
|
| 264 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. arXiv preprint arXiv:1602.03483, 2016.
|
| 265 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Controllable text generation. arXiv preprint arXiv:1703.00955, 2017.
|
| 266 |
+
A. Irvine. Combining bilingual and comparable corpora for low resource machine translation. 2013.
|
| 267 |
+
A. Irvine and C. Callison-Burch. End-to-end statistical machine translation with zero or small parallel texts. Natural Language Engineering, 1(1), 2015.
|
| 268 |
+
M. Johnson, M. Schuster, Q.V. Le, M. Krikun, Y. Wu, Z. Chen, N. Thorat, F. Vigas, M. Wattenberg, G. Corrado, M. Hughes, and J. Dean. Googles multilingual neural machine translation system: Enabling zero-shot translation, 2016.
|
| 269 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 270 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 271 |
+
Alex M Lamb, Anirudh Goyal ALIAS PARTH GOYAL, Ying Zhang, Saizheng Zhang, Aaron C Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In Advances In Neural Information Processing Systems, pp. 4601–4609, 2016.
|
| 272 |
+
Guillaume Lample, Neil Zeghidour, Nicolas Usunier, Antoine Bordes, Ludovic DENOYER, et al. Fader networks: Manipulating images by sliding attributes. In Advances in Neural Information Processing Systems, pp. 5963–5972, 2017.
|
| 273 |
+
J. Lee, K. Cho, J. Weston, and D. Kiela. Emergent translation in multi-agent communication. arXiv:1710.06922, 2017.
|
| 274 |
+
Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in neural information processing systems, pp. 469–477, 2016.
|
| 275 |
+
Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. arXiv preprint arXiv:1703.00848, 2017.
|
| 276 |
+
D.S. Munteanu, A. Fraser, and D. Marcu. Improved machine translation performance via parallel sentence extraction from comparable corpora. In ACL, 2004.
|
| 277 |
+
H. Nakayama and N. Nishida. Zero-resource machine translation by multimodal encoder-decoder network with multimedia pivot. arXiv:1611.04503, 2017.
|
| 278 |
+
K. Papineni, S. Roukos, T. Ward, and W.J. Zhu. Bleu: a method for automatic evaluation of machine translation. In Annual Meeting on Association for Computational Linguistics, 2002.
|
| 279 |
+
N. Pourdamghani and K. Knight. Deciphering related languages. In EMNLP, 2017.
|
| 280 |
+
S. Ravi and K. Knight. Deciphering foreign language. In ACL, 2011.
|
| 281 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. arXiv preprint arXiv:1511.06709, 2015a.
|
| 282 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015b.
|
| 283 |
+
Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi Jaakkola. Style transfer from non-parallel text by cross-alignment. arXiv preprint arXiv:1705.09655, 2017.
|
| 284 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 285 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016.
|
| 286 |
+
T. Tieleman and G. Hinton. Lecture 6.5—RmsProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 287 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008.
|
| 288 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 289 |
+
Qizhe Xie, Zihang Dai, Yulun Du, Eduard Hovy, and Graham Neubig. Controllable invariance through adversarial feature learning. arXiv preprint arXiv:1705.11122, 2017.
|
| 290 |
+
H. Zheng, Y. Cheng, and Y. Liu. Maximum expected likelihood estimation for zero-resource neural machine translation. In IJCAI, 2017.
|
| 291 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017.
|
md/train/rkgOLb-0W/rkgOLb-0W.md
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURAL LANGUAGE MODELING BY JOINTLY LEARNING SYNTAX AND LEXICON
|
| 2 |
+
|
| 3 |
+
Yikang Shen, Zhouhan Lin, Chin-Wei Huang & Aaron Courville
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Operations Research
|
| 6 |
+
Universit de Montral
|
| 7 |
+
Montral, QC H3C3J7, Canada
|
| 8 |
+
{yi-kang.shen, zhouhan.lin, chin-wei.huang, aaron.courville}@umontreal.ca
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
We propose a neural language model capable of unsupervised syntactic structure induction. The model leverages the structure information to form better semantic representations and better language modeling. Standard recurrent neural networks are limited by their structure and fail to efficiently use syntactic information. On the other hand, tree-structured recursive networks usually require additional structural supervision at the cost of human expert annotation. In this paper, We propose a novel neural language model, called the Parsing-Reading-Predict Networks (PRPN), that can simultaneously induce the syntactic structure from unannotated sentences and leverage the inferred structure to learn a better language model. In our model, the gradient can be directly back-propagated from the language model loss into the neural parsing network. Experiments show that the proposed model can discover the underlying syntactic structure and achieve state-of-the-art performance on word/character-level language model tasks.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Linguistic theories generally regard natural language as consisting of two part: a lexicon, the complete set of all possible words in a language; and a syntax, the set of rules, principles, and processes that govern the structure of sentences (Sandra & Taft, 1994). To generate a proper sentence, tokens are put together with a specific syntactic structure. Understanding a sentence also requires lexical information to provide meanings, and syntactical knowledge to correctly combine meanings. Current neural language models can provide meaningful word represent (Bengio et al., 2003; Mikolov et al., 2013; Chen et al., 2013). However, standard recurrent neural networks only implicitly model syntax, thus fail to efficiently use structure information (Tai et al., 2015).
|
| 17 |
+
|
| 18 |
+
Developing a deep neural network that can leverage syntactic knowledge to form a better semantic representation has received a great deal of attention in recent years (Socher et al., 2013; Tai et al., 2015; Chung et al., 2016). Integrating syntactic structure into a language model is important for different reasons: 1) to obtain a hierarchical representation with increasing levels of abstraction, which is a key feature of deep neural networks and of the human brain (Bengio et al., 2009; LeCun et al., 2015; Schmidhuber, 2015); 2) to capture complex linguistic phenomena, like long-term dependency problem (Tai et al., 2015) and the compositional effects (Socher et al., 2013); 3) to provide shortcut for gradient back-propagation (Chung et al., 2016).
|
| 19 |
+
|
| 20 |
+
A syntactic parser is the most common source for structure information. Supervised parsers can achieve very high performance on well constructed sentences. Hence, parsers can provide accurate information about how to compose word semantics into sentence semantics (Socher et al., 2013), or how to generate the next word given previous words (Wu et al., 2017). However, only major languages have treebank data for training parsers, and it request expensive human expert annotation. People also tend to break language rules in many circumstances (such as writing a tweet). These defects limit the generalization capability of supervised parsers.
|
| 21 |
+
|
| 22 |
+
Unsupervised syntactic structure induction has been among the longstanding challenges of computational linguistic (Klein & Manning, 2002; 2004; Bod, 2006). Researchers are interested in this problem for a variety of reasons: to be able to parse languages for which no annotated treebanks exist (Marecek, 2016); to create a dependency structure to better suit a particular NLP application (Wu et al., 2017); to empirically argue for or against the poverty of the stimulus (Clark, 2001; Chomsky, 2014); and to examine cognitive issues in language learning (Solan et al., 2003).
|
| 23 |
+
|
| 24 |
+
In this paper, we propose a novel neural language model: Parsing-Reading-Predict Networks (PRPN), which can simultaneously induce the syntactic structure from unannotated sentences and leverage the inferred structure to form a better language model. With our model, we assume that language can be naturally represented as a tree-structured graph. The model is composed of three parts:
|
| 25 |
+
|
| 26 |
+
1. A differentiable neural Parsing Network uses a convolutional neural network to compute the syntactic distance, which represents the syntactic relationships between all successive pairs of words in a sentence, and then makes soft constituent decisions based on the syntactic distance.
|
| 27 |
+
2. A Reading Network that recurrently computes an adaptive memory representation to summarize information relevant to the current time step, based on all previous memories that are syntactically and directly related to the current token.
|
| 28 |
+
3. A Predict Network that predicts the next token based on all memories that are syntactically and directly related to the next token.
|
| 29 |
+
|
| 30 |
+
We evaluate our model on three tasks: word-level language modeling, character-level language modeling, and unsupervised constituency parsing. The proposed model achieves (or is close to) the state-of-the-art on both word-level and character-level language modeling. The model’s unsupervised parsing outperforms some strong baseline models, demonstrating that the structure found by our model is similar to the intrinsic structure provided by human experts.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
The idea of introducing some structures, especially trees, into language understanding to help a downstream task has been explored in various ways. For example, Socher et al. (2013); Tai et al. (2015) learn a bottom-up encoder, taking as an input a parse tree supplied from an external parser. There are models that are able to infer a tree during test time, while still need supervised signal on tree structure during training. For example, (Socher et al., 2010; Alvarez-Melis & Jaakkola, 2016; Zhou et al., 2017; Zhang et al., 2015), etc. Moreover, Williams et al. (2017) did an in-depth analysis of recursive models that are able to learn tree structure without being exposed to any grammar trees. Our model is also able to infer tree structure in an unsupervised setting, but different from theirs, it is a recurrent network that implicitly models tree structure through attention.
|
| 35 |
+
|
| 36 |
+
Apart from the approach of using recursive networks to capture structures, there is another line of research which try to learn recurrent features at multiple scales, which can be dated back to 1990s (e.g. El Hihi & Bengio (1996); Schmidhuber (1991); Lin et al. (1998)). The NARX RNN (Lin et al., 1998) is another example which used a feed forward net taking different inputs with predefined time delays to model long-term dependencies. More recently, Koutnik et al. (2014) also used multiple layers of recurrent networks with different pre-defined updating frequencies. Instead, our model tries to learn the structure from data, rather than predefining it. In that respect, Chung et al. (2016) relates to our model since it proposes a hierarchical multi-scale structure with binary gates controlling intralayer connections, and the gating mechanism is learned from data too. The difference is that their gating mechanism controls the updates of higher layers directly, while ours control it softly through an attention mechanism.
|
| 37 |
+
|
| 38 |
+
In terms of language modeling, syntactic language modeling can be dated back to Chelba (1997). Charniak (2001); Roark (2001) have also proposed language models with a top-down parsing mechanism. Recently Dyer et al. (2016); Kuncoro et al. (2016) have introduced neural networks into this space. It learns both a discriminative and a generative model with top-down parsing, trained with a supervision signal from parsed sentences in the corpus. There are also dependency-based approaches using neural networks, including Buys & Blunsom (2015); Emami & Jelinek (2005); Titov & Henderson (2010).
|
| 39 |
+
|
| 40 |
+
Parsers are also related to our work since they are all inferring grammatical tree structure given a sentence. For example, SPINN (Bowman et al., 2016) is a shift-reduce parser that uses an LSTM as its composition function. The transition classifier in SPINN is supervisedly trained on the Stanford PCFG Parser (Klein & Manning, 2003) output. Unsupervised parsers are more aligned with what our model is doing. Klein & Manning (2004) presented a generative model for the unsupervised learning of dependency structures. Klein & Manning (2002) is a generative distributional model for the unsupervised induction of natural language syntax which explicitly models constituent yields and contexts. We compare our parsing quality with the aforementioned two papers in Section 6.3.
|
| 41 |
+
|
| 42 |
+
# 3 MOTIVATION
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 1: Hard arrow represents syntactic tree structure and parent-to-child dependency relation, dash arrow represents dependency relation between siblings
|
| 46 |
+
|
| 47 |
+
Suppose we have a sequence of tokens $x _ { 0 } , . . . , x _ { 6 }$ governed by the tree structure showed in Figure 1. The leafs $x _ { i }$ are observed tokens. Node $y _ { i }$ represents the meaning of the constituent formed by its leaves $x _ { l ( y _ { i } ) } , . . . , x _ { r ( y _ { i } ) }$ , where $l ( \cdot )$ and $r ( \cdot )$ stands for the leftmost child and right most child. Root $r$ represents the meaning of the whole sequence. Arrows represent the dependency relations between nodes. The underlying assumption is that each node depends only on its parent and its left siblings.
|
| 48 |
+
|
| 49 |
+
Directly modeling the tree structure is a challenging task, usually requiring supervision to learn (Tai et al., 2015). In addition, relying on tree structures can result in a model that is not sufficiently robust to face ungrammatical sentences (Hashemi & Hwa, 2016). In contrast, recurrent models provide a convenient way to model sequential data, with the current hidden state only depends on the last hidden state. This makes models more robust when facing nonconforming sequential data, but it suffers from neglecting the real dependency relation that dominates the structure of natural language sentences.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 2: Proposed model architecture, hard line indicate valid connection in Reading Network, dash line indicate valid connection in Predict Network.
|
| 53 |
+
|
| 54 |
+
In this paper, we use skip-connection to integrate structured dependency relations with recurrent neural network. In other words, the current hidden state does not only depend on the last hidden state, but also on previous hidden states that have a direct syntactic relation to the current one.
|
| 55 |
+
|
| 56 |
+
Figure 2 shows the structure of our model. The non-leaf node $y _ { j }$ is represented by a set of hidden states $y _ { j } = \{ m _ { i } \} _ { l ( y _ { j } ) \leq i \leq r ( y _ { j } ) }$ , where $l ( y _ { j } )$ is the left most descendant leaf and $r ( y _ { j } )$ is the right most one. Arrows shows skip connections built by our model according to the latent structure. Skip connections are controlled by gates $g _ { i } ^ { t }$ . In order to define $g _ { i } ^ { t }$ , we introduce a latent variable $l _ { t }$ to represent local structural context of $x _ { t }$ :
|
| 57 |
+
|
| 58 |
+
• if $x _ { t }$ is not left most child of any subtree, then $l _ { t }$ is the position of $x _ { t }$ ’s left most sibling. • if $x _ { t }$ is the left most child of a subtree $y _ { i }$ , then $l _ { t }$ is the position of the left most child that belongs to the left most sibling of $y _ { i }$ .
|
| 59 |
+
|
| 60 |
+
and gates are defined as:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
g _ { i } ^ { t } = \left\{ { \begin{array} { l l } { 1 , } & { l _ { t } \leq i < t } \\ { 0 , } & { 0 < i < l _ { t } } \end{array} } \right.
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Given this architecture, the siblings dependency relation is modeled by at least one skip-connect. The skip connection will directly feed information forward, and pass gradient backward. The parentto-child relation will be implicitly modeled by skip-connect relation between nodes.
|
| 67 |
+
|
| 68 |
+
The model recurrently updates the hidden states according to:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
m _ { t } = h ( x _ { t } , m _ { 0 } , . . . , m _ { t - 1 } , g _ { 0 } ^ { t } , . . . , g _ { t - 1 } ^ { t } )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
and the probability distribution for next word is approximated by:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
p ( x _ { t + 1 } | x _ { 0 } , . . . , x _ { t } ) \approx p ( x _ { t + 1 } ; f ( m _ { 0 } , . . . , m _ { t } , g _ { 0 } ^ { t + 1 } , . . . , g _ { t } ^ { t + 1 } ) )
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $g _ { i } ^ { t }$ are gates that control skip-connections. Both $f$ and $h$ have a structured attention mechanism that takes $g _ { i } ^ { t }$ as input and forces the model to focus on the most related information. Since $l _ { t }$ is an unobserved latent variable, We explain an approximation for $g _ { i } ^ { t }$ in the next section. The structured attention mechanism is explained in section 5.1.
|
| 81 |
+
|
| 82 |
+
# 4 MODELING SYNTACTIC STRUCTURE
|
| 83 |
+
|
| 84 |
+
# 4.1 MODELING LOCAL STRUCTURE
|
| 85 |
+
|
| 86 |
+
In this section we give a probabilistic view on how to model the local structure of language. A detailed elaboration for this section is given in Appendix B. At time step $t$ , $p ( l _ { t } | x _ { 0 } , . . . , x _ { t } )$ represents the probability of choosing one out of $t$ possible local structures. We propose to model the distribution by the Stick-Breaking Process:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
p ( l _ { t } = i | x _ { 0 } , . . . , x _ { t } ) = ( 1 - \alpha _ { i } ^ { t } ) \prod _ { j = i + 1 } ^ { t - 1 } \alpha _ { j } ^ { t }
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
The formassigned, nderstood by noting that ais remaining probability, time step is the por $i + 1 , . . . , t - 1$ have their probabilitiesing probability that we $\textstyle \prod _ { j = i + 1 } ^ { t - 1 } \alpha _ { j } ^ { t }$ $1 - \alpha _ { i } ^ { t }$
|
| 93 |
+
assign to time step $i$ . Variable $\alpha _ { j } ^ { t }$ is parametrized in the next section.
|
| 94 |
+
|
| 95 |
+
As shown in Appendix B, the expectation of gate value $g _ { i } ^ { t }$ is the Cumulative Distribution Function (CDF) of $p ( l _ { t } = \bar { i } | x _ { 0 } , . . . , x _ { t } )$ . Thus, we can replace the discrete gate value by its expectation:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
g _ { i } ^ { t } = \mathbf { P } ( l _ { t } \leq i ) = \prod _ { j = i + 1 } ^ { t - 1 } \alpha _ { j } ^ { t }
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
With these relaxations, Eq.2 and 3 can be approximated by using a soft gating vector to update the hidden state and predict the next token.
|
| 102 |
+
|
| 103 |
+
# 4.2 PARSING NETWORK
|
| 104 |
+
|
| 105 |
+
Inferring tree structure with Syntactic Distance In Eq.4, $1 - \alpha _ { j } ^ { t }$ is the portion of the remaining probability that we assign to position $j$ . Because the stick-breaking process should assign high probability to $l _ { t }$ , which is the closest constituent-beginning word. The model should assign large $\bar { 1 } - \alpha _ { j } ^ { t }$ to words beginning new constituents. While $x _ { t }$ itself is a constituent-beginning word, the model should assign large $1 - \alpha _ { j } ^ { t }$ to words beginning larger constituents. In other words, the model will consider longer dependency relations for the first word in constituent. Given the sentence in Figure 1, at time step $t = 6$ , both $1 - \alpha _ { 2 } ^ { 6 }$ and $1 - \alpha _ { 0 } ^ { 6 }$ should be close to 1, and all other $1 - \alpha _ { j } ^ { 6 }$ should be close to 0.
|
| 106 |
+
|
| 107 |
+
In order to parametrize $\alpha _ { j } ^ { t }$ , our basic hypothesis is that words in the same constituent should have a closer syntactic relation within themselves, and that this syntactical proximity can be represented by a scalar value. From the tree structure point of view, the shortest path between leafs in same subtree is shorter than the one between leafs in different subtree.
|
| 108 |
+
|
| 109 |
+
To model syntactical proximity, we introduce a new feature Syntactic Distance. For a sentence with length $K$ , we define a set of $K$ real valued scalar variables $d _ { 0 } , . . . , d _ { K - 1 }$ , with $d _ { i }$ representing a measure of the syntactic relation between the pair of adjacent words $( x _ { i - 1 } , x _ { i } )$ . $x _ { - 1 }$ could be the last word in previous sentence or a padding token. For time step $t$ , we want to find the closest words $x _ { j }$ , that have larger syntactic distance than $d _ { t }$ . Thus $\alpha _ { j } ^ { t }$ can be defined as:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\alpha _ { j } ^ { t } = { \frac { \operatorname { h a r d t a n h } { ( ( d _ { t } - d _ { j } ) \cdot \tau ) } + 1 } { 2 } }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where hardt $\mathrm { \ u n h } ( x ) = \operatorname* { m a x } ( - 1 , \operatorname* { m i n } ( 1 , x ) )$ . $\tau$ is the temperature parameter that controls the sensitivity of $\alpha _ { j } ^ { t }$ to the differences between distances.
|
| 116 |
+
|
| 117 |
+
The Syntactic Distance has some nice properties that both allow us to infer a tree structure from it and be robust to intermediate non-valid tree structures that the model may encounter during learning. In Appendix $\textrm { C }$ and D we list these properties and further explain the meanings of their values.
|
| 118 |
+
|
| 119 |
+
Parameterizing Syntactic Distance Roark & Hollingshead (2008) shows that it’s possible to identify the beginning and ending words of a constituent using local information. In our model, the syntactic distance between a given token (which is usually represented as a vector word embedding $e _ { i }$ ) and its previous token $e _ { i - 1 }$ , is provided by a convolutional kernel over a set of consecutive previous tokens $e _ { i - L } , e _ { i - L + 1 } , . . . , e _ { i }$ . This convolution is depicted as the gray triangles shown in Figure 3. Each triangle here represent 2 layers of convolution. Formally, the syntactic distance $d _ { i }$ between token $e _ { i - 1 }$ and $e _ { i }$ is computed by
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
h _ { i } = \mathrm { R e L U } ( W _ { c } \left[ \begin{array} { c } { e _ { i - L } } \\ { e _ { i - L + 1 } } \\ { \cdots } \\ { e _ { i } } \end{array} \right] + b _ { c } )
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
d _ { i } = \mathrm { R e L U } \left( W _ { d } h _ { i } + b _ { d } \right)
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $W _ { c }$ , $b _ { c }$ are the kernel parameters. $W _ { d }$ and $b _ { d }$ can be seen as another convolutional kernel with window size 1, convolved over $h _ { i }$ ’s. Here the kernel window size $L$ determines how far back into the history node $e _ { i }$ can reach while computing its syntactic distance $d _ { i }$ . Thus we call it the look-back range.
|
| 130 |
+
|
| 131 |
+
Convolving $^ { h }$ and $^ d$ on the whole sequence with length $K$ yields a set of distances. For the tokens in the beginning of the sequence, we simply pad $L - 1$ zero vectors to the front of the sequence in order to get $K - 1$ outputs.
|
| 132 |
+
|
| 133 |
+
# 5 MODELING LANGUAGE
|
| 134 |
+
|
| 135 |
+
# 5.1 READING NETWORK
|
| 136 |
+
|
| 137 |
+
The Reading Network generate new states $m _ { t }$ considering on input $x _ { t }$ , previous memory states $m _ { 0 } , . . . , m _ { t - 1 }$ , and gates $( g _ { 0 } ^ { t } , . . . , g _ { t - 1 } ^ { t }$ , as shown in Eq.2.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Convolutional network for computing syntactic distance. Gray triangles represent 2 layers of convolution, $d _ { 0 }$ to $d _ { 7 }$ are the syntactic distance output by each of the kernel position. The blue bars indicate the amplitude of $d _ { i }$ ’s, and $y _ { i }$ ’s are the inferred constituents.
|
| 141 |
+
|
| 142 |
+
Similar to Long Short-Term Memory-Network (LSTMN) (Cheng et al., 2016), the Reading Network maintains the memory states by maintaining two sets of vectors: a hidden tape $H _ { t - 1 } ~ =$ $\left( { { h } _ { t - { N } _ { m } } } , . . . , { { h } _ { t - 1 } } \right)$ , and a memory tape $C _ { t - 1 } = ( c _ { t - L } , . . . , c _ { t - 1 } )$ , where $N _ { m }$ is the upper bound for the memory span. Hidden states $m _ { i }$ is now represented by a tuple of two vectors $( \bar { h } _ { i } , c _ { i } )$ . The Reading Network captures the dependency relation by a modified attention mechanism: structured attention. At each step of recurrence, the model summarizes the previous recurrent states via the structured attention mechanism, then performs a normal LSTM update, with hidden and cell states output by the attention mechanism.
|
| 143 |
+
|
| 144 |
+
Structured Attention At each time step $t$ , the read operation attentively links the current token to previous memories with a structured attention layer:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\begin{array} { r l } & { k _ { t } = W _ { h } h _ { t - 1 } + W _ { x } x _ { t } } \\ & { } \\ & { \tilde { s } _ { i } ^ { t } = \mathrm { s o f t m a x } ( \frac { h _ { i } k _ { t } ^ { \mathrm { T } } } { \sqrt { \delta _ { k } } } ) } \end{array}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
where, $\delta _ { k }$ is the dimension of the hidden state. Modulated by the gates in Eq.5, the structured intra-attention weight is defined as:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
s _ { i } ^ { t } = \frac { g _ { i } ^ { t } \tilde { s } _ { i } ^ { t } } { \sum _ { i } g _ { i } ^ { t } }
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
This yields a probability distribution over the hidden state vectors of previous tokens. We can then compute an adaptive summary vector for the previous hidden tape and memory denoting by $\tilde { h } _ { t }$ and $\tilde { c } _ { t }$ :
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\left[ \tilde { h } _ { t } \right] = \sum _ { i = 1 } ^ { t - 1 } s _ { i } ^ { t } \cdot m _ { i } = \sum _ { i = 1 } ^ { t - 1 } s _ { i } ^ { t } \cdot \left[ h _ { i } \right]
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
Structured attention provides a way to model the dependency relations shown in Figure 1.
|
| 163 |
+
|
| 164 |
+
Recurrent Update The Reading Network takes $x _ { t }$ , ${ \tilde { c } } _ { t }$ and $\tilde { h } _ { t }$ as input, computes the values of $c _ { t }$ and $h _ { t }$ by the LSTM recurrent update (Hochreiter & Schmidhuber, 1997). Then the write operation concatenates $h _ { t }$ and $c _ { t }$ to the end of hidden and memory tape.
|
| 165 |
+
|
| 166 |
+
# 5.2 PREDICT NETWORK
|
| 167 |
+
|
| 168 |
+
Predict Network models the probability distribution of next word $x _ { t + 1 }$ , considering on hidden states $m _ { 0 } , . . . , m _ { t }$ , and gates $g _ { 0 } ^ { t + 1 } , . . . , g _ { t } ^ { t + 1 }$ gt+1t . Note that, at time step t, the model cannot observe xt+1 , a temporary estimation of $d _ { t + 1 }$ is computed considering on $x _ { t - L } , . . . , x _ { t }$ :
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
d _ { t + 1 } ^ { \prime } = \mathrm { R e L U } ( W _ { d } ^ { \prime } h _ { t } + b _ { d } ^ { \prime } )
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
From there we compute its corresponding $\{ \alpha ^ { t + 1 } \}$ and $\{ g _ { i } ^ { t + 1 } \}$ for Eq.3. We parametrize $f ( \cdot )$ function as:
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
f ( m _ { 0 } , . . . , m _ { t } , g _ { 0 } ^ { t + 1 } , . . . , g _ { t } ^ { t + 1 } ) = \hat { f } ( [ h _ { l : t - 1 } , h _ { t } ] )
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Syntactic distance estimated by Parsing Network. The model is trained on PTB dataset at the character level. Each blue bar is positioned between two characters, and represents the syntactic distance between them. From these distances we can infer a tree structure according to Section 4.2.
|
| 182 |
+
|
| 183 |
+
where $h _ { l : t - 1 }$ is an adaptive summary of $h _ { l _ { t + 1 } \leq i \leq t - 1 }$ , output by structured attention controlled by $g _ { 0 } ^ { t + 1 } , . . . , g _ { t - 1 } ^ { t + 1 }$ . ${ \hat { f } } ( \cdot )$ could be a simple feed-forward MLP, or more complex architecture, like ResNet, to add more depth to the model.
|
| 184 |
+
|
| 185 |
+
# 6 EXPERIMENTS
|
| 186 |
+
|
| 187 |
+
We evaluate the proposed model on three tasks, character-level language modeling, word-level language modeling, and unsupervised constituency parsing.
|
| 188 |
+
|
| 189 |
+
# 6.1 CHARACTER-LEVEL LANGUAGE MODEL
|
| 190 |
+
|
| 191 |
+
From a character-level view, natural language is a discrete sequence of data, where discrete symbols form a distinct and shallow tree structure: the sentence is the root, words are children of the root, and characters are leafs. However, compared to word-level language modeling, character-level language modeling requires the model to handle longer-term dependencies. We evaluate a character-level variant of our proposed language model over a preprocessed version of the Penn Treebank (PTB) and Text8 datasets.
|
| 192 |
+
|
| 193 |
+
When training, we use truncated back-propagation, and feed the final memory position from the previous batch as the initial memory of next one. At the beginning of training and test time, the model initial hidden states are filled with zero. Optimization is performed with Adam using learning rate $l r = 0 . 0 0 3$ , weight decay $w _ { d e c a y } = 1 0 ^ { - 6 }$ , $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ and $\sigma = 1 0 ^ { - 8 }$ . We carry out gradient clipping with maximum norm 1.0. The learning rate is multiplied by 0.1 whenever validation performance does not improve during 2 checkpoints. These checkpoints are performed at the end of each epoch. We also apply layer normalization (Ba et al., 2016) to the Reading Network and batch normalization to the Predict Network and parsing network. For all of the character-level language modeling experiments, we apply the same procedure, varying only the number of hidden units, mini-batch size and dropout rate.
|
| 194 |
+
|
| 195 |
+
Penn Treebank we process the Penn Treebank dataset (Marcus et al., 1993) by following the procedure introduced in (Mikolov et al., 2012). For character-level PTB, Reading Network has two recurrent layers, Predict Network has one residual block. Hidden state size is 1024 units. The input and output embedding size are 128, and not shared. Look-back range $L = 1 0$ , temperature parameter $\tau = 1 0$ , upper band of memory span $N _ { m } = 2 0$ . We use a batch size of 64, truncated backpropagation with 100 timesteps. The values used of dropout on input/output embeddings, between recurrent layers, and on recurrent states were $( 0 , 0 . 2 5 , 0 . 1 )$ respectively.
|
| 196 |
+
|
| 197 |
+
In Figure 4, we visualize the syntactic distance estimated by the Parsing Network, while reading three different sequences from the PTB test set. We observe that the syntactic distance tends to be higher between the last character of a word and a space, which is a reasonable breakpoint to separate between words. In other words, if the model sees a space, it will attend on all previous step. If the model sees a letter, it will attend no further then the last space step. The model autonomously discovered to avoid inter-word attention connection, and use the hidden states of space (separator) tokens to summarize previous information. This is strong proof that the model can understand the latent structure of data. As a result our model achieve state-of-the-art performance and significantly outperform baseline models. It is worth noting that HM-LSTM (Chung et al., 2016) also unsupervisedly induce similar structure from data. But discrete operations in HM-LSTM make their training procedure more complicated then ours.
|
| 198 |
+
|
| 199 |
+
Table 1: BPC on the Penn Treebank test set
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Model</td><td>BPC</td></tr><tr><td>Norm-stabilized RNN(Krueger& Memisevic,2015)</td><td>1.48</td></tr><tr><td>CW-RNN (Koutnik et al., 2014)</td><td>1.46</td></tr><tr><td>HF-MRNN (Mikolov et al., 2012)</td><td>1.41</td></tr><tr><td>MI-RNN (Wu et al., 2016)</td><td>1.39</td></tr><tr><td>ME n-gram (Mikolov et al., 2012)</td><td>1.37</td></tr><tr><td>BatchNorm LSTM (Cooijmans et al.,2016)</td><td>1.32</td></tr><tr><td>Zoneout RNN (Krueger et al., 2016)</td><td>1.27</td></tr><tr><td>HyperNetworks (Ha et al., 2016)</td><td>1.27</td></tr><tr><td>LayerNorm HM-LSTM (Chung et al., 2016)</td><td>1.24</td></tr><tr><td>LayerNorm HyperNetworks (Ha et al., 2016)</td><td>1.23</td></tr><tr><td>PRPN</td><td>1.202</td></tr></table>
|
| 202 |
+
|
| 203 |
+
# 6.2 WORD-LEVEL LANGUAGE MODEL
|
| 204 |
+
|
| 205 |
+
Comparing to character-level language modeling, word-level language modeling needs to deal with complex syntactic structure and various linguistic phenomena. But it has less long-term dependencies. We evaluate the word-level variant of our language model on a preprocessed version of the Penn Treebank (PTB) (Marcus et al., 1993) and Text8 (Mahoney, 2011) dataset.
|
| 206 |
+
|
| 207 |
+
We apply the same procedure and hyper-parameters as in character-level language model. Except optimization is performed with Adam with $\beta _ { 1 } = 0$ . This turns off the exponential moving average for estimates of the means of the gradients (Melis et al., 2017). We also adapt the number of hidden units, mini-batch size and the dropout rate according to the different tasks.
|
| 208 |
+
|
| 209 |
+
Penn Treebank we process the Penn Treebank dataset (Mikolov et al., 2012) by following the procedure introduced in (Mikolov et al., 2010). For word-level PTB, the Reading Network has two recurrent layers and the Predict Network do not have residual block. The hidden state size is 1200 units and the input and output embedding sizes are 800, and shared (Inan et al., 2016; Press & Wolf, 2017). Look-back range $L = 5$ , temperature parameter $\tau = 1 0$ and the upper band of memory span $N _ { m } = 1 5$ . We use a batch size of 64, truncated back-propagation with 35 time-steps. The values used of dropout on input/output embeddings, between recurrent layers, and on recurrent states were (0.7, 0.5, 0.5) respectively.
|
| 210 |
+
|
| 211 |
+
Table 2: PPL on the Penn Treebank test set
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Model</td><td>PPL</td></tr><tr><td>RNN-LDA + KN-5 + cache (Mikolov & Zweig, 2012)</td><td>92.0</td></tr><tr><td>LSTM (Zaremba et al., 2014)</td><td>78.4</td></tr><tr><td>Variational LSTM (Kim et al., 2016)</td><td>78.9</td></tr><tr><td>CharCNN (Kim et al., 2016)</td><td>78.9</td></tr><tr><td>Pointer Sentinel-LSTM (Merity et al.,2016)</td><td>70.9</td></tr><tr><td>LSTM + continuous cache pointer (Grave et al., 2016)</td><td>72.1</td></tr><tr><td>Variational LSTM (tied) + augmented loss (Inan et al.,2016)</td><td>68.5</td></tr><tr><td>Variational RHN (tied) (Zilly et al., 2016)</td><td>65.4</td></tr><tr><td>NAS Cell (tied) (Zoph & Le, 2016)</td><td>62.4</td></tr><tr><td>4-layer skip connection LSTM (tied) (Melis et al., 2017)</td><td>58.3</td></tr><tr><td>PRPN</td><td>61.98</td></tr></table>
|
| 214 |
+
|
| 215 |
+
Table 3: Ablation test on the Penn Treebank. “- Parsing Net” means that we remove Parsing Network and replace Structured Attention with normal attention mechanism; “- Reading Net Attention” means that we remove Structured Attention from Reading Network, that is equivalent to replace Reading Network with a normal 2-layer LSTM; “- Predict Net Attention” means that we remove Structured Attention from Predict Network, that is equivalent to have a standard projection layer; “Our 2-layer LSTM” is equivalent to remove Parsing Network and remove Structured Attention from both Reading and Predict Network.
|
| 216 |
+
|
| 217 |
+
<table><tr><td>Model</td><td>PPL</td></tr><tr><td>PRPN</td><td>61.98</td></tr><tr><td>- Parsing Net</td><td>64.42</td></tr><tr><td>- Reading Net Attention</td><td>64.63</td></tr><tr><td>- Predict Net Attention</td><td>63.65</td></tr><tr><td>Our 2-layer LSTM</td><td>65.81</td></tr></table>
|
| 218 |
+
|
| 219 |
+
Text8 dataset contains 17M training tokens and has a vocabulary size of 44k words. The dataset is partitioned into a training set (first 99M characters) and a development set (last 1M characters) that is used to report performance. As this dataset contains various articles from Wikipedia, the longer term information (such as current topic) plays a bigger role than in the PTB experiments (Mikolov et al., 2014). We apply the same procedure and hyper-parameters as in character-level PTB, except we use a batch size of 128. The values used of dropout on input/output embeddings, between Recurrent Layers and on recurrent states were (0.4, 0.2, 0.2) respectively.
|
| 220 |
+
|
| 221 |
+
Table 4: PPL on the Text8 valid set
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Model</td><td>PPL</td></tr><tr><td>LSTM-500 (Mikolov et al., 2014)</td><td>156</td></tr><tr><td>SCRNN (Mikolov et al., 2014)</td><td>161</td></tr><tr><td>MemNN (Sukhbaatar et al., 2015)</td><td>147</td></tr><tr><td>LSTM-1024 (Grave et al., 2016)</td><td>121</td></tr><tr><td>LSTM + continuous cache pointer (Grave et al., 2016)</td><td>99.9</td></tr><tr><td>PRPN</td><td>81.64</td></tr></table>
|
| 224 |
+
|
| 225 |
+
In Table 2, our results are comparable to the state-of-the-art methods. Since we do not have the same computational resource used in (Melis et al., 2017) to tune hyper-parameters at large scale, we expect that our model could achieve better performance after an aggressive hyperparameter tuning process. As shown in Table 4, our method outperform baseline methods. It is worth noticing that the continuous cache pointer can also be applied to output of our Predict Network without modification. Visualizations of tree structure generated from learned PTB language model are included in Appendix A. In Table 3, we show the value of test perplexity for different variants of PRPN, each variant remove part of the model. By removing Parsing Network, we observe a significant drop of performance. This stands as empirical evidence regarding the benefit of having structure information to control attention.
|
| 226 |
+
|
| 227 |
+
# 6.3 UNSUPERVISED CONSTITUENCY PARSING
|
| 228 |
+
|
| 229 |
+
The unsupervised constituency parsing task compares hte tree structure inferred by the model with those annotated by human experts. The experiment is performed on WSJ10 dataset. WSJ10 is the 7422 sentences in the Penn Treebank Wall Street Journal section which contained 10 words or less after the removal of punctuation and null elements. Evaluation was done by seeing whether proposed constituent spans are also in the Treebank parse, measuring unlabeled F1 $\mathrm { ( U F _ { 1 } ) }$ ) of unlabeled constituent precision and recall. Constituents which could not be gotten wrong (those of span one and those spanning entire sentences) were discarded. Given the mechanism discussed in Section 4.2, our model generates a binary tree. Although standard constituency parsing tree is not limited to binary tree. Previous unsupervised constituency parsing model also generate binary trees (Klein & Manning, 2002; Bod, 2006). Our model is compared with the several baseline methods, that are explained in Appendix E.
|
| 230 |
+
|
| 231 |
+
Different from the previous experiment setting, the model treat each sentence independently during train and test time. When training, we feed one batch of sentences at each iteration. In a batch, shorter sentences are padded with 0. At the beginning of the iteration, the model’s initial hidden states are filled with zero. When testing, we feed on sentence one by one to the model, then use the gate value output by the model to recursively combine tokens into constituents, as described in Appendix A.
|
| 232 |
+
|
| 233 |
+
Table 5: Parsing Performance on the WSJ10 dataset
|
| 234 |
+
|
| 235 |
+
<table><tr><td>Model</td><td>UF1</td></tr><tr><td>LBRANCH RANDOM</td><td>28.7</td></tr><tr><td>DEP-PCFG (Carroll & Charniak,1992)</td><td>34.7</td></tr><tr><td>RBRANCH</td><td>48.2</td></tr><tr><td>CCM (Klein & Manning,2002)</td><td>61.7</td></tr><tr><td>DMV+CCM (Klein & Manning, 2005)</td><td>71.9</td></tr><tr><td>UML-DOP (Bod, 2006)</td><td>77.6</td></tr><tr><td>PRPN</td><td>82.9</td></tr><tr><td>UPPERBOUND</td><td>70.02 88.1</td></tr></table>
|
| 236 |
+
|
| 237 |
+
Table 5 summarizes the results. Our model significantly outperform the RANDOM baseline indicate a high consistency with human annotation. Our model also shows a comparable performance with CCM model. In fact our parsing network and CCM both focus on the relation between successive tokens. As described in Section 4.2, our model computes syntactic distance between all successive pair of tokens, then our parsing algorithm recursively assemble tokens into constituents according to the learned distance. CCM also recursively model the probability whether a contiguous subsequences of a sentence is a constituent. Thus, one can understand how our model is outperformed by $\mathrm { D M V + C C M }$ and UML-DOP models. The $\mathrm { D M V + C C M }$ model has extra information from a dependency parser. The UML-DOP approach captures both contiguous and non-contiguous lexical dependencies (Bod, 2006).
|
| 238 |
+
|
| 239 |
+
# 7 CONCLUSION
|
| 240 |
+
|
| 241 |
+
In this paper, we propose a novel neural language model that can simultaneously induce the syntactic structure from unannotated sentences and leverage the inferred structure to learn a better language model. We introduce a new neural parsing network: Parsing-Reading-Predict Network, that can make differentiable parsing decisions. We use a new structured attention mechanism to control skip connections in a recurrent neural network. Hence induced syntactic structure information can be used to improve the model’s performance. Via this mechanism, the gradient can be directly backpropagated from the language model loss function into the neural Parsing Network. The proposed model achieve (or is close to) the state-of-the-art on both word/character-level language modeling tasks. Experiment also shows that the inferred syntactic structure highly correlated to human expert annotation.
|
| 242 |
+
|
| 243 |
+
# ACKNOWLEDGEMENT
|
| 244 |
+
|
| 245 |
+
The authors would like to thank Timothy J. O’Donnell and Chris Dyer for the helpful discussions.
|
| 246 |
+
|
| 247 |
+
# REFERENCES
|
| 248 |
+
|
| 249 |
+
David Alvarez-Melis and Tommi S Jaakkola. Tree-structured decoding with doubly-recurrent neural networks. 2016.
|
| 250 |
+
|
| 251 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 252 |
+
|
| 253 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic ´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 254 |
+
|
| 255 |
+
Yoshua Bengio et al. Learning deep architectures for ai. Foundations and trends $\textsuperscript { \textregistered }$ in Machine Learning, 2(1):1–127, 2009.
|
| 256 |
+
|
| 257 |
+
Rens Bod. An all-subtrees approach to unsupervised parsing. In Proceedings of the 21st International Conference on Computational Linguistics and the 44th annual meeting of the Association for Computational Linguistics, pp. 865–872. Association for Computational Linguistics, 2006.
|
| 258 |
+
|
| 259 |
+
Samuel R Bowman, Jon Gauthier, Abhinav Rastogi, Raghav Gupta, Christopher D Manning, and Christopher Potts. A fast unified model for parsing and sentence understanding. arXiv preprint arXiv:1603.06021, 2016.
|
| 260 |
+
|
| 261 |
+
Jan Buys and Phil Blunsom. Generative incremental dependency parsing with neural networks. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), volume 2, pp. 863–869, 2015.
|
| 262 |
+
|
| 263 |
+
Glenn Carroll and Eugene Charniak. Two experiments on learning probabilistic dependency grammars from corpora. Department of Computer Science, Univ., 1992.
|
| 264 |
+
|
| 265 |
+
Eugene Charniak. Immediate-head parsing for language models. In Proceedings of the 39th Annual Meeting on Association for Computational Linguistics, pp. 124–131. Association for Computational Linguistics, 2001.
|
| 266 |
+
|
| 267 |
+
Ciprian Chelba. A structured language model. In Proceedings of the eighth conference on European chapter of the Association for Computational Linguistics, pp. 498–500. Association for Computational Linguistics, 1997.
|
| 268 |
+
|
| 269 |
+
Yanqing Chen, Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. The expressive power of word embeddings. arXiv preprint arXiv:1301.3226, 2013.
|
| 270 |
+
|
| 271 |
+
Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016.
|
| 272 |
+
|
| 273 |
+
Noam Chomsky. Aspects of the Theory of Syntax, volume 11. MIT press, 2014.
|
| 274 |
+
|
| 275 |
+
Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural net works. arXiv preprint arXiv:1609.01704, 2016.
|
| 276 |
+
|
| 277 |
+
Alexander Clark. Unsupervised induction of stochastic context-free grammars using distributional clustering. In Proceedings of the 2001 workshop on Computational Natural Language LearningVolume 7, pp. 13. Association for Computational Linguistics, 2001.
|
| 278 |
+
|
| 279 |
+
Tim Cooijmans, Nicolas Ballas, Cesar Laurent, C¸ a ´ glar G ˘ ulc¸ehre, and Aaron Courville. Recurrent ¨ batch normalization. arXiv preprint arXiv:1603.09025, 2016.
|
| 280 |
+
|
| 281 |
+
Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A Smith. Recurrent neural network grammars. arXiv preprint arXiv:1602.07776, 2016.
|
| 282 |
+
|
| 283 |
+
Salah El Hihi and Yoshua Bengio. Hierarchical recurrent neural networks for long-term dependencies. 1996. URL http://www.iro.umontreal.ca/˜lisa/pointeurs/elhihi_ bengio_96.pdf.
|
| 284 |
+
|
| 285 |
+
Ahmad Emami and Frederick Jelinek. A neural syntactic language model. Machine learning, 60 (1-3):195–227, 2005.
|
| 286 |
+
|
| 287 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. arXiv preprint arXiv:1612.04426, 2016.
|
| 288 |
+
|
| 289 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 290 |
+
|
| 291 |
+
Homa B Hashemi and Rebecca Hwa. An evaluation of parser robustness for ungrammatical sentences. In EMNLP, pp. 1765–1774, 2016.
|
| 292 |
+
|
| 293 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 294 |
+
|
| 295 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. arXiv preprint arXiv:1611.01462, 2016.
|
| 296 |
+
|
| 297 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. Character-aware neural language models. In AAAI, pp. 2741–2749, 2016.
|
| 298 |
+
|
| 299 |
+
Dan Klein and Christopher D Manning. A generative constituent-context model for improved grammar induction. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, pp. 128–135. Association for Computational Linguistics, 2002.
|
| 300 |
+
|
| 301 |
+
Dan Klein and Christopher D. Manning. Accurate unlexicalized parsing. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics - Volume 1, ACL ’03, pp. 423–430, Stroudsburg, PA, USA, 2003. Association for Computational Linguistics. doi: 10.3115/1075096. 1075150. URL https://doi.org/10.3115/1075096.1075150.
|
| 302 |
+
|
| 303 |
+
Dan Klein and Christopher D Manning. Corpus-based induction of syntactic structure: Models of dependency and constituency. In Proceedings of the 42nd Annual Meeting on Association for Computational Linguistics, pp. 478. Association for Computational Linguistics, 2004.
|
| 304 |
+
|
| 305 |
+
Dan Klein and Christopher D Manning. Natural language grammar induction with a generative constituent-context model. Pattern recognition, 38(9):1407–1419, 2005.
|
| 306 |
+
|
| 307 |
+
Jan Koutnik, Klaus Greff, Faustino Gomez, and Juergen Schmidhuber. A clockwork rnn. In International Conference on Machine Learning, pp. 1863–1871, 2014.
|
| 308 |
+
|
| 309 |
+
David Krueger and Roland Memisevic. Regularizing rnns by stabilizing activations. arXiv preprint arXiv:1511.08400, 2015.
|
| 310 |
+
|
| 311 |
+
David Krueger, Tegan Maharaj, Janos Kram ´ ar, Mohammad Pezeshki, Nicolas Ballas, Nan Rose- ´ mary Ke, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, Aaron Courville, et al. Zoneout: Regularizing rnns by randomly preserving hidden activations. arXiv preprint arXiv:1606.01305, 2016.
|
| 312 |
+
|
| 313 |
+
Adhiguna Kuncoro, Miguel Ballesteros, Lingpeng Kong, Chris Dyer, Graham Neubig, and Noah A Smith. What do recurrent neural network grammars learn about syntax? arXiv preprint arXiv:1611.05774, 2016.
|
| 314 |
+
|
| 315 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 316 |
+
|
| 317 |
+
Tsungnan Lin, Bill G Horne, Peter Tino, and C Lee Giles. Learning long-term dependencies is not as difficult with narx recurrent neural networks. Technical report, 1998.
|
| 318 |
+
|
| 319 |
+
Matt Mahoney. Large text compression benchmark, 2011.
|
| 320 |
+
|
| 321 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 322 |
+
|
| 323 |
+
David Marecek. Twelve years of unsupervised dependency parsing. In ITAT, pp. 56–62, 2016.
|
| 324 |
+
|
| 325 |
+
Gabor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language ´ models. arXiv preprint arXiv:1707.05589, 2017.
|
| 326 |
+
|
| 327 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 328 |
+
|
| 329 |
+
Tomas Mikolov and Geoffrey Zweig. Context dependent recurrent neural network language model. SLT, 12:234–239, 2012.
|
| 330 |
+
|
| 331 |
+
Tomas Mikolov, Martin Karafiat, Lukas Burget, Jan Cernock ´ y, and Sanjeev Khudanpur. Recurrent\` neural network based language model. In Interspeech, volume 2, pp. 3, 2010.
|
| 332 |
+
|
| 333 |
+
Toma´s Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Stefan Kombrink, and Jan Cer- ˇ nocky. Subword language modeling with neural networks. preprint (http://www. fit. vutbr. cz/imikolov/rnnlm/char. pdf), 2012.
|
| 334 |
+
|
| 335 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
|
| 336 |
+
|
| 337 |
+
Tomas Mikolov, Armand Joulin, Sumit Chopra, Michael Mathieu, and Marc’Aurelio Ranzato. Learning longer memory in recurrent neural networks. arXiv preprint arXiv:1412.7753, 2014.
|
| 338 |
+
|
| 339 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 157–163. Association for Computational Linguistics, 2017. URL http://www.aclweb.org/anthology/E17-2025.
|
| 340 |
+
|
| 341 |
+
Brian Roark. Probabilistic top-down parsing and language modeling. Computational linguistics, 27 (2):249–276, 2001.
|
| 342 |
+
|
| 343 |
+
Brian Roark and Kristy Hollingshead. Classifying chart cells for quadratic complexity context-free inference. In Proceedings of the 22nd International Conference on Computational LinguisticsVolume 1, pp. 745–751. Association for Computational Linguistics, 2008.
|
| 344 |
+
|
| 345 |
+
Dominiek Sandra and Marcus Taft. Morphological structure, lexical representation and lexical access. Taylor & Francis, 1994.
|
| 346 |
+
|
| 347 |
+
Jurgen Schmidhuber. Deep learning in neural networks: An overview. ¨ Neural networks, 61:85–117, 2015.
|
| 348 |
+
|
| 349 |
+
Jrgen Schmidhuber. Neural sequence chunkers. Technical report, 1991.
|
| 350 |
+
|
| 351 |
+
Richard Socher, Christopher D Manning, and Andrew Y Ng. Learning continuous phrase representations and syntactic parsing with recursive neural networks. In Proceedings of the NIPS-2010 Deep Learning and Unsupervised Feature Learning Workshop, pp. 1–9, 2010.
|
| 352 |
+
|
| 353 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013.
|
| 354 |
+
|
| 355 |
+
Zach Solan, Eytan Ruppin, David Horn, and Shimon Edelman. Automatic acquisition and efficient representation of syntactic structures. In Advances in Neural Information Processing Systems, pp. 107–114, 2003.
|
| 356 |
+
|
| 357 |
+
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in neural information processing systems, pp. 2440–2448, 2015.
|
| 358 |
+
|
| 359 |
+
Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
|
| 360 |
+
|
| 361 |
+
Ivan Titov and James Henderson. A latent variable model for generative dependency parsing. In Trends in Parsing Technology, pp. 35–55. Springer, 2010.
|
| 362 |
+
|
| 363 |
+
Adina Williams, Andrew Drozdov, and Samuel R Bowman. Learning to parse from a semantic objective: It works. is it syntax? arXiv preprint arXiv:1709.01121, 2017.
|
| 364 |
+
|
| 365 |
+
Shuangzhi Wu, Dongdong Zhang, Nan Yang, Mu Li, and Ming Zhou. Sequence-to-dependency neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 698–707, 2017.
|
| 366 |
+
|
| 367 |
+
Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan R Salakhutdinov. On multiplicative integration with recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 2856–2864, 2016.
|
| 368 |
+
|
| 369 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 370 |
+
|
| 371 |
+
Xingxing Zhang, Liang Lu, and Mirella Lapata. Top-down tree long short-term memory networks. arXiv preprint arXiv:1511.00060, 2015.
|
| 372 |
+
|
| 373 |
+
Ganbin Zhou, Ping Luo, Rongyu Cao, Yijun Xiao, Fen Lin, Bo Chen, and Qing He. Generative neural machine for tree structures. arXiv preprint arXiv:1705.00321, 2017.
|
| 374 |
+
|
| 375 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ highway networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 376 |
+
|
| 377 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 378 |
+
|
| 379 |
+
# APPENDIX
|
| 380 |
+
|
| 381 |
+
A INFERRED TREE STRUCTURE
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 5: Syntactic structures of two different sentences inferred from $\{ d _ { i } \}$ given by Parsing Network.
|
| 385 |
+
|
| 386 |
+
The tree structure is inferred from the syntactic distances yielded by the Parsing Network. We first sort the $d _ { i }$ ’s in decreasing order. For the first $d _ { i }$ in the sorted sequence, we separate sentence into constituents $( ( x _ { < i } ) , ( x _ { i } , \bar { ( } x _ { > i } ) ) )$ . Then we separately repeat this operation for constituents $( x _ { < i } )$ and $( x _ { > i } )$ . Until the constituent contains only one word.
|
| 387 |
+
|
| 388 |
+
# B MODELING LOCAL STRUCTURE
|
| 389 |
+
|
| 390 |
+
In this section we give a probabilistic view on how to model the local structure of language. Given the nature of language, sparse connectivity can be enforced as a prior on how to improve generalization and interpretability of the model.
|
| 391 |
+
|
| 392 |
+
At time step $t$ , $p ( l _ { t } | x _ { 0 } , . . . , x _ { t } )$ represents the probability of choosing one out of $t$ possible local structures that defines the conditional dependencies. If ${ { l } _ { t } } \mathrm { ~ = ~ } t ^ { \prime }$ , it means $x _ { t }$ depends on all the previous hidden state from $m _ { t ^ { \prime } }$ to $m _ { t }$ $\left( t ^ { \prime } \leq t \right)$ .
|
| 393 |
+
|
| 394 |
+
A particularly flexible option for modeling $p ( l _ { t } | x _ { 0 } , . . . , x _ { t } )$ is the Dirichlet Process, since being nonparametric allows us to attend on as many words as there are in a sentence; i.e. number of possible structures (mixture components) grows with the length of the sentence. As a result, we can write the probability of $l _ { t + 1 } = t ^ { \prime }$ as a consequence of the stick breaking process 1:
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
p ( l _ { t } = t ^ { \prime } | x _ { 0 } , . . . , x _ { t } ) = ( 1 - \alpha _ { t ^ { \prime } } ^ { t } ) \prod _ { j = t ^ { \prime } + 1 } ^ { t - 1 } \alpha _ { j } ^ { t }
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
for $1 \leq t ^ { \prime } < t - 1$ , and
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
p ( l _ { t } = t - 1 | x _ { 0 } , . . . , x _ { t } ) = ( 1 - \alpha _ { t - 1 } ^ { t } ) ; \qquad p ( l _ { t } = 0 | x _ { 0 } , . . . , x _ { t } ) = \prod _ { j = 1 } ^ { t - 1 } \alpha _ { j } ^ { t }
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
where $\alpha _ { j } \ = \ 1 - \beta _ { j }$ and $\beta _ { j }$ is a sample from a Beta distribution. Once we sample $l _ { t }$ from the process, the connectivity is realized by a element-wise multiplication of an attention weight vector with a masking vector $g _ { t }$ defined in Eq. 1. In this way, $x _ { t }$ becomes functionally independent of all $x _ { s }$ for all $s < l _ { t }$ . The expectation of this operation is the CDF of the probability of $l$ , since
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\begin{array} { l } { { \displaystyle { \bf E } _ { l _ { t } } [ g _ { t } ^ { \{ t ^ { \prime } \} } ] = \prod _ { j = 1 } \alpha _ { j } ^ { t } + ( 1 - \alpha _ { 1 } ^ { t } ) \prod _ { j = 2 } \alpha _ { j } ^ { t } + . . . + ( 1 - \alpha _ { t ^ { \prime } } ^ { t } ) \prod _ { j = t ^ { \prime } + 1 } \alpha _ { j } ^ { t } } } \\ { { \displaystyle \qquad = \sum _ { k = 0 } ^ { t ^ { \prime } } p ( l _ { t } = k | x _ { 0 } , . . . , x _ { t } ) = { \bf P } ( l _ { t } \le t ^ { \prime } ) } } \end{array}
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
By telescopic cancellation, the CDF can be expressed in a succinct way:
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\mathbf { P } ( l _ { t } \leq t ^ { \prime } ) = \prod _ { j = t ^ { \prime } + 1 } ^ { t - 1 } \alpha _ { j } ^ { t }
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
for $t ^ { \prime } < t$ , and $\mathbf { P } ( l _ { t } \ \leq \ t ) = 1$ . However, being Bayesian nonparametric and assuming a latent variable model require approximate inference. Hence, we have the following relaxations
|
| 419 |
+
|
| 420 |
+
1. First, we relax the assumption and parameterize $\alpha _ { j } ^ { t }$ as a deterministic function depending on all the previous words, which we will describe in the next section. 2. We replace the discrete decision on the graph structure with a soft attention mechanism, by multiplying attention weight with the multiplicative gate:
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
g _ { i } ^ { t } = \prod _ { j = i + 1 } ^ { t } \alpha _ { j } ^ { t }
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
With these relaxations, Eq. (3) can be approximated by using a soft gating vector to update the hidden state $h$ and the predictive function $f$ . This approximation is reasonable since the gate is the expected value of the discrete masking operation described above.
|
| 427 |
+
|
| 428 |
+
# C NO PARTIAL OVERLAPPING IN DEPENDENCY RANGES
|
| 429 |
+
|
| 430 |
+
In this appendix, we show that having no partial overlapping in dependency ranges is an essential property for recovering a valid tree structure, and PRPN can provide a binary version of $g _ { i } ^ { t }$ , that have this property.
|
| 431 |
+
|
| 432 |
+
The masking vector $g _ { i } ^ { t }$ introduced in Section 4.1 determines the range of dependency, i.e., for the word $x _ { t }$ we have $g _ { i } ^ { t } = 1$ for all $l _ { t } \leq i < t$ . All the words fall into the range $l _ { t } \leq i < t$ is considered as $x _ { t }$ ’s sibling or offspring of its sibling. If the dependency ranges of two words are disjoint with each other, that means the two words belong to two different subtrees. If one range contains another, that means the one with smaller range is a sibling, or is an offspring of a sibling of the other word. However, if they partially overlaps, they can’t form a valid tree.
|
| 433 |
+
|
| 434 |
+
While Eq.5 and Eq.6 provide a soft version of dependency range, we can recover a binary version by setting $\tau$ in Eq.6 to $+ \infty$ . The binary version of $\alpha _ { j } ^ { t }$ corresponding to Eq. 6 becomes:
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\alpha _ { j } ^ { t } = \frac { \mathrm { s i g n } \left( d _ { t } - d _ { j + 1 } \right) + 1 } { 2 }
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
which is basically the sign of comparing $d _ { t }$ and $d _ { j + 1 }$ , scaled to the range of 0 and 1. Then for each of its previous token the gate value $g _ { i } ^ { t }$ can be computed through Eq.5.
|
| 441 |
+
|
| 442 |
+
Now for a certain $x _ { t }$ , we have
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
g _ { i } ^ { t } = { \left\{ \begin{array} { l l } { 1 , } & { t ^ { \prime } \leq i < t } \\ { 0 , } & { 0 \leq i < t ^ { \prime } } \end{array} \right. }
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
where
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
t ^ { \prime } = \operatorname* { m a x } i , \quad s . t . \quad d _ { i } > d _ { t }
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
Now all the words that fall into the range $t ^ { \prime } \leq i < t$ are considered as either sibling of $x _ { t }$ , or offspring of a sibling of $x _ { t }$ (Figure 3). The essential point here is that, under this parameterization, the dependency range of any two tokens won’t partially overlap. Here we provide a terse proof:
|
| 455 |
+
|
| 456 |
+
Proof. Let’s assume that the dependency range of $x _ { v }$ and $x _ { n }$ partially overlaps. We should have $g _ { i } ^ { u } \ = \ 1$ for $u \leq i < v$ and $g _ { i } ^ { n } \ = \ 1$ for $m \leq i < n$ . Without losing generality, we assume $u < m < v < n$ so that the two dependency ranges overlap in the range $[ m , v ]$ .
|
| 457 |
+
|
| 458 |
+
1. For $x _ { v }$ , we have $\alpha _ { i } ^ { v } = 1$ for all $u \leq i < v$ . According to Eq. 6 and 5, we have $d _ { i } < d _ { v }$ for all $u \leq i < v$ . Since $u < m$ , we have $d _ { m } < d _ { v }$ . 2. Similarly, for $x _ { n }$ , we have $d _ { i } < d _ { n }$ for all $m \leq i < n$ . Since $m < v$ , we have $d _ { v } < d _ { n }$ . On the other hand, since the range stops at $m$ , we should also have $d _ { m } > d _ { n }$ . Thus $d _ { m } > d _ { v }$ .
|
| 459 |
+
|
| 460 |
+
Items 1 and 2 are contradictory, so the dependency ranges of $x _ { v }$ and $x _ { n }$ won’t partially overlap.
|
| 461 |
+
|
| 462 |
+
# D PROPERTIES AND INTUITIONS OF $g _ { i } ^ { t }$ AND $d _ { i }$
|
| 463 |
+
|
| 464 |
+
First, for any fixed $t$ , $g _ { i } ^ { t }$ is monotonic in $i$ . This ensures that $g _ { i } ^ { t }$ still provides soft truncation to define a dependency range.
|
| 465 |
+
|
| 466 |
+
The second property comes from $\tau$ . The hyperparameter $\tau$ has an interesting effect on the tree structure: if it is set to 0, then for all $t$ , the gates $g _ { i } ^ { t }$ will be open to all of $e _ { t }$ ’s predecessors, which will result in a flat tree where all tokens are direct children of the root node; as $\tau$ becomes larger, the number of levels of hierarchy in the tree increases. As it approaches $+ \mathrm { i n f }$ , the hardtanh $( \cdot )$ becomes $\mathrm { s i g n } ( \cdot )$ and the dependency ranges form a valid tree. Note that, due to the linear part of the gating mechanism, which benefits training, when $\tau$ has a value in between the two extremes the truncation range for each token may overlap. That may sometimes result in vagueness in some part of the inferred tree. To eliminate this vagueness and ensure a valid tree, at test time we use $\tau = + \mathrm { i n f }$ .
|
| 467 |
+
|
| 468 |
+
Under this framework, the values of syntactic distance have more intuitive meanings. If two adjacent words are siblings of each other, the syntactic distance should approximate zero; otherwise, if they belong to different subtrees, they should have a larger syntactic distance. In the extreme case, the syntactic distance approaches 1 if the two words have no subtree in common. In Figure 3 we show the syntactic distances for each adjacent token pair which results in the tree shown in Figure 1.
|
| 469 |
+
|
| 470 |
+
# E BASELINE METHODS FOR UNSUPERVISED CONSTITUENCY PARSING
|
| 471 |
+
|
| 472 |
+
Our model is compared with the same baseline methods as in (Klein & Manning, 2005). RANDOM chooses a binary tree uniformly at random from the set of binary trees. This is the unsupervised baseline. LBRANCH and RBRANCH choose the completely left- and right-branching structures, respectively. RBRANCH is a frequently used baseline for supervised parsing, but it should be stressed that it encodes a significant fact about English structure, and an induction system need not beat it to claim a degree of success. UPPER BOUND is the upper bound on how well a binary system can do against the Treebank sentences. Because the Treebank sentences are generally more flat than binary, limiting the maximum precision which can be attained, since additional brackets added to provide a binary tree will be counted as wrong.
|
| 473 |
+
|
| 474 |
+
We also compared our model with other unsupervised constituency parsing methods. DEP-PCFG is dependency-structured PCFG (Carroll & Charniak, 1992). CCM is constituent-context model (Klein & Manning, 2002). DMV is an unsupervised dependency parsing model. $D M V { + } C C M$ is a combined model that jointly learn both constituency and dependency parser (Klein & Manning, 2004).
|
md/train/rkxQ-nA9FX/rkxQ-nA9FX.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/ry831QWAb/ry831QWAb.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BLOCK-NORMALIZED GRADIENT METHOD: AN EMPIRICAL STUDY FOR TRAINING DEEP NEURAL NETWORK
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we propose a generic and simple strategy for utilizing stochastic gradient information in optimization. The technique essentially contains two consecutive steps in each iteration: 1) computing and normalizing each block (layer) of the mini-batch stochastic gradient; 2) selecting appropriate step size to update the decision variable (parameter) towards the negative of the block-normalized gradient. We conduct extensive empirical studies on various non-convex neural network optimization problems, including multi layer perceptron, convolution neural networks and recurrent neural networks. The results indicate the blocknormalized gradient can help accelerate the training of neural networks. In particular, we observe that the normalized gradient methods having constant step size with occasionally decay, such as SGD with momentum, have better performance in the deep convolution neural networks, while those with adaptive step sizes, such as Adam, perform better in recurrent neural networks. Besides, we also observe this line of methods can lead to solutions with better generalization properties, which is confirmed by the performance improvement over strong baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Continuous optimization is a core technique for training non-convex sophisticated machine learning models such as deep neural networks (Bengio, 2009). Compared to convex optimization where a global optimal solution is expected, non-convex optimization usually aims to find a stationary point or a local optimal solution of an objective function by iterative algorithms. Among a large volume of optimization algorithms, first-order methods, which only iterate with the gradient information of objective functions, are widely used due to its relatively low requirement on memory space and computation time, compared to higher order algorithms. In many machine learning scenarios with large amount of data, the full gradient is still expensive to obtain, and hence the unbiased stochastic version will be adopted, as it is even more computationally efficient.
|
| 12 |
+
|
| 13 |
+
In this paper, we are particularly interested in solving the deep neural network training problems with stochastic first order methods. Compared to other non-convex problems, deep neural network training additionally has the following challenge: gradient may be vanishing and/or exploding. More specifically, due to the chain rule (a.k.a. backpropagation), the original gradient in the low layers will become very small or very large because of the multiplicative effect of the gradients from the upper layers, which is usually all smaller or larger than 1. As the number of layers in the neural network increases, the phenomenon of vanishing or exploding gradients becomes more severe such that the iterative solution will converge slowly or diverge quickly.
|
| 14 |
+
|
| 15 |
+
We aim to alleviate this problem by block-wise stochastic gradient normalization, which is constructed via dividing the stochastic gradient by its norm. Here, each block essentially contains the variables of one layer in a neural network, so it can also be interpreted as layer-wise gradient normalization. Compared to the regular gradient, normalized gradient only provides an updating direction but does not incorporate the local steepness of the objective through its magnitude, which helps to control the change of the solution through a well-designed step length. Intuitively, as it constrains the magnitude of the gradient to be 1, it should to some extent prevent the gradient vanishing or exploding phenomenon. In fact, as showed in (Hazan et al., 2015; Levy, 2016), normalized gradient descent (NGD) methods are more numerically stable and have better theoretical convergence properties than the regular gradient descent method in non-convex optimization.
|
| 16 |
+
|
| 17 |
+
Once the updating direction is determined, step size (learning rate) is the next important component in the design of first-order methods. While for convex problems there are some well studied strategies to find a stepsize ensuring convergence, for non-convex optimization, the choice of step size is more difficult and critical as it may either enlarge or reduce the impact of the aforementioned vanishing or exploding gradients.
|
| 18 |
+
|
| 19 |
+
Among different choices of step sizes, the constant or adaptive feature-dependent step sizes are widely adopted. On one hand, stochastic gradient descent (SGD) $^ +$ momentum $^ +$ constant step size has become the standard choice for training feed-forward networks such as Convolution Neural Networks (CNN). Ad-hoc strategies like decreasing the step size when the validation curve plateaus are well adopted to further improve the generalization quality. On the other hand, different from the standard step-size rule which multiplies a same number to each coordinate of gradient, the adaptive feature-dependent step-size rule multiplies different numbers to coordinates of gradient so that different parameters in the learning model can be updated in different paces. For example, the adaptive step size invented by (Duchi et al., 2011) is constructed by aggregating each coordinates of historical gradients. As discussed by (Duchi et al., 2011), this method can dynamically incorporate the frequency of features in the step size so that frequently occurring coordinates will have a small step sizes while infrequent features have long ones. The similar adaptive step size is proposed in (Kingma & Ba, 2014) but the historical gradients are integrated into feature-dependent step size by a different weighting scheme.
|
| 20 |
+
|
| 21 |
+
In this paper, we propose a generic framework using the mini-batch stochastic normalized gradient as the updating direction (like (Hazan et al., 2015; Levy, 2016)) and the step size is either constant or adaptive to each coordinate as in (Duchi et al., 2011; Kingma & Ba, 2014). Our framework starts with computing regular mini-batch stochastic gradient, which is immediately normalized layer-wisely. The normalized version is then plugged in the constant stepsize with occasional decay, such as SGD $^ +$ momentum, or the adaptive step size methods, such as Adam (Kingma & Ba, 2014) and AdaGrad (Duchi et al., 2011). The numerical results shows that normalized gradient always helps to improve the performance of the original methods especially when the network structure is deep. It seems to be the first thorough empirical study on various types of neural networks with this normalized gradient idea. Besides, although we focus our empirical studies on deep learning where the objective is highly non-convex, we also provide a convergence proof under this framework when the problem is convex and the stepsize is adaptive in the appendix. This convergence under the non-convex case will be a very interesting and important future work.
|
| 22 |
+
|
| 23 |
+
The rest of the paper is organized as follows. In Section 2, we briefly go through the previous work that are related to ours. In Section 3, we formalize the problem to solve and propose the generic algorithm framework. In Section 4, we conduct comprehensive experimental studies to compare the performance of different algorithms on various neural network structures. We conclude the paper in Section 5. Finally, in the appendix, we provide a concrete example of this type of algorithm and show its convergence property under the convex setting.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
A pioneering work on normalized gradient descent (NGD) method was by Nesterov (Nesterov, 1984) where it was shown that NGD can find a $\epsilon$ -optimal solution within $O ( \textstyle { \frac { \mathbf { \bar { 1 } } } { \epsilon ^ { 2 } } } )$ iterations when the objective function is differentiable and quasi-convex. Kiwiel (Kiwiel, 2001) and Hazan et al (Hazan et al., 2015) extended NGD for upper semi-continuous (but not necessarily differentiable) quasiconvex objective functions and local-quasi-convex objective functions, respectively, and achieved the same iteration complexity. Moreover, Hazan et al (Hazan et al., 2015) showed that NGD’s iteration complexity can be reduced to $O ( \textstyle { \frac { 1 } { \epsilon } } )$ if the objective function is local-quasi-convex and locally-smooth. A stochastic NGD algorithm is also proposed by Hazan et al (Hazan et al., 2015) which, if a mini-batch is used to construct the stochastic normalized gradient in each iteration, finds $\epsilon$ -optimal solution with a high probability for locally-quasi-convex functions within $O ( \textstyle { \frac { 1 } { \epsilon ^ { 2 } } } )$ iterations. Levy (Levy, 2016) proposed a Saddle-Normalized Gradient Descent (Saddle-NGD) method, which adds a zero-mean Gaussian random noise to the stochastic normalized gradient periodically. When applied to strict-saddle functions with some additional assumption, it is shown (Levy, 2016)
|
| 28 |
+
|
| 29 |
+
that Saddle-NGD can evade the saddle points and find a local minimum point approximately with a high probability.
|
| 30 |
+
|
| 31 |
+
Analogous yet orthogonal to the gradient normalization ideas have been proposed for the deep neural network training. For example, batch normalization (Ioffe & Szegedy, 2015) is used to address the internal covariate shift phenomenon in the during deep learning training. It benefits from making normalization a part of the model architecture and performing the normalization for each training mini-batch. Weight normalization (Salimans & Kingma, 2016), on the other hand, aims at a reparameterization of the weight vectors that decouples the length of those weight vectors from their direction. Recently (Neyshabur et al., 2015) proposes to use path normalization, an approximate path-regularized steepest descent with respect to a path-wise regularizer related to max-norm regularization to achieve better convergence than vanilla SGD and AdaGrad. Perhaps the most related idea to ours is Gradient clipping. It is proposed in (Pascanu et al., 2013) to avoid the gradient explosion, by pulling the magnitude of a large gradient to a certain level. However, this method does not do anything when the magnitude of the gradient is small.
|
| 32 |
+
|
| 33 |
+
Adaptive step size has been studied for years in the optimization community. The most celebrated method is the line search scheme. However, while the exact line search is usually computational infeasible, the inexact line search also involves a lot of full gradient evaluation. Hence, they are not suitable for the deep learning setting. Recently, algorithms with adaptive step sizes start to be applied to the non-convex neural network training, such as AdaGrad (Duchi et al., 2012), Adam (Kingma & Ba, 2014) and RMSProp (Hinton et al.). However they directly use the unnormalized gradient, which is different from our framework. Singh et al. (2015) recently proposes to apply layer-wise specific step sizes, which differs from ours in that it essentially adds a term to the gradient rather than normalizing it. Recently Wilson et al. (2017) finds the methods with adaptive step size might converge to a solution with worse generalization. However, this is orthogonal to our focus in this paper.
|
| 34 |
+
|
| 35 |
+
# 3 ALGORITHM FRAMEWORK
|
| 36 |
+
|
| 37 |
+
In this section, we present our algorithm framework to solve the following general problem:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\operatorname* { m i n } _ { \boldsymbol { x } \in \mathbb { R } ^ { d } } f ( \boldsymbol { x } ) = \mathbb { E } ( F ( \boldsymbol { x } , \boldsymbol { \xi } ) ) ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $x \ = \ ( x ^ { 1 } , x ^ { 2 } , \ldots , x ^ { B } ) \in \ \mathbb { R } ^ { d }$ with $x ^ { i } \in \mathbb { R } ^ { d _ { i } }$ and $\textstyle \sum _ { i = 1 } ^ { B } d _ { i } \ = \ d ,$ $\xi$ is a rando variable $\mathbb { P }$ $F ( \cdot , \xi )$ $\xi$ $\mathbb { E }$ over $\xi$ . In the case where (1) models an empirical risk minimization problem, the distribution $\mathbb { P }$ can be the empirical distribution over training samples such that the objective function in (1) becomes a finite-sum function. Now our goal is to minimize the objective function $f$ over $x$ , where $x$ can be the parameters of a machine learning model when (1) corresponds to a training problem. Here, the parameters are partitioned into $B$ blocks. The problem of training a neural network is an important instance of (1), where each block of parameters $x ^ { i }$ can be viewed as the parameters associated to the ith layer in the network.
|
| 44 |
+
|
| 45 |
+
We propose the generic optimization framework in Algorithm 1. In iteration $t$ , it firstly computes the partial (sub)gradient $\bar { \boldsymbol { F } } _ { i } ^ { \prime } ( \boldsymbol { x } _ { t } , \boldsymbol { \xi } _ { t } )$ of $F$ with respect to $x ^ { i }$ for $i = 1 , 2 , \dots$ , at $x \ = \ x _ { t }$ with a mini-batch data $\xi _ { t }$ , and then normalizes it to get a partial direction $\begin{array} { r } { g _ { t } ^ { i } = \frac { F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) } { \parallel F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) \parallel _ { 2 } } } \end{array}$ . We define $g _ { t } \ = \ ( g _ { t } ^ { 1 } , g _ { t } ^ { 2 } , . . . , g _ { t } ^ { B } )$ . The next is to find $d$ adaptive step sizes $\tau _ { t } \ \in \ \mathbb { R } ^ { d }$ with each coordinate of $\tau _ { t }$ corresponding to a coordinate of $x$ . We also partition $\tau _ { t }$ in the same way as $x$ so that $\tau _ { t } =$ $( \tau _ { t } ^ { 1 } , \tau _ { t } ^ { 2 } , \dots , \bar { \tau } _ { t } ^ { B } ) \in \mathbb { R } ^ { B }$ with $\tau _ { t } ^ { i } \in \mathbb { R } ^ { d _ { i } }$ . We use $\tau _ { t }$ as step sizes to update $x _ { t }$ to $x _ { t + 1 }$ as $x _ { t + 1 } =$ $x _ { t } - \tau _ { t } \circ g _ { t }$ , where $\circ$ represents coordinate-wise (Hadamard) product. In fact, our framework can be customized to most of existing first order methods with fixed or adaptive step sizes, such as SGD, AdaGrad(Duchi et al., 2011), RMSProp (Hinton et al.) and Adam(Kingma & Ba, 2014), by adopting their step size rules respectively.
|
| 46 |
+
|
| 47 |
+
# 4 NUMERICAL EXPERIMENTS
|
| 48 |
+
|
| 49 |
+
Basic Experiment Setup In this section, we conduct comprehensive numerical experiments on different types of neural networks. The algorithms we are testing are SGD with Momentum
|
| 50 |
+
|
| 51 |
+
# Algorithm 1 Generic Block-Normalized Gradient (BNG) Descent
|
| 52 |
+
|
| 53 |
+
1: Choose $x _ { 1 } \in \mathbb { R } ^ { d }$ .
|
| 54 |
+
2: for $t = 1 , 2 , . . . , \mathbf { d o }$
|
| 55 |
+
3: Sample a mini-batch of data ξt and compute the partial stochastic gradient git = F 0i (xt,ξt)kF 0(xt,ξt)k2
|
| 56 |
+
4: Let $g _ { t } = ( g _ { t } ^ { 1 } , g _ { t } ^ { 2 } , \ldots , g _ { t } ^ { B } )$ and choose step sizes $\tau _ { t } \in \mathbb { R } ^ { d }$ .
|
| 57 |
+
5: $x _ { t + 1 } = x _ { t } - \tau _ { t } \circ g _ { t }$
|
| 58 |
+
6: end for
|
| 59 |
+
|
| 60 |
+
(SGDM), AdaGrad (Duchi et al., 2013), Adam (Kingma & Ba, 2014) and their block-normalized gradient counterparts, which are denoted with suffix “NG”. Specifically, we partition the parameters into block as $x \overset { \cdot } { = } ( x ^ { 1 } , x ^ { 2 } , \ldots , x ^ { B } )$ such that $x ^ { i }$ corresponds to the vector of parameters (including the weight matrix and the bias/intercept coefficients) used in the ith layer in the network.
|
| 61 |
+
|
| 62 |
+
Our experiments are on four diverse tasks, ranging from image classification to natural language processing. The neural network structures under investigation include multi layer perceptron, longshort term memory and convolution neural networks.
|
| 63 |
+
|
| 64 |
+
To exclude the potential effect that might be introduced by advanced techniques, in all the experiments, we only adopt the basic version of the neural networks, unless otherwise stated. The loss functions for classifications are cross entropy, while the one for language modeling is log perplexity. Since the computational time is proportional to the epochs, we only show the performance versus epochs. Those with running time are similar so we omit them for brevity. For all the algorithms, we use their default settings. More specifically, for Adam/AdamNG, the initial step size scale $\alpha = 0 . 0 0 1$ , first order momentum $\beta _ { 1 } = 0 . 9$ , second order momentum $\beta _ { 2 } = 0 . 9 9 9$ , the parameter to avoid division of zero $\epsilon = 1 e ^ { - 8 }$ ; for AdaGrad/AdaGradNG, the initial step size scale is 0.01.
|
| 65 |
+
|
| 66 |
+
# 4.1 MULTI LAYER PERCEPTRON FOR MNIST IMAGE CLASSIFICATION
|
| 67 |
+
|
| 68 |
+
The first network structure we are going to test upon is the Multi Layer Perceptron (MLP). We will adopt the handwritten digit recognition data set MNIST1Lecun et al. (1998), in which, each data is an image of hand written digits from $\{ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 \}$ . There are 60k training and $1 0 \mathrm { k }$ testing examples and the task is to tell the right number contained in the test image. Our approach is applying MLP to learn an end-to-end classifier, where the input is the raw $2 8 \times 2 8$ images and the output is the label probability. The predicted label is the one with the largest probability. In each middle layer of the MLP, the hidden unit number are 100, and the first and last layer respectively contain 784 and 10 units. The activation functions between layers are all sigmoid and the batch size is 100 for all the algorithms.
|
| 69 |
+
|
| 70 |
+
We choose different numbers of layer from $\{ 6 , 1 2 , 1 8 \}$ . The results are shown in Figure 1. Each column of the figures corresponds to the training and testing objective curves of the MLP with a given layer number. From left to right, the layer numbers are respectively 6, 12 and 18. We can see that, when the network is as shallow as containing 6 layers, the normalized stochastic gradient descent can outperform its unnormalized counterpart, while the Adam and AdaGrad are on par with or even slightly better than their unnormalized versions. As the networks become deeper, the acceleration brought by the gradient normalization turns more significant. For example, starting from the second column, AdamNG outperforms Adam in terms of both training and testing convergence. In fact, when the network depth is 18, the AdamNG can still converge to a small objective value while Adam gets stuck from the very beginning. We can observe the similar trend in the comparison between AdaGrad (resp. SGDM) and AdaGradNG (resp. SGDMNG). On the other hand, the algorithms with adaptive step sizes can usually generate a stable learning curve. For example, we can see from the last two column that SGDNG causes significant fluctuation in both training and testing curves. Finally, under any setting, AdamNG is always the best algorithm in terms of convergence performance.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 1: The training and testing objective curves on MNIST dataset with multi layer perceptron. From left to right, the layer numbers are 6, 12 and 18 respectively. The first row is the training curve and the second is testing.
|
| 74 |
+
|
| 75 |
+
# 4.2 RESIDUAL NETWORK ON CIFAR10 AND CIFAR100
|
| 76 |
+
|
| 77 |
+
Datasets In this section, we benchmark the methods on CIFAR (both CIFAR10 and CIFAR100) datasets with the residual networks He et al. (2016a), which consist mainly of convolution layers and each layer comes with batch normalization (Ioffe & Szegedy, 2015). CIFAR10 consists of 50,000 training images and 10,000 test images from 10 classes, while CIFAR100 from 100 classes. Each input image consists of $3 2 \times 3 2$ pixels. The dataset is preprocessed as described in He et al. (2016a) by subtracting the means and dividing the variance for each channel. We follow the same data augmentation in He et al. (2016a) that 4 pixels are padded on each side, and a $3 2 \times 3 2$ crop is randomly sampled from the padded image or its horizontal flip.
|
| 78 |
+
|
| 79 |
+
Algorithms We adopt two types of optimization frameworks, namely SGD and $\mathbf { A d a m } ^ { 2 }$ , which respectively represent the constant step size and adaptive step size methods. We compare the performances of their original version and the layer-normalized gradient counterpart. We also investigate how the performance changes if the normalization is relaxed to not be strictly 1. In particular, we find that if the normalized gradient is scaled by its variable norm with a ratio, which we call $\mathrm { N G } _ { \mathrm { a d a p } }$ and defined as follows,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathrm { N G } _ { \mathrm { a d a p } } : = \mathrm { N G } \times \mathrm { N o r m ~ o f ~ v a r i a b l e } \times \alpha = \mathrm { G r a d } \times { \frac { \mathrm { N o r m ~ o f ~ v a r i a b l e } } { \mathrm { N o r m ~ o f ~ g r a d } } } \times \alpha ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
we can get lower testing error. The subscript “adap” is short for “adaptive”, as the resulting norm of the gradient is adaptive to its variable norm, while $\alpha$ is the constant ratio. Finally, we also compare with the gradient clipping trick that rescales the gradient norm to a certain value if it is larger than that threshold. Those methods are with suffix “CLIP”.
|
| 86 |
+
|
| 87 |
+
Parameters In the following, whenever we need to tune the parameter, we search the space with a holdout validation set containing 5000 examples.
|
| 88 |
+
|
| 89 |
+
For SGD $+$ Momentum method, we follow exactly the same experimental protocol as described in He et al. (2016a) and adopt the publicly available Torch implementation3 for residual network. In particular, SGD is used with momentum of 0.9, weight decay of 0.0001 and mini-batch size of 128. The initial learning rate is 0.1 and dropped by a factor of 0.1 at 80, 120 with a total training of 160 epochs. The weight initialization is the same as He et al. (2015).
|
| 90 |
+
|
| 91 |
+
For Adam, we search the initial learning rate in range $\{ 0 . 0 0 0 5 , 0 . 0 0 1 , 0 . 0 0 5 , 0 . 0 1 \}$ with the base algorithm Adam. We then use the best learning rate, i.e., 0.001, for all the related methods AdamCLIP, AdamNG, and $\mathrm { A d a m N G _ { a d a p } }$ . Other setups are the same as the SGD. In particular, we also adopt the manually learning rate decay here, since, otherwise, the performance will be much worse.
|
| 92 |
+
|
| 93 |
+
We adopt the residual network architectures with depths $L = \{ 2 0 , 3 2 , 4 4 , 5 6 , 1 1 0 \}$ on both CIFAR10 and CIFAR100. For the extra hyper-parameters, i.e., threshold of gradient clipping and scale ratio of $\mathrm { { N G } _ { \mathrm { { a d a p } } } }$ , i.e., $\alpha$ , we choose the best hyper-parameter from the 56-layer residual network. In particular, for clipping, the searched values are $\{ 0 . 0 5 , 0 . 1 , 0 . 5 , 1 , 5 \}$ , and the best value is 0.1. For the ratio $\alpha$ , the searched values are $\{ 0 . 0 1 , 0 . 0 2 , \dot { 0 . } 0 5 \}$ and the best is 0.02.
|
| 94 |
+
|
| 95 |
+
Results For each network structure, we make 5 runs with random initialization. We report the training and testing curves on CIFAR10 and CIFAR100 datasets with deepest network Res-110 in Figure 2. We can see that the normalized gradient methods (with suffix “NG”) converge the fastest in training, compared to the non-normalized counterparts. While the adaptive version $\mathrm { N G } _ { \mathrm { a d a p } }$ is not as fast as NG in training, however, it can always converge to a solution with lower testing error, which can be seen more clearly in Table 1 and 2.
|
| 96 |
+
|
| 97 |
+
For further quantitative analysis, we report the means and variances of the final test errors on both datasets in Table 1 and 2, respectively. Both figures convey the following two messages. Firstly, on both datasets with ResNet, SGD $+$ Momentum is uniformly better than Adam in that it always converges to a solution with lower test error. Such advantage can be immediately seen by comparing the two row blocks within each column of both tables. It is also consistent with the common wisdom (Wilson et al., 2017). Secondly, for both Adam and $\mathrm { S G D + N }$ Momentum, the $\mathrm { N G } _ { \mathrm { a d a p } }$ version has the best generalization performance (which is mark bold in each column), while the gradient clipping is inferior to all the remaining variants. While the normalized SGD $^ +$ Momentum is better than the vanilla version, Adam slightly outperforms its normalized counterpart. Those observations are consistent across networks with variant depths.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 2: The training and testing curves on CIFAR10 and CIFAR100 datasets with Resnet-110. Left: CIFAR10; Right: CIFAR100; Upper: $\mathbf { S G D + M }$ omentum; Lower: Adam. The thick curves are the training while the thin are testing.
|
| 101 |
+
|
| 102 |
+
Table 1: Error rates of ResNets with different depths on CIFAR 10. SGDM∗ indicates the results reported in He et al. (2015) with the same experimental setups as ours, where only ResNet-110 has multiple runs.
|
| 103 |
+
|
| 104 |
+
<table><tr><td>Algorithm</td><td>ResNet-20</td><td>ResNet-32</td><td>ResNet-44</td><td>ResNet-56</td><td>ResNet-110</td></tr><tr><td colspan="6">Adam</td></tr><tr><td>Adam</td><td>9.14 ± 0.07</td><td>8.33 ± 0.17</td><td>7.794 ± 0.22</td><td>7.33 ± 0.19</td><td>6.75 ± 0.30</td></tr><tr><td>AdamCLIP</td><td>10.18± 0.16</td><td>9.18± 0.06</td><td>8.89 ± 0.14</td><td>9.24 ± 0.19</td><td>9.96± 0.29</td></tr><tr><td>AdamNG</td><td>9.42 ± 0.20</td><td>8.50 ± 0.17</td><td>8.06± 0.20</td><td>7.69 ± 0.19</td><td>7.29 ± 0.08</td></tr><tr><td>AdamNGadap</td><td>8.52± 0.16</td><td>7.62± 0.25</td><td>7.28± 0.18</td><td>7.04± 0.27</td><td>6.71± 0.17</td></tr><tr><td colspan="6">SGD+Momentum</td></tr><tr><td>SGDM*</td><td>8.75</td><td>7.51</td><td>7.17</td><td>6.97</td><td>6.61± 0.16</td></tr><tr><td>SGDM</td><td>7.93 ± 0.15</td><td>7.15 ± 0.20</td><td>7.09 ± 0.21</td><td>7.34 ± 0.52</td><td>7.07 ± 0.65</td></tr><tr><td>SGDMCLIP</td><td>9.03 ± 0.15</td><td>8.44 ± 0.14</td><td>8.55 ± 0.20</td><td>8.30± 0.08</td><td>8.35± 0.25</td></tr><tr><td>SGDMNG</td><td>7.82 ± 0.26</td><td>7.09 ± 0.13</td><td>6.60± 0.21</td><td>6.59 ± 0.23</td><td>6.28 ± 0.22</td></tr><tr><td>SGDMNGadap</td><td>7.71 ± 0.18</td><td>6.90± 0.11</td><td>6.43± 0.03</td><td>6.19± 0.11</td><td>5.87± 0.10</td></tr></table>
|
| 105 |
+
|
| 106 |
+
<table><tr><td>Algorithm</td><td>ResNet-20</td><td>ResNet-32</td><td>ResNet-44</td><td>ResNet-56</td><td>ResNet-110</td></tr><tr><td colspan="6">Adam</td></tr><tr><td>Adam</td><td>34.44 ± 0.33</td><td>32.94 ± 0.16</td><td>31.53 ± 0.13</td><td>30.80± 0.30</td><td>28.20 ± 0.14</td></tr><tr><td>AdamCLIP</td><td>38.10 ± 0.48</td><td>35.78 ± 0.20</td><td>35.41± 0.19</td><td>35.62± 0.39</td><td>39.10± 0.35</td></tr><tr><td>AdamNG</td><td>35.06 ± 0.39</td><td>33.78 ± 0.07</td><td>32.26± 0.29</td><td>31.86 ± 0.21</td><td>29.87 ± 0.49</td></tr><tr><td>AdamNGadap</td><td>32.98± 0.52</td><td>31.74± 0.07</td><td>30.75± 0.60</td><td>29.92± 0.26</td><td>28.09± 0.46</td></tr><tr><td colspan="6">SGD+Momentum</td></tr><tr><td>SGDM</td><td>32.28±0.16</td><td>30.62 ± 0.36</td><td>29.96 ± 0.66</td><td>29.07 ± 0.41</td><td>28.79 ± 0.63</td></tr><tr><td>SGDMCLIP</td><td>35.06 ± 0.37</td><td>34.49± 0.49</td><td>33.36± 0.36</td><td>34.00± 0.96</td><td>33.38± 0.73</td></tr><tr><td>SGDMNG</td><td>32.46 ± 0.37</td><td>31.16 ± 0.37</td><td>30.05 ± 0.29</td><td>29.42 ± 0.51</td><td>27.49 ± 0.25</td></tr><tr><td>SGDMNGadap</td><td>31.43 ± 0.35</td><td>29.56 ± 0.25</td><td>28.92 ± 0.28</td><td>28.48 ± 0.19</td><td>26.72 ± 0.39</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Table 2: Error rates of ResNets with different depths on CIFAR 100. Note that He et al. (2015) did not run experiment on CIFAR 100.
|
| 109 |
+
|
| 110 |
+
# 4.3 RESIDUAL NETWORK FOR IMAGENET CLASSIFICATION
|
| 111 |
+
|
| 112 |
+
In this section, we further test our methods on ImageNet 2012 classification challenges, which consists of more than 1.2M images from 1,000 classes. We use the given 1.28M labeled images for training and the validation set with 50k images for testing. We employ the validation set as the test set, and evaluate the classification performance based on top-1 and top-5 error. The pre-activation (He et al., 2016b) version of ResNet is adopted in our experiments to perform the classification task. Like the previous experiment, we again compare the performance on SGD $^ +$ Momentum and Adam.
|
| 113 |
+
|
| 114 |
+
We run our experiments on one GPU and use single scale and single crop test for simplifying discussion. We keep all the experiments settings the same as the publicly available Torch implementation 4. That is, we apply stochastic gradient descent with momentum of 0.9, weight decay of 0.0001, and set the initial learning rate to 0.1. The exception is that we use mini-batch size of 64 and 50 training epochs considering the GPU memory limitations and training time costs. Regarding learning rate annealing, we use 0.001 exponential decay.
|
| 115 |
+
|
| 116 |
+
As for Adam, we search the initial learning rate in range $\{ 0 . 0 0 0 5 , 0 . 0 0 1 , 0 . 0 0 5 , 0 . 0 1 \}$ . Other setups are the same as the SGD optimization framework. Due to the time-consuming nature of training the networks (which usually takes one week) in this experiment, we only test on a 34-layer ResNet and compare SGD and Adam with our default NG method on the testing error of the classification. From Table 3, we can see normalized gradient has a non-trivial improvement on the testing error over the baselines SGD and Adam. Besides, the SGD $+$ Momentum again outperforms Adam, which is consistent with both the common wisdom (Wilson et al., 2017) and also the findings in previous section.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>method</td><td>Top-1</td><td>Top-5</td></tr><tr><td>Adam</td><td>35.6</td><td>14.09</td></tr><tr><td>AdamNG</td><td>30.17</td><td>10.51</td></tr><tr><td>SGDM</td><td>29.05</td><td>9.95</td></tr><tr><td>SGDMNG</td><td>28.43</td><td>9.57</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 3: Top-1 and Top 5 error rates of ResNet on ImageNet classification with different algorithms.
|
| 121 |
+
|
| 122 |
+
4.4 LANGUAGE MODELING WITH RECURRENT NEURAL NETWORK
|
| 123 |
+
|
| 124 |
+
Now we move on to test the algorithms on Recurrent Neural Networks (RNN). In this section, we test the performance of the proposed algorithm on the word-level language modeling task with a popular type of RNN, i.e. single directional Long-Short Term Memory (LSTM) networks (Hochreiter & Schmidhuber, 1997). The data set under use is Penn Tree Bank (PTB) (Marcus et al., 1993) data, which, after preprocessed, contains $9 2 9 \mathrm { k }$ training words, $7 3 \mathrm { k }$ validation and 82k test words. The vocabulary size is about $1 0 \mathrm { k }$ . The LSTM has 2 layers, each containing 200 hidden units. The word embedding has 200 dimensions which is trained from scratch. The batch size is 100. We vary the length of the backprop through time (BPTT) within the range $\{ 4 0 , 4 0 0 , 1 0 0 0 \}$ . To prevent overfitting, we add a dropout regularization with rate 0.5 under all the settings.
|
| 125 |
+
|
| 126 |
+
The results are shown in Figure 3. The conclusions drawn from those figures are again similar to those in the last two experiments. However, the slightly different yet cheering observations is that the AdamNG is uniformly better than all the other competitors with any training sequence length. The superiority in terms of convergence speedup exists in both training and testing.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: The training and testing objective curves on Penn Tree Bank dataset with LSTM recurrent neural networks. The first row is the training objective while the second is the testing. From left to right, the training sequence (BPTT) length are respectively 40, 400 and 1000. Dropout with 0.5 is imposed.
|
| 130 |
+
|
| 131 |
+
4.5 SENTIMENT ANALYSIS WITH CONVOLUTION NEURAL NETWORK
|
| 132 |
+
|
| 133 |
+
The task in this section is the sentiment analysis with convolution neural network. The dataset under use is Rotten Tomatoes5 Pang & Lee (2005), a movie review dataset containing 10,662 documents, with half positive and half negative. We randomly select around $90 \%$ for training and $10 \%$ for validation. The model is a single layer convolution neural network that follows the setup of (Kim, 2014). The word embedding under use is randomly initialized and of 128-dimension.
|
| 134 |
+
|
| 135 |
+
For each algorithm, we run 150 epochs on the training data, and report the best validation accuracy in Table 4. The messages conveyed by the table is three-fold. Firstly, the algorithms using normalized gradient achieve much better validation accuracy than their unnormalized versions. Secondly, those with adaptive stepsize always obtain better accuracy than those without. This is easily seen by the comparison between Adam and SGDM. The last point is the direct conclusion from the previous two that the algorithm using normalized gradient with adaptive step sizes, namely AdamNG, outperforms all the remaining competitors.
|
| 136 |
+
|
| 137 |
+
Table 4: The Best validation accuracy achieved by the different algorithms.
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan=1 colspan=1>Algorithm</td><td rowspan=1 colspan=1>AdamNG</td><td rowspan=1 colspan=1>Adam</td><td rowspan=1 colspan=1>AdaGradNG</td><td rowspan=1 colspan=1>AdaGrad</td><td rowspan=1 colspan=1>SGDMNG</td><td rowspan=1 colspan=1>SGDM</td></tr><tr><td rowspan=1 colspan=1>Validation Accuracy</td><td rowspan=1 colspan=1>77.11%</td><td rowspan=1 colspan=1>74.02%</td><td rowspan=1 colspan=1>71.95%</td><td rowspan=1 colspan=1>69.89%</td><td rowspan=1 colspan=1>71.95%</td><td rowspan=1 colspan=1>64.35%</td></tr></table>
|
| 140 |
+
|
| 141 |
+
# 5 CONCLUSION
|
| 142 |
+
|
| 143 |
+
In this paper, we propose a generic algorithm framework for first order optimization. It is particularly effective for addressing the vanishing and exploding gradient challenge in training with non-convex loss functions, such as in the context of convolutional and recurrent neural networks. Our method is based on normalizing the gradient to establish the descending direction regardless of its magnitude, and then separately estimating the ideal step size adaptively or constantly. This method is quite general and may be applied to different types of networks and various architectures. Although the primary application of the algorithm is deep neural network training, we provide a convergence for the new method under the convex setting in the appendix.
|
| 144 |
+
|
| 145 |
+
Empirically, the proposed method exhibits very promising performance in training different types of networks (convolutional, recurrent) across multiple well-known data sets (image classification, natural language processing, sentiment analysis, etc.). In general, the positive performance differential compared to the baselines is most striking for very deep networks, as shown in our comprehensive experimental study.
|
| 146 |
+
|
| 147 |
+
# REFERENCES
|
| 148 |
+
|
| 149 |
+
Yoshua Bengio. Learning deep architectures for ai. Foundations and trends $\textsuperscript { \textregistered }$ in Machine Learning, 2(1):1–127, 2009.
|
| 150 |
+
|
| 151 |
+
John Duchi, Michael I Jordan, and Brendan McMahan. Estimation, optimization, and parallelism when data is sparse. In NIPS, pp. 2832–2840, 2013.
|
| 152 |
+
|
| 153 |
+
John C. Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011.
|
| 154 |
+
|
| 155 |
+
John C Duchi, Alekh Agarwal, and Martin J Wainwright. Dual averaging for distributed optimization: convergence analysis and network scaling. Automatic Control, IEEE Transactions on, 57 (3):592–606, 2012.
|
| 156 |
+
|
| 157 |
+
Elad Hazan, Kfir Y. Levy, and Shai Shalev-Shwartz. Beyond convexity: Stochastic quasi-convex optimization. In NIPS, pp. 1594–1602, 2015.
|
| 158 |
+
|
| 159 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, 2015.
|
| 160 |
+
|
| 161 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
|
| 162 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. CoRR, abs/1603.05027, 2016b.
|
| 163 |
+
Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Lecture 6a: Overview of mini-batch gradient descent. Neural Networks for Machine Learning.
|
| 164 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 165 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pp. 448–456, 2015.
|
| 166 |
+
Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
|
| 167 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 168 |
+
Krzysztof C Kiwiel. Convergence and efficiency of subgradient methods for quasiconvex minimization. Mathematical programming, 90(1):1–25, 2001.
|
| 169 |
+
Yann Lecun, Leon Bottou, Yoshua Bengio, and Patrick Haffner? Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pp. 2278–2324, 1998.
|
| 170 |
+
Kfir Y. Levy. The power of normalization: Faster evasion of saddle points. CoRR, abs/1611.04831, 2016. URL http://arxiv.org/abs/1611.04831.
|
| 171 |
+
Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. Computational Linguistics, 19(2):313–330, 1993.
|
| 172 |
+
Nesterov. Minimization methods for nonsmooth convex and quasiconvex functions. Matekon, 29: 519–531, 1984.
|
| 173 |
+
Behnam Neyshabur, Ruslan Salakhutdinov, and Nathan Srebro. Path-sgd: Path-normalized optimization in deep neural networks. In NIPS, pp. 2422–2430, 2015.
|
| 174 |
+
Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd annual meeting on association for computational linguistics, pp. 115–124. Association for Computational Linguistics, 2005.
|
| 175 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In ICML, pp. 1310–1318, 2013.
|
| 176 |
+
Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NIPS, 2016.
|
| 177 |
+
Bharat Singh, Soham De, Yangmuzi Zhang, Thomas Goldstein, and Gavin Taylor. Layer-specific adaptive learning rates for deep networks. CoRR, abs/1510.04609, 2015.
|
| 178 |
+
Ashia C. Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 4151–4161, 2017.
|
| 179 |
+
|
| 180 |
+
# APPENDIX
|
| 181 |
+
|
| 182 |
+
As a concrete example for Algorithm 1, we present a simple modification of AdaGrad using blockwise normalized stochastic gradient in Algorithm 2, where $g _ { 1 : t }$ is a matrix created by stacking $g _ { 1 }$ , $g _ { 2 } , \ldots$ and $g _ { t }$ in columns and $\bar { g } _ { 1 : t , j } \in \mathbb { R } ^ { t }$ represents the $j$ th row of $g _ { 1 : t }$ for $j = 1 , 2 , \dots , d$ . Assuming the function $F$ is convex over $x$ for any $\xi$ and following the analysis in (Duchi et al., 2011), it is straightforward to show a $O \big ( \textstyle { \frac { 1 } { \sqrt { T } } } \big )$ convergence rate of this modification. In the following, we denote $\| x \| _ { W } : = { \sqrt { x ^ { \top } W x } }$ as the the Mahalanobis norm associated to a $d \times d$ positive definite matrix $W$ . The convergence property of Block-Normalized AdaGrad is presented in the following theorem.
|
| 183 |
+
|
| 184 |
+
# Algorithm 2 AdaGrad with Block-Normalized Gradient (AdaGradBNG)
|
| 185 |
+
|
| 186 |
+
1: Choose $x _ { 1 } \in \mathbb { R } ^ { d }$ , $\delta > 0$ and $\eta > 0$ .
|
| 187 |
+
2: for $t = 1 , 2 , . . . , \mathbf { d o }$
|
| 188 |
+
3: Sample a mini-batch data ξt and compute the stochastic partial gradient git = F 0i (xt,ξt)kF 0(xt,ξt)k2
|
| 189 |
+
4: Let gt = (g1t , g2t , . . . , gBt ), g1:t = [g1, g2, . . . , gt] and $\begin{array} { r l r l } { s _ { t } } & { { } } & { = } \end{array}$
|
| 190 |
+
5: ParLet $\tau _ { t } = ( \tau _ { t } ^ { 1 } , \tau _ { t } ^ { 2 } , . . . , \tau _ { t } ^ { B } )$ g1:t,2k2, . . . , kg1:t,dk2)= (s1t , s2t , . . . , sBt ) in the same way as gt.1 2 B 6 i 0 $\tau _ { t } ^ { i } = \eta \| F _ { i } ^ { \prime } ( \dot { x _ { t } } , \xi _ { t } ) \| _ { 2 } ( \delta \mathbf { 1 } _ { d _ { i } } + s _ { t } ^ { i } ) ^ { - 1 }$ .
|
| 191 |
+
7: $x _ { t + 1 } = x _ { t } - \tau _ { t } \circ g _ { t }$
|
| 192 |
+
8: end for
|
| 193 |
+
|
| 194 |
+
Theorem 1 Suppose $F$ is convex over $x$ , $\| F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) \| _ { 2 } \leq M _ { i }$ and $\| x _ { t } - x ^ { * } \| _ { \infty } \leq D _ { \infty }$ for all $t$ for some constants $M _ { i }$ and $D _ { \infty } > 0$ in Algorithm 2. Let $H _ { t } = \delta I _ { d } + d i a g ( s _ { t } )$ and $H _ { t } ^ { i } = \delta I _ { d _ { i } } + d i a g ( s _ { t } ^ { i } )$ for $t = 1 , 2 , \dots$ and $\begin{array} { r } { \bar { x } _ { T } : = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } x _ { t } . } \end{array}$ . Algorithm 2 guarantees
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
\begin{array} { r c l } { \displaystyle \mathtt { S } [ f ( \bar { x } _ { T } ) - f ( x ^ { * } ) ] } & { \le } & { \displaystyle \frac { \| x _ { 1 } - x ^ { * } \| _ { H _ { 1 } } ^ { 2 } } { 2 \eta T } + \frac { D _ { \infty } ^ { 2 } \sqrt { B d } } { 2 \eta \sqrt { T } } + \sum _ { i = 1 } ^ { B } \frac { \eta \mathbb { E } \left[ M _ { i } ^ { 2 } \sum _ { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i } } \| g _ { 1 : T , j } \| _ { 2 } \right] } { T } } \\ & { \le } & { \displaystyle \frac { \| x _ { 1 } - x ^ { * } \| _ { H _ { 1 } } ^ { 2 } } { 2 \eta T } + \frac { D _ { \infty } ^ { 2 } \sqrt { B d } } { 2 \eta \sqrt { T } } + \sum _ { i = 1 } ^ { B } \frac { \eta M _ { i } ^ { 2 } \sqrt { d _ { i } } } { \sqrt { T } } . } \end{array}
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
Proof: It is easy to see that $H _ { t }$ is a positive definite and diagonal matrix. According to the updating scheme of $x _ { t + 1 }$ and the definitions of $H _ { t }$ , $\tau _ { t }$ and $g _ { t }$ , we have
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\begin{array} { r c l } { \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } & { = } & { ( x _ { t } - \tau _ { t } \circ g _ { t } - x ^ { * } ) ^ { \top } H _ { t } ( x _ { t } - \tau _ { t } \circ g _ { t } - x ^ { * } ) } \\ & { = } & { \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } - 2 ( x _ { t } - x ^ { * } ) ^ { \top } H _ { t } ( \tau _ { t } \circ g _ { t } ) + \| \tau _ { t } \circ g _ { t } \| _ { H _ { t } } ^ { 2 } } \\ & { \leq } & { \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } - 2 \eta ( x _ { t } - x ^ { * } ) ^ { \top } F ^ { \prime } ( x _ { t } , \xi _ { t } ) + \| \tau _ { t } \circ g _ { t } \| _ { H _ { t } } ^ { 2 } . } \end{array}
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
The inequality above and the convexity of $F ( x , \xi )$ in $x$ imply
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\begin{array} { r c l } { F ( x _ { t } , \xi _ { t } ) - F ( x ^ { * } , \xi _ { t } ) } & { \le } & { \displaystyle \frac { \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } - \frac { \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } + \frac { \| \tau _ { t } \circ g _ { t } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } } \\ & { = } & { \displaystyle \frac { \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } - \frac { \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } + \sum _ { i = 1 } ^ { B } \frac { \eta \| F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) \| _ { 2 } ^ { 2 } \| g _ { t } ^ { i } \| _ { ( H _ { t } ^ { i } ) ^ { - 1 } } ^ { 2 } } { 2 } ( \frac { \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } + \frac { \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } ) ^ { \frac { 1 } { 2 } } . } \end{array}
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
Taking expectation over $\xi _ { t }$ for $t = 1 , 2 , \ldots$ and averaging the above inequality give
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\begin{array} { r l } & { \mathbb { E } [ f ( \bar { x } _ { T } ) - f ( x ^ { * } ) ] } \\ { \leq } & { \frac { 1 } { T } \displaystyle \sum _ { t = 1 } ^ { T } \left[ \frac { \mathbb { E } \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } - \frac { \mathbb { E } \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } \right] + \displaystyle \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { B } \frac { \eta \mathbb { E } \left[ \| F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) \| _ { 2 } ^ { 2 } \| g _ { t } ^ { i } \| _ { ( H _ { t } ^ { i } ) ^ { - 1 } } ^ { 2 } \right] } { 2 T } } \\ { \leq } & { \frac { 1 } { T } \displaystyle \sum _ { t = 1 } ^ { T } \left[ \frac { \mathbb { E } \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } - \frac { \mathbb { E } \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } { 2 \eta } \right] + \displaystyle \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { B } \frac { \eta M _ { i } ^ { 2 } \mathbb { E } \left[ \| g _ { t } ^ { i } \| _ { ( H _ { t } ^ { i } ) ^ { - 1 } } ^ { 2 } \right] } { 2 T } , \qquad ( \mathbb { E } \| x _ { t } - x ^ { * } \| _ { H _ { t } } ^ { 2 } \mathbb { E } \left[ \| g _ { t } ^ { i } \| _ { H _ { t } ^ { i } } ^ { 2 } \right] ) } \end{array}
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
where we use the fact that $\| F _ { i } ^ { \prime } ( x _ { t } , \xi _ { t } ) \| _ { 2 } ^ { 2 } \leq M _ { i } ^ { 2 }$ in the second inequality.
|
| 219 |
+
|
| 220 |
+
According to the equation (24) in the proof of Lemma 4 in (Duchi et al., 2011), we have
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
\sum _ { t = 1 } ^ { T } \Vert g _ { t } ^ { i } \Vert _ { ( H _ { t } ^ { i } ) ^ { - 1 } } ^ { 2 } = \sum _ { t = 1 } ^ { T } \sum _ { \substack { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i } } \frac { g _ { t , j } ^ { 2 } } { \delta + \Vert g _ { 1 : t , j } \Vert _ { 2 } } \leq \sum _ { \substack { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i } } 2 \Vert g _ { 1 : T , j } \Vert _ { 2 } .
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
Following the analysis in the proof of Theorem 5 in (Duchi et al., 2011), we show that
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
\begin{array} { r c l } { \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t + 1 } } ^ { 2 } - \| x _ { t + 1 } - x ^ { * } \| _ { H _ { t } } ^ { 2 } } & { = } & { \langle x ^ { * } - x _ { t + 1 } , \mathrm { d i a g } ( s _ { t + 1 } - s _ { t } ) ( x ^ { * } - x _ { t + 1 } ) \rangle } \\ & { \leq } & { D _ { \infty } ^ { 2 } \| s _ { t + 1 } - s _ { t } \| _ { 1 } = D _ { \infty } ^ { 2 } \langle s _ { t + 1 } - s _ { t } , \mathbf { 1 } \rangle . } \end{array}
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
After applying (4) and (5) to (3) and reorganizing terms, we have
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\begin{array} { r l } & { \mathbb { E } [ f ( \bar { x } _ { T } ) - f ( x ^ { * } ) ] } \\ { \leq } & { \frac { \| x _ { 1 } - x ^ { * } \| _ { H _ { 1 } } ^ { 2 } } { 2 \eta T } + \frac { D _ { \infty } ^ { 2 } \mathbb { E } \left. s _ { T } , 1 \right. } { 2 \eta T } + \displaystyle \sum _ { i = 1 } ^ { B } \frac { \eta \mathbb { E } \left[ M _ { i } ^ { 2 } \sum _ { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i } } \| g _ { 1 : T , j } \| _ { 2 } \right] } { T } } \\ { \leq } & { \frac { \| x _ { 1 } - x ^ { * } \| _ { H _ { 1 } } ^ { 2 } } { 2 \eta T } + \frac { D _ { \infty } ^ { 2 } \sqrt { B d } } { 2 \eta \sqrt { T } } + \displaystyle \sum _ { i = 1 } ^ { B } \frac { \eta \mathbb { E } \left[ M _ { i } ^ { 2 } \sum _ { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } } \| g _ { 1 : T , j } \| _ { 2 } \right] } { T } , } \end{array}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
where the second inequality is because $\begin{array} { r } { \langle s _ { T } , \mathbf { 1 } \rangle = \sum _ { j = 1 } ^ { d } \| g _ { 1 : T , j } \| _ { 2 } \leq \sqrt { T B d } } \end{array}$ which holds due to Cauchy-Schwarz inequality and the fact that $\| g _ { t } ^ { i } \| _ { 2 } = 1$ . Then, we obtain the first inequality in the conclusion of the theorem. To obtain the second inequality, we only need to observe that
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\sum _ { j = d _ { 1 } + d _ { 2 } + \cdots + d _ { i - 1 } + 1 } ^ { d _ { 1 } + d _ { 2 } + \cdots + d _ { i } } \lVert g _ { 1 : T , j } \rVert _ { 2 } \leq \sqrt { T d _ { i } }
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
which holds because of Cauchy-Schwarz inequality and the fact that $\| g _ { t } ^ { i } \| _ { 2 } = 1$
|
| 245 |
+
|
| 246 |
+
Remark 1 When $B = 1$ , namely, the normalization is applied to the full gradient instead of different blocks of the gradient, the inequality in Theorem $^ { l }$ becomes
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
\begin{array} { r l r } { \mathbb { E } \big [ f ( \bar { x } _ { T } ) - f ( x ^ { * } ) \big ] } & { \leq } & { \displaystyle \frac { \| x _ { 1 } - x ^ { * } \| _ { H _ { 1 } } ^ { 2 } } { 2 \eta T } + \frac { D _ { \infty } ^ { 2 } \sqrt { d } } { 2 \eta \sqrt { T } } + \frac { \eta M ^ { 2 } \sqrt { d } } { \sqrt { T } } , } \end{array}
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
where $M$ is a constant such that $\| F ^ { \prime } ( x _ { t } , \xi _ { t } ) \| _ { 2 } \leq M .$ . Note that the right hand side of this inequality can be larger than that of the inequality in Theorem $^ { l }$ with $B > 1$ . We use $B = 2$ as an example. $\begin{array} { r } { \sum _ { i = 1 } ^ { B } M _ { i } ^ { 2 } \sqrt { d _ { i } } = O ( M ^ { 2 } \sqrt { d _ { 1 } } + M _ { 2 } ^ { 2 } \sqrt { d } ) } \end{array}$ $F _ { 1 } ^ { \prime }$ $F ^ { \prime }$ , e., ich $M _ { 2 } \ll M _ { 1 } \approx M$ and ller t $d _ { 1 } \ll d _ { 2 } \approx d$ $M ^ { 2 } \sqrt { d }$ n havein the $M$ $d$ $B$ necessarily one.
|
md/train/uSQQH7Fj5U/uSQQH7Fj5U.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep learning is adaptive to intrinsic dimensionality of model smoothness in anisotropic Besov space
|
| 2 |
+
|
| 3 |
+
Taiji Suzuki Department of Mathematical Informatics, The University of Tokyo, Tokyo, Japan RIKEN Center for Advanced Intelligence Project, Tokyo, Japan taiji@mist.i.u-tokyo.ac.jp
|
| 4 |
+
|
| 5 |
+
Atsushi Nitanda Kyushu Institute of Technology, Fukuoka, Japan RIKEN Center for Advanced Intelligence Project, Tokyo, Japan nitanda@ai.kyutech.ac.jp
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Deep learning has exhibited superior performance for various tasks, especially for high-dimensional datasets, such as images. To understand this property, we investigate the approximation and estimation ability of deep learning on anisotropic Besov spaces. The anisotropic Besov space is characterized by direction-dependent smoothness and includes several function classes that have been investigated thus far. We demonstrate that the approximation error and estimation error of deep learning only depend on the average value of the smoothness parameters in all directions. Consequently, the curse of dimensionality can be avoided if the smoothness of the target function is highly anisotropic. Unlike existing studies, our analysis does not require a low-dimensional structure of the input data. We also investigate the minimax optimality of deep learning and compare its performance with that of the kernel method (more generally, linear estimators). The results show that deep learning has better dependence on the input dimensionality if the target function possesses anisotropic smoothness, and it achieves an adaptive rate for functions with spatially inhomogeneous smoothness.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Based on the recent literature pertaining to machine learning, deep learning has exhibited superior performance in several tasks such as image recognition (Krizhevsky et al., 2012), natural language processing (Devlin et al., 2018), and image synthesis (Radford et al., 2015). In particular, its superiority is remarkable for complicated and high-dimensional data like images. This is mainly due to its high flexibility and superior feature-extraction ability for effectively extracting the intrinsic structure of data. Its theoretical analysis also has been extensively developed considering several aspects such as expressive ability, optimization, and generalization error.
|
| 14 |
+
|
| 15 |
+
Amongst representation ability analysis of deep neural networks such as universal approximation ability (Cybenko, 1989; Hornik, 1991; Sonoda & Murata, 2017), approximation theory of deep neural networks on typical function classes such as Holder, Sobolev, and Besov spaces have been¨ extensively studied. In particular, analyses of deep neural networks with the ReLU activation (Nair & Hinton, 2010; Glorot et al., 2011) have been recently developed. Schmidt-Hieber (2020) showed that the deep learning with ReLU activations can achieve the minimax optimal estimation accuracy to estimate composite functions in Holder spaces by using the approximation theory of ¨ Yarotsky (2017). Suzuki (2019) generalized this analysis to those on the Besov space and the mixed smooth
|
| 16 |
+
|
| 17 |
+
Table 1: Relationship between existing research and our work. $\beta$ indicates the smoothness of the target function, $d$ is the dimensionality of input $x$ , $D$ is the dimensionality of a low-dimensional structure on which the data are distributed, and $\widetilde { \beta }$ is the average smoothness of an anisotropic Besov space (Eq. (1)).
|
| 18 |
+
|
| 19 |
+
<table><tr><td rowspan=1 colspan=1>Functionclass</td><td rowspan=1 colspan=1>Holder</td><td rowspan=1 colspan=1>Besov</td><td rowspan=1 colspan=1>mixed smoothBesov</td><td rowspan=1 colspan=1>Holder onalow-dimensional set</td><td rowspan=1 colspan=1>anisotropicBesov</td></tr><tr><td rowspan=1 colspan=1>Author</td><td rowspan=1 colspan=1>Schmidt-Hieber(2020)</td><td rowspan=1 colspan=1>Suzuki(2019)</td><td rowspan=1 colspan=1>Suzuki (2019)</td><td rowspan=1 colspan=1>Nakada & Imaizumi(2020);Schmidt-Hieber(2019); Chen et al. (2019)</td><td rowspan=1 colspan=1>This work</td></tr><tr><td rowspan=1 colspan=1>Estimationerror</td><td rowspan=1 colspan=1>O(n-2a)2β</td><td rowspan=1 colspan=1>O(n-2)2β</td><td rowspan=1 colspan=1>o(n-2β2+1×2(d-1)(u+β)log(n) 1+2β</td><td rowspan=1 colspan=1>O(n-2D)2β</td><td rowspan=1 colspan=1>2β0(n-2+1)</td></tr></table>
|
| 20 |
+
|
| 21 |
+
Besov space by utilizing the techniques developed in approximation theories (Temlyakov, 1993; DeVore, 1998). It was shown that deep learning can achieve an adaptive approximation error rate that is faster than that of (non-adaptive) linear approximation methods (DeVore & Popov, 1988; DeVore et al., 1993; Dung ˜ , 2011), and it outperforms any linear estimators (including kernel ridge regression) in terms of the minimax optimal rate.
|
| 22 |
+
|
| 23 |
+
From these analyses, one can see that the approximation errors and estimation errors are strongly influenced by two factors, i.e., the smoothness of the target function and the dimensionality of the input (see Table 1). In particular, they suffer from the curse of dimensionality, which is unavoidable. However, these analyses are about the worst case errors and do not exploit specific intrinsic properties of the true distributions. For example, practically encountered data usually possess low intrinsic dimensionality, i.e., data are distributed on a low dimensional sub-manifold of the input space (Tenenbaum et al., 2000; Belkin & Niyogi, 2003). Recently, Nakada & Imaizumi (2020); Schmidt-Hieber (2019); Chen et al. (2019); Chen et al. (2019) have shown that deep ReLU network has adaptivity to the intrinsic dimensionality of data and can avoid curse of dimensionality if the intrinsic dimensionality is small. However, one drawback is that they assumed exact low dimensionality of the input data. This could be a strong assumption because practically observed data are always noisy, and injecting noise immediately destroys the low-dimensional structure. Therefore, we consider another direction in this paper. In terms of curse of dimensionality, Suzuki (2019) showed that deep learning can alleviate the curse of dimensionality to estimate functions in a so called mixed smooth Besov space (m-Besov). However, m-Besov space assumes strong smoothness toward all directions uniformly and does not include the ordinary Besov space as a special case. Moreover, the convergence rate includes heavy poly-log term which is not negligible (see Table 1).
|
| 24 |
+
|
| 25 |
+
In practice, one of the typically expected properties of a true function on high-dimensional data is that it is invariant against perturbations of an input in some specific directions (Figure 1). For example, in image-recognition tasks, the target function must be invariant against the spatial shift of an input image, which is utilized by data-augmentation techniques (Simard et al., 2003; Krizhevsky et al., 2012). In this paper, we investigate the approximation and estimation abilities of deep learning on anisotropic Besov spaces (Nikol’skii, 1975; Vybiral, 2006; Triebel, 2011) (also called dominated mixed-smooth Besov spaces). An anisotropic Besov space is a set of functions that have “direction-dependent” smoothness, whereas ordinary function spaces such as Holder, Sobolev, and ¨ Besov spaces assume isotropic smoothness that is uniform in all directions. We consider a composition of functions included in an anisotropic Besov space, including several existing settings as special cases; it includes analyses of the Holder space ¨ Schmidt-Hieber (2020) and Besov space Suzuki (2019), as well as the low-dimensional sub-manifold setting (Nakada & Imaizumi, 2020; Schmidt-Hieber, 2019; Chen et al., 2019; Chen et al., 2019)1. By considering such a space, we can show that deep learning can alleviate curse of dimensionality if the smoothness in each direction is highly anisotropic. Interestingly, any linear estimator (including kernel ridge regression) has worse dependence on the dimensionality than deep learning. Our contributions can be summarized as follows:
|
| 26 |
+
|
| 27 |
+
• We consider a situation in which the target function is included in a class of anisotropic Besov spaces and show that deep learning can avoid the curse of dimensionality even if the input data do not lie on a low-dimensional manifold. Moreover, deep learning can achieve the optimal adaptive approximation error rate and minimax optimal estimation error rate.
|
| 28 |
+
|
| 29 |
+
• We compare deep learning with general linear estimators (including kernel methods) and show that deep learning has better dependence on the input dimensionality than linear estimators.
|
| 30 |
+
|
| 31 |
+
# 2 Problem setting and the model
|
| 32 |
+
|
| 33 |
+
In this section, we describe the problem setting considered in this work. We consider the following nonparametric regression model:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
y _ { i } = f ^ { \mathrm { o } } ( x _ { i } ) + \xi _ { i } \quad ( i = 1 , \ldots , n ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $x _ { i }$ is generated from a probability distribution $P _ { X }$ on $[ 0 , 1 ] ^ { d } , \ \xi _ { i } \ \sim \ N ( 0 , \sigma ^ { 2 } )$ , and the data $D _ { n } \ = \ ( x _ { i } , y _ { i } ) _ { i = 1 } ^ { n }$ are independently identically distributed. $f ^ { \mathrm { o } }$ is the true function that we want to estimate. We are interested in the mean squared estimation error of an estimator $\hat { f }$ : $\mathrm { E } _ { D _ { n } } [ \| \widehat { f } - f ^ { \mathrm { o } } \| _ { L ^ { 2 } ( P _ { X } ) } ^ { 2 } ]$ , where $\operatorname { E } _ { D _ { n } } [ . ]$ indicates the expectation with respect to the training data $D _ { n }$ . We consider a least-squares estimator in the deep neural network model as $\widehat { f }$ (see Eq. (5)) and discuss its optimality. More specifically, we investigate how the “intrinsic dimensionality” of data affects the estimation accuracy of deep learning. For this purpose, we consider an anisotropic Besov space as a model of the target function.
|
| 40 |
+
|
| 41 |
+
# 2.1 Anisotropic Besov space
|
| 42 |
+
|
| 43 |
+
In this section, we introduce the anisotropic Besov which was investigated as the model of the true function in this paper. Throughout this paper, we set the domain of the input to $\Omega = [ 0 , 1 ] ^ { d }$ . For a function $f : \Omega \to \mathbb { R }$ , let $\begin{array} { r } { \| f \| _ { p } : = \| f \| _ { L ^ { p } ( \Omega ) } : = ( \int _ { \Omega } | f | ^ { p } \mathrm { d } x ) ^ { 1 / p } } \end{array}$ for $0 < p < \infty$ . For $p = \infty$ , we define $\| f \| _ { \infty } : = \| f \| _ { L ^ { \infty } ( \Omega ) } : = \operatorname* { s u p } _ { x \in \Omega } | f ( x ) |$ . For $\beta \in \mathbb { R } _ { + + } ^ { d }$ , let $\begin{array} { r } { | \beta | = \sum _ { j = 1 } ^ { d } | \beta _ { j } | ^ { 2 } } \end{array}$ .
|
| 44 |
+
|
| 45 |
+
For a function $f : { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ , we define the $r$ th difference of $f$ in the direction $h \in \mathbb { R } ^ { d }$ as
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\Delta _ { h } ^ { r } ( f ) ( x ) : = \Delta _ { h } ^ { r - 1 } ( f ) ( x + h ) - \Delta _ { h } ^ { r - 1 } ( f ) ( x ) , \Delta _ { h } ^ { 0 } ( f ) ( x ) : = f ( x ) ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
for $x \in \Omega$ with $x + r h \in \Omega$ , otherwise, let $\Delta _ { h } ^ { r } ( f ) ( x ) = 0$ .
|
| 52 |
+
|
| 53 |
+
Definition 1. For a function $f \in L ^ { p } ( \Omega )$ where $p \in ( 0 , \infty ]$ , the $r$ -th modulus of smoothness of $f$ is defined by $\begin{array} { r } { w _ { r , p } ( f , t ) = \operatorname* { s u p } _ { h \in \mathbb { R } ^ { d } : | h _ { i } | \leq t _ { i } } \| \Delta _ { h } ^ { r } ( f ) \| _ { p } , f o r t = ( t _ { 1 } , \ldots , t _ { d } ) , t _ { i } > 0 . } \end{array}$
|
| 54 |
+
|
| 55 |
+
With this modulus of smoothness, we define the anisotropic Besov space $B _ { p , q } ^ { \beta } ( \Omega )$ for $\beta \ =$ $( \beta _ { 1 } , \ldots , \beta _ { d } ) ^ { \top } \in \mathbb { R } _ { + + } ^ { d }$ as follows.
|
| 56 |
+
|
| 57 |
+
Definition 2 (Anisotropic Besov space $( B _ { p , q } ^ { \beta } ( \Omega ) ) )$ . For $0 < p , q \le \infty$ , $\beta = ( \beta _ { 1 } , \ldots , \beta _ { d } ) ^ { \top } \in \mathbb { R } _ { + + } ^ { d } ,$ r := maxibβic + 1, let the seminorm | · |Bαp,q be
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
| f | _ { B _ { p , q } ^ { \beta } } : = \left\{ \begin{array} { l l } { \left( \sum _ { k = 0 } ^ { \infty } [ 2 ^ { k } w _ { r , p } ( f , ( 2 ^ { - k / \beta _ { 1 } } , \ldots , 2 ^ { - k / \beta _ { d } } ) ) ] ^ { q } \right) ^ { 1 / q } } & { ( q < \infty ) , } \\ { \operatorname* { s u p } _ { k \geq 0 } 2 ^ { k } w _ { r , p } ( f , ( 2 ^ { - k / \beta _ { 1 } } , \ldots , 2 ^ { - k / \beta _ { d } } ) ) } & { ( q = \infty ) . } \end{array} \right.
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The norm of the anisotropic Besov space $B _ { p , q } ^ { \beta } ( \Omega )$ is defined by $\lVert f \rVert _ { B _ { p , q } ^ { \beta } } : = \lVert f \rVert _ { p } + \lvert f \rvert _ { B _ { p , q } ^ { \beta } }$ , and $B _ { p , q } ^ { \beta } ( \Omega ) = \{ f \in L ^ { p } ( \Omega ) \mid \| f \| _ { B _ { p , q } ^ { \beta } } < \infty \} .$ .
|
| 64 |
+
|
| 65 |
+
Roughly speaking $\beta$ represents the smoothness in each direction. If $\beta _ { i }$ is large, then a function in $B _ { p , q } ^ { \beta }$ is smooth to the $i$ th coordinate direction, otherwise, it is non-smooth to that direction. $p$ is also an important quantity that controls the spatial inhomogeneity of the smoothness. If $\beta _ { 1 } = \beta _ { 2 } = \cdot \cdot \cdot =$ $\beta _ { d }$ , then the definition is equivalent to the usual Besov space (DeVore & Popov, 1988; DeVore et al., 1993). Suzuki (2019) analyzed curse of dimensionality of deep learning through a so-called mixed smooth Besov (m-Besov) space which imposes a stronger condition toward all directions uniformly.
|
| 66 |
+
|
| 67 |
+
Particularly, it imposes stronger smoothness toward non-coordinate axis directions. Moreover, mBesov space does not include the vanilla Besov space as a special case and thus cannot capture the situation that we consider in this paper.
|
| 68 |
+
|
| 69 |
+
Throughout this paper, for given $\beta = ( \beta _ { 1 } , \ldots , \beta _ { d } ) ^ { \top } \in \mathbb { R } _ { + + } ^ { d }$ , we write $\underline { { \beta } } : = \operatorname* { m i n } _ { i } \beta _ { i }$ (smallest smoothness) and $\overline { { \beta } } : = \operatorname* { m a x } _ { i } \beta _ { i }$ (largest smoothness). The approximation error of a function in anisotropic Besov spaces is characterized by the harmonic mean of $( \beta _ { j } ) _ { j = 1 } ^ { d }$ , which corresponds to the average smoothness, and thus we define
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r } { \widetilde { \beta } : = \left( \sum _ { j = 1 } ^ { d } 1 / \beta _ { j } \right) ^ { - 1 } . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
The Besov space is closely related to other function spaces such as Holder space. Let ¨ $\partial ^ { \alpha } f ( x ) =$ $\frac { \partial ^ { | \alpha | } f } { \partial ^ { \alpha _ { 1 } } x _ { 1 } . . . \partial ^ { \alpha _ { d } } x _ { d } } ( x )$ .
|
| 76 |
+
|
| 77 |
+
Definition 3 (Holder space¨ $( \mathscr { C } ^ { \beta } ( \Omega ) ) )$ . For a smoothness paraemter $\beta \in \mathbb { R } _ { + + }$ with $\beta \notin \mathbb { N }$ , consider an $m$ times differentiable function $f ~ : ~ \mathbb { R } ^ { d } ~ \to ~ \mathbb { R }$ where $m ~ = ~ \left\lfloor \beta \right\rfloor$ (the largest integer less than $\beta$ ), and let the norm of the Holder space ¨ $\mathscr { C } ^ { \beta } ( \Omega )$ be $\| f \| _ { \mathcal { C } ^ { \beta } } : = \operatorname* { m a x } _ { | \alpha | \leq m } \| \partial ^ { \alpha } f \| _ { \infty } +$ $\begin{array} { r l } & { \operatorname* { m a x } _ { | \alpha | = m } \operatorname* { s u p } _ { x , y \in \Omega } \frac { | \partial ^ { \alpha } f ( x ) - \partial ^ { \alpha } f ( y ) | } { \| x - y \| ^ { \beta - m } } } \end{array}$ |∂αf(x)−∂αf(y)|kx−ykβ−m . Then, (β-)Holder space ¨ Cβ(Ω) is defined as Cβ(Ω) = {f | $\| f \| _ { C ^ { \beta } } < \infty \}$ .
|
| 78 |
+
|
| 79 |
+
Let ${ \mathcal { C } } ^ { 0 } ( \Omega )$ be the set of continuous functions equipped with $L ^ { \infty }$ -norm: $\mathcal { C } ^ { 0 } ( \Omega ) : = \{ f : \Omega \to \mathbb { R } \ |$ $f$ is continuous and $\| f \| _ { \infty } < \infty \}$ . These function spaces are closely related to each other.
|
| 80 |
+
|
| 81 |
+
Proposition 1 (Triebel (2011)). There exist the following relations between the spaces:
|
| 82 |
+
|
| 83 |
+
1. For $\beta = ( \beta _ { 0 } , \ldots , \beta _ { 0 } ) ^ { \intercal } \in \mathbb { R } ^ { d }$ with $\beta _ { 0 } \notin \mathbb { N } ,$ , it holds that $\mathcal { C } ^ { \beta _ { 0 } } ( \Omega ) = B _ { \infty , \infty } ^ { \beta } ( \Omega )$ . 2. For $0 < p _ { 1 } , p _ { 2 } , q \le \infty$ , $p _ { 1 } \leq p _ { 2 }$ and $\beta \in \mathbb { R } _ { + + } ^ { d }$ with $\widetilde { \beta } > ( 1 / p _ { 1 } - 1 / p _ { 2 } ) _ { + } { } ^ { 3 }$ , it holds that4 $B _ { p _ { 1 } , q } ^ { \beta } ( \Omega ) \hookrightarrow B _ { p _ { 2 } , q } ^ { \gamma \beta } ( \Omega ) f o r \gamma = 1 - ( 1 / p _ { 1 } - 1 / p _ { 2 } ) _ { + } / \tilde { \beta }$ . 13. For $0 < p , q _ { 1 } , q _ { 2 } \leq \infty$ , $q _ { 1 } < q _ { 2 }$ , and $\beta \in \mathbb { R } _ { + + } ^ { d }$ , it holds that $B _ { p , q _ { 1 } } ^ { \beta } \hookrightarrow B _ { p , q _ { 2 } } ^ { \beta }$ . In particular, with properties $^ { l }$ and 2, $i f \widetilde { \beta } > 1 / p ,$ , it holds that $B _ { p , q } ^ { \beta } ( \Omega ) \hookrightarrow \mathcal { C } ^ { \gamma \beta } ( \Omega )$ where $\gamma = 1 - 1 / ( \widetilde { \beta } p )$ . 4. For $0 < p , q \le \infty$ and $\beta \in \mathbb { R } _ { + + } ^ { d }$ , $i f { \widetilde \beta } > 1 / p$ , then $B _ { p , q } ^ { \beta } ( \Omega ) \hookrightarrow \mathcal { C } ^ { 0 } ( \Omega )$ .
|
| 84 |
+
|
| 85 |
+
This result is basically proven by Triebel (2011). For completeness, we provide its derivation in Appendix D. If the average smoothness $\widetilde { \beta }$ is sufficiently large $( \widetilde { \beta } > 1 / \bar { p } )$ , then the functions in $B _ { p , q } ^ { \beta }$ are continuous; however, if it is small $( { \widetilde \beta } < 1 / p )$ , then they are no longer continuous. Small $p$ indicates spatially inhomogeneous smoothness; thus, spikes and jumps appear (see Donoho & Johnstone (1998) for this perspective, from the viewpoint of wavelet analysis).
|
| 86 |
+
|
| 87 |
+
# 2.2 Model of the true function
|
| 88 |
+
|
| 89 |
+
As a model of the true function $f ^ { \mathrm { o } }$ , we consider two types of models: Affien composition model and deep composition model. For a Banach space $\mathcal { H }$ , we let $U ( \mathcal { H } )$ be the unit ball of $\mathcal { H }$ .
|
| 90 |
+
|
| 91 |
+
(a) Affine composition model: The first model we introduced is a very naive model which is just a composition of an affine transformation and a function in the anisotropic Besov space:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \mathcal { H } _ { \mathrm { a f f } } : = \{ h ( A x + b ) ~ \vert ~ h \in U ( B _ { p , q } ^ { \beta } ( [ 0 , 1 ] ^ { \bar { d } } ) ) , ~ A \in \mathbb { R } ^ { \bar { d } \times d } , ~ b \in \mathbb { R } ^ { b } \mathrm { ~ s . t . ~ } A x + b \in [ 0 , 1 ] ^ { \bar { d } } \left( \forall x \in \Omega \right) \} , } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where we assume $\tilde { d } \leq d$ . Here, we assumed that the affine transformation has an appropriate scaling such that $A x + b$ is included in the domain of $h$ for all $x \in \Omega$ . This is a quite naive model but provides an instructive example to understand how the estimation error of deep learning behaves under the anisotropic setting.
|
| 98 |
+
|
| 99 |
+
(b) Deep composition model: The deep composition model generalizes the affine composition model to a composition of nonlinear functions. Let $m _ { 1 } = d , m _ { L + 1 } = 1 , m _ { \ell }$ be the dimension of the \`th layer, and let $\beta ^ { ( \ell ) } \in \mathbb { R } _ { + + } ^ { m _ { \ell } }$ be the smoothness parameter in the \`th layer. The deep composition model is defined as
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 1: Near low dimensional data distribution with anisotropic smoothness of the target function. The target function has less smoothness $( s _ { 1 } , s _ { 2 } )$ toward the first two coordinates on the manifold while it is almost constant toward the third coordinate (large $s _ { 3 }$ ).
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
H _ { \mathrm { d e e p } } : = \{ h _ { H } \circ \cdot \cdot \circ h _ { 1 } ( x ) \mid h _ { \ell } : [ 0 , 1 ] ^ { m _ { \ell } } \} [ 0 , 1 ] ^ { m _ { \ell + 1 } } , h _ { \ell , k } \in U ( B _ { p , q } ^ { \beta ^ { ( \ell ) } } ( [ 0 , 1 ] ^ { m _ { \ell } } ) ) \left( \forall k \in [ m _ { \ell + 1 } ] \right) \} .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Here, the interval ference can be abs $[ 0 , 1 ]$ can be replaced by another compact interval, by changing a scaling factor. The assumption $\| h _ { \ell , k } \| _ { B _ { p , q } ^ { \beta ^ { ( \ell ) } } } \leq 1$ $[ a _ { \ell } , b _ { \ell } ]$ but this dif-can also be affine composition model as a special case. However, it requires a stronger assumption to properly evaluate the estimation error on this model.
|
| 109 |
+
|
| 110 |
+
Examples The model we have introduced includes some instructive examples as listed below:
|
| 111 |
+
|
| 112 |
+
(a) Linear projection Schmidt-Hieber (2020) analyzed estimation of the following model by deep learning: $\bar { f ^ { \mathrm { o } } } ( \bar { x } ) = g ( w ^ { \top } x )$ where $g \in \mathcal { C } ^ { \beta } ( [ 0 , 1 ] )$ and $w \in \mathbb { R } ^ { d }$ . In this example, the function $f ^ { \mathrm { o } }$ varies along only one direction, $w$ . Apparently, this is an example of the affine composition model.
|
| 113 |
+
|
| 114 |
+
(b) Distribution on low dimensional smooth manifold Assume that the input $x$ is distributed on a low-dimensional smooth manifold embedded in $\Omega$ , and the smoothness of the true function $f ^ { \mathrm { o } }$ is anisotropic along a coordinate direction on the manifold. We suppose that the low dimensional manifold is $\tilde { d }$ -dimensional and $\tilde { d } \ll d$ . In this situation, the true function can be written as $f ^ { \mathrm { o } } ( x ) = h ( \phi ( x ) )$ where $\phi : \mathbb { R } ^ { d } \mathbb { R } ^ { \tilde { d } }$ is a map that returns the coordinate of $x$ on the manifold and $h$ is an element in an anisotropic Besov space on $\mathbb { R } ^ { \tilde { d } }$ . This situation appears if data is distributed on a low-dimensional sub-manifold of $\Omega$ and the target function is invariant against noise injection to some direction on the manifold at each input point $x$ (Figure 1 illustrates this situation). One typical example of this situation is a function invariant with data augmentation (Simard et al., 2003; Krizhevsky et al., 2012). Even if the noise injection destroys low dimensionality of the data distribution (i.e., $\bar { \tilde { d } } = d _ { \ast }$ , an anisotropic smoothness of the target function eases the curse of dimensionality as analyzed below, which is quite different from existing works (Yang & Dunson, 2016; Bickel & Li, 2007; Nakada & Imaizumi, 2020; Schmidt-Hieber, 2019; Chen et al., 2019; Chen et al., 2019).
|
| 115 |
+
|
| 116 |
+
Related work Here, we introduce some more related work and discuss their relation to our analysis. The statistical analysis on an anisotropic Besov space can be back to Ibragimov & Khas’minskii (1984) who considered density estimation, where the density is assumed to be included in an anisotropic Sobolev space with $p \geq 2$ , and derived the minimax optimal rate $n ^ { - r \widetilde { \beta } / ( 2 \widetilde { \beta } + 1 ) }$ with respect to $L ^ { r }$ -norm. Nyssbaum (1983, 1987) analyzed a nonparametric regression problem on an anisotropic Besov space. Following these results, several studied have been conducted in the literature pertaining to nonparametric statistics, such as nonlinear kernel estimator Kerkyacharian et al. (2001), adaptive confidence band construction Hoffman & Lepski (2002), optimal aggregation Gaiffas & Lecue (2011), Gaussian process estimator Bhattacharya et al. (2011, 2014), and kernel ridge regression Hang & Steinwart (2018). Basically, these studies investigated estimation problems in which the target function is in anisotropic Besov spaces, but the composition models considered in this paper have not been analyzed. Hoffman & Lepski (2002); Bhattacharya et al. (2011) considered a dimension reduction model; that is, the target function is dependent on only a few variables of $x$ , but they did not deal with more general models, such as the affine/deep composition models. The nonparametric regression problems where the input data are distributed on a low-dimensional smooth manifold has been studied as a “manifold regression” Yang & Dunson (2016); Bickel & Li (2007); Yang & Tokdar (2015). Such a model can be considered as a specific example of the deep composition model. In this sense, our analysis is a significant extension of these analyses.
|
| 117 |
+
|
| 118 |
+
# 3 Approximation error analysis
|
| 119 |
+
|
| 120 |
+
Here, we consider approximating the true function $f ^ { \mathrm { o } }$ via a deep neural network and derive the approximation error. As the activation function, we consider the ReLU activation denoted by $\eta ( x ) = \operatorname* { m a x } \{ x , 0 \}$ $( x \in \mathbb { R }$ ). For a vector $x$ , $\eta ( x )$ is operated in an element-wise manner. The model of neural networks with height $L$ , width $W$ , sparsity constraint $S$ , and norm constraint $B$ as $\Phi ( L , W , S , B ) : = \{ ( \mathcal { W } ^ { ( L ) } \eta ( \cdot ) + \bar { b ^ { ( L ) } } ) \circ \cdot \cdot \cdot \circ ( \mathcal { W } ^ { ( 1 ) } \bar { x } + b ^ { ( 1 ) } ) \ | \ \mathcal { W } ^ { ( L ) } \in \mathbb { R } ^ { 1 \times W } .$ , $b ^ { ( L ) } \in \mathbb { R }$ , $\mathcal { W } ^ { ( 1 ) } \in$ $\mathbb { R } ^ { W \times d }$ , $b ^ { ( 1 ) } \in \mathbb { R } ^ { W } , \mathcal { W } ^ { ( \ell ) } \in \mathbb { R } ^ { W \times W }$ , $b ^ { ( \ell ) } \in \mathbb { R } ^ { W } ( 1 < \ell < L ) , \sum _ { \ell = 1 } ^ { L } ( \| \mathcal { W } ^ { ( \ell ) } \| _ { 0 } + \| b ^ { ( \ell ) } \| _ { 0 } ) \le$ $S , \operatorname* { m a x } _ { \ell } \| \mathcal W ^ { ( \ell ) } \| _ { \infty } \vee \| b ^ { ( \ell ) } \| _ { \infty } \le B \}$ , where $\| \cdot \| _ { 0 }$ is the $\ell _ { 0 }$ -norm of the matrix (the number of nonzero elements of the matrix), and $\| \cdot \| _ { \infty }$ is the $\ell _ { \infty }$ -norm of the matrix (maximum of the absolute values of the elements). The sparsity constraint and norm bounds are required to obtain the nearoptimal rate of the estimation error. To evaluate the accuracy of the deep neural network model in approximating target functions, we define the worst-case approximation error as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r } { R _ { r } ( \mathcal { F } , \mathcal { H } ) : = \operatorname* { s u p } _ { f ^ { * } \in \mathcal { H } } \operatorname* { i n f } _ { f \in \mathcal { F } } \| f ^ { * } - f \| _ { L ^ { r } ( \Omega ) } , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\mathcal { F }$ is the set of functions used for approximation, and $\mathcal { H }$ is the set of target functions.
|
| 127 |
+
|
| 128 |
+
Proposition 2 (Approximation ability for anisotropic Besov space). Suppose that $0 < p , q , r \leq \infty$ and $\beta \in \mathbb { R } _ { + + } ^ { d }$ satisfy the following condition: $\widetilde { \beta } > ( 1 / p - 1 / r ) _ { + }$ . Assume that $m \in \mathbb { N }$ satisfies $0 < \overline { { \beta } } < \operatorname* { m i n } ( m , m - 1 + 1 / p )$ . Let $\delta = ( 1 / p - 1 / r ) _ { + }$ , $\nu = ( \widetilde { \beta } - \delta ) / ( 2 \delta )$ and $W _ { 0 } ( d ) : =$ $6 d m ( m + 2 ) + 2 d$ . Then, for $N \in \mathbb N$ , we can bound the approximation error as
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
R _ { r } ( \Phi ( L _ { 1 } , W _ { 1 } , S _ { 1 } , B _ { 1 } ) , U ( B _ { p , q } ^ { \beta } ( \Omega ) ) ) \lesssim N ^ { - \widetilde { \beta } } ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
by setting
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { r l } & { L _ { 1 } ( d ) : = 3 + 2 \lceil \log _ { 2 } \left( \frac { 3 ^ { d \vee m } } { \epsilon c _ { ( d , m ) } } \right) + 5 \rceil \lceil \log _ { 2 } ( d \vee m ) \rceil , W _ { 1 } ( d ) : = N W _ { 0 } , } \\ & { S _ { 1 } ( d ) : = \lbrack ( L - 1 ) W _ { 0 } ^ { 2 } + 1 \rbrack N , B _ { 1 } ( d ) : = O ( N ^ { d ( 1 + \nu ^ { - 1 } ) ( 1 / p - \widetilde { \beta } ) _ { + } } ) , } \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
for $\epsilon = N ^ { - \widetilde { \beta } } \log ( N ) ^ { - 1 }$ and a constant $c _ { ( d , m ) }$ depending only on $d$ and $m$
|
| 141 |
+
|
| 142 |
+
The proof of this proposition is provided in Appendix B. The rate $N ^ { - \widetilde { \beta } }$ is the optimal adaptive approximation error rate that can be achieved by a model with $N$ parameters (the difference between adaptive and non-adaptive methods is explained in the discussion below). Note that this is an approximation error in an oracle setting and no sample complexity appears here. We notice that we can avoid the curse of dimensionality if the average smoothness $\widetilde { \beta }$ is small. This means that if the target function is non-smooth in only a few directions and smooth in other directions, we can avoid the curse of dimensionality. In contrast, if we consider an isotropic Besov space where $\beta _ { 1 } = \cdots = \beta _ { d } ( = \underline { { \beta } } )$ , then $\widetilde { \beta } = \underline { { \beta } } / d$ , which directly depends on the dimensionality $d$ , and we need an exponentially large number of parameters in this situation to achieve $\epsilon$ -accuracy. Therefore, the anisotropic smoothness has a significant impact on the approximation error rate. The assumption $\widetilde { \beta } > ( 1 / p - 1 / r ) _ { + }$ ensures the $L _ { r }$ -integrability of the target function, and the inequality (without equality) admits a near-optimal wavelet approximation of the target function in terms of $L _ { r }$ -norm.
|
| 143 |
+
|
| 144 |
+
Using this evaluation as a basic tool, we can obtain the approximation error for the deep composition models. We can also obtain the approximation error for the affine composition models, but it is almost identical to Proposition 2. Therefore, we defer it to Appendix A.
|
| 145 |
+
|
| 146 |
+
Theorem 1 (Deep composition model). Assume that $\widetilde { \beta } ^ { ( \ell ) } > 1 / p$ for all $\ell = 1 , \ldots , H$ . Then, the estimation error on the deep composition model is bounded as
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
R _ { \infty } ( \Phi ( L , W , S , B ) , \mathcal { H } _ { \mathrm { d e e p } } ) \lesssim \operatorname* { m a x } _ { \ell \in [ H ] } N ^ { - \widetilde { \beta } ^ { * ( \ell ) } } ,
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { r l } & { v h e r e ~ \widetilde { \beta } ^ { * } ^ { ( \ell ) } = \widetilde { \beta } ^ { ( \ell ) } \prod _ { k = \ell + 1 } ^ { H } [ ( \underline { { \beta } } ^ { ( k ) } - 1 / p ) \wedge 1 ] , a n d \ L = \sum _ { \ell = 1 } ^ { H } ( L _ { 1 } ( m _ { \ell } ) + 1 ) , W = \operatorname* { m a x } _ { \ell } ( W _ { 1 } ( m _ { \ell } ) \vee \ell ) } \\ & { n _ { \ell + 1 } ) , S = \sum _ { \ell = 1 } ^ { H } ( S _ { 1 } ( m _ { \ell } ) + 3 m _ { \ell + 1 } ) , B = \operatorname* { m a x } _ { \ell } B _ { 1 } ( m _ { \ell } ) . } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
The proof can be found in Appendix B.1. Since the model is more general than the vanilla anisotropic Besov space, we require a stronger assumption $\widetilde { \beta } ^ { ( \ell ) } > 1 / p$ on $\widetilde { \beta } ^ { \left( \ell \right) }$ than the condition in Proposition 2. This is because we need to bound the Holder smoothness of the remaining ¨ layers to bound the influence of the approximation error in the internal layers to the entire function. Holder smoothness is ensured according to the embedding property under this condition (Proposi- ¨ tion 1). This Holder smoothness assumption affects the approximation error rate. The convergence ¨ rate ${ \widetilde { \beta } } ^ { * ( \ell ) }$ in Eq. (4) is different from that in Eq. (8). This is because the approximation error in the internal layers are propagated through the remaining layers with Holder smoothness and its ¨ amplitude is controlled by the Holder smoothness. ¨
|
| 157 |
+
|
| 158 |
+
Approximation error by non-adaptive method The approximation error obtained in the previous section is called an adaptive error rate in the literature regarding approximation theory (DeVore, 1998). If we fix $N$ bases beforehand and approximate the target function by a linear combination of the $N$ bases (which is called the non-adaptive method), then we cannot achieve the adaptive error rate obtained in the previous section. Roughly speaking, the approximation error of non-adaptive methods is lower bounded by $\begin{array} { r } { N ^ { - \left( \widetilde { \beta } - \left( \frac { 1 } { p } - \frac { 1 } { \operatorname* { m i n } \left\{ 2 , r \right\} } \right) + \right) } } \end{array}$ (Myronyuk, 2015, 2016, 2017), which is slower than the approximation error rate of deep neural networks especially for small $p$ .
|
| 159 |
+
|
| 160 |
+
# 4 Estimation error analysis
|
| 161 |
+
|
| 162 |
+
In this section, we analyze the accuracy of deep learning in estimating a function in compositions of anisotropic Besov spaces. We consider a least-squares estimator in the deep neural network model:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\begin{array} { r } { \widehat { f } = \operatorname * { a r g m i n } _ { \bar { f } : f \in \Phi ( L , W , S , B ) } \sum _ { i = 1 } ^ { n } ( y _ { i } - \bar { f } ( x _ { i } ) ) ^ { 2 } } \end{array}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $\bar { f }$ is the clipping of $f$ defined by $\bar { f } = \operatorname* { m i n } \{ \operatorname* { m a x } \{ f , - F \} , F \}$ for a constant $F > 0$ which is realized by ReLU units. The network parameters $( L , W , S , B )$ should be specified appropriately as indicated in Theorems 2 and 3. In practice, these parameters can be specified by cross validation. Indeed, we can theoretically show that cross validation can provide the appropriate choice of these parameters in compensation to an additional $\log ( n )$ -factor in the estimation error bound. This estimator can be seen as a sparsely regularized estimator because there are constraints on $S$ . In terms of optimization, this requires a combinatorial optimization, but we do not pursue the computational aspect. The estimation error that we derive in this section can involve the optimization error, but for simplicity, we only demonstrate the estimation error of the ideal situation where there is no optimization error.
|
| 169 |
+
|
| 170 |
+
Affine composition model The following theorem provides an upper bound of the estimation error for the affine composition model.
|
| 171 |
+
|
| 172 |
+
Theorem 2. Assume the same condition as in Theorem $6$ ; in particular, suppose $0 < p , q \le \infty$ and $\widetilde { \beta } > ( 1 / p - 1 / 2 ) _ { + }$ for $\widetilde { \beta } \in \mathbb { R } _ { + + } ^ { \tilde { d } }$ . Moreover, we assume that the distribution $P _ { X }$ has a density $p _ { X }$ such that $\| p _ { X } \| _ { \infty } \leq R$ for a constant $R > 0$ . If $f ^ { \mathrm { o } } \in \mathcal { H } _ { \mathrm { a f f } } \cap L ^ { \infty } ( \Omega )$ , and $\| f ^ { \mathrm { o } } \| _ { \infty } \leq F$ for $F \geq 1$ ; then, letting $( W , L , S , B ) = \big ( L _ { 1 } ( \tilde { d } ) , W _ { 1 } ( \tilde { d } ) , S _ { 1 } ( \tilde { d } ) , ( \tilde { d } C + 1 ) B _ { 1 } ( \tilde { d } ) \big )$ as in Theorem $6$ with $N \asymp n ^ { \frac { 1 } { 2 \tilde { \beta } + 1 } }$ , we obtain
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\mathrm { E } _ { D _ { n } } [ \| f ^ { \mathrm { o } } - \widehat { f } \| _ { L ^ { 2 } ( P _ { X } ) } ^ { 2 } ] \lesssim n ^ { - \frac { 2 \widetilde { \beta } } { 2 \widetilde { \beta } + 1 } } \log ( n ) ^ { 3 } ,
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
where $\operatorname { E } _ { D _ { n } } [ \cdot ]$ indicates the expectation with respect to the training data $D _ { n }$
|
| 179 |
+
|
| 180 |
+
The proof is provided in Appendix C. We will show that the convergence rate $n ^ { - 2 \widetilde { \beta } / ( 2 \widetilde { \beta } + 1 ) }$ is minimax optimal in Section 5 (see also Kerkyacharian & Picard (1992); Donoho et al. (1996); Donoho & Johnstone (1998); Gine & Nickl ´ (2015) for ordinary Besov spaces). The $L ^ { \infty }$ -norm constraint $\| f ^ { \mathrm { o } } \| _ { \infty } \leq F$ is used to derive a uniform bound on the discrepancy between the population and the empirical $L ^ { 2 }$ -norm. Without this condition, the convergence rate could be slower.
|
| 181 |
+
|
| 182 |
+
Deep composition model For the deep composition model, we obtain the following convergence rate. This is an extension of Theorem 2 but requires a stronger assumption on the smoothness.
|
| 183 |
+
|
| 184 |
+
Theorem 3. Suppose that $0 < p , q \le \infty$ and $\widetilde { \beta } ^ { ( \ell ) } > 1 / p$ for all $\ell \in [ H ]$ . If $f ^ { \mathrm { o } } \in \mathcal { H } _ { \mathrm { d e e p } } \cap L ^ { \infty } ( \Omega )$ and $\| f \| _ { \infty } \leq F$ for $F \geq 1$ , then we obtain
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\begin{array} { r } { { \mathrm { E } } _ { D _ { n } } [ \| f ^ { \mathrm { o } } - \widehat f \| _ { L ^ { 2 } ( P _ { X } ) } ^ { 2 } ] \lesssim \operatorname* { m a x } _ { \ell \in [ H ] } n ^ { - 2 \widetilde { \beta } ^ { * ( \ell ) } / ( 2 \widetilde { \beta } ^ { * ( \ell ) } + 1 ) } \log ( n ) ^ { 3 } , } \end{array}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
where ${ \widetilde { \beta } } ^ { * ( \ell ) }$ is defined in Theorem 1, and $( L , W , S , B )$ is as given in Theorem 1 with $N \ \asymp$ $\begin{array} { r } { \operatorname* { m a x } _ { \ell \in [ L ] } n ^ { \frac { 1 } { 2 \widetilde { \beta } ^ { * ( \ell ) } + 1 } } } \end{array}$ .
|
| 191 |
+
|
| 192 |
+
The proof is provided in Appendix C. We will show that this is also minimax optimal in Theorem 4. Because of the Holder continuity, the convergence rate becomes slower than the affine composition ¨ model (that is, $\widetilde { \beta } ^ { * ( \ell ) } \le \widetilde { \beta } ^ { ( \ell ) } )$ . However, this slower rate is unavoidable in terms of the minimax optimal rate. Schmidt-Hieber (2020) analyzed the same situation for the Holder class which corre- ¨ sponds to $\beta _ { 1 } ^ { ( \ell ) } = \cdot \cdot \cdot = \beta _ { d } ^ { ( \ell ) }$ $( \forall \ell )$ and $p = q = \infty$ . Our analysis far extends their analysis to the setting of anisotropic Besov spaces in which the parameters $\beta ^ { ( \ell ) } , p , q$ have much more freedom.
|
| 193 |
+
|
| 194 |
+
From these two bounds (Theorems 2 and 3), we can see that as the smoothness $\widetilde { \beta }$ becomes large, the convergence rates faster. If the target function is included in the isotropic Besov space with smoothness $\beta _ { 1 } = \cdots = \beta _ { d } ( = \underline { { \beta } } )$ , then the estimation error becomes
|
| 195 |
+
|
| 196 |
+
# (Isotropic Besov)
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
n ^ { - 2 \underline { { \beta } } / ( 2 \underline { { \beta } } + d ) } .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
In the exponent, the dimensionality $d$ appears, which causes the curse of dimensionality. In contrast, if the target function is in the anisotropic Besov space, and the smoothness in each direction is sufficiently imbalanced such that $\widetilde { \beta }$ does not depend on $d$ , our obtained rate
|
| 203 |
+
|
| 204 |
+
# (Anisotropic Besov)
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
n ^ { - 2 \widetilde { \beta } / ( 2 \widetilde { \beta } + 1 ) }
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
avoids the curse of dimensionality. For high-dimensional settings, there would be several redundant directions in which the true function does not change. Deep learning is adaptive to this redundancy and achieves a better estimation error. However, in Section 6, we prove that linear estimators are affected by the dimensionality more strongly than deep learning. This indicates the superiority of deep learning.
|
| 211 |
+
|
| 212 |
+
# 5 Minimax optimal rate
|
| 213 |
+
|
| 214 |
+
Here, we show that the estimation error rate, that we have presented, of deep learning achieves the minimax optimal rate. Roughly speaking the minimax optimal risk on a model ${ \mathcal { F } } ^ { \circ }$ of the true function is the smallest worst case error over all estimators:
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
\begin{array} { r } { R _ { * } ( \mathcal { F } ^ { \circ } ) : = \operatorname* { i n f } _ { \widehat f } { \operatorname* { s u p } _ { f ^ { \circ } \in \mathcal { F } ^ { \circ } } { \operatorname E } _ { D _ { n } } [ \| \widehat f - f ^ { \circ } \| _ { L ^ { 2 } ( P _ { X } ) } ^ { 2 } ] } , } \end{array}
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
where $\widehat { f }$ runs over all estimators. The convergence rate of the minimax optimal risk is referred to as minimax optimal rate. We obtain the following minimax optimal rate for anisotropic Besov spaces.
|
| 221 |
+
|
| 222 |
+
Theorem 4. (a) Affine composition model: For $0 < p , q \le \infty$ and $\beta \in \mathbb { R } _ { + + } ^ { d }$ , assume that $\widetilde { \beta } > \operatorname* { m a x } { \{ 1 / p - 1 / 2 , 1 / p - 1 , 0 \} }$ . Then, the minimax optimal risk of the affine composition model is lower bounded as $R _ { * } ( \mathcal { H } _ { \mathrm { a f f } } ) \gtrsim n ^ { - \frac { 2 \widetilde { \beta } } { 2 \widetilde { \beta } + 1 } }$ . (b) Deep composition model: For $0 < p , q \le \infty$ and $\beta ^ { ( \ell ) } \in \mathbb { R } _ { + + } ^ { d } \ ( \ell = 1 , \dots , H )$ , assume that $\widetilde { \beta } ^ { ( \ell ) } > 1 / p$ . Let $\epsilon > 0$ be arbitrarily small for $q < \infty$ , and let $\epsilon = 0 f o r q = 0$ . Let $\begin{array} { r } { \widetilde { \beta } ^ { * ( \ell ) } = \widetilde { \beta } ^ { ( \ell ) } \prod _ { k = \ell + 1 } ^ { H } [ ( \underline { { \beta } } ^ { ( k ) } - 1 / p + \epsilon ) \wedge 1 ] } \end{array}$ , and $\begin{array} { r } { \widetilde { \beta } ^ { * * } : = \operatorname* { m i n } _ { \ell } \widetilde { \beta } ^ { * ( \ell ) } } \end{array}$ . Then, the minimax optimal risk of the deep composition model is lower bounded as $R _ { * } ( \mathcal { H } _ { \mathrm { d e e p } } ) \gtrsim n ^ { - \frac { 2 \widetilde { \beta } ^ { * * } } { 2 \widetilde { \beta } ^ { * * } + 1 } }$ .
|
| 223 |
+
|
| 224 |
+
The proof is provided in Appendix E (see also Ibragimov & Khas’minskii (1984); Nyssbaum (1987)). From this theorem, we can see that the estimation error of deep learning shown in Theorems 2 and 3 indeed achieve the minimax optimal rate up to a poly- $\log ( n )$ factor.
|
| 225 |
+
|
| 226 |
+
# 6 Suboptimality of linear estimators
|
| 227 |
+
|
| 228 |
+
In this section, we give the minimax optimal rate in the class of linear estimators. The linear estimator is a class of estimators that can be written as
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\begin{array} { r } { \widehat { f } ( x ) = \sum _ { i = 1 } ^ { n } y _ { i } \varphi _ { i } ( x ; X ^ { n } ) , } \end{array}
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
where $X ^ { n } \ = \ ( x _ { 1 } , \ldots , x _ { n } )$ and $\varphi _ { i } ( x ; X ^ { n } ) ~ ( i = 1 , \dots , n )$ are (measurable) functions that only depend on $x$ and $X ^ { n }$ . This is linearly dependent on $Y ^ { n } = ( y _ { 1 } , \dots , y _ { n } )$ . We notice that the kernel ridge regression is included in this class because it can be written as $\widehat { f } ( x ) = k _ { x , X ^ { n } } ( k _ { X ^ { n } , X ^ { n } } +$ $\lambda \mathrm { I } ) ^ { - 1 } Y ^ { n }$ , which linearly depends on $Y ^ { n }$ . This class includes other important estimators, such as the Nadaraya–Watson estimator, the $k$ -nearest neighbor estimator, and the sieve estimator. We compare deep learning with the linear estimators in terms of minimax risk. For this purpose, we define the minimax risk of the class of linear estimators:
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
R _ { * } ^ { ( \mathrm { l i n } ) } ( \mathcal { F } ^ { \circ } ) : = \operatorname* { i n f } _ { \widehat { f } : \mathrm { l i n e a r } f ^ { \circ } \in \mathcal { F } ^ { \circ } } \mathrm { E } _ { D _ { n } } [ \| f ^ { \mathrm { o } } - \widehat { f } \| _ { L ^ { 2 } ( P _ { X } ) } ^ { 2 } ] ,
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
where $\widehat { f }$ runs over all linear estimators. We can see that linear estimators suffer from the sub-optimal rate because of the following two points: (i) they do not have adaptivity, and (ii) they significantly suffer from the curse of dimensionality.
|
| 241 |
+
|
| 242 |
+
Theorem 5. (i) Suppose that the input distribution $P _ { X }$ is the uniform distribution on $\Omega = [ 0 , 1 ] ^ { d }$ and assume that ${ \widetilde \beta } > 1 / p$ and $1 \leq p , q \leq \infty$ . Then, the minimax optimal rate of the linear estimators is lower bounded as
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
R _ { * } ^ { ( \mathrm { l i n } ) } ( U ( B _ { p , q } ^ { \beta } ) ) \gtrsim n ^ { - \frac { 2 \widetilde { \beta } - v } { 2 \widetilde { \beta } + 1 - v } } ,
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
where $v = 2 ( 1 / p - 1 / 2 ) _ { + }$
|
| 249 |
+
|
| 250 |
+
(ii) In addition to the above conditions, we assume that the true function is included in the affine composition model with $\tilde { d } \leq d , \underline { { \beta } } = \beta _ { 1 } = \cdot \cdot \cdot = \beta _ { \tilde { d } }$ and $0 < p \le 2$ . Let $a _ { d } = 1 + \kappa$ with arbitrary small $\kappa > 0$ when $\tilde { d } < d / 2$ , and let $a _ { d } = 0$ when $\tilde { d } \ge d / 2$ . Then, the minimax rate of the linear estimators on the affine composition model is lower bounded by
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\begin{array} { r } { R _ { * } ^ { ( \mathrm { l i n } ) } ( \mathcal { H } _ { \mathrm { a f f } } ) \gtrsim n ^ { - \frac { 2 ( \underline { { \beta } } - \tilde { d } / p + d / 2 + a _ { d } ) } { 2 ( \underline { { \beta } } - \tilde { d } / p + d / 2 + a _ { d } ) + d } } . } \end{array}
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
The proof is provided in Appendix F. (i) The lower bound (7) reveals the suboptimality of linear estimators in terms of input dimensionality. Actually, if we consider a particular case where $\tilde { d } = 1$ , $p = 1$ and $d \gg \tilde { d }$ , then the obtained minimax rate of linear estimators and the estimation error rate of deep learning can be summarized as
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\mathrm { l i n e a r : } \ n ^ { - \frac { 2 \beta + d } { 2 \beta + 2 d } } , \ \qquad \mathrm { d e e p : } \ n ^ { - \frac { 2 \beta } { 2 \beta + 1 } } ,
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
by Theorem 2 when $\underline { { \beta } } > 1$ (which can be checked by noticing $\widetilde { d } = \underline { { \beta } } / \widetilde { \beta } = 1$ in this situation). We can see that the dependence on the dimensionality of linear estimators is significantly worse than that of deep leaning. This indicates poor adaptivity of linear estimators to the intrinsic dimensionality√ of data. Actually, as $d$ becomes large, the rate for the linear estimator approaches to $1 / { \sqrt { n } }$ but that for the deep learning is not affected by $d$ and still faster than $1 / \sqrt { n }$ . To show the theorem, we used the “convex-hull argument” developed by Hayakawa & Suzuki (2019); Donoho $\&$ Johnstone (1998). We combined this technique with the so-called Irie-Miyake’s integral representation (Irie & Miyake, 1988; Hornik et al., 1990). Note that this difference appears because there is an affine transformation in the first layer of the affine composition model. Deep learning is flexible against such a coordinate transform so that it can find directions to which the target function is smooth. In contrast, kernel methods do not have such adaptivity because there is no feature extraction layer. (ii) The lower bound (6) states that when $p < 2$ (that is, $v > 0$ ), the minimax rate of the linear estimators is outperformed by that of deep learning (Theorem 2). This is due to the “adaptivity” of deep leaning. When $p$ is small, the smoothness of the target function is less homogeneous, and it requires an adaptive approximation scheme to achieve the best estimation error. Linear estimators do not have adaptivity and thus fail to achieve the minimax optimal rate. Our bound (6) extends the result by Zhang et al. (2002) to a multivariate anisotropic Besov space while Zhang et al. (2002) investigated the univariate space $\langle d = 1 \rangle$ ).
|
| 263 |
+
|
| 264 |
+
# 7 Conclusion
|
| 265 |
+
|
| 266 |
+
We investigated the approximation error and estimation error of deep learning in the anisotropic Besov spaces. It was proved that the convergence rate is determined by the average of the anisotropic smoothness, which results in milder dependence on the input dimensionality. If the smoothness is highly anisotropic, deep learning can avoid overfitting. We also compared the error rate of deep learning with that of linear estimators and showed that deep learning has better dependence on the input dimensionality. Moreover, it was shown that deep learning can achieve the adaptive rate and outperform non-adaptive approximation methods and linear estimators if the homogeneity $p$ of smoothness is small. These analyses strongly support the practical success of deep learning from a theoretical perspective.
|
| 267 |
+
|
| 268 |
+
Limitations of this work Our work does not cover the optimization aspect of deep learning. It is assumed that the regularized least squares (5) can be executed. It would be nice to combine our study with recent developments of non-convex optimization techniques (Vempala & Wibisono, 2019; Suzuki & Akiyama, 2021).
|
| 269 |
+
|
| 270 |
+
Potential negative societal impact Since this is purely theoretical result, it is not expected that there is a direct negative societal impact. However, revealing detailed properties of the deep learning could promote an opportunity to pervert deep learning.
|
| 271 |
+
|
| 272 |
+
# Acknowledgment
|
| 273 |
+
|
| 274 |
+
TS was partially supported by JSPS KAKENHI (18H03201), Japan Digital Design and JST CREST.
|
| 275 |
+
AN was partially supported by JSPS Kakenhi (19K20337) and JST-PRESTO.
|
| 276 |
+
|
| 277 |
+
# References
|
| 278 |
+
|
| 279 |
+
M. Belkin and P. Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003.
|
| 280 |
+
A. Bhattacharya, D. Pati, and D. B. Dunson. Adaptive dimension reduction with a gaussian process prior. arXiv preprint arXiv:1111.1044, 1445, 2011.
|
| 281 |
+
A. Bhattacharya, D. Pati, and D. Dunson. Anisotropic function estimation using multi-bandwidth gaussian processes. Annals of statistics, 42(1):352, 2014.
|
| 282 |
+
P. J. Bickel and B. Li. Local polynomial regression on unknown manifolds. In Complex datasets and inverse problems, pp. 177–186. Institute of Mathematical Statistics, 2007.
|
| 283 |
+
M. Chen, H. Jiang, W. Liao, and T. Zhao. Nonparametric Regression on Low-Dimensional Manifolds using Deep ReLU Networks. arXiv e-prints, art. arXiv:1908.01842, Aug 2019.
|
| 284 |
+
M. Chen, H. Jiang, W. Liao, and T. Zhao. Efficient approximation of deep relu networks for functions on low dimensional manifolds. In Advances in Neural Information Processing Systems, pp. 8172– 8182, 2019.
|
| 285 |
+
G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems (MCSS), 2(4):303–314, 1989.
|
| 286 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv e-prints, art. arXiv:1810.04805, Oct 2018.
|
| 287 |
+
R. A. DeVore. Nonlinear approximation. Acta Numerica, 7:51–150, 1998.
|
| 288 |
+
R. A. DeVore and V. A. Popov. Interpolation of Besov spaces. Transactions of the American Mathematical Society, 305(1):397–414, 1988.
|
| 289 |
+
R. A. DeVore, G. Kyriazis, D. Leviatan, and V. M. Tikhomirov. Wavelet compression and nonlinearn-widths. Advances in Computational Mathematics, 1(2):197–214, 1993.
|
| 290 |
+
D. L. Donoho and I. M. Johnstone. Minimax estimation via wavelet shrinkage. The Annals of Statistics, 26(3):879–921, 1998.
|
| 291 |
+
D. L. Donoho, I. M. Johnstone, G. Kerkyacharian, and D. Picard. Density estimation by wavelet thresholding. The Annals of Statistics, 24(2):508–539, 1996.
|
| 292 |
+
D. Dung. Optimal adaptive sampling recovery. ˜ Advances in Computational Mathematics, 34(1): 1–41, 2011.
|
| 293 |
+
S. Gaiffas and G. Lecue. Hyper-sparse optimal aggregation. Journal of Machine Learning Research, 12(Jun):1813–1833, 2011.
|
| 294 |
+
E. Gine and R. Nickl. ´ Mathematical Foundations of Infinite-Dimensional Statistical Models. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2015.
|
| 295 |
+
X. Glorot, A. Bordes, and Y. Bengio. Deep sparse rectifier neural networks. In Proceedings of the 14th International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 315–323, 2011.
|
| 296 |
+
H. Hang and I. Steinwart. Optimal learning with anisotropic gaussian svms. arXiv preprint arXiv:1810.02321, 2018.
|
| 297 |
+
S. Hayakawa and T. Suzuki. On the minimax optimality and superiority of deep neural network learning over sparse parameter spaces. arXiv preprint arXiv:1905.09195, 2019.
|
| 298 |
+
M. Hoffman and O. Lepski. Random rates in anisotropic regression (with a discussion and a rejoinder by the authors). The Annals of Statistics, 30(2):325–396, 04 2002.
|
| 299 |
+
K. Hornik. Approximation capabilities of multilayer feedforward networks. Neural Networks, 4(2): 251–257, 1991.
|
| 300 |
+
K. Hornik, M. Stinchcombe, and H. White. Universal approximation of an unknown mapping and its derivatives using multilayer feedforward networks. Neural Networks, 3(5):551–560, 1990.
|
| 301 |
+
I. Ibragimov and R. Khas’minskii. More on the estimation of distribution densities. Journal of Soviet Mathematics, 25(3):1155–1165, 1984.
|
| 302 |
+
B. Irie and S. Miyake. Capabilities of three-layered perceptrons. In IEEE 1988 International Conference on Neural Networks, pp. 641–648, 1988.
|
| 303 |
+
G. Kerkyacharian and D. Picard. Density estimation in Besov spaces. Statistics & Probability Letters, 13:15–24, 1992.
|
| 304 |
+
G. Kerkyacharian, O. Lepski, and D. Picard. Nonlinear estimation in anisotropic multi-index denoising. Probability Theory and Related Fields, 121(2):137–170, Oct 2001.
|
| 305 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 306 |
+
V. Myronyuk. Trigonometric approximations and kolmogorov widths of anisotropic besov classes of periodic functions of several variables. Ukrainian Mathematical Journal, 66(8), 2015.
|
| 307 |
+
V. V. Myronyuk. Kolmogorov widths of the anisotropic besov classes of periodic functions of many variables. Ukrainian Mathematical Journal, 68(5):718–727, Oct 2016.
|
| 308 |
+
V. V. Myronyuk. Widths of the anisotropic besov classes of periodic functions of several variables. Ukrainian Mathematical Journal, 68(8):1238–1251, Jan 2017. ISSN 1573-9376. doi: 10.1007/ s11253-017-1290-1. URL https://doi.org/10.1007/s11253-017-1290-1.
|
| 309 |
+
V. Nair and G. E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning, pp. 807–814, 2010.
|
| 310 |
+
R. Nakada and M. Imaizumi. Adaptive approximation and generalization of deep neural network with intrinsic dimensionality. Journal of Machine Learning Research, 21(174):1–38, 2020. URL http://jmlr.org/papers/v21/20-002.html.
|
| 311 |
+
S. M. Nikol’skii. Approximation of functions of several variables and imbedding theorems, volume 205. Springer-Verlag Berlin Heidelberg, 1975.
|
| 312 |
+
M. Nyssbaum. Optimal filtration of a function of many variables in white gaussian noise. Problems of Information Transmission, 19:23–29, 1983.
|
| 313 |
+
|
| 314 |
+
M. Nyssbaum. Nonparametric estimation of a regression function that is smooth in a domain in $\mathbb { R } ^ { k }$ . Theory of Probability & Its Applications, 31(1):108–115, 1987.
|
| 315 |
+
|
| 316 |
+
A. Radford, L. Metz, and S. Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. arXiv e-prints, art. arXiv:1511.06434, Nov 2015.
|
| 317 |
+
J. Schmidt-Hieber. Deep ReLU network approximation of functions on a manifold. arXiv preprint arXiv:1908.00695, 2019.
|
| 318 |
+
J. Schmidt-Hieber. Nonparametric regression using deep neural networks with relu activation function. The Annals of Statistics, 48(4):1875–1897, 2020.
|
| 319 |
+
P. Y. Simard, D. Steinkraus, and J. C. Platt. Best practices for convolutional neural networks applied to visual document analysis. In Proceedings of the Seventh International Conference on Document Analysis and Recognition-Volume 2, pp. 958. IEEE Computer Society, 2003.
|
| 320 |
+
S. Sonoda and N. Murata. Neural network with unbounded activation functions is universal approximator. Applied and Computational Harmonic Analysis, 43(2):233–268, 2017.
|
| 321 |
+
T. Suzuki. Adaptivity of deep ReLU network for learning in Besov and mixed smooth Besov spaces: optimal rate and curse of dimensionality. In International Conference on Learning Representations (ICLR2019), 2019. URL https://openreview.net/forum?id $\equiv$ H1ebTsActm.
|
| 322 |
+
T. Suzuki and S. Akiyama. Benefit of deep learning with non-convex noisy gradient descent: Provable excess risk bound and superiority to kernel methods. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $\equiv$ 2m0g1wEafh.
|
| 323 |
+
V. Temlyakov. Approximation of Periodic Functions. Nova Science Publishers, 1993.
|
| 324 |
+
J. B. Tenenbaum, V. De Silva, and J. C. Langford. A global geometric framework for nonlinear dimensionality reduction. science, 290(5500):2319–2323, 2000.
|
| 325 |
+
H. Triebel. Entropy numbers in function spaces with mixed integrability. Revista matematica com- ´ plutense, 24(1):169–188, 2011.
|
| 326 |
+
S. Vempala and A. Wibisono. Rapid convergence of the unadjusted langevin algorithm: Isoperimetry suffices. In Advances in Neural Information Processing Systems, pp. 8094–8106, 2019.
|
| 327 |
+
J. Vybiral. Function spaces with dominating mixed smoothness. Dissertationes Math. (Rozprawy Mat.), 436:3–73, 2006.
|
| 328 |
+
Y. Yang and D. B. Dunson. Bayesian manifold regression. The Annals of Statistics, 44(2):876–905, 2016.
|
| 329 |
+
Y. Yang and S. T. Tokdar. Minimax-optimal nonparametric regression in high dimensions. The Annals of Statistics, 43(2):652–674, 2015.
|
| 330 |
+
D. Yarotsky. Error bounds for approximations with deep relu networks. Neural Networks, 94: 103–114, 2017.
|
| 331 |
+
S. Zhang, M.-Y. Wong, and Z. Zheng. Wavelet threshold estimation of a regression function with random design. Journal of Multivariate Analysis, 80(2):256–284, 2002.
|
| 332 |
+
|
| 333 |
+
# Checklist
|
| 334 |
+
|
| 335 |
+
1. For all authors...
|
| 336 |
+
|
| 337 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 338 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 339 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No]
|
| 340 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 341 |
+
|
| 342 |
+
2. If you are including theoretical results...
|
| 343 |
+
|
| 344 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Each theorem explicitly describes assumptions on which the theorem is established.
|
| 345 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix in the supplementary material. All proofs are included there.
|
| 346 |
+
|
| 347 |
+
3. If you ran experiments...
|
| 348 |
+
|
| 349 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [N/A]
|
| 350 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
|
| 351 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
|
| 352 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A]
|
| 353 |
+
|
| 354 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 355 |
+
|
| 356 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 357 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 358 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 359 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 360 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 361 |
+
|
| 362 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 363 |
+
|
| 364 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 365 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 366 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/v5gjXpmR8J/v5gjXpmR8J.md
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SSD: A UNIFIED FRAMEWORK FOR SELFSUPERVISED OUTLIER DETECTION
|
| 2 |
+
|
| 3 |
+
Vikash Sehwag Princeton University vvikash@princeton.edu
|
| 4 |
+
|
| 5 |
+
Mung Chiang Purdue University chiang@purdue.edu
|
| 6 |
+
|
| 7 |
+
Prateek Mittal Princeton University pmittal@princeton.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We ask the following question: what training information is required to design an effective outlier/out-of-distribution (OOD) detector, i.e., detecting samples that lie far away from the training distribution? Since unlabeled data is easily accessible for many applications, the most compelling approach is to develop detectors based on only unlabeled in-distribution data. However, we observe that most existing detectors based on unlabeled data perform poorly, often equivalent to a random prediction. In contrast, existing state-of-the-art OOD detectors achieve impressive performance but require access to fine-grained data labels for supervised training. We propose SSD, an outlier detector based on only unlabeled in-distribution data. We use self-supervised representation learning followed by a Mahalanobis distance based detection in the feature space. We demonstrate that SSD outperforms most existing detectors based on unlabeled data by a large margin. Additionally, SSD even achieves performance on par, and sometimes even better, with supervised training based detectors. Finally, we expand our detection framework with two key extensions. First, we formulate few-shot OOD detection, in which the detector has access to only one to five samples from each class of the targeted OOD dataset. Second, we extend our framework to incorporate training data labels, if available. We find that our novel detection framework based on SSD displays enhanced performance with these extensions, and achieves state-of-the-art performance1.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep neural networks are at the cornerstone of multiple safety-critical applications, ranging from autonomous driving (Ramanagopal et al., 2018) to biometric authentication (Masi et al., 2018; Gunther et al., 2017). When trained on a particular data distribution, referred to as in-distribution ¨ data, deep neural networks are known to fail against test inputs that lie far away from the training distribution, commonly referred to as outliers or out-of-distribution (OOD) samples (Grubbs, 1969; Hendrycks & Gimpel, 2017). This vulnerability motivates the use of an outlier detector before feeding the input samples to the downstream neural network modules. However, a key question is to understand what training information is crucial for effective outlier detection? Will the detector require fine-grained annotation of training data labels or even access to a set of outliers in the training process?
|
| 16 |
+
|
| 17 |
+
Since neither data labels nor outliers are ubiquitous, the most compelling option is to design outlier detectors based on only unlabeled in-distribution data. However, we observe that most of the existing outlier detectors based on unlabeled data fail to scale up to complex data modalities, such as images. For example, autoencoder (AE) (Hawkins et al., 2002) based outlier detectors have achieved success in applications such as intrusion detection (Mirsky et al., 2018), and fraud detection (Schreyer et al., 2017). However, this approach achieves close to chance performance on image datasets. Similarly, density modeling based methods, such as $\mathrm { P i x e l C N N + + }$ (Salimans et al., 2017) and Glow (Kingma & Dhariwal, 2018) are known to assign even a higher likelihood to outliers in comparison to indistribution data (Nalisnick et al., 2019).
|
| 18 |
+
|
| 19 |
+
In contrast, existing state-of-the-art OOD detectors achieve high success on image datasets but assume the availability of fine-grained labels for in-distribution samples (Hendrycks & Gimpel, 2017;
|
| 20 |
+
|
| 21 |
+
Bendale & Boult, 2016; Liang et al., 2018; Dhamija et al., 2018; Winkens et al., 2020). This is a strong assumption since labels, in-particular fine-grained labels, can be very costly to collect in some applications (Google AI Pricing, 2020), which further motivates the use of unlabeled data. The inability of supervised detectors to use unlabeled data and poor performance of existing unsupervised approaches naturally give rise to the following question.
|
| 22 |
+
|
| 23 |
+
Can we design an effective out-of-distribution (OOD) data detector with access to only unlabeled data from training distribution?
|
| 24 |
+
|
| 25 |
+
A framework for outlier detection with unlabeled data2 involves two key steps: 1) Learning a good feature representation with unsupervised training methods 2) Modeling features of in-distribution data without requiring class labels. For example, autoencoders attempt to learn the representation with a bottleneck layer, under the expectation that successful reconstruction requires learning a good set of representations. Though useful for tasks such as dimensionality reduction, we find that these representations are not good enough to sufficiently distinguish in-distribution data and outliers. We argue that if unsupervised training can develop a rich understanding of key semantics in in-distribution data then absence of such semantics in outliers can cause them to lie far away in the feature space, thus making it easy to detect them. Recently, self-supervised representation learning methods have made large progress, commonly measured by accuracy achieved on a downstream classification task (Chen et al., 2020; He et al., 2020; Oord et al., 2018; Misra & Maaten, 2020; Tian et al., 2020). We leverage these representations in our proposed cluster-conditioned framework based on the Mahalanobis distance (Mahalanobis, 1936). Our key result is that self-supervised representations are highly effective for the task of outlier detection in our self-supervised outlier detection (SSD) framework where they not only perform far better than most of the previous unsupervised representation learning methods but also perform on par, and sometimes even better, than supervised representations.
|
| 26 |
+
|
| 27 |
+
What if access to a fraction of OOD data or training data labels is available? How do we move past a detector based on unlabeled data and design a framework which can take advantage of such information? Though access to outliers during training is a strong assumption, it may be feasible to obtain a few prior instances of such outliers (Gornitz et al., 2013). We characterize this setting as ¨ few-shot OOD detection, where we assume access to very few, often one to five, samples from the targeted set of outliers. While earlier approaches (Liang et al., 2018; Lee et al., 2018b) mostly use such data to calibrate the detector, we find that access to just a few outliers can bring an additional boost in the performance of our detector. Crucial to this success is the reliable estimation of first and second order statistics of OOD data in the high dimensional feature space with just a few samples.
|
| 28 |
+
|
| 29 |
+
Finally, if class labels are available in the training phase, how can we incorporate them in the SSD framework for outlier detection? Recent works have proposed the addition of the supervised crossentropy and self-supervised learning loss with a tunable parameter, which may require tuning for optimal parameter setting for each dataset (Hendrycks et al., 2019b; Winkens et al., 2020). We demonstrate that incorporating labels directly in the contrastive loss achieves 1) a tuning parameterfree detector, and 2) state-of-the-art performance.
|
| 30 |
+
|
| 31 |
+
# 1.1 KEY CONTRIBUTIONS
|
| 32 |
+
|
| 33 |
+
SSD for unlabeled data. We propose $S S D$ , an unsupervised framework for outlier detection based on unlabeled in-distribution data. We demonstrate that SSD outperforms most existing unsupervised outlier detectors by a large margin while also performing on par, and sometimes even better than supervised training based detection methods. We validate our observation across four different datasets: CIFAR-10, CIFAR-100, STL-10, and ImageNet.
|
| 34 |
+
|
| 35 |
+
Extensions of SSD. We provide two extensions of $S S D$ to further improve its performance. First, we formulate few-shot OOD detection and propose detection methods which can achieve a significantly large gain in performance with access to only a few targeted OOD samples. Next, we extend SSD, without using any tuning parameter, to also incorporate in-distribution data labels and achieve state-of-the-art performance.
|
| 36 |
+
|
| 37 |
+
# 2 RELATED WORK
|
| 38 |
+
|
| 39 |
+
OOD detection with unsupervised detectors. Interest in unsupervised outlier detection goes back to Grubbs (1969). We categorize these approaches in three groups 1) Reconstruction-error based detection using Auto-encoders (Hawkins et al., 2002; Mirsky et al., 2018; Schreyer et al., 2017) or Variational auto-encoders (Abati et al., 2019; An & Cho, 2015) 2) Classification based, such as DeepSVDD (Ruff et al., 2018; El-Yaniv & Wiener, 2010; Geifman & El-Yaniv, 2017) and 3) Probabilistic detectors, such as density models like Glow and $\mathrm { P i x e l C N N + + }$ (Ren et al., 2019; Nalisnick et al., 2019; Salimans et al., 2017; Kingma & Dhariwal, 2018). We compare with detectors from each category and find that SSD outperforms them by a wide margin.
|
| 40 |
+
|
| 41 |
+
OOD detection with supervised learning. Supervised detectors have been most successful with complex input modalities, such as images and language (Chalapathy et al., 2018a; DeVries & Taylor, 2018; Dhamija et al., 2018; Jiang et al., 2018; Yoshihashi et al., 2018; Lee et al., 2018a). Most of these approaches model features of in-distribution data at output (Liang et al., 2018; Hendrycks & Gimpel, 2017; Dhamija et al., 2018) or in the feature space (Lee et al., 2018b; Winkens et al., 2020) for detection. We show that SSD can achieve performance on par with these supervised detectors, without using data labels. A subset of these detectors also leverages generic OOD data to boost performance (Hendrycks et al., 2019a; Mohseni et al., 2020).
|
| 42 |
+
|
| 43 |
+
Access to OOD data at training time. Some recent detectors also require OOD samples for hyperparameter tuning (Liang et al., 2018; Lee et al., 2018b; Zisselman & Tamar, 2020). We extend $S S D$ to this setting but assume access to only a few OOD samples, referred to as few-shot OOD detection, which our framework can efficiently utilize to bring further gains in performance.
|
| 44 |
+
|
| 45 |
+
In conjunction with supervised training. Vyas et al. (2018) uses ensemble of leave-one-out classifier, Winkens et al. (2020) uses contrastive self-supervised training, and Hendrycks et al. (2019b) uses rotation based self-supervised loss, in conjunction with supervised cross-entropy loss to achieve state-of-the-art performance in OOD detection. Here we extend SSD, to incorporate data labels, when available, and achieve better performance than existing state-of-the-art.
|
| 46 |
+
|
| 47 |
+
Anomaly detection. In parallel to OOD detection, this research direction focuses on the detection of semantically related anomalies in applications such as intrusion detection, spam detection, disease detection, image classification, and video surveillance. We refer the interested reader to Pang et al. (2020) for a detailed review. While a large number of works focuses on developing methods particularly for single-class modeling in anomaly detection (Perera et al., 2019; Schlegl et al., 2017; Ruff et al., 2018; Chalapathy et al., 2018b; Golan & El-Yaniv, 2018; Wang et al., 2019), some recent work achieve success in both OOD detection and anomaly detection Tack et al. (2020); Bergman & Hoshen (2020). We provide a detailed comparison of our approach with previous work in both categories.
|
| 48 |
+
|
| 49 |
+
# 3 SSD: SELF-SUPERVISED OUTLIER/OUT-OF-DISTRIBUTION DETECTION
|
| 50 |
+
|
| 51 |
+
In this section, we first provide the necessary background on outlier/out-of-distribution (OOD) detection and then present the underlying formulation of our self-supervised detector (SSD) that relies on only unlabeled in-distribution data. Finally, we describe two extensions of $S S D$ to (optionally) incorporate targeted OOD samples and in-distribution data labels (if available).
|
| 52 |
+
|
| 53 |
+
Notation. We represent the input space by $\mathcal { X }$ and corresponding label space as $\mathcal { V }$ . We assume in-distribution data is sampled from $\mathbb { P } _ { X \times \mathcal { Y } } ^ { i n }$ . In the absence of data labels, it is sampled from marginal distribution $\mathbb { P } _ { \mathcal { X } } ^ { i n }$ . We sample out-of-distribution data from $\mathbb { P } _ { \mathcal { X } } ^ { o o d }$ . We denote the feature extractor by $f : \mathcal { X } \to \mathcal { Z }$ , where $\mathcal { Z } \subset \mathbb { R } ^ { d }$ , a function which maps a sample from the input space to the $d$ -dimensional feature space $( { \mathcal { Z } } )$ . The feature extractor is often parameterized by a deep neural network. In supervised learning, we obtain classification confidence for each class by $g \circ f : \mathcal { X } \to \mathbb { R } ^ { c }$ In most cases, $g$ is parameterized by a shallow neural network, generally a linear classifier.
|
| 54 |
+
|
| 55 |
+
Problem Formulation: Outlier/Out-of-distribution (OOD) detection. Given a collection of samples from $\mathbb { P } _ { \mathcal { X } } ^ { i n } \times \mathbb { P } _ { \mathcal { X } } ^ { o o d }$ , the objective is to correctly identify the source distribution, i.e., $\mathbb { P } _ { \mathcal { X } } ^ { i n }$ n r Pood, o for each sample. We use the term supervised detectors for detectors which use in-distribution data labels, i.e., train the neural network $( g \circ f )$ on $\mathbb { P } _ { X \times y } ^ { i n }$ using supervised training techniques.
|
| 56 |
+
|
| 57 |
+
Unsupervised OOD detectors aim to solve the aforementioned OOD detection tasks, with access to only $\bar { \mathbb { P } } _ { \mathcal { X } } ^ { i n }$ . In this work, we focus on developing effective unsupervised OOD detectors.
|
| 58 |
+
|
| 59 |
+
Background: Contrastive self-supervised representation learning. Given unlabeled training data, it aims to train a feature extractor, by discriminating between individual instances from data, to learn a good set of representations. Using image transformations, it first creates two views of each image, commonly referred to as positives. Next, it optimizes to pull each instance close to its positive instances while pushing away from other images, commonly referred to as negatives. Assuming that $( x _ { i } , x _ { j } )$ are positive pairs for the ith image from a batch of $N$ images and $h ( . )$ is a projection header, $\tau$ is the temperature, contrastive training minimizes the following loss, referred to as Normalized temperature-scaled cross-entropy (NT-Xent), over each batch.
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal { L } _ { b a t c h } = \frac { 1 } { 2 N } \sum _ { i = 1 } ^ { 2 N } - l o g \frac { e ^ { u _ { i } ^ { T } u _ { j } / \tau } } { \sum _ { k = 1 } ^ { 2 N } \mathbb { 1 } ( k \neq i ) e ^ { u _ { i } ^ { T } u _ { k } / \tau } } ~ ; \qquad u _ { i } = \frac { h \left( f ( x _ { i } ) \right) } { \| h ( f ( x _ { i } ) ) \| _ { 2 } }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
# 3.1 UNSUPERVISED OUTLIER DETECTION WITH SSD
|
| 66 |
+
|
| 67 |
+
Leveraging contrastive self-supervised training. In the absence of data labels, SSD consists of two steps: 1) Training a feature extractor using unsupervised representation learning, 2) Developing an effective OOD detector based on hidden features which isn’t conditioned on data labels.
|
| 68 |
+
|
| 69 |
+
We leverage contrastive self-supervised training for representation learning in our outlier detection framework, particularly due to its state-of-the-art performance (Chen et al., 2020; Tian et al., 2020). We will discuss the effect of different representation learning methods later in Section 4.2.
|
| 70 |
+
|
| 71 |
+
Cluster-conditioned detection. In absence of data labels, we develop a cluster-conditioned detection method in the feature space. We first partition the features for in-distribution training data in $m$ clusters. We represent features for each cluster as ${ \mathcal { Z } } _ { m }$ . We use $\mathbf { k }$ -means clustering method, due to its effectiveness and low computation cost. Next, we model features in each cluster independently, and calculate the following outlier score $( s _ { x } ) = \operatorname* { m i n } _ { m } { \mathcal { D } } ( x , { \mathcal { Z } } _ { m } )$ for each test input $x$ , where $\mathcal { D } ( . , . )$ is a distance metric in the feature space. We discuss the choice of the number of clusters in Section 4.2.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: AUROC along individual principle eigenvector with CIFAR-10 as indistribution and CIFAR-100 as OOD. Higher eigenvalues dominates euclidean distance, but are least helpful for outlier detection. Mahalnobis distance avoid this bias with appropriate scaling and performs much better.
|
| 75 |
+
|
| 76 |
+
Choice of distance metric: Mahalanobis distance. We use Mahalanobis distance to calculate the outlier score as follows:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
s _ { x } = \operatorname* { m i n } _ { m } ( z _ { x } - \mu _ { m } ) ^ { T } \Sigma _ { m } ^ { - 1 } ( z _ { x } - \mu _ { m } )
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\mu _ { m }$ and $\Sigma _ { m }$ are the sample mean and sample covariance of features $( { \mathcal { Z } } )$ of the in-distribution training data. We justify this choice with quantitative results in Figure 1. With eigendecomposition of sample covariance $( \Sigma _ { m } = Q _ { m } \Lambda _ { m } Q _ { m } ^ { - 1 } )$ , $s _ { x } = \operatorname* { m i n } _ { m } \left( Q _ { m } ^ { T } ( z _ { x } - \mu _ { m } ) \right) ^ { T } \Lambda _ { m } ^ { - 1 } \left( Q _ { m } ^ { \bar { T } } ( z _ { x } - \mu _ { m } ) \right)$ which is equivalent to euclidean distance scaled with eigenvalues in the eigenspace. We discriminate between in-distribution (CIFAR-10) and OOD (CIFAR-100) data along each principal eigenvector (using AUROC, higher the better). With euclidean distance, i.e., in absence of scaling, components with higher eigenvalues have more weight but provide least discrimination. Scaling with eigenvalues removes the bias, making Mahalnobis distance effective for outlier detection in the feature space.
|
| 83 |
+
|
| 84 |
+
# 3.2 FEW-SHOT OOD DETECTION $( S S D _ { k } )$
|
| 85 |
+
|
| 86 |
+
In this extension of the $S S D$ framework, we consider the scenario where a few samples from the OOD dataset used at inference time are also available at the time of training. We focus on one-shot and five-shot detection, which refers to access to only one and fives samples, from each class of the targeted OOD dataset, respectively. Our hypothesis is that in-distribution samples and OOD samples will be closer to other inputs from their respective distribution in the feature space, while lying further away from each other. We incorporate this hypothesis by using following formulation of outlier score.
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
s _ { x } = ( z _ { x } - \mu _ { i n } ) ^ { T } \Sigma _ { i n } ^ { - 1 } ( z _ { x } - \mu _ { i n } ) - ( z _ { x } - \mu _ { o o d } ) ^ { T } \Sigma _ { o o d } ^ { - 1 } ( z _ { x } - \mu _ { o o d } )
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\mu _ { i n } , \Sigma _ { i n }$ and $\mu _ { o o d } , \Sigma _ { o o d }$ are the sample mean and sample covariance in the feature space for in-distribution and OOD data, respectively.
|
| 93 |
+
|
| 94 |
+
Challenge. The key challenge is to reliably estimate the statistics for OOD data, with access to only a few samples. Sample covariance is not an accurate estimator of covariance when the number of samples is less than the dimension of feature space (Stein, 1975), which is often in the order of thousands for deep neural networks.
|
| 95 |
+
|
| 96 |
+
Shrunk covariance estimators and data augmentation. We overcome this challenge by using following two techniques: 1) we use shrunk covariance estimators (Ledoit & Wolf, 2004), and 2) we amplify number of OOD samples using data augmentation. We use shrunk covariance estimators due to their ability to estimate covariance better than sample covariance, especially when the number of samples is even less than the feature dimension. To further improve the estimation we amplify the number of samples using data augmentation at the input stage. We use common image transformations, such as geometric and photometric changes to create multiple different images from a single source image from the OOD dataset. Thus given a set of $k$ OOD samples $\{ u _ { 1 } , \{ u _ { 2 } , \ldots , u _ { k } \}$ , we first create a set of $k \times n$ samples using data augmentation, $\mathcal { U } = \{ u _ { 1 } ^ { 1 } , \dotsc , \bar { u } _ { 1 } ^ { n } , \dotsc u _ { k } ^ { 1 } , \dotsc , u _ { k } ^ { n } \}$ . Using this set, we calculate the outlier score for a test sample in the following manner.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
s _ { x } = ( z _ { x } - \mu _ { i n } ) ^ { T } \Sigma _ { i n } ^ { - 1 } ( z _ { x } - \mu _ { i n } ) - ( z _ { x } - \mu _ { U } ) ^ { T } S _ { U } ^ { - 1 } ( z _ { x } - \mu _ { U } )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $\mu _ { U }$ and $S _ { U }$ are the sample mean and estimated covariance using shrunk covariance estimators for the set $\mathcal { U }$ , respectively.
|
| 103 |
+
|
| 104 |
+
# 3.3 HOW TO BEST USE DATA LABELS $( S S D + )$
|
| 105 |
+
|
| 106 |
+
If fine-grained labels for in-distribution data are available, an immediate question is how to incorporate them in training to improve the success in detecting OOD samples.
|
| 107 |
+
|
| 108 |
+
Conventional approach: Additive self-supervised and supervised training loss. A common theme in recent works (Hendrycks et al. 2019b; Winkens et al. 2020) is to add self-supervised $( L _ { s s l } )$ and supervised $( L _ { s u p } )$ training loss functions, i.e., $L _ { t r a i n i n g } = L _ { s u p } + \alpha L _ { s s l }$ , where the hyperparameter $\alpha$ is chosen for best performance on OOD detection. A common loss function for supervised training is cross-entropy.
|
| 109 |
+
|
| 110 |
+
Our approach: Incorporating labels in contrastive self-supervised training. As we show in Section 4.2, even without labels, contrasting between instances using self-supervised learning is highly successful for outlier detection. We argue for a similar instance-based contrastive training, where labels can also be incorporated to further improve the learned representations. To this end, we use the recently proposed supervised contrastive training loss function (Khosla et al., 2020), which uses labels for a more effective selection of positive and negative instances for each image. In particular, we minimize the following loss function.
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathcal { L } _ { b a t c h } = \frac { 1 } { 2 N } \sum _ { i = 1 } ^ { 2 N } - l o g \frac { \frac { 1 } { 2 N _ { y _ { i } } - 1 } \sum _ { k = 1 } ^ { 2 N } \mathbb { 1 } { ( k \neq i ) \mathbb { 1 } ( y _ { k } = y _ { i } ) e ^ { u _ { i } ^ { T } u _ { k } / \tau } } } { \sum _ { k = 1 } ^ { 2 N } \mathbb { 1 } { ( k \neq i ) e ^ { u _ { i } ^ { T } u _ { k } / \tau } } }
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $N _ { y _ { i } }$ refers to number of images with label $y _ { i }$ in the batch. In comparison to contrastive NT-Xent loss (Equation 1), now we use images with identical labels in each batch as positives. We will show the superior performance of this approach compared to earlier approaches, and note that it is also a parameter-free approach which doesn’t require additional OOD data to tune parameters. We further use the proposed cluster-conditioned framework with Mahalnobis distance, as we find it results in better performance than using data labels. We further summarize our framework in Algorithm 1.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Algorithm 1: Self-supervised outlier detection framework (SSD)</td><td></td></tr><tr><td>Output :Is outlier or not? ∀x E Xtest</td><td>Input :Xin, Xtest, feature extractor (f), projection head (h),Required True-positive rate (T),</td></tr><tr><td>Function getFeatures(X): return {f(xi)/llf(xi)ll2,∀ xi ∈ X};</td><td></td></tr><tr><td>Function SSDkScore(Z, μin,Σin, μood,Σood):</td><td>Function SSDScore(Z,μ,∑): return {(z - μ)T∑-1(z - μ),∀ z ∈ Z};</td></tr><tr><td>end</td><td>return{(z-μin)T∑-1(z-μin)-(z-μood)T∑-ld(z-μood),∀z∈Z};</td></tr><tr><td>Parition Xin in training set (Xtrain) and calibration set (Xcal);</td><td></td></tr><tr><td>if Vin isnot available then</td><td></td></tr><tr><td>Lbatch = N∑²N1 uj/T -log eu</td><td>h(f(xi))</td></tr><tr><td>N 1(k≠i)eu uk/T</td><td>;ui=</td></tr><tr><td>else</td><td></td></tr><tr><td>1</td><td></td></tr><tr><td>2Nyi -log</td><td>11(k≠i)1(yk=yi)eTuk/T</td></tr><tr><td></td><td>1(k≠i)e²Tuk/T</td></tr><tr><td>end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>Train feature extractor(f) by minimizing Lbatch over Xtrain;</td></tr><tr><td></td><td>Ztrain = getFeatures(Xtrain),Zcal = getFeatures(Xcal)</td></tr><tr><td></td><td>Ztest = getFeatures(Xtest),if Xood is available: Zood = getFeatures(Xood);</td></tr><tr><td>if Xood is not available then</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td> Scal = SSDScore(Zcal, μtrain,∑train); # Sample mean and convariance of Ztrain</td></tr><tr><td></td><td>Stest = SSDScore(Ztest, μtrain,∑train) # outlier score;</td></tr><tr><td>else</td><td></td></tr><tr><td></td><td># Using convariance estimation techniques from Section 3.2 for Zood</td></tr><tr><td>Scal = SSDkScore(Zcal, μtrain,∑train, μood,∑ood);</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>Stest = SSDkScore(Ztest, μtrain,∑train,μood,∑ood);</td></tr><tr><td>end</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>Xi E Xtest is an outlier if stest > (Scal threshold at TPR = T);</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 119 |
+
|
| 120 |
+
# 4 EXPERIMENTAL RESULTS
|
| 121 |
+
|
| 122 |
+
# 4.1 COMMON SETUP ACROSS ALL EXPERIMENTS
|
| 123 |
+
|
| 124 |
+
We use recently proposed NT-Xent loss function from SimCLR (Chen et al., 2020) method for self-supervised training. We use the ResNet-50 network in all key experiments but also provide ablation with ResNet-18, ResNet-34, and ResNet-101 network architecture. We train each network, for both supervised and self-supervised training, with stochastic gradient descent for 500 epochs, 0.5 starting learning rate with cosine decay, and weight decay and batch size set to 1e-4 and 512, respectively. We set the temperature parameter to 0.5 in the NT-Xent loss. We evaluate our detector with three performance metrics, namely FPR (at $\mathrm { T P R } { = } 9 5 \%$ ), AUROC, and AUPR. For the supervised training baseline, we use identical training budget as SSD while also using the Mahalanobis distance based detection in the feature space. Due to space constraints, we present results with AUROC, which refers to area under the receiver operating characteristic curve, in the main paper and provide detailed results with other performance metrics in Appendix B.5. Our setup incorporates six image datasets along with additional synthetic datasets based on random noise. We report the average results over three independent runs in most experiments.
|
| 125 |
+
|
| 126 |
+
Number of clusters. We find the choice of the number of clusters dependent on which layer we extract the features from in the Residual neural networks. While for the first three blocks, we find an increase in AUROC with the number of clusters, the trend is reversed for the last block (Appendix B.2). Since the last block features achieve the highest detection performance, we model the in-distribution features as a single cluster in subsequent experiments.
|
| 127 |
+
|
| 128 |
+
# 4.2 PERFORMANCE OF SSD
|
| 129 |
+
|
| 130 |
+
Comparison with unsupervised learning based detectors. We present this comparison in Table 1. We find that SSD improves average AUROC by up to 55, compared to standard outlier detectors based on Density modeling $\mathrm { ( P i x e l C N N + + }$ (Salimans et al., 2017)), input reconstruction (Autoencoder (Hawkins et al., 2002), Variational Auto-encoder (Kingma & Welling, 2014)), and One-class classification (Deep-SVDD Ruff et al. (2018)). A common limitation of each of these three detectors is to find images from the SVHN dataset as more in-distribution when trained on CIFAR-10 or CIFAR-100 dataset. In contrast, SSD is able to successfully detect a large fraction of outliers from SVHN dataset. We also experiment with Rotation-loss Gidaris et al. (2018), a non-contrastive self-supervised training objective. We find that SSD with contrastive NT-Xent loss achieves $9 . 6 \%$ higher average AUROC compared to using Rotation-loss.
|
| 131 |
+
|
| 132 |
+
Table 1: Comparison of SSD with different outlier detectors using only unlabeled training data.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>In-distribution (Out-of-distribution)</td><td>CIFAR-10 (SVHN)</td><td>CIFAR-10 (CIFAR-100)</td><td>CIFAR-100 (SVHN)</td><td>CIFAR-100 (CIFAR-10)</td><td>Average</td></tr><tr><td>Autoencoder (Hawkins et al., 2002)</td><td>2.5</td><td>51.3</td><td>3.0</td><td>51.4</td><td>27.0</td></tr><tr><td>VAE (Kingma &Welling,2014)</td><td>2.4</td><td>52.8</td><td>2.6</td><td>47.1</td><td>26.2</td></tr><tr><td>PixelCNN++ (Salimans et al., 2017)</td><td>15.8</td><td>52.4</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Deep-SVDD (Ruff et al., 2018)</td><td>14.5</td><td>52.1</td><td>16.3</td><td>51.4</td><td>33.5</td></tr><tr><td>Rotation-loss (Gidaris et al.,2018)</td><td>97.9</td><td>81.2</td><td>94.4</td><td>50.1</td><td>80.9</td></tr><tr><td>CSI(Tack et al.,2020)</td><td>99.8</td><td>89.2</td><td></td><td>一</td><td>一</td></tr><tr><td>SSD</td><td>99.6</td><td>90.6</td><td>94.9</td><td>69.6</td><td>88.7</td></tr><tr><td>SSDk(k=5)</td><td>99.7</td><td>93.1</td><td>99.1</td><td>78.2</td><td>92.5</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Ablation studies. We ablate along individual parameters in self-supervised training with CIFAR-10 as in-distribution data (Figure 2). While architecture doesn’t have a very large effect on AUROC for most OOD dataset, we find that the number of training epochs and batch size plays a key role in detecting outliers from the CIFAR-100 dataset, which is hardest to detect among the four OOD datasets. We also find an increase in the size of training dataset helpful in the detection of all four OOD datasets.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 2: Ablating across different training parameters in SSD under following setup: In-distribution dataset $=$ CIFAR-10, OOD dataset $=$ CIFAR-100, Training epochs $= 5 0 0$ , Batch size $= 5 1 2$ .
|
| 140 |
+
|
| 141 |
+
Comparison with supervised representations. We earlier asked the question whether data labels are even necessary to learn representations crucial for OOD detection? To answer it, we compare SSD with a supervised network, trained with an identical budget as SSD while also using Mahalanobis distance in the feature space, across sixteen different pairs of in-distribution and out-of-distribution datasets (Table 2). We observe that self-supervised representations even achieve better performance than supervised representations for $56 \%$ of the tasks in Table 2.
|
| 142 |
+
|
| 143 |
+
Success in anomaly detection. We now measure the performance of $S S D$ in anomaly detection where we consider one of the CIFAR-10 classes as in-distribution and the rest of the classes as a source of anomalies. Similar to the earlier setup, we train a ResNet-50 network using self-supervised training with NT-Xent loss function. While the contrastive loss attempt to separate individual instances in the feature space, we find that adding an $\ell _ { 2 }$ regularization in the feature space helps in improving performance. In particular, we add this regularization (with a scaling coefficient of 0.01) to bring individual instance features close to the mean of all feature vectors in the batch. Additionally, we reduce the temperature from 0.5 to 0.1 to reduce the separability of individual instances due to the contrastive loss. Overall, we find that our approach outperforms all previous works and achieves competitive performance with the concurrent work of Tack et al. (2020) (Table 3).
|
| 144 |
+
|
| 145 |
+
# 4.3 FEW-SHOT OOD DETECTION $( S S D _ { k }$
|
| 146 |
+
|
| 147 |
+
Setup. We focus on one-shot and five-shot OOD detection, i.e., set $k$ to 1 or 5 in Equation 4 and use Ledoit-Wolf (Ledoit & Wolf, 2004) estimator for covariance estimation. To avoid a bias on selected samples, we report average results over 25 random trials.
|
| 148 |
+
|
| 149 |
+
Table 2: Comparing performance of self-supervised (SSD) and supervised representations. We also provide results for few-shot OOD detection $( S S D _ { k } )$ ) for comparison with our baseline SSD detector.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan="2">In- distribution</td><td rowspan="2">OOD</td><td rowspan="2">SSD</td><td rowspan="2">Supervised</td><td colspan="2">SSDk k=5</td><td rowspan="2">In- distribution</td><td rowspan="2">0OD</td><td rowspan="2">SSD</td><td rowspan="2">Superivsed</td><td colspan="2">SSDk k=5</td></tr><tr><td>k=1</td><td></td><td>k=1</td></tr><tr><td rowspan="6">CIFAR-10</td><td>CIFAR-100</td><td>90.6</td><td>90.6</td><td>91.7</td><td>93.0</td><td rowspan="6">STL-10</td><td>CIFAR-100</td><td>94.8</td><td>84.0</td><td>90.1</td><td>90.0</td></tr><tr><td>SVHN</td><td>99.6</td><td>99.6</td><td>99.9</td><td>99.7</td><td>SVHN</td><td>98.7</td><td>95.7</td><td>98.7</td><td>99.4</td></tr><tr><td>Texture</td><td>97.6</td><td>97.8</td><td>98.9</td><td>99.4</td><td>Texture</td><td>85.8</td><td>75.5</td><td>85.7</td><td>84.5</td></tr><tr><td>Blobs</td><td>98.8</td><td>99.9</td><td>99.7</td><td>100.0</td><td>Blobs</td><td>96.4</td><td>88.6</td><td>96.5</td><td>99.9</td></tr><tr><td>LSUN</td><td>96.5</td><td>93.8</td><td>97.6</td><td>97.8</td><td>LSUN</td><td>88.8</td><td>66.8</td><td>94.1</td><td>94.5</td></tr><tr><td>Places365</td><td>95.2</td><td>92.7</td><td>96.7</td><td>97.3</td><td>Places365</td><td>88.3</td><td>64.9</td><td>95.4</td><td>95.6</td></tr><tr><td rowspan="6">CIFAR-100</td><td>CIFAR-10</td><td>69.6</td><td>55.3</td><td>74.8</td><td>78.3</td><td rowspan="6">ImageNet</td><td>SVHN</td><td>99.1</td><td>99.4</td><td>99.7</td><td>100.0</td></tr><tr><td>SVHN</td><td>94.9</td><td>94.5</td><td>99.5</td><td>99.1</td><td>Texture</td><td>95.4</td><td>85.1</td><td>94.7</td><td>97.3</td></tr><tr><td>Texture</td><td>82.9</td><td>98.8</td><td>96.8</td><td>94.2</td><td>Blobs</td><td>99.5</td><td>98.4</td><td>100.0</td><td>100.0</td></tr><tr><td>Blobs</td><td>98.1</td><td>57.3</td><td>98.1</td><td>100.0</td><td>Gaussian Noise</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>LSUN</td><td>79.5</td><td>69.4</td><td>92.3</td><td>93.4</td><td>ImageNet-O</td><td>45.2</td><td>75.5</td><td>89.4</td><td>93.3</td></tr><tr><td>Places365</td><td>79.6</td><td>62.6</td><td>90.7</td><td>92.7</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 3: Comparison of SSD with other detectors for anomaly detection task on CIFAR-10 dataset.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>Airplane</td><td>Automobile</td><td>Bird</td><td>Cat</td><td>Deer</td><td>Dog</td><td>Frog</td><td>Horse</td><td>Ship</td><td>Truck</td><td>Average</td></tr><tr><td>Randomly Initialized network</td><td>77.4</td><td>44.1</td><td>62.4</td><td>44.1</td><td>62.1</td><td>49.6</td><td>59.8</td><td>48.0</td><td>73.8</td><td>53.7</td><td>57.5</td></tr><tr><td>VAE(Kingma & Welling,2014)</td><td>70.0</td><td>38.6</td><td>67.9</td><td>53.5</td><td>74.8</td><td>52.3</td><td>68.7</td><td>49.3</td><td>69.6</td><td>38.6</td><td>58.3</td></tr><tr><td>OCSVM (Scholkopf et al., 2001)</td><td>63.0</td><td>44.0</td><td>64.9</td><td>48.7</td><td>73.5</td><td>50.0</td><td>72.5</td><td>53.3</td><td>64.9</td><td>50.8</td><td>58.5</td></tr><tr><td>AnoGAN (Schlegl et al., 2017)</td><td>67.1</td><td>54.7</td><td>52.9</td><td>54.5</td><td>65.1</td><td>60.3</td><td>58.5</td><td>62.5</td><td>75.8</td><td>66.5</td><td>61.8</td></tr><tr><td>PixelCNN(Van den Oord et al.,2016)</td><td>53.1</td><td>99.5</td><td>47.6</td><td>51.7</td><td>73.9</td><td>54.2</td><td>59.2</td><td>78.9</td><td>34.0</td><td>66.2</td><td>61.8</td></tr><tr><td>DSVDD (Ruff et al., 2018)</td><td>61.7</td><td>65.9</td><td>50.8</td><td>59.1</td><td>60.9</td><td>65.7</td><td>67.7</td><td>67.3</td><td>75.9</td><td>73.1</td><td>64.8</td></tr><tr><td>OCGAN (Perera et al.,2019)</td><td>75.7</td><td>53.1</td><td>64.0</td><td>62.0</td><td>72.3</td><td>62.0</td><td>72.3</td><td>57.5</td><td>82.0</td><td>55.4</td><td>65.6</td></tr><tr><td>RCAE(Chalapathy et al., 2018b)</td><td>72.0</td><td>63.1</td><td>71.7</td><td>60.6</td><td>72.8</td><td>64.0</td><td>64.9</td><td>63.6</td><td>74.7</td><td>74.5</td><td>68.2</td></tr><tr><td>DROCC (Goyal et al.,2020)</td><td>81.7</td><td>76.7</td><td>66.7</td><td>67.1</td><td>73.6</td><td>74.4</td><td>74.4</td><td>71.4</td><td>80.0</td><td>76.2</td><td>74.2</td></tr><tr><td>Deep-SAD (Ruff et al., 2019)</td><td>二</td><td>二</td><td>二</td><td></td><td></td><td>一</td><td>一</td><td></td><td></td><td>一</td><td>77.9</td></tr><tr><td>E3Outlier (Wang et al.,2019)</td><td>79.4</td><td>95.3</td><td>75.4</td><td>73.9</td><td>84.1</td><td>87.9</td><td>85.0</td><td>93.4</td><td>92.3</td><td>89.7</td><td>85.6</td></tr><tr><td>GT(Golan & El-Yaniv,2018)</td><td>74.7</td><td>95.7</td><td>78.1</td><td>72.4</td><td>87.8</td><td>87.8</td><td>83.4</td><td>95.5</td><td>93.3</td><td>91.3</td><td>86.0</td></tr><tr><td>InvAE (Huang et al., 2019)</td><td>78.5</td><td>89.8</td><td>86.1</td><td>77.4</td><td>90.5</td><td>84.5</td><td>89.2</td><td>92.9</td><td>92.0</td><td>85.5</td><td>86.6</td></tr><tr><td>GOAD (Bergman & Hoshen,2020)</td><td>77.2</td><td>96.7</td><td>83.3</td><td>77.7</td><td>87.8</td><td>87.8</td><td>90.0</td><td>96.1</td><td>93.8</td><td>92.0</td><td>88.2</td></tr><tr><td>CSI (Tack et al., 2020)</td><td>89.9</td><td>99.9</td><td>93.1</td><td>86.4</td><td>93.9</td><td>93.2</td><td>95.1</td><td>98.7</td><td>97.9</td><td>95.5</td><td>94.3</td></tr><tr><td>SSD</td><td>82.7</td><td>98.5</td><td>84.2</td><td>84.5</td><td>84.8</td><td>90.9</td><td>91.7</td><td>95.2</td><td>92.9</td><td>94.4</td><td>90.0</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Results. Compared to the baseline SSD detector, one-shot and five-shot settings improve the average AUROC, across all OOD datasets, by 1.6 and 2.1, respectively (Table 1, 2). In particular, we observe large gains with CIFAR-100 as in-distribution and CIFAR-10 as OOD where five-shot detection improves the AUROC from 69.6 to 78.3. We find the use of shrunk covariance estimator most critical in the success of our approach. Use of shrunk covariance estimation itself improves the AUROC from 69.6 to 77.1. Then data augmentation further improves it 78.3 for the five-shot detection. With an increasing number of transformed copies of each sample, we also observe improvement in AUROC, though it later plateaus close to ten copies (Appendix B.3).
|
| 158 |
+
|
| 159 |
+
What if additional OOD images are available Note that some earlier works, such as Liang et al. (2018), assume that 1000 OOD inputs are available for tuning the detector. We find that with access to this large amount of OOD samples, $S S D _ { k }$ can improve the state-of-the-art by an even larger margin. For example, with CIFAR-100 as in-distribution and CIFAR-10 as out-of-distribution, it achieves 89.4 AUROC, which is $1 4 . 2 \%$ higher than the current state-of-the-art (Winkens et al., 2020).
|
| 160 |
+
|
| 161 |
+
# 4.4 SUCCESS WHEN USING DATA LABELS $( S S D + )$
|
| 162 |
+
|
| 163 |
+
Now we integrate labels of training data in our framework and compare it with the existing state-ofthe-art detectors. We report our results in Table 4. Our approach improves the average AUROC by 0.8 over the previous state-of-the-art detector. Our approach also achieves equal or better performance than previous state-of-the-art across individual pairs of in and out-distribution dataset. For example, using labels in our framework improves the AUROC of Mahalanobis detector from 55.5 to 72.1 for CIFAR-100 as in-distribution and CIFAR-10 as the OOD dataset. Using the simple softmax probabilities, training a two-layer MLP on learned representations further improves the AUROC to 78.3. Combining $S S D +$ with a five-shot OOD detection method further brings a gain of 1.4 in the average AUROC.
|
| 164 |
+
|
| 165 |
+
# 5 DISCUSSION AND CONCLUSION
|
| 166 |
+
|
| 167 |
+
On tuning hyperparameters in SSD. In our framework, we either explicitly avoid the use of additional tuning-parameters (such as when combining self-supervised and supervised loss functions in $S S D +$ ) or refrain from tuning the existing set of parameters for each OOD dataset. For example, we use a standard set of parameters for self-supervised training and model the learned features with a single-cluster.
|
| 168 |
+
|
| 169 |
+
Table 4: Comparison of $S S D +$ , i.e., incorporating labels in the SSD detector, with state-of-the-art detectors based on supervised training.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>In-distribution (Out-of-distribution)</td><td>CIFAR-10 (CIFAR-100)</td><td>CIFAR-10 (SVHN)</td><td>CIFAR-100 (CIFAR-10)</td><td>CIFAR-100 (SVHN)</td><td>Average</td></tr><tr><td>Softmax-probs (Hendrycks & Gimpel, 2017)</td><td>89.8</td><td>95.9</td><td>78.0</td><td>78.9</td><td>85.6</td></tr><tr><td>ODIN(Liang et al.,2018)†</td><td>89.6</td><td>96.4</td><td>77.9</td><td>60.9</td><td>81.2</td></tr><tr><td>Mahalnobis (Lee et al.,2018b)†</td><td>90.5</td><td>99.4</td><td>55.3</td><td>94.5</td><td>84.8</td></tr><tr><td>Residual Flows (Zisselman & Tamar,2020)†</td><td>89.4</td><td>99.1</td><td>77.1</td><td>97.5</td><td>90.7</td></tr><tr><td>Gram Matrix (Sastry & Oore,2019)</td><td>79.0</td><td>99.5</td><td>67.9</td><td>96.0</td><td>85.6</td></tr><tr><td>Outlier exposure (Hendrycks et al.,2019a)</td><td>93.3</td><td>98.4</td><td>75.7</td><td>86.9</td><td>88.6</td></tr><tr><td>Rotation-loss + Supervised (Hendrycks et al.,2019b)</td><td>90.9</td><td>98.9</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Contrastive+ Supervised (Winkens et al.,2020)*</td><td>92.9</td><td>99.5</td><td>78.3</td><td>95.6</td><td>91.6</td></tr><tr><td>CSI (Tack et al.,2020)</td><td>92.2</td><td>97.9</td><td>1</td><td>1</td><td>1</td></tr><tr><td>SSD+</td><td>93.4</td><td>99.9</td><td>78.3</td><td>98.2</td><td>92.4</td></tr><tr><td>SSDk+(k =5)</td><td>94.1</td><td>99.6</td><td>84.1</td><td>97.4</td><td>93.8</td></tr></table>
|
| 172 |
+
|
| 173 |
+
∗ Uses $4 \times$ wider ResNet-50 network, † Requires additional out-of-distribution data for tuning.
|
| 174 |
+
|
| 175 |
+
Why contrastive self-supervised learning is effective in the SSD framework? We focus on the NT-Xent loss function, which is parameterized by a temperature variable $( \tau )$ . Its objective is to pull positive instances, i.e., different transformations of an image, together while pushing away from other instances. Earlier works have shown that such contrastive training forces the network to learn a good set of feature representations. However, a smaller value of temperature quickly saturates the loss, discouraging it to further improve the feature representations. We find that the performance of SSD also degrades with lower temperature, suggesting the necessity of learning a good set of feature representation for effective outlier detection (Table 5).
|
| 176 |
+
|
| 177 |
+
Table 5: Test Accuracy and AUROC with different temperature values in NTXent (Equation 1) loss. Using CIFAR10 as in-distribution and CIFAR-100 as OOD dataset with ResNet18 network.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Temperature</td><td>0.001</td><td>0.01 0.1</td><td>0.5</td></tr><tr><td>Test -Accuracy</td><td>70.8</td><td>76.7 86.9</td><td>90.5</td></tr><tr><td>AUROC</td><td>66.7</td><td>71.6 85.5</td><td>89.5</td></tr></table>
|
| 180 |
+
|
| 181 |
+
How discriminative ability of feature representations evolves over the course of training. We analyze this effect in Figure 3 where we compare both SSD and supervised training based detector over the course of training. While discriminative ability of self-supervised training in $S S D$ is lower at the start, it quickly catches up with supervised representations after half of the training epochs.
|
| 182 |
+
|
| 183 |
+
Performance of SSD improves with the amount of available unlabeled data. A compelling advantage of unsupervised learning is to learn from unlabeled data, which can be easily collected. As presented in Figure 2, we find that performance of SSD increases with the size of training dataset. We conduct another experiment with the STL-10 dataset, where in addition to the $5 \mathrm { k }$ training images, we also use additional 10k images from the unlabeled set. This improves the AUROC from 94.7 to 99.4 for CIFAR100 as the OOD dataset, further demonstrating the success of SSD in leveraging unlabeled data (Appendix B.4). In conclusion, our framework provides an effective & flexible approach for outlier detection using unlabeled data.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 3: AUROC over the course of training with CIFAR-10 as indistribution and CIFAR-100 as OOD set.
|
| 187 |
+
|
| 188 |
+
# Acknowledgments We would like to thank Chong Xiang,
|
| 189 |
+
|
| 190 |
+
Liwei Song, and Arjun Nitin Bhagoji for their helpful feedback on the paper. This work was supported in part by the National Science Foundation under grants CNS-1553437 and CNS-1704105, by a Qualcomm Innovation Fellowship, by the Army Research Office Young Investigator Prize, by Army Research Laboratory (ARL) Army Artificial Intelligence Institute (A2I2), by Office of Naval Research (ONR) Young Investigator Award, by Facebook Systems for ML award, by Schmidt DataX Fund, and by Princeton E-ffiliates Partnership.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Davide Abati, Angelo Porrello, Simone Calderara, and Rita Cucchiara. Latent space autoregression for novelty detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 481–490, 2019.
|
| 195 |
+
|
| 196 |
+
Jinwon An and Sungzoon Cho. Variational autoencoder based anomaly detection using reconstruction probability. Special Lecture on IE, 2:1–18, 2015.
|
| 197 |
+
|
| 198 |
+
Abhijit Bendale and Terrance E Boult. Towards open set deep networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1563–1572, 2016.
|
| 199 |
+
|
| 200 |
+
Liron Bergman and Yedid Hoshen. Classification-based anomaly detection for general data. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id ${ . } = { }$ H1lK_lBtvS.
|
| 201 |
+
|
| 202 |
+
Raghavendra Chalapathy, Aditya Krishna Menon, and Sanjay Chawla. Anomaly detection using one-class neural networks. arXiv preprint arXiv:1802.06360, 2018a.
|
| 203 |
+
|
| 204 |
+
Raghavendra Chalapathy, Aditya Krishna Menon, and Sanjay Chawla. Anomaly detection using one-class neural networks. arXiv preprint arXiv:1802.06360, 2018b.
|
| 205 |
+
|
| 206 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning (ICML), 2020.
|
| 207 |
+
|
| 208 |
+
M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014.
|
| 209 |
+
|
| 210 |
+
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.
|
| 211 |
+
|
| 212 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. Ieee, 2009.
|
| 213 |
+
|
| 214 |
+
Terrance DeVries and Graham W Taylor. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018.
|
| 215 |
+
|
| 216 |
+
Akshay Raj Dhamija, Manuel Gunther, and Terrance Boult. Reducing network agnostophobia. In ¨ Advances in Neural Information Processing Systems, pp. 9175–9186, 2018.
|
| 217 |
+
|
| 218 |
+
Ran El-Yaniv and Yair Wiener. On the foundations of noise-free selective classification. Journal of Machine Learning Research, 11(May):1605–1641, 2010.
|
| 219 |
+
|
| 220 |
+
Yonatan Geifman and Ran El-Yaniv. Selective classification for deep neural networks. In Advances in neural information processing systems, pp. 4878–4887, 2017.
|
| 221 |
+
|
| 222 |
+
Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ S1v4N2l0-.
|
| 223 |
+
|
| 224 |
+
Izhak Golan and Ran El-Yaniv. Deep anomaly detection using geometric transformations. In Advances in Neural Information Processing Systems, pp. 9758–9769, 2018.
|
| 225 |
+
|
| 226 |
+
API Google AI Pricing. Data Labelling Pricing - Google AI Platform, 2020. URL https: //cloud.google.com/ai-platform/data-labeling/pricing.
|
| 227 |
+
|
| 228 |
+
Nico Gornitz, Marius Kloft, Konrad Rieck, and Ulf Brefeld. Toward supervised anomaly detection.¨ Journal of Artificial Intelligence Research, 46:235–262, 2013.
|
| 229 |
+
|
| 230 |
+
Sachin Goyal, Aditi Raghunathan, Moksh Jain, Harsha Vardhan Simhadri, and Prateek Jain. Drocc: Deep robust one-class classification. In International Conference on Machine Learning, 2020.
|
| 231 |
+
|
| 232 |
+
Frank E Grubbs. Procedures for detecting outlying observations in samples. Technometrics, 11(1): 1–21, 1969.
|
| 233 |
+
|
| 234 |
+
Manuel Gunther, Steve Cruz, Ethan M Rudd, and Terrance E Boult. Toward open-set face recognition. ¨ In Conference on Computer Vision and Pattern Recognition (CVPR) Workshops. IEEE, 2017.
|
| 235 |
+
|
| 236 |
+
Simon Hawkins, Hongxing He, Graham Williams, and Rohan Baxter. Outlier detection using replicator neural networks. In International Conference on Data Warehousing and Knowledge Discovery, pp. 170–180. Springer, 2002.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In International Conference on Learning Representations, 2017.
|
| 241 |
+
|
| 242 |
+
Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. In International Conference on Learning Representations, 2019a. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HyxCxhRcY7.
|
| 243 |
+
|
| 244 |
+
Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In Advances in Neural Information Processing Systems, pp. 15663–15674, 2019b.
|
| 245 |
+
|
| 246 |
+
Chaoqing Huang, Jinkun Cao, Fei Ye, Maosen Li, Ya Zhang, and Cewu Lu. Inverse-transform autoencoder for anomaly detection. arXiv preprint arXiv:1911.10676, 2019.
|
| 247 |
+
|
| 248 |
+
Heinrich Jiang, Been Kim, Melody Guan, and Maya Gupta. To trust or not to trust a classifier. In Advances in Neural Information Processing Systems, pp. 5546–5557, 2018.
|
| 249 |
+
|
| 250 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. In Advances in Neural Information Processing Systems, 2020.
|
| 251 |
+
|
| 252 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. URL http: //arxiv.org/abs/1312.6114.
|
| 253 |
+
|
| 254 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in neural information processing systems, pp. 10215–10224, 2018.
|
| 255 |
+
|
| 256 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 257 |
+
|
| 258 |
+
Olivier Ledoit and Michael Wolf. Honey, i shrunk the sample covariance matrix. The Journal of Portfolio Management, 30(4):110–119, 2004.
|
| 259 |
+
|
| 260 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. In International Conference on Learning Representations, 2018a.
|
| 261 |
+
|
| 262 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pp. 7167–7177, 2018b.
|
| 263 |
+
|
| 264 |
+
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ H1VGkIxRZ.
|
| 265 |
+
|
| 266 |
+
Prasanta Chandra Mahalanobis. On the generalized distance in statistics. National Institute of Science of India, 1936.
|
| 267 |
+
|
| 268 |
+
Iacopo Masi, Yue Wu, Tal Hassner, and Prem Natarajan. Deep face recognition: A survey. In 2018 31st SIBGRAPI conference on graphics, patterns and images (SIBGRAPI), pp. 471–478. IEEE, 2018.
|
| 269 |
+
|
| 270 |
+
Yisroel Mirsky, Tomer Doitshman, Yuval Elovici, and Asaf Shabtai. Kitsune: an ensemble of autoencoders for online network intrusion detection. arXiv preprint arXiv:1802.09089, 2018.
|
| 271 |
+
|
| 272 |
+
Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6707–6717, 2020.
|
| 273 |
+
|
| 274 |
+
Sina Mohseni, Mandar Pitale, JBS Yadawa, and Zhangyang Wang. Self-supervised learning for generalizable out-of-distribution detection. In AAAI, pp. 5216–5223, 2020.
|
| 275 |
+
|
| 276 |
+
Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1xwNhCcYm.
|
| 277 |
+
|
| 278 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 5, 2011.
|
| 279 |
+
|
| 280 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 281 |
+
|
| 282 |
+
Guansong Pang, Chunhua Shen, Longbing Cao, and Anton van den Hengel. Deep learning for anomaly detection: A review. arXiv preprint arXiv:2007.02500, 2020.
|
| 283 |
+
|
| 284 |
+
Pramuditha Perera, Ramesh Nallapati, and Bing Xiang. Ocgan: One-class novelty detection using gans with constrained latent representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2898–2906, 2019.
|
| 285 |
+
|
| 286 |
+
Manikandasriram Srinivasan Ramanagopal, Cyrus Anderson, Ram Vasudevan, and Matthew JohnsonRoberson. Failing to learn: autonomously identifying perception failures for self-driving cars. IEEE Robotics and Automation Letters, 3(4):3860–3867, 2018.
|
| 287 |
+
|
| 288 |
+
Jie Ren, Peter J Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark Depristo, Joshua Dillon, and Balaji Lakshminarayanan. Likelihood ratios for out-of-distribution detection. In Advances in Neural Information Processing Systems, pp. 14707–14718, 2019.
|
| 289 |
+
|
| 290 |
+
Lukas Ruff, Robert A. Vandermeulen, Nico Gornitz, Lucas Deecke, Shoaib A. Siddiqui, Alexander ¨ Binder, Emmanuel Muller, and Marius Kloft. Deep one-class classification. In ¨ Proceedings of the 35th International Conference on Machine Learning, volume 80, pp. 4393–4402, 2018.
|
| 291 |
+
|
| 292 |
+
Lukas Ruff, Robert A Vandermeulen, Nico Gornitz, Alexander Binder, Emmanuel M ¨ uller, Klaus- ¨ Robert Muller, and Marius Kloft. Deep semi-supervised anomaly detection. In ¨ International Conference on Learning Representations, 2019.
|
| 293 |
+
|
| 294 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. In International Conference on Learning Representations, 2017.
|
| 295 |
+
|
| 296 |
+
Chandramouli Shama Sastry and Sageev Oore. Detecting out-of-distribution examples with indistribution examples and gram matrices. arXiv preprint arXiv:1912.12510, 2019.
|
| 297 |
+
|
| 298 |
+
Thomas Schlegl, Philipp Seebock, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. ¨ Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging, pp. 146–157. Springer, 2017.
|
| 299 |
+
|
| 300 |
+
Bernhard Scholkopf, John C Platt, John Shawe-Taylor, Alex J Smola, and Robert C Williamson. ¨ Estimating the support of a high-dimensional distribution. Neural computation, 13(7):1443–1471, 2001.
|
| 301 |
+
|
| 302 |
+
Marco Schreyer, Timur Sattarov, Damian Borth, Andreas Dengel, and Bernd Reimer. Detection of anomalies in large scale accounting data using deep autoencoder networks. arXiv preprint arXiv:1709.05254, 2017.
|
| 303 |
+
|
| 304 |
+
C. Stein. Estimation of a covariance matrix. 39th Annual Meeting IMS, Atlanta, GA, 1975, 1975. URL https://ci.nii.ac.jp/naid/10020185297/en/.
|
| 305 |
+
|
| 306 |
+
Jihoon Tack, Sangwoo Mo, Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via contrastive learning on distributionally shifted instances. Advances in Neural Information Processing Systems, 33, 2020.
|
| 307 |
+
|
| 308 |
+
Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020.
|
| 309 |
+
|
| 310 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
|
| 311 |
+
|
| 312 |
+
Apoorv Vyas, Nataraj Jammalamadaka, Xia Zhu, Dipankar Das, Bharat Kaul, and Theodore L Willke. Out-of-distribution detection using an ensemble of self supervised leave-out classifiers. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 550–564, 2018.
|
| 313 |
+
|
| 314 |
+
Siqi Wang, Yijie Zeng, Xinwang Liu, En Zhu, Jianping Yin, Chuanfu Xu, and Marius Kloft. Effective end-to-end unsupervised outlier detection via inlier priority of discriminative network. In Advances in Neural Information Processing Systems, pp. 5962–5975, 2019.
|
| 315 |
+
|
| 316 |
+
Jim Winkens, Rudy Bunel, Abhijit Guha Roy, Robert Stanforth, Vivek Natarajan, Joseph R Ledsam, Patricia MacWilliams, Pushmeet Kohli, Alan Karthikesalingam, Simon Kohl, et al. Contrastive training for improved out-of-distribution detection. arXiv preprint arXiv:2007.05566, 2020.
|
| 317 |
+
|
| 318 |
+
Ryota Yoshihashi, Wen Shao, Rei Kawakami, Shaodi You, Makoto Iida, and Takeshi Naemura. Classification-reconstruction learning for open-set recognition. arXiv preprint arXiv:1812.04246, 2018.
|
| 319 |
+
|
| 320 |
+
Ev Zisselman and Aviv Tamar. Deep residual flow for novelty detection. arXiv preprint arXiv:2001.05419, 2020.
|
| 321 |
+
|
| 322 |
+
# A ADDITIONAL DETAILS ON EXPERIMENTAL SETUP
|
| 323 |
+
|
| 324 |
+
A.1 TRAINING AND EVALUATION SETUP FOR DEEP NEURAL NETWORKS.
|
| 325 |
+
|
| 326 |
+
We use ResNet-50 architecture for all our major experiments and ResNet-18 for ablation studies. We also provide results with ResNet-34 and ResNet-101 architecture. We use a two-layer fully connected network as the projection header $( h ( . ) )$ . To contrast with a large number of negatives, NT-Xent loss requires a much larger batch size compared to the supervised cross-entropy loss function. We train it using a batch size of 512. When evaluating self-supervised models, even when we incorporate labels in $S S D$ , we achieve the best performance when modeling in-distribution features with only a single cluster. However, for supervised training, which refers to the supervised baseline in the paper, we find that increasing the number of clusters helps. For it, we report the best of the results obtained from cluster indexes or using true labels of the data. For each dataset, we use the test set partition, if it exists, as the OOD dataset. For consistent comparison, we re-implement Softmax-probabilities (Hendrycks & Gimpel, 2017), ODIN (Liang et al., 2018), and Mahalanobis detector (Lee et al., 2018b) and evaluate their performance on the identical network, trained with supervised training for 500 epochs. We set the perturbation budget to 0.0014 and temperature to 1000 for ODIN, since these are the most successful set of parameters reported in the original paper (Liang et al., 2018). We primarily focus on one-shot and five-shot OOD detection, i.e., set $k$ to one or five. It implies access to one and five images, respectively, from each class of the targeted OOD dataset. We create ten randomly transformed samples from each available OOD image in the $S S D _ { k }$ detector. With very small $k$ , such as one, we find that increasing number of transformations may degrade performance in some cases. In this case we simply resort to using only one transformation per sample. To avoid any hyperparameter selection, we set the image augmentation pipeline to be the same as the one used in training. Finally, we use the Ledoit-Wolf method (Ledoit & Wolf, 2004) to estimate the covariance of the OOD samples.
|
| 327 |
+
|
| 328 |
+
# A.2 PERFORMANCE METRICS FOR OUTLIER DETECTORS
|
| 329 |
+
|
| 330 |
+
We use the following three performance metrics to evaluate the performance of outlier detectors.
|
| 331 |
+
|
| 332 |
+
• FPR at $\mathbf { T P R = 9 5 \% }$ . It refers to the false positive rate $\left( = \mathrm { F P } / \left( \mathrm { F P + T N } \right) \right)$ , when true positive rate $\left( = \mathrm { T P } / \left( \mathrm { T P } + \mathrm { F N } \right) \right)$ is equal to $9 5 \%$ . Effectively, its goal is to measure what fraction of outliers go undetected when it is desirable to have a true positive rate of $9 5 \%$ . AUROC. It refers to the area under the receiver operating characteristic curve. We measure it by calculating the area under the curve when we plot TPR against FPR. • AUPR. It refers to the area under the precision-recall curve, where precision $=$ TP / $( \mathrm { T P + F P } )$ and recall $=$ TP / $\mathrm { ( T P + F N ) }$ . Similar to AUROC, AUPR is also a threshold independent metric.
|
| 333 |
+
|
| 334 |
+
# A.3 DATASETS USED IN THIS WORK
|
| 335 |
+
|
| 336 |
+
We use the following datasets in this work. Whenever there is a mismatch between the resolution of images in in-distribution and out-of-distribution (OOD) data, we appropriately scale the OOD images with bilinear scaling. When there is an overlap between the classes of the in-distribution and OOD dataset, we remove the common classes from the OOD dataset.
|
| 337 |
+
|
| 338 |
+
• CIFAR-10 (Krizhevsky et al., 2009). It consists of 50,000 training images and 10,000 test images from 10 different classes. Each image size is $3 2 \times 3 2$ pixels.
|
| 339 |
+
|
| 340 |
+
• CIFAR-100 (Krizhevsky et al., 2009). CIFAR-100 also has 50,000 training images and 10,000 test images. However, it has 100 classes which are further organized in 20 sub-classes. Note that its classes aren’t identical to the CIFAR-10 dataset, with a slight exception with class truck in CIFAR-10 and pickup truck in CIFAR-100. However, their classes share multiple similar semantics, making it hard to catch outliers from the other dataset.
|
| 341 |
+
|
| 342 |
+
• SVHN (Netzer et al., 2011). SVHN is a real-world street-view housing number dataset. It has 73,257 digits available for training, and 26,032 digits for testing. Similar to the CIFAR-10/100 dataset, the size of its images is also $3 2 \times 3 2$ pixels.
|
| 343 |
+
|
| 344 |
+
• STL-10 (Coates et al., 2011). STL-10 has identical classes as the CIFAR-10 dataset but focuses on the unsupervised learning. It has 5,000 training images, 8,000 test images, and a set of 100,000 unlabeled images. Unlike the previous three datasets, the size of its images is $9 6 \times 9 6$ pixels.
|
| 345 |
+
|
| 346 |
+
• DTD (Cimpoi et al., 2014). Describable Textures Dataset (DTD) is a collection of textural images in the wild. It includes a total of 5,640 images, split equally between 47 categories where the size of images range between $3 0 0 \times 3 0 0$ and $6 4 0 \times 6 4 0$ pixels.
|
| 347 |
+
|
| 348 |
+
• ImageNet3 (Deng et al., 2009). ImageNet is a large scale dataset of 1,000 categories with 1.2 Million training images and 50,000 validation images. It has high diversity in both inter- and intra-class images and is known to have strong generalization properties to other datasets.
|
| 349 |
+
|
| 350 |
+
• Blobs. Similar to Hendrycks et al. (2019a), we algorithmically generate these amorphous shapes with definite edges.
|
| 351 |
+
|
| 352 |
+
• Gaussian Noise. We generate images with Gaussian noise using a mean of 0.5 and a standard deviation of 0.25. We clip the pixel value to the valid pixel range of [0, 1].
|
| 353 |
+
|
| 354 |
+
• Uniform Noise. It refers to images where each pixel value is uniformly sampled from the [0, 1] range.
|
| 355 |
+
|
| 356 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 357 |
+
|
| 358 |
+
# B.1 LIMITATIONS OF OUTLIER DETECTORS BASED ON SUPERVISED TRAINING
|
| 359 |
+
|
| 360 |
+
Existing supervised training based detector assumes that fine-grained data labels are available for the training data. What happens to the performance of current detectors if we relax this assumption by assuming that only coarse labels are present. We simulate this setup by combining consecutive classes from the CIFAR-10 dataset into two groups, referred to as CIFAR-2, or five groups referred to as CIFAR-5. We use CIFAR-100 as the out-of-distribution dataset. We find that the performance of existing detectors degrades significantly when only coarse labels are present (Figure 4). In contrast, SSD operates on unlabeled data thus doesn’t suffer from similar performance degradation.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 4: Existing supervised detector requires fine-grained labels. In contrast, SSD can achieve similar performance with only unlabeled data.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 5: Relationship of AUROC with clusters depends on which block we use as the feature extractor.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 6: Using extra unlabeled training data can help to further improve the performance of SSD.
|
| 370 |
+
|
| 371 |
+
# B.2 ON CHOICE OF NUMBER OF CLUSTERS
|
| 372 |
+
|
| 373 |
+
We find that the choice of optimal number of clusters is dependent on which layer we use as the feature extractor in a Residual Neural network. We demonstrate this trend in Figure 5, with CIFAR-10 as in-distribution dataset and CIFAR-100 as out-of-distribution dataset. We extract features from the last layer of each block in the residual network and measure the SSD performance with them. While for the first three blocks, we find an increase in AUROC with number of clusters, the trend is reversed for the last block (Figure 5). Since last block features achieve highest detection performance, we model in-distribution features using a single cluster.
|
| 374 |
+
|
| 375 |
+
# B.3 ABLATION STUDY FOR FEW-SHOT OOD DETECTION
|
| 376 |
+
|
| 377 |
+
For few shot OOD detection, we ablate along the number of transformations used for each sample. We choose CIFAR-100 as in-distribution and CIFAR-10 as OOD dataset with $S S D _ { k }$ , set $k$ to five, and choose ResNet-18 network architecture. When increasing number of transformations from 1, 5, 10, 20, 50 the AUROC of detector is 74.3, 75.7, 76.1, 76.3, 76.7. To achieve a balance between the performance and computational cost, we use ten transformations for each sample in our final experiments.
|
| 378 |
+
|
| 379 |
+
# B.4 PERFORMANCE OF SSD IMPROVES WITH AMOUNT OF UNLABELED DATA
|
| 380 |
+
|
| 381 |
+
With easy access to unlabeled data, it is compelling to develop detectors that can benefit from the increasing amount of such data. We earlier demonstrated this ability of SSD for the CIFAR-10 dataset in Figure 2. Now we present similar results with the STL-10 dataset. We first train a self-supervised network, and an equivalent supervised network with 5,000 training images from the STL-10 dataset. We refer to these networks by SSD- $5 \mathrm { k }$ and Sup- $5 \mathrm { k }$ , respectively. Next, we include additional 10,000 images from the available 100k unlabeled images in the dataset. As we show in Figure 6, SSD is able to achieve large gains in performance with access to the additional unlabeled training data.
|
| 382 |
+
|
| 383 |
+
# B.5 RESULTS WITH DIFFERENT PERFORMANCE METRICS
|
| 384 |
+
|
| 385 |
+
We provide our detailed experimental results for each component in the SSD framework with three different performance metrics in Table 6, 7,.
|
| 386 |
+
|
| 387 |
+
Table 6: Experimental results of SSD detector with multiple metrics for ImageNet dataset.
|
| 388 |
+
|
| 389 |
+
<table><tr><td rowspan="3">In- distribution</td><td rowspan="3">OOD</td><td colspan="4">FPR(TPR=95%)↓</td><td colspan="4">AUROC ↑</td><td colspan="4">AUPR↑</td></tr><tr><td rowspan="2">SSD</td><td rowspan="2">Supervised</td><td colspan="2">SSDk</td><td rowspan="2">SSD</td><td rowspan="2">Superivsed</td><td colspan="2">SSDk</td><td rowspan="2">SSD</td><td rowspan="2">Supervised</td><td colspan="2">SSDk</td></tr><tr><td>k=1</td><td>k=5</td><td>k=1</td><td>k=5</td><td>k=1</td><td>k=5</td></tr><tr><td>ImageNet</td><td>SVHN</td><td>1.3</td><td>0.6</td><td>0.0</td><td>0.0</td><td>99.4</td><td>99.1</td><td>100.0</td><td>100.0</td><td>98.4</td><td>96.6</td><td>100.0</td><td>100.0</td></tr><tr><td></td><td>Texture</td><td>57.2</td><td>23.2</td><td>20.1</td><td>11.4</td><td>85.4</td><td>95.4</td><td>95.4</td><td>97.4</td><td>41.7</td><td>75.8</td><td>78.6</td><td>84.2</td></tr><tr><td></td><td>Blobs</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>98.4</td><td>99.5</td><td>100.0</td><td>100.0</td><td>81.1</td><td>91.6</td><td>100.0</td><td>100.0</td></tr><tr><td></td><td>Gaussian noise</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td></td><td>Uniform noise</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr></table>
|
| 390 |
+
|
| 391 |
+
<table><tr><td rowspan="10">↓JJPP 3 √UUDOC (%P6= P15) 11</td><td>3 灯 +ass</td><td>3 0'001 3</td><td>4</td><td>0'001 9</td><td rowspan="10">3 12</td><td rowspan="10"></td><td rowspan="10">9 0 3 7 00 0</td><td rowspan="2">0'001 82 0'001 8</td><td rowspan="2">8 3 3</td><td rowspan="2"></td><td rowspan="2">0'001 </td><td rowspan="2">31 3 8 3 8 </td></tr><tr><td>灯</td><td>0 0 0'001</td><td>3 0'00I 00 0'001</td></tr><tr><td>1</td><td>0'001 3 8 </td><td>3 38 0 58</td><td>5 </td><td>4</td><td>3 3</td><td>0</td><td>3 8</td></tr><tr><td>Psaisne gs</td><td></td><td>84 4</td><td>8 2</td><td>8</td><td>5</td><td></td><td>3 2</td></tr><tr><td>32</td><td>8 6</td><td></td><td></td><td rowspan="3">0'001</td><td rowspan="3">0'001</td><td rowspan="3">8</td><td>38</td></tr><tr><td>灯 +ass</td><td>3 00 </td><td>0'001 3</td><td>3 3 88</td><td>00 8 0</td></tr><tr><td>1</td><td>34 0 8</td><td>0'001 2</td><td rowspan="2">32</td><td rowspan="2">8 34 </td></tr><tr><td>+ass</td><td>44 6'66</td><td>0'001 0'001</td><td>1 2</td><td>8</td></tr><tr><td>s= S</td><td>3 0</td><td>4'66</td><td>3 1'66</td><td>2 8</td><td>0'001 3</td><td>00 466</td><td>148</td><td>0 37 6</td></tr><tr><td>1</td><td>1 0</td><td>3</td><td>8 </td><td>8</td><td>3</td><td>4</td><td>8</td><td></td></tr><tr><td>sssrsnt gss</td><td>00 00</td><td>8</td><td>0 3</td><td>3 3</td><td></td><td>8</td><td>3</td><td>万 3</td></tr><tr><td></td><td>00</td><td>00 5</td><td>8 6</td><td>3</td><td>8</td><td>4</td><td></td><td>88 o</td></tr><tr><td>=y[=y +ass</td><td>3 1</td><td>30</td><td>0 62</td><td>1</td><td>8 0</td><td>8</td><td>3 4</td><td>854 0 0</td></tr><tr><td>+ass</td><td>3</td><td>64</td><td>0 1</td><td>B</td><td>3</td><td>0</td><td></td><td>2</td></tr><tr><td></td><td>3</td><td>17</td><td>0 3</td><td>79</td><td>8</td><td>3</td><td>0 </td><td>8 68</td></tr><tr><td>s=y[=y S</td><td>5638 10</td><td>17</td><td>0 469</td><td>4</td><td>121455</td><td>0 3</td><td>24</td><td>5603.05 0</td></tr><tr><td></td><td>4 2</td><td>51</td><td>3 44</td><td>2</td><td>1</td><td>3</td><td>58</td><td>40</td></tr><tr><td>Psssn gss</td><td>4 16</td><td>24</td><td>0 </td><td>24</td><td>3 3</td><td>32</td><td>2</td><td>34 8</td></tr><tr><td></td><td>50</td><td>20 40</td><td>4</td><td>34 20</td><td>68 2</td><td>3</td><td>60</td><td>30 3</td></tr><tr><td>QOO</td><td>CEI-TIIITEI-TITI1</td><td>NHAS</td><td>Jniee B5oog</td><td>CIPAIII1 NHAS</td><td>Jee 15org</td><td>CEIPIPI0</td><td>NHAS</td><td>Jee Bporg</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>uinnnnsin 自</td><td></td><td></td><td>CIIPIPP0</td><td></td><td></td><td>OI-TLS</td><td></td><td></td></tr></table>
|
md/train/yILzFBjR0Y/yILzFBjR0Y.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GraphFormers: GNN-nested Transformers for Representation Learning on Textual Graph
|
| 2 |
+
|
| 3 |
+
Junhan Yang♦∗, Zheng Liu♣, Shitao Xiao♠, Chaozhuo Li♣, Defu Lian♦,
|
| 4 |
+
Sanjay Agrawal♥, Amit Singh♥, Guangzhong $\mathbf { S u n ^ { \bullet } }$ , Xing Xie♣
|
| 5 |
+
$\spadesuit$ University of Science and Technology of China, Hefei, China
|
| 6 |
+
♣ Microsoft Research Asia, Beijing, China
|
| 7 |
+
♠ Beijing University of Posts and Telecommunications, Beijing, China
|
| 8 |
+
♥ Microsoft India Development Center, Bengaluru, India
|
| 9 |
+
yangjun2@mail.ustc.edu.cn,
|
| 10 |
+
{zhengliu,cli,siamit,xingx}@microsoft.com,
|
| 11 |
+
stxiao@bupt.edu.cn,
|
| 12 |
+
{liandefu,gzsun}@ustc.edu.cn,
|
| 13 |
+
sanjayiitk0@gmail.com
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
The representation learning on textual graph is to generate low-dimensional embeddings for the nodes based on the individual textual features and the neighbourhood information. Recent breakthroughs on pretrained language models and graph neural networks push forward the development of corresponding techniques. The existing works mainly rely on the cascaded model architecture: the textual features of nodes are independently encoded by language models at first; the textual embeddings are aggregated by graph neural networks afterwards. However, the above architecture is limited due to the independent modeling of textual features. In this work, we propose GraphFormers, where layerwise GNN components are nested alongside the transformer blocks of language models. With the proposed architecture, the text encoding and the graph aggregation are fused into an iterative workflow, making each node’s semantic accurately comprehended from the global perspective. In addition, a progressive learning strategy is introduced, where the model is successively trained on manipulated data and original data to reinforce its capability of integrating information on graph. Extensive evaluations are conducted on three large-scale benchmark datasets, where GraphFormers outperform the SOTA baselines with comparable running efficiency. The source code is released at https://github.com/microsoft/GraphFormers .
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
The textual graph is a widely existed data format, where each node is annotated with its textual feature. The representation learning on textual graph is to generate low-dimensional node embeddings based on the individual textual features and the information from the neighbourhood. In recent years, the breakthroughs in pretrained language models and graph neural networks contribute to the development of corresponding techniques. Particularly, with pretrained language models, such as BERT (Devlin et al., 2018) and RoBERTa (Liu et al., 2019a), the underlying semantics of texts can be captured more precisely; at the same time, with graph neural networks, like GraphSage (Hamilton et al., 2017a) and GAT (Velickovi ˇ c et al., 2018), neighbours can be effectively aggregated for more informative node ´ embeddings. It is necessary to combine both techniques for better textual graph representation. As suggested by GraphSage (Hamilton et al., 2017a) and PinSage (Ying et al., 2018), the textual feature can be independently modeled by text encoders and further aggregated by rear-mounted GNNs for the final node embeddings. Such a representation paradigm has been widely adopted by subsequent works on various scenarios (Zhu et al., 2021; Li et al., 2021; Hu et al., 2020; Liu et al., 2019b; Zhou et al., 2019), where GNNs are combined with powerful PLM-based text encoders.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Model architecture comparison (a center node C is connected with two neighbours N1, N2). (A) Cascaded Transformers-GNN: text embeddings are independently generated by language models and aggregated by rear-mounted GNNs. (B) GNN-nested Transformers: the text encoding and graph aggregation are iteratively performed with the layerwise GNNs and Transformers (TRM).
|
| 25 |
+
|
| 26 |
+
The above way of combination is called the “Cascaded Transformers-GNN” architecture (Figure 1 A), as the language models (built upon Transformers) are deployed ahead of the GNN component. With the above architecture, the text encoding and the graph aggregation are performed in two consecutive steps, where there is no information exchange between the nodes when text embeddings are generated. However, the above workflow is defective considering that the linked nodes are correlated, whose underlying semantics can be mutually enhanced. For example, given a node “notes on transformers” and its neighbour “tutorials on machine translation”; by making reference to the whole context, the “transformers” here can be interpreted as a machine learning model, rather than an electric device.
|
| 27 |
+
|
| 28 |
+
Our Work. We propose “GNN-nested Transformers” (GraphFormers), which are highlighted for the fusion of GNNs and language models (Figure 1 B). In GraphFormers, the GNN components are nested alongside the transformer layers (TRM) of language models, where the text encoding and graph aggregation are fused as an iteratively workflow. In each iteration, the linked nodes will exchange information with each other in the layerwise GNN component; thus, each node will be augmented by its neighbourhood information. The transformer component will work on the augmented node features, where increasingly informative node representations can be generated for the next iteration. Compared with the cascaded architecture, GraphFormers achieve more sufficient utilization of the cross-node information on graph, which significantly benefit the representation quality. Given that the layerwise GNN components merely involve simple and effective multi-head attention, GraphFormers preserve comparable running costs as the existing cascaded Transformers-GNN models.
|
| 29 |
+
|
| 30 |
+
On top of the proposed model architecture, we further improve GraphFormers’ representation quality and practicability as follows. Firstly, the training of GraphFormers is likely to be shortcut: in many cases, the center node itself can be “sufficiently informative”, where the training tasks can be accomplished without leveraging the neighbourhood information. As such, GraphFormers may end up with insufficiently trained GNNs. Inspired by recent success of curriculum learning (Bengio et al., 2009), we propose to train the model progressively: the first round of training is performed with manipulated data, where the nodes are randomly polluted; thus, it becomes harder to make prediction merely rely on the center nodes, and the model will be forced to leverage the whole input nodes. The second round of training gets back to the unpolluted data, where the model will be fit into the targeted distribution. Another concern about GraphFormers is that all the linked nodes are mutually dependent in the representation process: once a new node is presented, all the neighbours, regardless of whether they have been processed before, need to be encoded from scratch. As a result, a great deal of unnecessary computations will be incurred. We introduce unidirectional graph attention to alleviate this problem: only the center node is required to make reference to the neighbours, while the neighbour nodes remain independently encoded. By this means, the existing neighbours’ encoding results can be cached and reused, which significantly saves the computation cost.
|
| 31 |
+
|
| 32 |
+
Extensive evaluations are conducted with three million-scale textual graph datasets: DBLP, Wiki and Product, where the representation quality is measured by the link prediction accuracy. According to our experiment results, GraphFormers significantly outperform the SOTA cascaded TransformersGNN baselines with comparable running efficiency.
|
| 33 |
+
|
| 34 |
+
# 2 Related Work
|
| 35 |
+
|
| 36 |
+
The textual graph representation is an important research topic in multiple areas, such as natural language processing, information retrieval and graph learning (Yang et al., 2015; Wang et al., 2016b,a; Yasunaga et al., 2017; Wang et al., 2019a; Xu et al., 2019). To learn high-quality representation for textual graph, techniques on natural language understanding and graph representation need to be jointly leveraged. In recent years, breakthroughs on pretrained language models (PLM) and graph neural networks (GNN) significantly advance the development of corresponding techniques.
|
| 37 |
+
|
| 38 |
+
PLM. The PLMs are proposed to learn universal language models with neural networks trained on large-scale corpus. The early works were based on shallow networks, e.g, word embeddings learned by Skip-Gram (Mikolov et al., 2013) and GloVe (Pennington et al., 2014). In recent years, the backbone networks are being quickly scaled up: from EMLo (Peters et al., 2018), GPT (Radford et al., 2018), to BERT (Devlin et al., 2018), XLNet (Yang et al., 2019), T5 (Raffel et al., 2019), GPT-3 (Brown et al., 2020). The large-scale models, which get fully trained with massive data, demonstrate superior performances on general NLP tasks. One of the most critical usages of PLMs is text representation, where the underlying semantics of texts are captured by low-dimensional embeddings. Such embeddings achieve competitive results on downstream tasks, like text retrieval and classification (Reimers and Gurevych, 2019; Luan et al., 2020; Gao et al., 2021; Su et al., 2021).
|
| 39 |
+
|
| 40 |
+
GNN. Graph neural networks are recognized as powerful tools of modeling graph data (Hamilton et al., 2017b; Zhou et al., 2020). Such methods (e.g., GCN (Kipf and Welling, 2016), GAT (Velickovi ˇ c´ et al., 2018), GraphSage (Hamilton et al., 2017a)) learn effective message passing mechanisms such that information between the nodes can get aggregated for expressive graph representations.
|
| 41 |
+
|
| 42 |
+
Graph neural networks may also incorporate node attributes, like texts; and it’s quite straightforward to leverage GNNs and PLMs for textual graph representation following the “cascaded architecture” suggested by GraphSage (Hamilton et al., 2017a): the node features are independently encoded at first; then, the node embeddings are aggregated via GNNs to generate the final representations. Such a representation paradigm is widely adopted by subsequent works (Zhu et al., 2021; Li et al., 2021; Hu et al., 2020; Liu et al., 2019b; Zhou et al., 2019). However, the above approaches treat the text encoding and graph aggregation as two consecutive steps, where the node-level features are independently processed. Our work is different from these approaches as the text encoding and graph aggregation are fused as an iterative workflow based on the “GNN-nested Transformers”.
|
| 43 |
+
|
| 44 |
+
# 3 GraphFormers
|
| 45 |
+
|
| 46 |
+
In this work, we deal with textual graph data, where each node $x$ is a text. The node $x$ together with its neighbours $N _ { x }$ are denoted as $G _ { x }$ . Our model learns the embedding for node $x$ based on its own textual feature and the information of its neighbourhood $N _ { x }$ . The generated embeddings are expected to capture the relationship between the nodes, i.e., to accurately predict whether two nodes $x _ { q }$ and $x _ { k }$ are connected based on the embedding similarity.
|
| 47 |
+
|
| 48 |
+
# 3.1 GNN-nested Transformers
|
| 49 |
+
|
| 50 |
+
The encoding process of GraphFormers is indicated as follows. The input nodes (the center node and its neighbours) are tokenized into sequences of tokens, with special tokens [CLS] padded in the front, whose states are used for node representation. The input sequences are mapped into the initial embedding sequences $\{ \mathbf { H } _ { g } ^ { 0 } \} _ { G }$ based on the summation of word embeddings and position embeddings. The embedding sequences are encoded by multiple layers of GNN-nested Transformers (shown as Figure 2), where the graph aggregation and text encoding are iteratively performed.
|
| 51 |
+
|
| 52 |
+
• Graph Aggregation in GNN. Each node is enhanced by its neighbourhood information based on the layerwise graph aggregation. For each node in the $l$ -th layer, the first token-level embedding (corresponding to [CLS]) is taken as the node-level embedding: $\mathbf { z } _ { g } ^ { l } \gets \mathbf { H } _ { g } ^ { l } [ 0 ]$ . The node-level embeddings are gathered from all the nodes and passed to the layerwise GNN for graph aggregation. We leverage Multi-Head Attention (MHA) to encode the node-level embeddings $\bar { \mathbf Z } _ { G } ^ { l }$ $( \{ \bar { \mathbf { z } } _ { g } ^ { l } \} _ { G } )$ , similar as GAT (Velickovi ˇ c et al., 2018). For each attention head, the scaled dot-product attention is performed as: ´
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: GNN-nested Transformers (using the $l$ -th layer for illustration). The graph aggregation is performed in the first place: the node-level embeddings $\{ \mathbf { z } _ { g } ^ { l } \} _ { G }$ are gathered from all the nodes and processed by the GNN component (the leftmost rectangle). The GNN processed node-level embeddings $\{ \hat { \mathbf { z } } _ { g } ^ { l } \} _ { G }$ are dispatched to their original nodes, which forms the graph-augmented tokenlevel embeddings. The graph-augmented token-level embeddings are further encoded by Transformer.
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { c } { { \hat { \mathbf { Z } } _ { G } ^ { l } = \mathrm { M H A } ( \mathbf { Z } _ { G } ^ { l } ) ; } } \\ { { \mathrm { M H A } ( \mathbf { Z } _ { G } ^ { l } ) = \mathrm { C o n c a t } ( \mathbf { h e a d } _ { 1 } , . . . , \mathbf { h e a d } _ { h } ) ; } } \\ { { \mathrm { h e a d } _ { j } = \mathrm { s o f t m a x } ( \frac { \mathbf { Q } \mathbf { K } ^ { \mathrm { T } } } { \sqrt { d } } + \mathbf { B } ) \mathbf { V } ; } } \\ { { \mathrm { \mathbf { Q } } = \mathbf { Z } _ { G } ^ { l } \mathbf { W } _ { j } ^ { Q } ; \mathbf { K } = \mathbf { Z } _ { G } ^ { l } \mathbf { W } _ { j } ^ { K } ; \mathbf { V } = \mathbf { Z } _ { G } ^ { l } \mathbf { W } _ { j } ^ { V } ; } } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
In the above equations, $\mathbf { W } _ { j } ^ { Q } , \mathbf { W } _ { j } ^ { K }$ , and $\mathbf { W } _ { j } ^ { V }$ are the projection matrices of MHA, corresponding to the $j$ -th attention head. A learnable position bias $\mathbf { B }$ is added to the dot-product result; the positions differentiate the relationship between the nodes; i.e., “center-to-center” ( $x$ to $x$ ), “center-to-neighbour” $\scriptstyle { \dot { x } }$ to $N _ { x }$ ), and “neighbour-to-neighbour” ( $N _ { x }$ to $N _ { x }$ ), respectively.
|
| 62 |
+
|
| 63 |
+
Each of the embeddings $\hat { \mathbf { z } } _ { g } ^ { l }$ $( \hat { \mathbf { z } } _ { g } ^ { l } \in \hat { \mathbf { Z } } _ { G } ^ { l } )$ is dispatched to its original node and concatenated $\left( \oplus \right)$ with the token-level embeddings, which gives rise to the graph-augmented token-level embeddings:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\widehat { \mathbf { H } } _ { g } ^ { l } \mathrm { C o n c a t } ( \widehat { \mathbf { z } } _ { g } ^ { l } , \mathbf { H } _ { g } ^ { l } ) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
In this place, the GNN-processed node-level embeddings $\hat { \mathbf { Z } } _ { G } ^ { l }$ can be interpreted as “messagers”, with which the neighbourhood information can be introduced to each of the nodes.
|
| 70 |
+
|
| 71 |
+
• Text Encoding in Transformer. The graph-augmented token-level embeddings $\widehat { \mathbf { H } } _ { g } ^ { l }$ are processed by the transformer component (Vaswani et al., 2017), where the following computations are performed:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { l } { \widehat { \mathbf { H } } _ { g } ^ { l } = \mathrm { L N } ( \mathbf { H } _ { g } ^ { l } + \mathrm { M H A } ^ { a s y } ( \widehat { \mathbf { H } } _ { g } ^ { l } ) ) ; } \\ { \mathbf { H } _ { g } ^ { l + 1 } = \mathrm { L N } ( \widehat { \mathbf { H } } _ { g } ^ { l } + \mathrm { M L P } ( \widehat { \mathbf { H } } _ { g } ^ { l } ) ) . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
In the above equations, MLP is the Multi-Layer Projection unit, and LN is the Layer-Norm unit. We use asymmetric Multi-Head Attention $( \mathrm { M H A } ^ { a s y }$ ), where $\mathbf { Q }$ , K, $\mathbf { V }$ are computed as:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathbf { Q } = \mathbf { H } _ { g } ^ { l } \mathbf { W } _ { j } ^ { Q } ; ~ \mathbf { K } = \widehat { \mathbf { H } } _ { g } ^ { l } \mathbf { W } _ { j } ^ { K } ; ~ \mathbf { V } = \widehat { \mathbf { H } } _ { g } ^ { l } \mathbf { W } _ { j } ^ { V } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Therefore, the output sequence $\mathbf { H } _ { g } ^ { l + 1 }$ will be of the same length as the input sequence $\mathbf { H } _ { g } ^ { l }$ . The encoding result will be used as the input token-level embeddings for the next layer. The node-level embedding at the last layer $\mathbf { z } _ { x } ^ { L }$ (i.e., $\bar { \mathbf { H } } _ { g } ^ { L } [ 0 ] )$ will be used as the final node representation.
|
| 84 |
+
|
| 85 |
+
• Workflow. We summarize GraphFormers’ encoding workflow as Algorithm 1. The initial tokenlevel embeddings $\{ \mathbf { H } _ { g } ^ { 0 } \} _ { G }$ are independently encoded by the first Transformer layer $\mathrm { T R M } ^ { 0 }$ . For a $L$ -layer GraphFormers, the graph aggregation and text encoding are iteratively performed for the subsequent $L \mathrm { - } 1$ steps (from 1 to $L - 1 )$ ). In each step, the node-level embeddings $\dot { \mathbf { Z } } _ { G } ^ { \hat { l } }$ are gathered and
|
| 86 |
+
|
| 87 |
+
Input: The input graphs $G$ (consist of the center node $x$ and its neighbours).
|
| 88 |
+
Output: The embedding for the center node $\mathbf { h } _ { x }$ .
|
| 89 |
+
1 begin
|
| 90 |
+
2 for each text $g \in G$ do
|
| 91 |
+
3 $\mathbf { H } _ { g } ^ { 1 } \mathrm { T R M } ^ { 0 } ( \mathbf { H } _ { g } ^ { 0 } ) ;$ ; // Get the initial token-level embeddings
|
| 92 |
+
4 for $l = 1 , . . . , L - 1$ do
|
| 93 |
+
5 $\mathbf { Z } _ { G } ^ { l } \gets \{ \mathbf { z } _ { g } ^ { l } | g \in G \}$ ; // Gather node-level embeddings to GNN
|
| 94 |
+
6 $\hat { \mathbf { Z } } _ { G } ^ { l } \gets \mathrm { G N N } ( \mathbf { Z } _ { G } ^ { l } )$ ; // Graph aggregation in GNN
|
| 95 |
+
7 for each text $g \in G$ do
|
| 96 |
+
8 $\widehat { \mathbf { H } } _ { g } ^ { l } \gets \mathrm { C o n c a t } ( \hat { \mathbf { z } } _ { g } ^ { l } , \mathbf { H } _ { g } ^ { l } )$ ; // Get graph-augmented token-level embeddings
|
| 97 |
+
9 $\mathbf { H } _ { g } ^ { l + 1 } \mathrm { T R M } ^ { l } ( \widehat { \mathbf { H } } _ { g } ^ { l } )$ ; // Text encoding in Transformer
|
| 98 |
+
|
| 99 |
+
Return $\mathbf { h } _ { x } \mathbf { z } _ { x } ^ { L }$ ;
|
| 100 |
+
|
| 101 |
+
processed by the layerwise GNN component. The output node-level embeddings $\hat { \mathbf { Z } } _ { G } ^ { l }$ are dispatched to their original nodes, which generates the graph-augmented token-level embeddings $\widehat { \mathbf { H } } _ { g } ^ { l }$ . The graphaugmented token-level embedding are further processed by the Transformer component. Finally, The node-level embedding (for the center node $x$ ) in the last layer $\mathbf { z } _ { x } ^ { L }$ is taken as our representation result.
|
| 102 |
+
|
| 103 |
+
• Encoding Complexity. Given an input of $M$ nodes, each one has $P$ tokens; the time complexity of each layer’s encoding operation is $O ( \bar { M } ^ { 2 } + M P ^ { 2 } )$ : the graph aggregation takes $O ( M ^ { 2 } )$ , because $M$ node-level embeddings are gathered for multi-head attention; the text encoding takes $\mathrm { \Delta } O ( M P ^ { 2 } )$ , as each of the $M$ node calls for the multi-head attention of $P$ tokens. Compared with Transformers, the GNN’s computation cost is much smaller, mainly because of two reasons: 1) $M ^ { 2 } \ll M P ^ { 2 }$ in general, 2) operations like MLP are not needed in graph aggregation. Therefore, the working efficiency of GraphFormers is close to the cascaded GNN-Transformers as the extra computation cost of layerwise graph aggregation is relatively small. Such a property is also empirically verified in our experiment.
|
| 104 |
+
|
| 105 |
+
# 3.2 Model Simplification: Unidirectional Graph Aggregation
|
| 106 |
+
|
| 107 |
+
One concern about GraphFormers is that the input nodes are mutually dependent on each other during the encoding process. As a result, to generate the embedding for a node, all the related nodes in its neighbourhood need to be encoded from scratch, regardless of whether they have been processed before. Such a property is unfavorable in practice as a great deal of unnecessary computation cost might be incurred (i.e., a node will be repetitively encoded every time it serves as a neighbour node). We leverage a simple but effective simplification, the unidirectional graph aggregation, to address this problem. Particularly, only the center node $x$ is required to make reference to the neighbourhood; while the rest of nodes $N _ { x }$ remain independently encoded all by their own textual features:
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathbf { H } _ { g } ^ { l + 1 } = \left\{ \mathrm { T R M } ^ { l } ( \widehat { \mathbf { H } _ { x } ^ { l } } ) , g = x ; \right.
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Because the encoding of the neighbour nodes is independent of the center node, the intermediate encoding results $\{ \mathbf { z } _ { g } ^ { 1 . . . L } \} _ { N _ { x } }$ can be cached in storage2 and reused in subsequent computations when they are needed. As a result, the nodes can be prevented from being encoded repetitively, which saves a great deal of unnecessary computation cost. We empirically verify that GraphFormers maintain similar performances when the above simplification is introduced.
|
| 114 |
+
|
| 115 |
+
# 3.3 Model Training: Two-Stage Progressive Learning
|
| 116 |
+
|
| 117 |
+
• Training Objective. We take advantage of link prediction as our training task. Given a pair of nodes $q$ and $k$ , the model is learned to predict whether they are connected based on their embedding
|
| 118 |
+
|
| 119 |
+
Table 1: Specifications of the experimental datasets: the number of items, the number of neighbour nodes on average, and the number of training, validation, testing cases.
|
| 120 |
+
|
| 121 |
+
<table><tr><td></td><td>Product</td><td>DBLP</td><td>Wiki</td></tr><tr><td>#Item</td><td>5,643,688</td><td>4,894,081</td><td>4,818.679</td></tr><tr><td>#N</td><td>4.71</td><td>9.31</td><td>8.86</td></tr><tr><td>#Train</td><td>22,146,934</td><td>3,009,506</td><td>7,145,834</td></tr><tr><td>#Valid</td><td>30,000</td><td>60,000</td><td>66,167</td></tr><tr><td>#Test</td><td>306,742</td><td>100,000</td><td>100,000</td></tr></table>
|
| 122 |
+
|
| 123 |
+
similarity. Particularly, the following classification loss is minimized for a positive pair of $q$ and $k$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathcal { L } = - \log \frac { \exp ( \langle \mathbf { h } _ { q } , \mathbf { h } _ { k } \rangle ) } { \exp ( \langle \mathbf { h } _ { q } , \mathbf { h } _ { k } \rangle ) + \sum _ { r \in R } \exp ( \langle \mathbf { h } _ { q } , \mathbf { h } _ { r } \rangle ) } .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
In the above equation, $\mathbf { h } _ { q }$ and $\mathbf { h } _ { k }$ are the node embeddings; $\langle \cdot \rangle$ denotes the computation of inner product; $R$ stands for the negative samples. In our implementation, we leverage “in-batch negative samples” (Karpukhin et al., 2020; Luan et al., 2020) for the reduction of encoding cost: a positive sample in one training instance will be used as a negative sample in the rest of the training instances within the same mini-batch.
|
| 130 |
+
|
| 131 |
+
• Two-stage Training. In GraphFormers, the information from the center node and neighbour nodes are not treated equally, which may undermine the model’s training effect. Particularly, the center node’s information can be directly utilized, while the neighbourhood information needs to be introduced via three steps: 1) encoded as node-level embeddings, 2) making graph aggregation with the center node, and 3) introduced to center node’s graph augmented token-level embeddings. The message passing pathway can shortcut when the center nodes are “sufficiently informative”, i.e., two nodes are sufficiently similar with each other in terms of their own textual features, such that their connection can be predicted without considering the neighbours. Given the existence of such cases, GraphFormers may end up with well-trained Transformers but insufficiently trained GNNs.
|
| 132 |
+
|
| 133 |
+
To alleviate the above problem, we introduce a warm-up training task, where the link prediction is made based on the polluted input nodes. Particularly, for each input node $g$ , a subset of its tokens $g _ { m }$ will be randomly masked4. As a result, the classification loss becomes:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\mathcal { L } ^ { \prime } = - \log \frac { \exp ( \langle \mathbf { h } _ { \widetilde { q } } , \mathbf { h } _ { \widetilde { k } } \rangle ) } { \exp ( \langle \mathbf { h } _ { \widetilde { q } } , \mathbf { h } _ { \widetilde { k } } \rangle ) + \sum _ { r \in R } \exp ( \langle \mathbf { h } _ { \widetilde { q } } , \mathbf { h } _ { \widetilde { r } } \rangle ) } ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $\mathbf { h } _ { \widetilde { q } } , \mathbf { h } _ { \widetilde { k } } .$ , $\mathbf { h } _ { \tilde { r } }$ are the embeddings generated from the polluted nodes. The masked tokens reduce the informativeness of each individual node; therefore, the model is forced to leverage the whole input nodes to make the right prediction.
|
| 140 |
+
|
| 141 |
+
Finally, the model training is organized as a two-stage progressive learning process. In the first stage, the model is trained to minimize $\mathcal { L } ^ { \prime }$ based on the polluted nodes until its convergence, which reinforce the model’s capability of integrating information on graph. In the second stage, the model is continually trained to minimize $\mathcal { L }$ based on the original data until the convergence, which makes the model fit into the target distribution.
|
| 142 |
+
|
| 143 |
+
# 4 Experimental Studies
|
| 144 |
+
|
| 145 |
+
# 4.1 Data and Settings
|
| 146 |
+
|
| 147 |
+
We make use of the following three real-world textual graph datasets for our experimental studies.
|
| 148 |
+
|
| 149 |
+
• $\mathbf { \nabla } \mathbf { D B L P } ^ { 5 }$ , which contains the paper citation graph from DBLP up to 2020-04-09. Two papers are linked if one is cited by the other one. The paper’s title is used as the textual feature.
|
| 150 |
+
|
| 151 |
+
• Wikidata5M6 (Wiki) (Wang et al., 2019b), which contains the entity graph from Wikipedia. The first sentence in each entity’s introduction is taken as its textual feature.
|
| 152 |
+
|
| 153 |
+
Table 2: Overall evaluation (GraphFormers marked in bold, the best baseline underlined). GraphFormers outperforms all baselines, especially the ones based on cascaded Transformers-GNN.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td colspan="3">Product</td><td colspan="3">DBLP</td><td colspan="3">Wiki</td></tr><tr><td>Methods</td><td>P@1</td><td>NDCG</td><td>MRR</td><td>P@1</td><td>NDCG</td><td>MRR</td><td>P@1</td><td>NDCG</td><td>MRR</td></tr><tr><td>PLM</td><td>0.6563</td><td>0.7911</td><td>0.7344</td><td>0.5673</td><td>0.7484</td><td>0.6777</td><td>0.3466</td><td>0.5799</td><td>0.4712</td></tr><tr><td>TNVE</td><td>0.4618</td><td>0.6204</td><td>0.5364</td><td>0.2978</td><td>0.5295</td><td>0.4163</td><td>0.1786</td><td>0.4274</td><td>0.2933</td></tr><tr><td>IFTN</td><td>0.5233</td><td>0.6740</td><td>0.5982</td><td>0.3691</td><td>0.5798</td><td>0.4773</td><td>0.1838</td><td>0.4276</td><td>0.2945</td></tr><tr><td>PLM+GAT</td><td>0.7540</td><td>0.8637</td><td>0.8232</td><td>0.6633</td><td>0.8204</td><td>0.7667</td><td>0.3006</td><td>0.5430</td><td>0.4270</td></tr><tr><td>PLM+Max</td><td>0.7570</td><td>0.8678</td><td>0.8280</td><td>0.6934</td><td>0.8386</td><td>0.7900</td><td>0.3712</td><td>0.6071</td><td>0.5022</td></tr><tr><td>PLM+Mean</td><td>0.7550</td><td>0.8671</td><td>0.8271</td><td>0.6896</td><td>0.8359</td><td>0.7866</td><td>0.3664</td><td>0.6037</td><td>0.4980</td></tr><tr><td>PLM+Att</td><td>0.7513</td><td>0.8652</td><td>0.8246</td><td>0.6910</td><td>0.8366</td><td>0.7875</td><td>0.3709</td><td>0.6067</td><td>0.5018</td></tr><tr><td>GraphFormers</td><td>0.7786</td><td>0.8793</td><td>0.8430</td><td>0.7267</td><td>0.8565</td><td>0.8133</td><td>0.3952</td><td>0.6230</td><td>0.5220</td></tr></table>
|
| 156 |
+
|
| 157 |
+
• Product Graph (Product), an even larger dataset of online products collected by a world-wide search engine. In this dataset, the users’ web browsing behaviors are tracked for the targeted product webpages (e.g., Amazon webpages of Nike shoes). The user’s continuously browsed webpages within a short period of time (e.g., 30 minutes) is called a “session”. The products within a common session are connected in the graph (which is a common way of graph construction in e-commerce scenarios (Ying et al., 2018; Wang et al., 2018)). Each product has its unique textual description, which specifies information like the product name, brand, and saler, etc.
|
| 158 |
+
|
| 159 |
+
The textual features of all the datasets are in English. We make use of uncased WordPiece (Wu et al., 2016) to tokenize the input text. In our experiment, each text is associated with 5 uniformly sampled neighbours (without replacement); for texts with neighbourhood smaller than 5, all the neighbours will be utilized. We summarized the specifications of all the datasets with Table 1. The experiment results are evaluated in terms of link prediction accuracy, i.e., to predict whether a query node and key node are connected given the textual features of themselves and their neighbours. In each testing instance, one query is provided with 300 keys: 1 positive plus 299 randomly sampled negative cases. We leverage three common metrics to measure the prediction accuracy: Precision $@ 1$ , NDCG, and MRR. Without specifications, we will take the unidirectional-simplified GraphFormers trained with the two-stage progressive learning as our default model. More details about the implementations and the training/testing configurations are summarized in an Appendix file. It is submitted together with our source code within the supplementary materials.
|
| 160 |
+
|
| 161 |
+
# 4.2 Baselines
|
| 162 |
+
|
| 163 |
+
We focus on the comparison between GNN-nested Transformers and Cascaded Transformers-GNN. To make sure the difference between both architectures can be truthfully reflected from the evaluation results, GraphFormers and the Cascaded Transformers-GNN baselines are equipped with text encoders and graph aggregators of the same capacities. Particularly, we use the BERT-like PLM as our text encoder, where UniLM-base7 (Bao et al., 2020) is chosen as the network backbone for all related methods; the final layer’s [CLS] token embedding is used for the text embedding.
|
| 164 |
+
|
| 165 |
+
We enumerate the following representative graph aggregators as used in GAT (Velickovi ˇ c et al., 2018), ´ GIN (Xu et al., 2018), GraphSage (Hamilton et al., 2017a). The GAT aggregator, where the node embedding is generated as the weighted sum of all the text embeddings. Each text embedding’s relative importance is calculated as the attention score with the center node. The Pooling-andConcat aggregators, where the center node’s text embedding is concatenated with the neighbours’ pooling result and linearly transformed for the final representation. Depending on the form of pooling function, we have the following options: Max and Mean, where neighbours are aggregated by max-pooling and mean-pooling, respectively; Att, where the neighbours are summed up based on the attention weights with the center node. By comparison, the neighbourhood information may get more emphasized with GAT; while the center node itself tends to be highlighted with Pooling-and-Concat.
|
| 166 |
+
|
| 167 |
+
We consider two more baselines which make use of simplified text encoders (such as CNN) and network embeddings: TNVE (Wang et al., 2019a) and IFTN (Xu et al., 2019). We also include the PLM only baseline, which merely leverages the textual feature of the center node.
|
| 168 |
+
|
| 169 |
+
Table 3: Impact of neighbour size (#N).
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan="2">#N</td><td colspan="3">GraphFormers</td><td colspan="3">PLM+Max</td></tr><tr><td>P@1</td><td>NDCG</td><td>MRR</td><td>P@1</td><td>NDCG</td><td>MRR</td></tr><tr><td>1</td><td>0.6485</td><td>0.8087</td><td>0.7522</td><td>0.6249</td><td>0.7946</td><td>0.7342</td></tr><tr><td>2</td><td>0.6841</td><td>0.8308</td><td>0.7804</td><td>0.6538</td><td>0.8137</td><td>0.7583</td></tr><tr><td>3</td><td>0.6980</td><td>0.8396</td><td>0.7916</td><td>0.6728</td><td>0.8256</td><td>0.7734</td></tr><tr><td>4</td><td>0.7126</td><td>0.8485</td><td>0.8029</td><td>0.6823</td><td>0.8319</td><td>0.7814</td></tr><tr><td>5</td><td>0.7267</td><td>0.8565</td><td>0.8133</td><td>0.6934</td><td>0.8386</td><td>0.7900</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 4.3 Overall Evaluation
|
| 174 |
+
|
| 175 |
+
The overall evaluation results are reported in Table 2. It’s observed that GraphFormers consistently outperform all the baselines, especially the ones based on the cascaded Transformers-GNN, with notable advantages. Particularly, it achieves $2 . 9 \%$ , $4 . 8 \%$ , $6 . 5 \%$ relative improvements over the most competitive baselines (underlined) on each of the experimental datasets. Such an observation indicates that the relationship between the nodes can be captured more accurately based on the node embeddings generated by GraphFormers, which verifies the effectiveness of our proposed method.
|
| 176 |
+
|
| 177 |
+
We also observe the following underlying factors that may influence the representation quality.
|
| 178 |
+
|
| 179 |
+
Firstly, the effective utilization of neighbourhood information is critical. With the joint consideration of the center node and neighbour nodes, the $\mathrm { P L M + G N N s }$ methods, including GraphFormers and the cascaded Transformers-GNN baselines, significantly outperform the PLM only baseline in most of the time. We further analyze the impact of neighbourhood size as Table 3, with a fraction of neighbour nodes randomly sampled for each center node (using DBLP for illustration). It can be observed that both GraphFormers and $\mathrm { P L M + M a x }$ (the most competitive baseline) achieve higher prediction accuracy than the PLM only method $( \mathrm { P } \ @ 1 . 0 . 5 6 7 3$ , NDCG:0.7484, MRR:0.6777, as reported in Table 2), even with fewer neighbour nodes included. With the increasing number of neighbour nodes, the advantages become gradually enlarged. However, the marginal gain is vanishing, as the relative improvement becomes smaller when more neighbours are included. In all the testing cases, GraphFormers maintain consistent advantages over PLM+Max, which reaffirms the effectiveness of our proposed methods.
|
| 180 |
+
|
| 181 |
+
Secondly, the capacity of the text encoder is crucial for textual graph representation. All the pretrained language model based methods (GraphFormers, Cascaded Transformers-GNN baselines, PLM-only baseline) significantly outperform the baselines with simplified text encoders (TNVE, IFTN).
|
| 182 |
+
|
| 183 |
+
Thirdly, the representation quality is also sensitive to the form of graph aggregator. In Product, the cascaded Transformers-GNN baselines’ performances are quite close to each other. In DBLP, $\mathrm { P L M + }$ (Max, Mean, Att) outperforms PLM+GAT. In Wiki, not only $\mathrm { P L M + }$ (Max, Mean, Att) but also PLM-only baseline outperform PLM $^ +$ GAT. Such phenomenons could be attributed to the type of graph: whether it is homogeneous or heterogeneous. Particularly, both Product and DBLP can be regarded as homogeneous graphs as the nodes are connected based on the same relationships; i.e., co-view relationship in Product, and citation relationship in DBLP. In both homogeneous graphs, the connected nodes may have quite similar semantics (the co-viewed products usually serve similar user intents, and the citation relationships usually indicate similar research topics); thus, the incorporated neighbour nodes will probably provide complementary information for the link prediction between the center nodes. However, Wiki is a heterogeneous graph, where the connections between entities may have highly different semantics. As a result, the incorporation of neighbour nodes may not contribute to the link prediction task, especially when the incorporated neighbours and the prediction target are connected to the center nodes with totally different relationships. Considering that GAT tends to focus more on the neighbourhood, its performance can be vulnerable in such unfavorable situations. These findings suggest that the neighbourhood information should be properly handled in case that the information of the center node is wiped out.
|
| 184 |
+
|
| 185 |
+
Finally, we may conclude different methods’ utility in textual graph representation: simplified text encoders $\prec P L M s \prec C$ ascaded Transformers-GNN $\prec$ GNNs-nested Transformers. Such findings are consistent with our expectation that the precise modeling of individual textual feature and the effective integration of neighbourhood information will jointly contribute to high-quality textual graph representation. GraphFormers enjoy the high expressiveness of PLMs and leverage layerwise nested-GNNs to facilitate graph aggregation, which contributes to both of the above perspectives.
|
| 186 |
+
|
| 187 |
+
Table 4: Ablation Studies (The top ablated methods are marked in bold; $\uparrow ^ { \mathrm { , , } } / \downarrow ^ { \mathrm { , } } \downarrow ^ { \mathrm { , } }$ : the performance is increased/decreased compared with the default setting). “-Progressive”: two-stage progressive learning disabled; “-Simplified”: unidirectional simplification disabled; “-Shared GNNs”: GNNs parameters are not shared across the layers; “-Position”: GNNs learnable position bias disabled.
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td colspan="3">Product</td><td colspan="3">DBLP</td><td colspan="3">Wiki</td></tr><tr><td>Methods</td><td>P@1</td><td>NDCG</td><td>MRR</td><td>P@1</td><td>NDCG</td><td>MRR</td><td>P@1</td><td>NDCG</td><td>MRR</td></tr><tr><td>GraphFormers</td><td>0.7786</td><td>0.8793</td><td>0.8430</td><td>0.7267</td><td>0.8565</td><td>0.8133</td><td>0.3952</td><td>0.6230</td><td>0.5220</td></tr><tr><td>PLM+Max</td><td>0.7570</td><td>0.8678</td><td>0.8280</td><td>0.6934</td><td>0.8386</td><td>0.7900</td><td>0.3712</td><td>0.6071</td><td>0.5022</td></tr><tr><td>- Progressive</td><td>0.7688</td><td>0.8751</td><td>0.8373</td><td>0.7096</td><td>0.8468</td><td>0.8007</td><td>0.3834</td><td>0.6155</td><td>0.5127</td></tr><tr><td>- Simplified</td><td>0.7795个</td><td>0.8798 个</td><td>0.8436 个</td><td>0.7225</td><td>0.8542</td><td>0.8102</td><td>0.3923</td><td>0.6209</td><td>0.5195</td></tr><tr><td>- Shared GNNs</td><td>0.7788</td><td>0.8795</td><td>0.8433</td><td>0.7256</td><td>0.8558</td><td>0.8123</td><td>0.3945 ↓</td><td>0.6221↓</td><td>0.5211 ↓</td></tr><tr><td>- Position</td><td>0.7788</td><td>0.8795</td><td>0.8434</td><td>0.7276个</td><td>0.8570个</td><td>0.8139个</td><td>0.3942</td><td>0.6222</td><td>0.5211</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 5: Time and memory costs per mini-batch for $\mathrm { P L M + M a x }$ and GraphFormers, with neighbour size increased from 3 to 200. GraphFormers achieve similar efficiency and scalability as $\mathrm { P L M + M a x }$
|
| 192 |
+
|
| 193 |
+
<table><tr><td>#N</td><td>3</td><td>5</td><td>10</td><td>20</td><td>50</td><td>100</td><td>200</td></tr><tr><td>Time: PLM+Max</td><td>60.29 ms</td><td>93.41 ms</td><td>161.40 ms</td><td>295.92 ms</td><td>684.16 ms</td><td>1357.93 ms</td><td>2706.35 ms</td></tr><tr><td>Time: GraphFormers</td><td>63.95 ms</td><td>97.19 ms</td><td>170.16 ms</td><td>306.12 ms</td><td>714.32 ms</td><td>1411.09 ms</td><td>2801.67 ms</td></tr><tr><td>Mem: PLM+Max</td><td>1.33 GiB</td><td>1.39 GiB</td><td>1.55 GiB</td><td>1.82 GiB</td><td>2.67 GiB</td><td>4.09 GiB</td><td>6.92 GiB</td></tr><tr><td>Mem: GraphFormers</td><td>1.33 GiB</td><td>1.39 GiB</td><td>1.55 GiB</td><td>1.83 GiB</td><td>2.70 GiB</td><td>4.28 GiB</td><td>7.33 GiB</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 4.4 Ablation Studies
|
| 196 |
+
|
| 197 |
+
The ablation studies (as Table 4) are performed to clarify the following issues: 1) the impact of two-stage progressive learning, and 2) the impact of unidirectional-simplified GraphFormers.
|
| 198 |
+
|
| 199 |
+
Firstly, the two-stage progressive learning substantially improves GraphFormers’ representation quality. Without such a training strategy ("-Progressive": training directly on the original data), the model’s performance is decreased by $0 . 9 8 \%$ , $1 . 7 1 \%$ , and $1 . 1 8 \%$ in each of the datasets, respectively.
|
| 200 |
+
|
| 201 |
+
Secondly, the performances between simplified and non-simplified (“-Simplified”) GraphFormers are comparable. In fact, the necessity of graph aggregation is not equivalent for the center node and the neighbour nodes: since the center node is the one for representation, it is much more important to ensure that the center node may extract complementary information from its neighbours. The unidirectional-simplified GraphFormers maintain such a property; thus, there is little impact on the final performances. Such a finding affirms that we may safely leverage the simplified model to save the cost of repetitively encoding the existing neighbours.
|
| 202 |
+
|
| 203 |
+
We make two additional ablation studies. “-Shared GNNs”: the GNNs parameters sharing is disabled, where each layer maintains its own graph aggregator (by default, the layerwise GNN components in GraphFormers share the same set of parameters). “-Position”: the learnable position bias $\mathbf { b }$ in Eq. 1) is disabled in GNNs. We find that model’s performance is little affected from the above changes.
|
| 204 |
+
|
| 205 |
+
# 4.5 Efficiency Analysis
|
| 206 |
+
|
| 207 |
+
We compare the time efficiency between GNN-nested Transformers (GraphFormers) and Cascaded Transformers+GNN (using PLM+Max for comparison). The evaluation is made with a Nvidia P100 GPU. Each mini-batch contains 32 encoding instances; each instance contains one center and #N neighbour nodes; the token length of each node is 16. We report the average time and memory (GPU RAM) costs per mini-batch as Table 5.
|
| 208 |
+
|
| 209 |
+
Firstly, the time and memory costs of both methods grow linearly with the increment of neighbours. (There are overheads of time and memory costs. The time cost overhead may come from CPU processing; while the memory cost overhead is mainly due to the model parameters (Rajbhandari et al., 2020)). We may approximately remove the overheads by deducting the time and memory costs where $\# \mathrm { N } { = } 3$ ). Such a finding is consistent with our theoretical analysis in Section 3.1.
|
| 210 |
+
|
| 211 |
+
Secondly, the overall time and memory costs of GraphFormers are quite close to $\mathrm { P L M + M a x }$ . When the number of neighbour nodes is small, the differences between both methods are almost ignorable. The differences become slightly larger when more neighbour nodes are included, because the layerwise graph aggregations in GraphFormers get increasingly time consuming. However, the differences are still relatively small: merely around $3 . 5 \%$ of the overall running costs when #N is increased to 200 $\because \angle A N = 2 0 0 ^ { \circ }$ is already more than enough for most of the real world scenarios).
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 3: Online $\mathrm { A } / \mathrm { B }$ Test: the relative improvements of RPM, CY and CPC against the last version of production system in Bing Search (green: positive; blue: negative). In most of the time, all three performance indicators are significantly improved thanks to the utilization of GraphFormers.
|
| 215 |
+
|
| 216 |
+
Based on the above observations, we may conclude that GraphFormers are more accurate, meanwhile equally efficient and scalable as the conventional cascaded Transformer+GNNs.
|
| 217 |
+
|
| 218 |
+
# 4.6 Online A/B Test on Bing Search
|
| 219 |
+
|
| 220 |
+
GraphFormers has been deployed as one of the major ads retrieval algorithms on Bing Search, and it achieves highly competitive performance against the previous production system (the combination of a wide spectrum of semantic representation algorithms, including large-scale PLMs and cascaded PLMsGNNs). Particularly, the primary objective of Ads service is to maximize the revenue meanwhile increasing the user clicks. Therefore, the following three metrics are taken as the major performance indicators: $\mathrm { R P M } ^ { 8 }$ (revenue per thousand impressions), CY (click yield), and $\mathrm { C P C ^ { 9 } }$ (cost per click) . During our large-scale online $\mathrm { A } / \mathrm { B }$ test, GraphFormers significantly improves the overall RPM, CY, CPC by $1 . 8 7 \%$ , $0 . 9 6 \%$ and $0 . 9 1 \%$ , respectively. A 11-day performance snapshot is demonstrated as Figure 3; it can be observed that in most of the time, all three metrics are significantly improved thanks to the utilization of GraphFormers (the daily performance are measured based on millions of impressions, thus having strong statistic significance).
|
| 221 |
+
|
| 222 |
+
# 5 Conclusion
|
| 223 |
+
|
| 224 |
+
In this paper, we propose a novel model architecture GraphFormers for textual graph representation. By having GNNs nested alongside each transformer layer of the pretrained language model, the underlying semantic of each textual node can be precisely captured and effectively integrated for high-quality textual graph representation. On top of the fundamental architecture, we introduce the two-stage progressive training strategy to further strengthen GraphFormers’ representation quality; we also simplify the model with the unidirectional graph aggregation, which eliminates the unnecessary computation cost. The experimental studies on three large-scale textual graph datasets verify the effectiveness of our proposed methods, where GraphFormers notably outperform the existing cascaded Transformer-GNNs methods with comparable running efficiency and scalability.
|
| 225 |
+
|
| 226 |
+
# 6 Acknowledgement
|
| 227 |
+
|
| 228 |
+
We are grateful to anonymous reviewers for their constructive comments on this work. The work was supported by grants from the National Natural Science Foundation of China (No. 62022077).
|
| 229 |
+
|
| 230 |
+
# References
|
| 231 |
+
|
| 232 |
+
Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Jianfeng Gao, Songhao Piao, Ming Zhou, et al. 2020. Unilmv2: Pseudo-masked language models for unified
|
| 233 |
+
|
| 234 |
+
language model pre-training. In International Conference on Machine Learning, pages 642–652.
|
| 235 |
+
PMLR.
|
| 236 |
+
|
| 237 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. 2009. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48.
|
| 238 |
+
|
| 239 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165.
|
| 240 |
+
|
| 241 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
|
| 242 |
+
|
| 243 |
+
Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. Simcse: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821.
|
| 244 |
+
|
| 245 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. 2017a. Inductive representation learning on large graphs. In Advances in neural information processing systems, pages 1024–1034.
|
| 246 |
+
|
| 247 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. 2017b. Representation learning on graphs: Methods and applications. arXiv preprint arXiv:1709.05584.
|
| 248 |
+
|
| 249 |
+
Ziniu Hu, Yuxiao Dong, Kuansan Wang, Kai-Wei Chang, and Yizhou Sun. 2020. Gpt-gnn: Generative pre-training of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1857–1867.
|
| 250 |
+
|
| 251 |
+
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-˘ tau Yih. 2020. Dense passage retrieval for open-domain question answering. arXiv preprint arXiv:2004.04906.
|
| 252 |
+
|
| 253 |
+
Thomas N Kipf and Max Welling. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907.
|
| 254 |
+
|
| 255 |
+
Chaozhuo Li, Bochen Pang, Yuming Liu, Hao Sun, Zheng Liu, Xing Xie, Tianqi Yang, Yanling Cui, Liangjie Zhang, and Qi Zhang. 2021. Adsgnn: Behavior-graph augmented relevance modeling in sponsored search. arXiv preprint arXiv:2104.12080.
|
| 256 |
+
|
| 257 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019a. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
|
| 258 |
+
|
| 259 |
+
Zhenghao Liu, Chenyan Xiong, Maosong Sun, and Zhiyuan Liu. 2019b. Fine-grained fact verification with kernel graph attention network. arXiv preprint arXiv:1910.09796.
|
| 260 |
+
|
| 261 |
+
Yi Luan, Jacob Eisenstein, Kristina Toutanova, and Michael Collins. 2020. Sparse, dense, and attentional representations for text retrieval. arXiv preprint arXiv:2005.00181.
|
| 262 |
+
|
| 263 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Distributed representations of words and phrases and their compositionality. arXiv preprint arXiv:1310.4546.
|
| 264 |
+
|
| 265 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In 2014 EMNLP, pages 1532–1543.
|
| 266 |
+
|
| 267 |
+
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. arXiv preprint arXiv:1802.05365.
|
| 268 |
+
|
| 269 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training.
|
| 270 |
+
|
| 271 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683.
|
| 272 |
+
|
| 273 |
+
Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. 2020. Zero: Memory optimizations toward training trillion parameter models. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pages 1–16. IEEE.
|
| 274 |
+
|
| 275 |
+
Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bertnetworks. arXiv preprint arXiv:1908.10084.
|
| 276 |
+
|
| 277 |
+
Jianlin Su, Jiarun Cao, Weijie Liu, and Yangyiwen Ou. 2021. Whitening sentence representations for better semantics and faster retrieval. arXiv preprint arXiv:2103.15316.
|
| 278 |
+
|
| 279 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. arXiv preprint arXiv:1706.03762.
|
| 280 |
+
|
| 281 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. 2018. Graph attention networks. International Conference on Learning Representations (ICLR).
|
| 282 |
+
|
| 283 |
+
Chenguang Wang, Yangqiu Song, Haoran Li, Ming Zhang, and Jiawei Han. 2016a. Text classification with heterogeneous information network kernels. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30.
|
| 284 |
+
|
| 285 |
+
Jizhe Wang, Pipei Huang, Huan Zhao, Zhibo Zhang, Binqiang Zhao, and Dik Lun Lee. 2018. Billionscale commodity embedding for e-commerce recommendation in alibaba. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 839–848.
|
| 286 |
+
|
| 287 |
+
Suhang Wang, Jiliang Tang, Charu Aggarwal, and Huan Liu. 2016b. Linked document embedding for classification. In Proceedings of the 25th ACM international on conference on information and knowledge management, pages 115–124.
|
| 288 |
+
|
| 289 |
+
Wenlin Wang, Chenyang Tao, Zhe Gan, Guoyin Wang, Liqun Chen, Xinyuan Zhang, Ruiyi Zhang, Qian Yang, Ricardo Henao, and Lawrence Carin. 2019a. Improving textual network learning with variational homophilic embeddings. arXiv preprint arXiv:1909.13456.
|
| 290 |
+
|
| 291 |
+
Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhiyuan Liu, Juanzi Li, and Jian Tang. 2019b. Kepler: A unified model for knowledge embedding and pre-trained language representation. arXiv preprint arXiv:1911.06136.
|
| 292 |
+
|
| 293 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144.
|
| 294 |
+
|
| 295 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. 2018. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826.
|
| 296 |
+
|
| 297 |
+
Zenan Xu, Qinliang Su, Xiaojun Quan, and Weijia Zhang. 2019. A deep neural information fusion architecture for textual network embeddings. arXiv preprint arXiv:1908.11057.
|
| 298 |
+
|
| 299 |
+
Cheng Yang, Zhiyuan Liu, Deli Zhao, Maosong Sun, and Edward Y Chang. 2015. Network representation learning with rich text information. In IJCAI, volume 2015, pages 2111–2117.
|
| 300 |
+
|
| 301 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237.
|
| 302 |
+
|
| 303 |
+
Michihiro Yasunaga, Rui Zhang, Kshitijh Meelu, Ayush Pareek, Krishnan Srinivasan, and Dragomir Radev. 2017. Graph-based neural multi-document summarization. arXiv preprint arXiv:1706.06681.
|
| 304 |
+
|
| 305 |
+
Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. 2018. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 974–983.
|
| 306 |
+
|
| 307 |
+
Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. 2020. Graph neural networks: A review of methods and applications. AI Open, 1:57–81.
|
| 308 |
+
Jie Zhou, Xu Han, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. 2019. Gear: Graph-based evidence aggregating and reasoning for fact verification. arXiv preprint arXiv:1908.01843.
|
| 309 |
+
Jason Zhu, Yanling Cui, Yuming Liu, Hao Sun, Xue Li, Markus Pelger, Liangjie Zhang, Tianqi Yan, Ruofei Zhang, and Huasha Zhao. 2021. Textgnn: Improving text encoder via graph neural network in sponsored search. arXiv preprint arXiv:2101.06323.
|