ZHANGYUXUAN-zR commited on
Commit
22bdfe6
·
verified ·
1 Parent(s): e2ac0e9

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. parse/train/-xEk43f_EO6/-xEk43f_EO6.md +277 -0
  2. parse/train/-xEk43f_EO6/-xEk43f_EO6_content_list.json +1325 -0
  3. parse/train/-xEk43f_EO6/-xEk43f_EO6_middle.json +0 -0
  4. parse/train/-xEk43f_EO6/-xEk43f_EO6_model.json +0 -0
  5. parse/train/3Aoft6NWFej/3Aoft6NWFej.md +274 -0
  6. parse/train/3Aoft6NWFej/3Aoft6NWFej_content_list.json +1396 -0
  7. parse/train/3Aoft6NWFej/3Aoft6NWFej_middle.json +0 -0
  8. parse/train/3Aoft6NWFej/3Aoft6NWFej_model.json +0 -0
  9. parse/train/H1eSS3CcKX/H1eSS3CcKX.md +704 -0
  10. parse/train/H1eSS3CcKX/H1eSS3CcKX_content_list.json +0 -0
  11. parse/train/H1eSS3CcKX/H1eSS3CcKX_middle.json +0 -0
  12. parse/train/H1eSS3CcKX/H1eSS3CcKX_model.json +0 -0
  13. parse/train/HJWLfGWRb/HJWLfGWRb.md +264 -0
  14. parse/train/HJWLfGWRb/HJWLfGWRb_content_list.json +1400 -0
  15. parse/train/HJWLfGWRb/HJWLfGWRb_middle.json +0 -0
  16. parse/train/HJWLfGWRb/HJWLfGWRb_model.json +0 -0
  17. parse/train/HkeuD34KPH/HkeuD34KPH.md +303 -0
  18. parse/train/HkeuD34KPH/HkeuD34KPH_content_list.json +1603 -0
  19. parse/train/HkeuD34KPH/HkeuD34KPH_middle.json +0 -0
  20. parse/train/HkeuD34KPH/HkeuD34KPH_model.json +0 -0
  21. parse/train/HkxjYoCqKX/HkxjYoCqKX.md +306 -0
  22. parse/train/HkxjYoCqKX/HkxjYoCqKX_content_list.json +1688 -0
  23. parse/train/HkxjYoCqKX/HkxjYoCqKX_middle.json +0 -0
  24. parse/train/HkxjYoCqKX/HkxjYoCqKX_model.json +0 -0
  25. parse/train/LKUfuWxajHc/LKUfuWxajHc.md +274 -0
  26. parse/train/LKUfuWxajHc/LKUfuWxajHc_content_list.json +1223 -0
  27. parse/train/LKUfuWxajHc/LKUfuWxajHc_middle.json +0 -0
  28. parse/train/LKUfuWxajHc/LKUfuWxajHc_model.json +0 -0
  29. parse/train/hw2VfWAr6t6/hw2VfWAr6t6.md +288 -0
  30. parse/train/hw2VfWAr6t6/hw2VfWAr6t6_content_list.json +1520 -0
  31. parse/train/hw2VfWAr6t6/hw2VfWAr6t6_middle.json +0 -0
  32. parse/train/hw2VfWAr6t6/hw2VfWAr6t6_model.json +0 -0
  33. parse/train/jnRqf0CzBK/jnRqf0CzBK.md +281 -0
  34. parse/train/jnRqf0CzBK/jnRqf0CzBK_content_list.json +1221 -0
  35. parse/train/jnRqf0CzBK/jnRqf0CzBK_middle.json +0 -0
  36. parse/train/jnRqf0CzBK/jnRqf0CzBK_model.json +0 -0
  37. parse/train/rylnK6VtDH/rylnK6VtDH.md +341 -0
  38. parse/train/rylnK6VtDH/rylnK6VtDH_content_list.json +1827 -0
  39. parse/train/rylnK6VtDH/rylnK6VtDH_middle.json +0 -0
  40. parse/train/rylnK6VtDH/rylnK6VtDH_model.json +0 -0
  41. vlm/dev/3jooF27-0Wy/0.png +3 -0
  42. vlm/dev/3jooF27-0Wy/1.png +3 -0
  43. vlm/dev/3jooF27-0Wy/10.png +3 -0
  44. vlm/dev/3jooF27-0Wy/11.png +3 -0
  45. vlm/dev/3jooF27-0Wy/12.png +3 -0
  46. vlm/dev/3jooF27-0Wy/13.png +3 -0
  47. vlm/dev/3jooF27-0Wy/14.png +3 -0
  48. vlm/dev/3jooF27-0Wy/15.png +3 -0
  49. vlm/dev/3jooF27-0Wy/16.png +3 -0
  50. vlm/dev/3jooF27-0Wy/17.png +3 -0
parse/train/-xEk43f_EO6/-xEk43f_EO6.md ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Multi-Scale Representation Learning on Proteins
2
+
3
+ Vignesh Ram Somnath∗ Dept. of Computer Science ETH Zurich vsomnath@ethz.ch
4
+
5
+ Charlotte Bunne∗ Dept. of Computer Science ETH Zurich bunnec@ethz.ch
6
+
7
+ Andreas Krause Dept. of Computer Science ETH Zurich krausea@ethz.ch
8
+
9
+ # Abstract
10
+
11
+ Proteins are fundamental biological entities mediating key roles in cellular function and disease. This paper introduces a multi-scale graph construction of a protein – HOLOPROT – connecting surface to structure and sequence. The surface captures coarser details of the protein, while sequence as primary component and structure – comprising secondary and tertiary components – capture finer details. Our graph encoder then learns a multi-scale representation by allowing each level to integrate the encoding from level(s) below with the graph at that level. We test the learned representation on different tasks, (i.) ligand binding affinity (regression), and (ii.) protein function prediction (classification). On the regression task, contrary to previous methods, our model performs consistently and reliably across different dataset splits, outperforming all baselines on most splits. On the classification task, it achieves a performance close to the top-performing model while using $1 0 \mathrm { x }$ fewer parameters. To improve the memory efficiency of our construction, we segment the multiplex protein surface manifold into molecular superpixels and substitute the surface with these superpixels at little to no performance loss.
12
+
13
+ # 1 Introduction
14
+
15
+ Protein design and engineering has become a crucial component of pharmaceutical research and development, finding application in a wide variety of diagnostic and industrial settings. Besides understanding the design principles determining structure and function of proteins, current efforts seek to further enhance or discover proteins with properties useful for technological or therapeutic applications. To efficiently guide the search in the vast design space of functional proteins, we need to be able to robustly predict properties of a candidate protein [Yang et al., 2019]. Moreover, understanding role and function of proteins is crucial to study causes and mechanism of human disease [Fessenden, 2017].
16
+
17
+ To achieve this, representations incorporating the complex nature of proteins are required. Proteins consist of amino acids, organic molecules linked by peptide bonds forming a linear sequence. Each of the twenty amino acids carries a unique side chain, giving rise to an incomprehensibly large combinatorial space of possible protein sequences. The primary sequence drives the folding of polymers – a spontaneous process guided by hydrophobic interactions, formation of intramolecular hydrogen bonds, and van der Waals forces into a unique three-dimensional structure. The resulting shape and surface manifold with rich physiochemical properties carry essential information for understanding function and potential molecular interactions.
18
+
19
+ Previous methods typically only consider an individual subset within these scales, focusing on either sequence [Öztürk et al., 2018, Hou et al., 2018], three-dimensional structure [Hermosilla et al., 2021, Derevyanko et al., 2018] or surface [Gainza et al., 2020]. Two proteins with similar sequences can fold into entirely different conformations. While these proteins might catalyze the same type of ooreactions, their behavior to specific inhibiting drugs might be divergent. Interaction between proteins and ligands, on the other hand, is controlled by molecular surface contacts [Gainza et al., 2020]. Molecular surfaces, determined by subjacent amino acids, are fingerprinted with patterns of geometric and chemical properties, and thus their integration in protein representations is crucial.
20
+
21
+ ![](images/142a696c61c62df98affdc5a645e7a6a06caa904cc842671b628a5322fa26c95.jpg)
22
+ Figure 1: Overview of HOLOPROT Our multi-scale protein representation algorithm integrates primary, secondary and tertiary elements of protein structures and connects them to the surface. We extract higher-level protein motifs by introducing molecular superpixels. Both structure and surface are represented as graphs $\mathcal { G } _ { B }$ and $\mathcal { G } _ { S }$ , respectively. The method is evaluated on two representative fintasks, protein-ligand binding affinity and enzyme-catalyzed reaction classification.
23
+
24
+ In this work, we present a novel multi-scale graph representation which integrates and connects the complex nature of proteins across all levels of information. HOLOPROT consists of a surface and structure layer (both represented as graphs) with explicit edges between the layers. Our construction finiris guided by the intuition that propagating information from surface to structure would allow each residue to learn encodings reflective of not just its immediate residue neighborhood, but also the higher-level geometric and chemical properties that arise from interactions between a residue and ooits neighborhood. The associated multi-scale encoder then learns representations by integrating sathe encoding from the layer below, with the graph at that layer (Section 3). Such multi-scale representations have been previously used in molecular graph generation [Jin et al., 2020] with impressive results.
25
+
26
+ We further improve the memory efficiency of our construction by segmenting the large and rich protein surface into molecular “superpixels”, summarizing higher-level fingerprint features and motifs of proteins. Substituting the surface layer with these superpixels results in little to no performance degradation across the evaluated tasks. The concept of molecular superpixels might be of interest beyond our model (Section 4).
27
+
28
+ The multi-objective and multi-task nature of protein engineering poses a challenge for current methods, often designed and evaluated only on specific subtasks of protein design. By incorporating the biology of proteins, strong representations exhibit robust performance across tasks. We demonstrate our model’s versatility and range of applications by deploying it to tasks of rather distinct nature, including a regression task, e.g., inference of protein ligand binding affinity, and classification tasks, i.e., enzyme-catalyzed reaction classification (Section 5).
29
+
30
+ # 2 Related Work
31
+
32
+ Protein Representation Learning With increasing availability of sequence and structure data, the field of protein representation learning has advanced rapidly, with methods falling largely in one of the following categories:
33
+
34
+ Sequence-based methods. One-dimensional amino acid sequences continue to be the simplest, most abundant source of protein data and various methods have been developed that borrow architectures developed in natural language processing (NLP). One-dimensional convolutional neural networks have been used to classify a protein sequence into folds and enzyme function [Hou et al., 2018, Dalkiran et al., 2018], and to predict their binding affinity to ligands [Öztürk et al., 2018]. Furthermore, methods have applied complex NLP models trained unsupervised on millions of unlabeled protein sequences and fine-tuned them on different downstream tasks [Rao et al., 2019, Elnaggar et al., 2020, Bepler and Berger, 2019]. Despite being advantageous when only the sequence is available, these methods ignore the full spatial complexity of proteins.
35
+
36
+ Structure-based methods. To learn beyond sequences, approaches have been developed, that consider the 3D structure of proteins. 3D convolutional neural networks have been utilized for protein quality assessment [Derevyanko et al., 2018], protein contact prediction [Townshend et al., 2019] and protein-ligand binding affinity tasks [Ragoza et al., 2017, Jiménez et al., 2018, Townshend et al., 2020]. An alternate representation treats proteins as graphs, applying graph neural networks for enzyme classification [Dobson and Doig, 2005], interface prediction [Fout et al., 2017], and protein structure quality prediction [Baldassarre et al., 2021]. Gligorijevic et al. [2021] use a long short term memory cell (LSTM) to encode the sequence, followed by a graph convolutional network (GCN) [Kipf and Welling, 2017] to capture the tertiary structure, and apply this to the function prediction task. Hermosilla et al. [2021] propose a convolutional operator that learns to adapt filters based on the primary, secondary, and tertiary structure of a protein, showing strong performance on reaction and fold class prediction.
37
+
38
+ Surface-based methods. Taking a different viewpoint, Gainza et al. [2020] hypothesize that the protein surface displays patterns of chemical and geometric features that fingerprint a protein’s interaction with other biomolecules. They utilize geodesic convolutions, which are extensions of convolutions on surfaces, and learn fingerprint vectors, showing improved performance across binding pocket and protein interface prediction tasks.
39
+
40
+ Protein Motif Detection Protein motifs have largely been synonymous with common and conserved patterns in a protein’s sequence or structure influencing protein function, e.g., the helixturn-helix motif binds DNA. Understanding these fragments is essential for 3D structure prediction, modeling, and drug design. While reliably detecting evolutionary motifs, existing tools [Golovin and Henrick, 2008] do not provide a full segmentation of the protein surface manifold. Our work takes a different viewpoint, by looking at protein motifs from the context of a protein surface. Previous methods developed in this context either only consider geometric information rather than physiological properties [Cantoni et al., 2010], are computationally expensive [Cantoni et al., 2011], or designed for particular downstream tasks [Stepniewska-Dziubinska et al., 2020]. Our molecular superpixel approach provides a task-independent segmentation utilizing both geometric and chemical features, while also being computationally efficient.
41
+
42
+ # 3 Multi-Scale Protein Representation
43
+
44
+ In this section, we describe our multi-scale graph construction and the associated encoder. Figure 1 illustrates the main principles of HOLOPROT. We represent a protein $\mathcal { P }$ as a graph $\mathcal { G } _ { \mathcal { P } }$ with two layers capturing different scales:
45
+
46
+ (i.) Surface layer. This layer captures the coarser representation details of a protein. The protein surface is generated using the triangulation software MSMS [Connolly, 1983, Sanner et al., 1996]. We represent this layer as a graph $\mathcal { G } _ { S }$ , where each surface node $u _ { \cal S }$ has a feature vector $\mathbf { f } _ { u _ { S } }$ denoting its charge, hydrophobicity and local curvature [Gainza et al., 2020]. Two surface nodes $( u _ { S } , v _ { S } )$ have an edge if they are part of a triangulation. Each surface node additionally has a residue identifier $r$ , indicating the amino acid residue it corresponds to. Multiple surface nodes can have the same residue identifier.
47
+ (ii.) Structure layer. This layer captures the finer representation details of a protein. A protein typically has four structural levels: (i.) primary structure (sequence), (ii.) secondary structure $\alpha$ -helices and $\beta$ -sheets), (iii.) tertiary structure (3D structure) and (iv.) quaternary structure (complexes) [Fout et al., 2017]. We represent this layer as a graph $\mathcal { G } _ { B }$ , where each node $u _ { B }$ corresponds to a residue $r$ . Two nodes $( u _ { B } , v _ { B } )$ have an edge in $\mathcal { G } _ { B }$ if the $\mathbf { C } _ { \alpha }$ atoms of the two nodes occur within a certain distance of each other. Distance based thresholding ensures that different structural levels are implicitly captured in the neighborhood of a node $u _ { B }$ .
48
+
49
+ We further introduce edges from the surface layer to the structure layer in order to propagate information between them. Specifically, we introduce a directed edge between a surface node $u _ { \mathcal { S } }$ and a backbone node $u _ { B }$ if they both have the same residue identifier $r$ . Typically, we have between 20-40 surface nodes $\{ u _ { \mathcal { S } } \}$ that map to the same structure node $u _ { B }$ . This gives us the multi-scale graph which is then encoded by our multi-scale message passing network. Details on the features used for both the structure and surface layer can be found in Appendix ??.
50
+
51
+ # 3.1 Multi-Scale Encoder
52
+
53
+ Our multi-scale message passing network uses one message passing neural network (MPN) for each layer in the multi-scale graph [Lei et al., 2017, Gilmer et al., 2017]. This allows us to learn structured representations of each scale, which can then be tied together through connections between the scales. Before detailing the remainder of the architecture, we introduce some notational preliminaries. For simplicity, we denote the MPN encoding process as $\mathbf { M P N } _ { \theta } ( \cdot )$ with parameters $\theta$ . We denote $\mathbf { M L P } _ { \theta } ( \bar { \mathbf { x } } , \mathbf { y } )$ for a multi-layer perceptron (MLP) with parameters $\theta$ , whose input is the concatenation of $\mathbf { x }$ and $\mathbf { y }$ , and $\operatorname { M L P } _ { \theta } ( \mathbf { x } )$ when the input is only $\mathbf { x }$ . We also denote the residue identifier of a node $u$ with $\operatorname { i d } ( u )$ , and the neighbors of a node $u$ as $\mathcal { N } ( u )$ . The details of the MPN architecture are listed in the Appendix ??.
54
+
55
+ # 3.1.1 Surface Message Passing Network
56
+
57
+ We first encode the surface layer $\mathcal { G } _ { S }$ of the multi-scale protein graph $\mathcal { G } _ { \mathcal { P } }$ . The inputs to the MPN are node features $\mathbf { f } _ { u _ { S } }$ and edge features $\mathbf { f } _ { u _ { S } v _ { S } }$ of $\mathcal { G } _ { S }$ . For more details on the input features used for surface nodes and edges, refer to Appendix ??. The MPN (with parameters $\theta _ { S }$ ) propagates messages between the nodes for $K$ iterations, and outputs a representation $h _ { u s }$ for each surface node $u _ { \cal S }$ ,
58
+
59
+ $$
60
+ \{ \mathbf h _ { u _ { S } } \} = \mathrm { M P N } _ { \theta _ { S } } ( \mathcal G _ { S } , \{ \mathbf f _ { u _ { S } } \} , \{ \mathbf f _ { u _ { S } v _ { S } } \} _ { v _ { S } \in \mathcal N ( u _ { S } ) } ) .
61
+ $$
62
+
63
+ # 3.1.2 Structure Message Passing Network
64
+
65
+ For each node $u _ { B }$ in the structure layer $\mathcal { G } _ { B }$ , we first prepare the input to the MPN (with parameters $\theta _ { B } ,$ ) by using an MLP (with parameters $\theta$ ) on the concatenated version of its initial features $\mathbf { f } _ { u B }$ and the mean of the surface node vectors with the same residue identifier $S = \{ \mathbf { h } _ { u _ { s } } | \mathrm { i d } ( u _ { S } ) = \mathrm { i d } ( \bar { u } _ { B } ) \}$
66
+
67
+ $$
68
+ \begin{array} { r } { { \bf x } _ { u s } = \mathrm { M L P } _ { \theta } \big ( { \bf f } _ { u s } , \Sigma _ { s } { \bf h } _ { u _ { S } } \big / | S | \big ) . } \end{array}
69
+ $$
70
+
71
+ Given the edge features $\mathbf { f } _ { u B v s }$ , we then run $K$ iterations of message passing, to compute the representations $\mathbf { h } _ { u _ { B } }$ for each structure node $u _ { B }$ ,
72
+
73
+ $$
74
+ \begin{array} { r } { \{ \mathbf { h } _ { u _ { B } } \} = \mathrm { M P N } _ { \theta _ { B } } ( \mathcal G _ { B } , \{ \mathbf { x } _ { u _ { B } } \} , \{ \mathbf { f } _ { u _ { B } v _ { B } } \} _ { v _ { B } \in \mathcal N ( u _ { B } ) } ) . } \end{array}
75
+ $$
76
+
77
+ The graph representation $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ is an aggregation of structure node representations,
78
+
79
+ $$
80
+ \mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } } = \sum _ { u _ { B } \in \mathcal { G } _ { B } } \mathbf { h } _ { u _ { B } } .
81
+ $$
82
+
83
+ # 3.2 Task Specific Training
84
+
85
+ This multi-scale encoding allows us to learn a structured representation of a protein tying different scales together, which can then be utilized for any downstream task. In this work, we evaluate our method on two rather distinct tasks (i.) protein-ligand binding affinity regression, and (ii.) enzyme– catalyzed reaction classification. The architectural details for both downstream tasks are described below. These modules can be adapted and modified in order to utilize HOLOPROT for other use cases.
86
+
87
+ # 3.2.1 Protein-Ligand Binding Affinity
88
+
89
+ Protein-ligand binding affinity prediction depends on the interaction of a protein, encoded using the HOLOPROT framework, and a corresponding ligand, in most cases small molecules. To encode the ligand represented as a graph $\mathcal { G } _ { \mathcal { L } }$ , we use another MPN (with parameters $\theta _ { \mathcal { L } }$ ) and aggregate its node representations to obtain a graph representation $c _ { \mathcal { G } _ { \mathcal { L } } }$ . We concatenate the graph representations $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ (Equation 1) of the protein and $c _ { \mathcal { G } _ { \mathcal { L } } }$ of the ligand, and use that as input to a MLP (with parameters $\phi$ ) to obtain predictions,
90
+
91
+ $$
92
+ s _ { a } = \mathrm { M L P } _ { \phi } ( c _ { \mathcal { G } _ { \mathcal { P } } } , c _ { \mathcal { G } _ { \mathcal { L } } } ) .
93
+ $$
94
+
95
+ The model is trained by minimizing the mean squared error.
96
+
97
+ ![](images/1518ae65077d66b5b2215419766472d99a9f67542e99ac93ec6d5410a8442047.jpg)
98
+ Figure 2: Molecular Superpixels and Surface Features of the HIV-1 Protease (PDB ID: 2AVQ). a. Molecular superpixels, indicated by different colors $k = 2 0$ ), and the corresponding surface features, i.e., b. hydropathy, c. shape index, and d. free electrons. As highlighted, molecular superpixels are spatially compact and overlap with surface regions dominated by single features such as hydrophobic patches while capturing coherent areas across all surface features. The protein complex contains 198 residues.
99
+
100
+ # 3.2.2 Enzyme-Catalyzed Reaction Classification
101
+
102
+ To predict the enzyme-catalyzed reaction class, we use the graph representation $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ of the protein obtained via HOLOPROT as the input to a MLP (with parameters $\phi$ ) to obtain the prediction logits,
103
+
104
+ $$
105
+ p _ { k } = \mathrm { M L P } _ { \phi } ( c _ { \mathcal { G } } ) .
106
+ $$
107
+
108
+ The model is trained by minimizing the cross-entropy loss.
109
+
110
+ # 4 Superpixels on Molecular Surfaces
111
+
112
+ Protein surface manifolds are complex and represented via large meshes. In order to improve the computational and memory efficiency of our construction, we introduce the notion of molecular superpixels. Originally developed in computer vision [Ren and Malik, 2003, Mori et al., 2004, Kohli et al., 2009], superpixels are defined as perceptually uniform regions in the image. In the molecular context, we refer to superpixels as segments on the protein surface capturing higher-level fingerprint features and protein motifs such as hydrophobic binding sites.
113
+
114
+ In order to apply the segmentation principle to three-dimensional molecular surfaces, we employ graph-based superpixel algorithms on triangulated surface meshes. The superpixel representation of the protein surface needs to satisfy several requirements, as (i.) molecular superpixels should not reduce the overall achievable performance of HOLOPROT, and (ii.) molecular superpixels need to form geometrically compact clusters, and overlap with surface regions that are coherent in physiological surface properties, e.g., capture hydrophobic binding sides or highly charged areas. Popular graph-based segmentation tools such as Felzenszwalb and Huttenlocher [2004, FH], mean shift [Comaniciu and Meer, 2002], and watershed [Vincent and Soille, 1991], however, produce non-compact superpixels of irregular sizes and shapes. By posing the segmentation task as a maximization problem on a graph maximizing over (i.) the entropy rate of the random walk on the surface graph $\bar { \mathcal { G } } s = ( \gamma _ { S } , \mathcal { E } _ { S } )$ favoring the formation of compact and homogeneous clusters, and (ii.) a balancing term encouraging clusters with similar sizes, the entropy rate superpixel (ERS) segmentation algorithm [Liu et al., 2011] outperforms previous methods across different tasks [Stutz et al., 2018] and achieves the desired properties of molecular superpixels.
115
+
116
+ In order to incorporate geometric and chemical features of the surface $\mathbf { F } _ { S }$ , we extend the surface graph $\mathcal { G } _ { S } = ( \nu _ { S } , \mathcal { E } _ { S } )$ with a non-negative similarity measure $w$ , given as $\begin{array} { r } { w _ { i j } = \sum _ { \mathbf { f } \in \mathbf { F } _ { \mathcal { S } } } | \mathbf { f } _ { v _ { i } } \mathbf { f } _ { v _ { j } } | } \end{array}$ for nodes $v _ { i }$ and $v _ { j }$ if connected by an edge $e _ { i j }$ . We simulate a random walk $\mathbf { X } = \{ X _ { t } | t \in T , X _ { t } \in \mathcal { V } _ { S } \}$ on a protein surface mesh, where the transition probability $p _ { i j }$ between two nodes $v _ { i }$ and $v _ { j }$ is defined as $p _ { i j } = P ( X _ { t + 1 } = v _ { j } | X _ { t } = v _ { i } ) = w _ { i j } / w _ { i }$ , where $\begin{array} { r } { \boldsymbol { w } _ { i } = \sum _ { k : e _ { i k } \in \mathcal { E } _ { S } } \boldsymbol { w } _ { i k } } \end{array}$ .The corresponding stationary distributions of nodes $\gamma _ { s }$ are given by
117
+
118
+ $$
119
+ \pmb { \mu } = \left( \mu _ { 1 } , \mu _ { 2 } , . . . , \mu _ { | \mathcal { V } s | } \right) ^ { \top } = \left( \frac { w _ { 1 } } { w _ { T } } , \frac { w _ { 2 } } { w _ { T } } , . . . , \frac { w _ { | \mathcal { V } s | } } { w _ { T } } \right) ^ { \top } .
120
+ $$
121
+
122
+ Molecular superpixels are then defined by a subset of edges $\mathcal { M } \subseteq \mathcal { E } _ { S }$ such that the resulting graph, $\mathcal { G } _ { S } = ( \nu _ { S } , \bar { \mathcal { M } } )$ , contains exactly $k$ connected subgraphs. Computing molecular superpixels is achieved via optimizing the objective function with respect to the edge set $\mathcal { M }$
123
+
124
+ $$
125
+ \operatorname* { m a x } _ { \mathcal { M } } - \sum _ { i } \mu _ { i } \sum _ { j } p _ { i j } ( \mathcal { M } ) \log \left( p _ { i j } ( \mathcal { M } ) \right) - \sum _ { i } p _ { Z _ { \mathcal { M } } } ( i ) \log \left( p _ { Z _ { \mathcal { M } } } ( i ) \right) - n _ { \mathcal { M } }
126
+ $$
127
+
128
+ # s.t. $\mathcal { M } \subseteq \mathcal { E } _ { S }$ and $n _ { \mathcal { M } } \geq k$ ,
129
+
130
+ where $n _ { \mathcal { M } }$ is the number of connected components in the graph, $p _ { Z _ { \mathcal { M } } }$ denotes the distribution of cluster memberships $Z _ { \mathcal { M } }$ , and $\lambda \geq 0$ is the weight of the balancing term. Both terms satisfy monotonicity and submodularity and can thus be efficiently optimized based on techniques from submodular optimization [Nemhauser et al., 1978]. For further details on the entropy rate superpixel algorithm, see Liu et al. [2011].
131
+
132
+ A molecular superpixel $m$ comprising $k$ surface vertices is then given as $\mathbf { f } _ { m } = ( \mathbf { f } _ { v _ { 1 } } , \ldots , \mathbf { f } _ { v _ { k } } )$ for all f $\in \mathbf { F } _ { \mathcal { S } }$ . We summarize the feature representation of each molecular superpixel via the graph $\mathcal { G _ { M } } = ( \nu _ { \mathcal { M } } , \mathcal { E _ { M } } )$ , where each node $m \in \mathcal { V } _ { \mathcal { M } }$ is represented via $( \mathrm { m e a n } ( \mathbf { f } _ { m } )$ , std $( \mathbf { f } _ { m } )$ , $\mathtt { m a x } ( \mathbf { f } _ { m } )$ $\mathfrak { m i n } ( \mathbf { f } _ { m } ) )$ for all $\mathbf { f } \in \mathbf { F } _ { \mathcal { S } }$ and an edge $e \in \mathcal { E } _ { \mathcal { M } }$ via the Wasserstein distance between neighboring superpixels.
133
+
134
+ Figure 2 demonstrates molecular superpixels for the enzyme HIV-1 protease [Brik and Wong, 2003]. Besides being spatially compact, superpixels overlap with surface regions dominated by single features such as hydrophobic patches, while capturing coherent areas across all surface features. Further examples of superpixels are displayed in Appendix ??.
135
+
136
+ # 5 Evaluation
137
+
138
+ Successful protein engineering requires optimization of multiple objectives. When searching for a protein with desired functionality, auxiliary but crucial properties such as stability measured in terms of free energy of folding also need to be satisfied. Furthermore, the field is also subject to a plethora of potential tasks and applications. In order to capture the multi-objective and multi-task nature of protein engineering, we evaluate our method on two representative tasks: regression of the binding affinity between proteins and their ligands, and classification of enzyme proteins based on the type of reaction they catalyze.
139
+
140
+ # 5.1 Protein-Ligand Binding Affinity Prediction
141
+
142
+ Studying the interaction between proteins and small molecules is crucial for many downstream tasks, e.g., accelerating virtual screening for potential candidates in drug discovery or protein design to improve the output of an enzyme-catalyzed reaction. The architecture of the regression module is described in Equation 2.
143
+
144
+ Dataset. The PDBBIND database (version 2019) [Liu et al., 2017] is a collection of the experimentally measured binding affinity data for all types of biomolecular complexes deposited in the Protein Data Bank [Berman et al., 2000]. After quality filtering for resolution and surface construction, the refined subset comprises a total of 4, 709 biomolecular complexes. The binding affinity provided in PDBBIND is experimentally determined and expressed in molar units of the inhibition constant $( K _ { i } )$ or dissociation constant $( K _ { d } )$ . Similar to previous methods [Öztürk et al., 2018, Townshend et al., 2020], we do not distinguish both constants and predict negative log-transformed binding affinity $p K _ { d } / p K _ { i }$ . We split the dataset into training, test and validation splits based on the scaffolds of the corresponding ligands (scaffold), or a $30 \%$ and a $60 \%$ sequence identity threshold (identity $30 \%$ , identity $60 \%$ ) to limit homologous ligands or proteins appearing in both train and test sets.
145
+
146
+ Baselines. For evaluating the overall performance on the regression task, we compare HOLOPROT against several baselines including current state-of-the-art methods on both tasks. This comprises sequence-based methods [Öztürk et al., 2018, Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods based on the three-dimensional structure of proteins [Townshend et al., 2020, Hermosilla et al., 2021], and recent methods using geometric deep learning on protein molecular surfaces [Gainza et al., 2020].
147
+
148
+ Table 1: Protein-Ligand Binding Affinity Prediction Results Comparison predictive performance of ligand binding affinity using the PDBbind dataset [Liu et al., 2017] of HOLOPROT against other methods. Results are reported for 3 experimental runs.
149
+
150
+ <table><tr><td>Model</td><td>#Params</td><td colspan="3">Sequence Identity (30 %)</td><td colspan="3">Sequence Identity (60 %)</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93M</td><td>1.866 ± 0.080</td><td>0.472 ± 0.022</td><td>0.471 ± 0.024</td><td>1.762 ± 0.261</td><td>0.666 ± 0.012</td><td>0.663 ± 0.015</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M 93.0M</td><td>1.985 ± 0.006</td><td>0.165 ± 0.006</td><td>0.152 ± 0.024</td><td>1.891 ± 0.004</td><td>0.249 ± 0.006</td><td>0.275 ± 0.008</td></tr><tr><td>Rao et al. [2019]</td><td>2.4M1</td><td>1.890 ± 0.035 1.544 ± 0.015</td><td>0.338 ± 0.044</td><td>0.286 ± 0.124 0.434± 0.058</td><td>1.633 ± 0.016 1.641 ± 0.016</td><td>0.568± 0.033</td><td>0.571 ± 0.021</td></tr><tr><td>Elnaggar et al.[2020] Surface-based Methods</td><td></td><td></td><td>0.438 ± 0.053</td><td></td><td></td><td>0.595 ± 0.014</td><td>0.588 ± 0.009</td></tr><tr><td>Gainza et al. [2020]</td><td>0.62M</td><td>1.484 ± 0.018</td><td>0.467 ± 0.020</td><td>0.455 ± 0.014</td><td>1.426 ± 0.017</td><td>0.709 ±0.008</td><td>0.701 ± 0.011</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Townshend et al. [2020]2</td><td></td><td>1.429 ± 0.042</td><td>0.541 ± 0.029</td><td>0.532 ± 0.033</td><td>1.450 ± 0.024</td><td>0.716 ± 0.008</td><td>0.714 ± 0.009</td></tr><tr><td>Townshend et al.[2020]3</td><td>5.80M</td><td>1.936 ± 0.120 1.554 ± 0.016</td><td>0.581 ± 0.039 0.414 ± 0.053</td><td>0.647± 0.071</td><td>1.493 ± 0.010 1.473 ± 0.024</td><td>0.669 ± 0.013</td><td>0.691± 0.010</td></tr><tr><td>Hermosilla et al. [2021]</td><td></td><td></td><td></td><td>0.428 ±0.032</td><td></td><td>0.667 ± 0.011</td><td>0.675 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>1.365 ± 0.038</td><td>0.749 ± 0.014</td><td>0.742 ± 0.011</td></tr><tr><td>HOLOPROT()</td><td>1.76 M</td><td>1.491 ± 0.004</td><td>0.491 ± 0.014</td><td>0.482 ± 0.017</td><td>1.416 ± 0.022</td><td>0.724 ± 0.011</td><td>0.715 ± 0.006</td></tr></table>
151
+
152
+ <table><tr><td>Model</td><td>#Params</td><td colspan="3">Scaffold</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93 M</td><td>1.908 ± 0.145</td><td>0.384 ± 0.014</td><td>0.387 ± 0.016</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M</td><td>1.864 ± 0.009</td><td>0.269 ±0.002</td><td>0.285 ± 0.019</td></tr><tr><td>Rao et al. [2019]</td><td>93.0M</td><td>1.680 ± 0.055</td><td>0.487 ± 0.029</td><td>0.462 ± 0.051</td></tr><tr><td>Elnaggar et al. [2020]</td><td>2.4M1</td><td>1.592 ± 0.009</td><td>0.398 ± 0.027</td><td>0.409 ± 0.029</td></tr><tr><td>Surface-based Methods Gainza et al. [2020]</td><td>0.62 M</td><td>1.583 ± 0.132</td><td>0.416 ± 0.111</td><td>0.412 ± 0.126</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Hermosilla et al. [2021]</td><td>5.80M</td><td>1.592 ± 0.012</td><td>0.365 ± 0.024</td><td>0.373 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.523 ± 0.028</td><td>0.489 ± 0.019</td><td>0.491 ± 0.020</td></tr><tr><td>HOLOPROT()</td><td>1.28M</td><td>1.516 ± 0.014</td><td>0.491 ± 0.016</td><td>0.493 ± 0.014</td></tr></table>
153
+
154
+ full surface molecular superpixels
155
+
156
+ Evaluation metrics. For evaluating different methods, we use three metrics – root mean squared error (RMSE), Pearson correlation coefficient, and Spearman correlation coefficient. We also include the mean and standard deviation across 3 experimental runs.
157
+
158
+ Results. Table 1 displays the results on protein-ligand binding affinity. HOLOPROT $( \circ , \bullet )$ performs consistently well across different tasks and dataset splits, outperforming all methods on the splits scaffold and identity $60 \%$ . On identity $30 \%$ , our method outperforms most baselines, while having lower variability across the evaluated metrics. HOLOPROT with molecular superpixels $( \bullet )$ performs similar to HOLOPROT on the entire surface, with no or little performance loss, suggesting that molecular superpixels capture meaningful biological motifs. We include the models from [Townshend et al., 2020] for completeness, but note that these models were trained only using the protein binding pocket. Binding sites on proteins are often structurally highly conserved regions [Panjkovich and Daura, 2010]. Considering only binding pockets, which vary less between the train and test splits, provides an additional simplification making the task less challenging. All other baselines were tested on the full proteins.
159
+
160
+ # 5.2 Enzyme-Catalyzed Reaction Classification
161
+
162
+ Predicting the reaction class of enzymes without the use of sequence similarity allows for efficient screening of de novo proteins, i.e., macromolecules without evolutionary homologs, for catalytic properties [des Jardins et al., 1997]. The architecture of the classification module is described in Equation 3).
163
+
164
+ Table 2: Enzyme-Catalyzed Reaction Classification Results Comparison of classification accuracy of HOLOPROT against other methods.
165
+
166
+ <table><tr><td>Model</td><td>Parameters</td><td>Reaction Class Accuracy</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td></tr><tr><td>Hou et al. [2018]</td><td>41.7M</td><td>70.9 %</td></tr><tr><td>Bepler and Berger [2019]</td><td>31.7 M</td><td>66.7 %</td></tr><tr><td>Rao et al.[2019] (Transformer)</td><td>38.4M</td><td>69.8 %</td></tr><tr><td>Elnaggar et al. [2020]</td><td>420.0M</td><td>72.2 %</td></tr><tr><td>Structure-basedMethods</td><td></td><td></td></tr><tr><td>Kipf and Welling [2017]</td><td>1.0 M</td><td>67.3 %</td></tr><tr><td>Derevyanko et al. [2018]</td><td>6.0M</td><td>78.8 %</td></tr><tr><td>Hermosilla et al. [2021]</td><td>9.8M</td><td>87.2 %</td></tr><tr><td>HOLOPROT(O)</td><td>0.64M</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>0.64 M</td><td>78.9 %</td></tr></table>
167
+
168
+ full surface molecular superpixels
169
+
170
+ Dataset. Enzyme Commission (EC) numbers constitute an ontological system with the purpose of defining and organizing enzyme functions [Webb, 1992]. The four digits of an EC number are related in a functional hierarchy, where the first level annotates the main enzymatic classes, while the next levels constitute subclasses, e.g. the EC number of the HIV-1 protease is 3.4.23.16. This task aims at predicting the enzyme-catalyzed reaction class of a protein based on according to all four levels of the EC number. We use the same dataset and splits as provided by [Hermosilla et al., 2021], comprising 37, 428 proteins from 384 EC numbers, with 29, 215 instances for training, 2, 562 instances for validation, and 5, 651 for testing. For more details on dataset construction, we refer to Hermosilla et al. [2021, Appendix C].
171
+
172
+ Baselines. For the classification task, we again compare HOLOPROT against several baselines including sequence-based methods [Hou et al., 2018], methods partially pretrained on millions of sequences [Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods utilizing principles of geometric deep learning [Kipf and Welling, 2017, Derevyanko et al., 2018, Hermosilla et al., 2021]. The values for different baselines are taken from [Hermosilla et al., 2021].
173
+
174
+ Evaluation metric. Model performance is measured via the mean accuracy score.
175
+
176
+ Results. We report the results of enzyme-catalyzed reaction classification in Table 2. While our method $( \circ , \bullet )$ is unable to outperform the current state-of-the-art method [Hermosilla et al., 2021], we achieve equivalent, if not better results to other methods at a fraction of the parameters used. Molecular superpixels also capture biologically meaningful protein surface motifs, as evidenced by a small increase in the overall classification performance.
177
+
178
+ # 5.3 Ablation Studies
179
+
180
+ To further evaluate the contribution of HOLOPROT to learning multi-scale protein representations, we conduct several ablation studies. First, we analyze if the performance of the multi-scale model outperforms its isolated components, i.e. when using only structure or surface representation for subsequent downstream tasks. The second ablation axis analyzes the construction of molecular superpixel representations. Besides computing summary features for each molecular superpixel as described in Section 4, we learn patch representations via a MPN on the superpixel graph. The ablation study were conducted on both tasks, ligand binding affinity (Section 5.1) and enzyme catalytic function classification (Section 5.2).
181
+
182
+ As displayed in Table 3, HOLOPROT with $( \bullet )$ and without molecular superpixels ( ) improve over the performance of structure and surface representations. Further, the results of the ablation study clearly show that different protein scales are more relevant for particular downstream tasks, e.g., predicting the enzyme-catalyzed reaction class from surface only results in poor performance. We further see no
183
+
184
+ Table 3: Ablation Studies Results Evaluation of architectural design choices of HOLOPROT by analyzing the performance of its individual components as well as feature summarization of molecular superpixels.
185
+
186
+ <table><tr><td>Model</td><td colspan="3">Ligand Binding Affinity Sequence Identity (30 %)</td><td>Enzyme Class</td></tr><tr><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>Accuracy</td></tr><tr><td>Structure</td><td>1.476 ± 0.027</td><td>0.51 ± 0.029</td><td>0.503 ± 0.027</td><td>74.2 %</td></tr><tr><td>Surface</td><td>1.482 ± 0.015</td><td>0.512 ± 0.022</td><td>0.505 ± 0.017</td><td>28.6 %</td></tr><tr><td>HOLOPROT(O)</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.004</td><td>0.491 ±0.014</td><td>0.482 ± 0.017</td><td>78.9 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.027</td><td>0.503 ±0.005</td><td>0.492 ± 0.004</td><td>75.7 %</td></tr></table>
187
+
188
+ full surface ? molecular superpixels molecular superpixel with MPN
189
+
190
+ improvement in applying a MPN within a molecular superpixel ( ) over using summary features ( ).
191
+ Further ablation studies are presented in Appendix ??.
192
+
193
+ # 5.4 Limitations
194
+
195
+ Despite the reported success of HOLOPROT, our method faces some limitations. First, HOLOPROT relies on existing protein structures and the corresponding generated surface manifolds. However, protein sequence data still remains the most abundant data source, and in protein design, conformations of mutated macromolecules are unknown. This limitation could however be partly remedied, (i.) by the recent advancements in protein structure prediction [Senior et al., 2020, Jumper et al., 2021, AlphaFold] [Baek et al., 2021, RoseTTAFold] and protein structure determination methods such as cryo-electron microscopy [Callaway, 2020], and (ii.) by utilizing homology modeling algorithms on available wild type structures for mutant analysis [Schymkowitz et al., 2005]. Second, our method requires precomputed surface meshes, resulting in an additional preprocessing step before deploying HOLOPROT to the desired application. This bottleneck can be bypassed by utilizing techniques developed in the concurrent work by Sverrisson et al. [2020], which allow computation and sampling of the molecular surface on-the-fly.
196
+
197
+ # 6 Conclusion
198
+
199
+ In this work, we present a novel multi-scale protein graph construction, HOLOPROT, which integrates finer and coarser representation details of a protein by connecting sequence and structure with surface. We further establish molecular superpixels, which capture higher-level fingerprint motifs on the protein surface, improving the memory efficiency of our construction without reducing the overall performance. We validate HOLOPROT’s effectiveness and versatility through representative tasks on protein-ligand binding affinity and enzyme-catalyzed reaction class prediction. While being significantly more parameter-efficient, HOLOPROT performs consistently well across different tasks and dataset splits, partly outperforming current state-of-the-art methods. This will potentially be of great benefit and advantage when working with datasets of reduced size, e.g., comprising experiments on mutational fitness of proteins, thus opening up new possibilities within protein engineering and design, which we leave for future work.
200
+
201
+ # Acknowledgments
202
+
203
+ This project received funding from the Swiss National Science Foundation under the National Center of Competence in Research (NCCR) Catalysis under grant agreement 51NF40 180544. Moreover, we thank Mojmír Mutný and Clemens Isert for their valuable feedback.
204
+
205
+ # References
206
+
207
+ M. Baek, F. DiMaio, I. Anishchenko, J. Dauparas, S. Ovchinnikov, G. R. Lee, J. Wang, Q. Cong, L. N. Kinch, R. D. Schaeffer, et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science, 373(6557), 2021.
208
+
209
+ F. Baldassarre, D. Menéndez Hurtado, A. Elofsson, and H. Azizpour. GraphQA: protein model quality assessment using graph convolutional networks. Bioinformatics, 37(3), 2021.
210
+
211
+ T. Bepler and B. Berger. Learning Protein Sequence Embeddings using Information From Structure. In International Conference on Learning Representations (ICLR), 2019.
212
+
213
+ H. M. Berman, J. Westbrook, Z. Feng, G. Gilliland, T. N. Bhat, H. Weissig, I. N. Shindyalov, and P. E. Bourne. The Protein Data Bank. Nucleic Acids Research, 28(1), 2000.
214
+
215
+ A. Brik and C.-H. Wong. HIV-1 protease: mechanism and drug discovery. Organic & Biomolecular Chemistry, 1(1), 2003.
216
+
217
+ E. Callaway. ’It will change everything’: DeepMind’s AI makes gigantic leap in solving protein structures. Nature, 2020.
218
+
219
+ V. Cantoni, R. Gatti, and L. Lombardi. Segmentation of SES for Protein Structure Analysis. In Bioinformatics, 2010.
220
+
221
+ V. Cantoni, R. Gatti, and L. Lombardi. 3D Protein Surface Segmentation through Mathematical Morphology. In International Joint Conference on Biomedical Engineering Systems and Technologies. Springer, 2011.
222
+
223
+ D. Comaniciu and P. Meer. Mean Shift: A Robust Approach Toward Feature Space Analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5), 2002.
224
+
225
+ M. L. Connolly. Solvent-accessible surfaces of proteins and nucleic acids. Science, 221(4612), 1983.
226
+
227
+ A. Dalkiran, A. S. Rifaioglu, M. J. Martin, R. Cetin-Atalay, V. Atalay, and T. Dogan. ECPred: a tool ˘ for the prediction of the enzymatic functions of protein sequences based on the EC nomenclature. BMC Bioinformatics, 19(1), 2018.
228
+
229
+ G. Derevyanko, S. Grudinin, Y. Bengio, and G. Lamoureux. Deep convolutional networks for quality assessment of protein folds. Bioinformatics, 34(23), 2018.
230
+
231
+ M. des Jardins, P. D. Karp, M. Krummenacker, T. J. Lee, and C. A. Ouzounis. Prediction of enzyme classification from protein sequence without the use of sequence similarity. In Proceedings. International Conference on Intelligent Systems for Molecular Biology, volume 5, 1997.
232
+
233
+ P. D. Dobson and A. J. Doig. Predicting Enzyme Class From Protein Structure Without Alignments. Journal of Molecular Biology, 345(1), 2005.
234
+
235
+ A. Elnaggar, M. Heinzinger, C. Dallago, G. Rihawi, Y. Wang, L. Jones, T. Gibbs, T. Feher, C. Angerer, D. Bhowmik, et al. ProtTrans: Towards Cracking the Language of Life’s Code Through SelfSupervised Deep Learning and High Performance Computing. arXiv Preprint, 2020.
236
+
237
+ P. F. Felzenszwalb and D. P. Huttenlocher. Efficient Graph-Based Image Segmentation. International Journal of Computer Vision, 59(2), 2004.
238
+
239
+ M. Fessenden. Protein maps chart the causes of disease. Nature, 549(7671), 2017.
240
+
241
+ A. Fout, J. Byrd, B. Shariat, and A. Ben-Hur. Protein Interface Prediction using Graph Convolutional Networks. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017.
242
+
243
+ P. Gainza, F. Sverrisson, F. Monti, E. Rodola, D. Boscaini, M. Bronstein, and B. Correia. Deciphering interaction fingerprints from protein molecular surfaces using geometric deep learning. Nature Methods, 17(2), 2020.
244
+
245
+ J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural Message Passing for Quantum Chemistry. In International Conference on Machine Learning (ICML), 2017.
246
+
247
+ V. Gligorijevic, P. D. Renfrew, T. Kosciolek, J. K. Leman, K. Cho, T. Vatanen, D. Berenberg, B. Taylor, I. M. Fisk, R. J. Xavier, R. Knight, and R. Bonneau. Structure-Based Function Prediction using Graph Convolutional Networks. Nature Communications, 12(1), 2021.
248
+
249
+ A. Golovin and K. Henrick. MSDmotif: exploring protein sites and motifs. BMC Bioinformatics, 9 (1), 2008.
250
+ P. Hermosilla, M. Schäfer, M. Lang, G. Fackelmann, P.-P. Vázquez, B. Kozlikova, M. Krone, T. Ritschel, and T. Ropinski. Intrinsic-Extrinsic Convolution and Pooling for Learning on 3D Protein Structures. In International Conference on Learning Representations (ICLR), 2021.
251
+ J. Hou, B. Adhikari, and J. Cheng. DeepSF: deep convolutional neural network for mapping protein sequences to folds. Bioinformatics, 34(8), 2018.
252
+ J. Jiménez, M. Skalic, G. Martinez-Rosell, and G. De Fabritiis. KDEEP: Protein–Ligand Absolute Binding Affinity Prediction via 3D-Convolutional Neural Networks. Journal of Chemical Information and Modeling, 58(2), 2018.
253
+ W. Jin, R. Barzilay, and T. Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In International Conference on Machine Learning, pages 4839–4848. PMLR, 2020.
254
+ J. Jumper, R. Evans, A. Pritzel, T. Green, M. Figurnov, O. Ronneberger, K. Tunyasuvunakool, R. Bates, A. Žídek, A. Potapenko, et al. Highly accurate protein structure prediction with AlphaFold. Nature, 596(7873), 2021.
255
+ T. N. Kipf and M. Welling. Semi-Supervised Classification with Graph Convolutional Networks. In International Conference on Learning Representations (ICLR), 2017.
256
+ P. Kohli, P. H. Torr, et al. Robust Higher Order Potentials for Enforcing Label Consistency. International Conference on Computer Vision (ICCV), 82(3), 2009.
257
+ T. Lei, W. Jin, R. Barzilay, and T. Jaakkola. Deriving Neural Architectures from Sequence and Graph Kernels. In International Conference on Machine Learning (ICML), 2017.
258
+ M.-Y. Liu, O. Tuzel, S. Ramalingam, and R. Chellappa. Entropy Rate Superpixel Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011.
259
+ Z. Liu, M. Su, L. Han, J. Liu, Q. Yang, Y. Li, and R. Wang. Forging the Basis for Developing Protein–Ligand Interaction Scoring Functions. Accounts of Chemical Research, 50(2), 2017.
260
+ G. Mori, X. Ren, A. A. Efros, and J. Malik. Recovering Human Body Configurations: Combining Segmentation and Recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2004.
261
+ G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions. Mathematical programming, 14(1), 1978.
262
+ H. Öztürk, A. Özgür, and E. Ozkirimli. DeepDTA: deep drug–target binding affinity prediction. Bioinformatics, 34(17), 2018.
263
+ A. Panjkovich and X. Daura. Assessing the structural conservation of protein pockets to study functional and allosteric sites: implications for drug discovery. BMC structural biology, 10(1): 1–14, 2010.
264
+ M. Ragoza, J. Hochuli, E. Idrobo, J. Sunseri, and D. R. Koes. Protein–ligand scoring with convolutional neural networks. Journal of chemical information and modeling, 57(4):942–957, 2017.
265
+ R. Rao, N. Bhattacharya, N. Thomas, Y. Duan, X. Chen, J. Canny, P. Abbeel, and Y. S. Song. Evaluating Protein Transfer Learning with TAPE. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
266
+ X. Ren and J. Malik. Learning a Classification Model for Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2003.
267
+ M. F. Sanner, A. J. Olson, and J.-C. Spehner. Reduced Surface: An Efficient Way to Compute Molecular Surfaces. Biopolymers, 38(3), 1996.
268
+ J. Schymkowitz, J. Borg, F. Stricher, R. Nys, F. Rousseau, and L. Serrano. The FoldX web server: an online force field. Nucleic Acids Research, 33, 2005.
269
+ A. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, C. Qin, A. Žídek, A. W. Nelson, A. Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792), 2020.
270
+ M. M. Stepniewska-Dziubinska, P. Zielenkiewicz, and P. Siedlecki. Improving detection of proteinligand binding sites with 3d segmentation. Scientific Reports, 10(1), 2020.
271
+ D. Stutz, A. Hermans, and B. Leibe. Superpixels: An evaluation of the state-of-the-art. Computer Vision and Image Understanding, 166, 2018.
272
+ F. Sverrisson, J. Feydy, B. Correia, and M. Bronstein. Fast end-to-end learning on protein surfaces. bioRxiv, 2020.
273
+ R. Townshend, R. Bedi, P. Suriana, and R. Dror. End-to-End Learning on 3D Protein Structure for Interface Prediction. Advances in Neural Information Processing Systems (NeurIPS), 32, 2019.
274
+ R. J. Townshend, M. Vögele, P. Suriana, A. Derry, A. Powers, Y. Laloudakis, S. Balachandar, B. Anderson, S. Eismann, R. Kondor, et al. ATOM3D: Tasks On Molecules in Three Dimensions. NeurIPS Workshop of Learning Meaningful Representations of Life (LMRL), 2020.
275
+ L. Vincent and P. Soille. Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations. IEEE Computer Architecture Letters, 13(06), 1991.
276
+ E. C. Webb. Enzyme Nomenclature 1992. Recommendations of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology on the Nomenclature and Classification of Enzymes. Academic Press, 1992.
277
+ K. K. Yang, Z. Wu, and F. H. Arnold. Machine-learning-guided directed evolution for protein engineering. Nature Methods, 16(8), 2019.
parse/train/-xEk43f_EO6/-xEk43f_EO6_content_list.json ADDED
@@ -0,0 +1,1325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Multi-Scale Representation Learning on Proteins ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 200,
8
+ 122,
9
+ 797,
10
+ 147
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Vignesh Ram Somnath∗ Dept. of Computer Science ETH Zurich vsomnath@ethz.ch ",
17
+ "bbox": [
18
+ 196,
19
+ 200,
20
+ 377,
21
+ 257
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Charlotte Bunne∗ Dept. of Computer Science ETH Zurich bunnec@ethz.ch ",
28
+ "bbox": [
29
+ 408,
30
+ 202,
31
+ 589,
32
+ 256
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Andreas Krause Dept. of Computer Science ETH Zurich krausea@ethz.ch ",
39
+ "bbox": [
40
+ 619,
41
+ 202,
42
+ 800,
43
+ 257
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 462,
53
+ 292,
54
+ 535,
55
+ 309
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "Proteins are fundamental biological entities mediating key roles in cellular function and disease. This paper introduces a multi-scale graph construction of a protein – HOLOPROT – connecting surface to structure and sequence. The surface captures coarser details of the protein, while sequence as primary component and structure – comprising secondary and tertiary components – capture finer details. Our graph encoder then learns a multi-scale representation by allowing each level to integrate the encoding from level(s) below with the graph at that level. We test the learned representation on different tasks, (i.) ligand binding affinity (regression), and (ii.) protein function prediction (classification). On the regression task, contrary to previous methods, our model performs consistently and reliably across different dataset splits, outperforming all baselines on most splits. On the classification task, it achieves a performance close to the top-performing model while using $1 0 \\mathrm { x }$ fewer parameters. To improve the memory efficiency of our construction, we segment the multiplex protein surface manifold into molecular superpixels and substitute the surface with these superpixels at little to no performance loss. ",
62
+ "bbox": [
63
+ 233,
64
+ 324,
65
+ 766,
66
+ 531
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 Introduction ",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 174,
76
+ 556,
77
+ 310,
78
+ 574
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Protein design and engineering has become a crucial component of pharmaceutical research and development, finding application in a wide variety of diagnostic and industrial settings. Besides understanding the design principles determining structure and function of proteins, current efforts seek to further enhance or discover proteins with properties useful for technological or therapeutic applications. To efficiently guide the search in the vast design space of functional proteins, we need to be able to robustly predict properties of a candidate protein [Yang et al., 2019]. Moreover, understanding role and function of proteins is crucial to study causes and mechanism of human disease [Fessenden, 2017]. ",
85
+ "bbox": [
86
+ 174,
87
+ 588,
88
+ 825,
89
+ 699
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "To achieve this, representations incorporating the complex nature of proteins are required. Proteins consist of amino acids, organic molecules linked by peptide bonds forming a linear sequence. Each of the twenty amino acids carries a unique side chain, giving rise to an incomprehensibly large combinatorial space of possible protein sequences. The primary sequence drives the folding of polymers – a spontaneous process guided by hydrophobic interactions, formation of intramolecular hydrogen bonds, and van der Waals forces into a unique three-dimensional structure. The resulting shape and surface manifold with rich physiochemical properties carry essential information for understanding function and potential molecular interactions. ",
96
+ "bbox": [
97
+ 174,
98
+ 705,
99
+ 825,
100
+ 815
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Previous methods typically only consider an individual subset within these scales, focusing on either sequence [Öztürk et al., 2018, Hou et al., 2018], three-dimensional structure [Hermosilla et al., 2021, Derevyanko et al., 2018] or surface [Gainza et al., 2020]. Two proteins with similar sequences can fold into entirely different conformations. While these proteins might catalyze the same type of ooreactions, their behavior to specific inhibiting drugs might be divergent. Interaction between proteins and ligands, on the other hand, is controlled by molecular surface contacts [Gainza et al., 2020]. Molecular surfaces, determined by subjacent amino acids, are fingerprinted with patterns of geometric and chemical properties, and thus their integration in protein representations is crucial. ",
107
+ "bbox": [
108
+ 174,
109
+ 821,
110
+ 825,
111
+ 878
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "image",
117
+ "img_path": "images/142a696c61c62df98affdc5a645e7a6a06caa904cc842671b628a5322fa26c95.jpg",
118
+ "image_caption": [
119
+ "Figure 1: Overview of HOLOPROT Our multi-scale protein representation algorithm integrates primary, secondary and tertiary elements of protein structures and connects them to the surface. We extract higher-level protein motifs by introducing molecular superpixels. Both structure and surface are represented as graphs $\\mathcal { G } _ { B }$ and $\\mathcal { G } _ { S }$ , respectively. The method is evaluated on two representative fintasks, protein-ligand binding affinity and enzyme-catalyzed reaction classification. "
120
+ ],
121
+ "image_footnote": [],
122
+ "bbox": [
123
+ 181,
124
+ 92,
125
+ 818,
126
+ 236
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "",
133
+ "bbox": [
134
+ 174,
135
+ 343,
136
+ 825,
137
+ 398
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "In this work, we present a novel multi-scale graph representation which integrates and connects the complex nature of proteins across all levels of information. HOLOPROT consists of a surface and structure layer (both represented as graphs) with explicit edges between the layers. Our construction finiris guided by the intuition that propagating information from surface to structure would allow each residue to learn encodings reflective of not just its immediate residue neighborhood, but also the higher-level geometric and chemical properties that arise from interactions between a residue and ooits neighborhood. The associated multi-scale encoder then learns representations by integrating sathe encoding from the layer below, with the graph at that layer (Section 3). Such multi-scale representations have been previously used in molecular graph generation [Jin et al., 2020] with impressive results. ",
144
+ "bbox": [
145
+ 174,
146
+ 406,
147
+ 825,
148
+ 544
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "We further improve the memory efficiency of our construction by segmenting the large and rich protein surface into molecular “superpixels”, summarizing higher-level fingerprint features and motifs of proteins. Substituting the surface layer with these superpixels results in little to no performance degradation across the evaluated tasks. The concept of molecular superpixels might be of interest beyond our model (Section 4). ",
155
+ "bbox": [
156
+ 174,
157
+ 550,
158
+ 825,
159
+ 619
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "The multi-objective and multi-task nature of protein engineering poses a challenge for current methods, often designed and evaluated only on specific subtasks of protein design. By incorporating the biology of proteins, strong representations exhibit robust performance across tasks. We demonstrate our model’s versatility and range of applications by deploying it to tasks of rather distinct nature, including a regression task, e.g., inference of protein ligand binding affinity, and classification tasks, i.e., enzyme-catalyzed reaction classification (Section 5). ",
166
+ "bbox": [
167
+ 174,
168
+ 626,
169
+ 825,
170
+ 709
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "2 Related Work ",
177
+ "text_level": 1,
178
+ "bbox": [
179
+ 174,
180
+ 728,
181
+ 321,
182
+ 744
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Protein Representation Learning With increasing availability of sequence and structure data, the field of protein representation learning has advanced rapidly, with methods falling largely in one of the following categories: ",
189
+ "bbox": [
190
+ 174,
191
+ 760,
192
+ 825,
193
+ 801
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Sequence-based methods. One-dimensional amino acid sequences continue to be the simplest, most abundant source of protein data and various methods have been developed that borrow architectures developed in natural language processing (NLP). One-dimensional convolutional neural networks have been used to classify a protein sequence into folds and enzyme function [Hou et al., 2018, Dalkiran et al., 2018], and to predict their binding affinity to ligands [Öztürk et al., 2018]. Furthermore, methods have applied complex NLP models trained unsupervised on millions of unlabeled protein sequences and fine-tuned them on different downstream tasks [Rao et al., 2019, Elnaggar et al., 2020, Bepler and Berger, 2019]. Despite being advantageous when only the sequence is available, these methods ignore the full spatial complexity of proteins. ",
200
+ "bbox": [
201
+ 183,
202
+ 814,
203
+ 825,
204
+ 911
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "",
211
+ "bbox": [
212
+ 192,
213
+ 90,
214
+ 823,
215
+ 119
216
+ ],
217
+ "page_idx": 2
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Structure-based methods. To learn beyond sequences, approaches have been developed, that consider the 3D structure of proteins. 3D convolutional neural networks have been utilized for protein quality assessment [Derevyanko et al., 2018], protein contact prediction [Townshend et al., 2019] and protein-ligand binding affinity tasks [Ragoza et al., 2017, Jiménez et al., 2018, Townshend et al., 2020]. An alternate representation treats proteins as graphs, applying graph neural networks for enzyme classification [Dobson and Doig, 2005], interface prediction [Fout et al., 2017], and protein structure quality prediction [Baldassarre et al., 2021]. Gligorijevic et al. [2021] use a long short term memory cell (LSTM) to encode the sequence, followed by a graph convolutional network (GCN) [Kipf and Welling, 2017] to capture the tertiary structure, and apply this to the function prediction task. Hermosilla et al. [2021] propose a convolutional operator that learns to adapt filters based on the primary, secondary, and tertiary structure of a protein, showing strong performance on reaction and fold class prediction. ",
222
+ "bbox": [
223
+ 181,
224
+ 125,
225
+ 825,
226
+ 290
227
+ ],
228
+ "page_idx": 2
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "Surface-based methods. Taking a different viewpoint, Gainza et al. [2020] hypothesize that the protein surface displays patterns of chemical and geometric features that fingerprint a protein’s interaction with other biomolecules. They utilize geodesic convolutions, which are extensions of convolutions on surfaces, and learn fingerprint vectors, showing improved performance across binding pocket and protein interface prediction tasks. ",
233
+ "bbox": [
234
+ 183,
235
+ 296,
236
+ 825,
237
+ 366
238
+ ],
239
+ "page_idx": 2
240
+ },
241
+ {
242
+ "type": "text",
243
+ "text": "Protein Motif Detection Protein motifs have largely been synonymous with common and conserved patterns in a protein’s sequence or structure influencing protein function, e.g., the helixturn-helix motif binds DNA. Understanding these fragments is essential for 3D structure prediction, modeling, and drug design. While reliably detecting evolutionary motifs, existing tools [Golovin and Henrick, 2008] do not provide a full segmentation of the protein surface manifold. Our work takes a different viewpoint, by looking at protein motifs from the context of a protein surface. Previous methods developed in this context either only consider geometric information rather than physiological properties [Cantoni et al., 2010], are computationally expensive [Cantoni et al., 2011], or designed for particular downstream tasks [Stepniewska-Dziubinska et al., 2020]. Our molecular superpixel approach provides a task-independent segmentation utilizing both geometric and chemical features, while also being computationally efficient. ",
244
+ "bbox": [
245
+ 174,
246
+ 382,
247
+ 826,
248
+ 535
249
+ ],
250
+ "page_idx": 2
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "3 Multi-Scale Protein Representation ",
255
+ "text_level": 1,
256
+ "bbox": [
257
+ 173,
258
+ 554,
259
+ 500,
260
+ 571
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "In this section, we describe our multi-scale graph construction and the associated encoder. Figure 1 illustrates the main principles of HOLOPROT. We represent a protein $\\mathcal { P }$ as a graph $\\mathcal { G } _ { \\mathcal { P } }$ with two layers capturing different scales: ",
267
+ "bbox": [
268
+ 176,
269
+ 587,
270
+ 825,
271
+ 628
272
+ ],
273
+ "page_idx": 2
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "(i.) Surface layer. This layer captures the coarser representation details of a protein. The protein surface is generated using the triangulation software MSMS [Connolly, 1983, Sanner et al., 1996]. We represent this layer as a graph $\\mathcal { G } _ { S }$ , where each surface node $u _ { \\cal S }$ has a feature vector $\\mathbf { f } _ { u _ { S } }$ denoting its charge, hydrophobicity and local curvature [Gainza et al., 2020]. Two surface nodes $( u _ { S } , v _ { S } )$ have an edge if they are part of a triangulation. Each surface node additionally has a residue identifier $r$ , indicating the amino acid residue it corresponds to. Multiple surface nodes can have the same residue identifier. \n(ii.) Structure layer. This layer captures the finer representation details of a protein. A protein typically has four structural levels: (i.) primary structure (sequence), (ii.) secondary structure $\\alpha$ -helices and $\\beta$ -sheets), (iii.) tertiary structure (3D structure) and (iv.) quaternary structure (complexes) [Fout et al., 2017]. We represent this layer as a graph $\\mathcal { G } _ { B }$ , where each node $u _ { B }$ corresponds to a residue $r$ . Two nodes $( u _ { B } , v _ { B } )$ have an edge in $\\mathcal { G } _ { B }$ if the $\\mathbf { C } _ { \\alpha }$ atoms of the two nodes occur within a certain distance of each other. Distance based thresholding ensures that different structural levels are implicitly captured in the neighborhood of a node $u _ { B }$ . ",
278
+ "bbox": [
279
+ 200,
280
+ 642,
281
+ 825,
282
+ 842
283
+ ],
284
+ "page_idx": 2
285
+ },
286
+ {
287
+ "type": "text",
288
+ "text": "We further introduce edges from the surface layer to the structure layer in order to propagate information between them. Specifically, we introduce a directed edge between a surface node $u _ { \\mathcal { S } }$ and a backbone node $u _ { B }$ if they both have the same residue identifier $r$ . Typically, we have between 20-40 surface nodes $\\{ u _ { \\mathcal { S } } \\}$ that map to the same structure node $u _ { B }$ . This gives us the multi-scale graph which is then encoded by our multi-scale message passing network. Details on the features used for both the structure and surface layer can be found in Appendix ??. ",
289
+ "bbox": [
290
+ 176,
291
+ 856,
292
+ 823,
293
+ 911
294
+ ],
295
+ "page_idx": 2
296
+ },
297
+ {
298
+ "type": "text",
299
+ "text": "",
300
+ "bbox": [
301
+ 173,
302
+ 90,
303
+ 823,
304
+ 119
305
+ ],
306
+ "page_idx": 3
307
+ },
308
+ {
309
+ "type": "text",
310
+ "text": "3.1 Multi-Scale Encoder ",
311
+ "text_level": 1,
312
+ "bbox": [
313
+ 174,
314
+ 135,
315
+ 356,
316
+ 150
317
+ ],
318
+ "page_idx": 3
319
+ },
320
+ {
321
+ "type": "text",
322
+ "text": "Our multi-scale message passing network uses one message passing neural network (MPN) for each layer in the multi-scale graph [Lei et al., 2017, Gilmer et al., 2017]. This allows us to learn structured representations of each scale, which can then be tied together through connections between the scales. Before detailing the remainder of the architecture, we introduce some notational preliminaries. For simplicity, we denote the MPN encoding process as $\\mathbf { M P N } _ { \\theta } ( \\cdot )$ with parameters $\\theta$ . We denote $\\mathbf { M L P } _ { \\theta } ( \\bar { \\mathbf { x } } , \\mathbf { y } )$ for a multi-layer perceptron (MLP) with parameters $\\theta$ , whose input is the concatenation of $\\mathbf { x }$ and $\\mathbf { y }$ , and $\\operatorname { M L P } _ { \\theta } ( \\mathbf { x } )$ when the input is only $\\mathbf { x }$ . We also denote the residue identifier of a node $u$ with $\\operatorname { i d } ( u )$ , and the neighbors of a node $u$ as $\\mathcal { N } ( u )$ . The details of the MPN architecture are listed in the Appendix ??. ",
323
+ "bbox": [
324
+ 173,
325
+ 160,
326
+ 826,
327
+ 286
328
+ ],
329
+ "page_idx": 3
330
+ },
331
+ {
332
+ "type": "text",
333
+ "text": "3.1.1 Surface Message Passing Network ",
334
+ "text_level": 1,
335
+ "bbox": [
336
+ 174,
337
+ 299,
338
+ 460,
339
+ 314
340
+ ],
341
+ "page_idx": 3
342
+ },
343
+ {
344
+ "type": "text",
345
+ "text": "We first encode the surface layer $\\mathcal { G } _ { S }$ of the multi-scale protein graph $\\mathcal { G } _ { \\mathcal { P } }$ . The inputs to the MPN are node features $\\mathbf { f } _ { u _ { S } }$ and edge features $\\mathbf { f } _ { u _ { S } v _ { S } }$ of $\\mathcal { G } _ { S }$ . For more details on the input features used for surface nodes and edges, refer to Appendix ??. The MPN (with parameters $\\theta _ { S }$ ) propagates messages between the nodes for $K$ iterations, and outputs a representation $h _ { u s }$ for each surface node $u _ { \\cal S }$ , ",
346
+ "bbox": [
347
+ 173,
348
+ 323,
349
+ 825,
350
+ 380
351
+ ],
352
+ "page_idx": 3
353
+ },
354
+ {
355
+ "type": "equation",
356
+ "img_path": "images/d1af0fd99f550b673841bcd5e53d5b91b5000a1436342e14d8cdd3f90851daf0.jpg",
357
+ "text": "$$\n\\{ \\mathbf h _ { u _ { S } } \\} = \\mathrm { M P N } _ { \\theta _ { S } } ( \\mathcal G _ { S } , \\{ \\mathbf f _ { u _ { S } } \\} , \\{ \\mathbf f _ { u _ { S } v _ { S } } \\} _ { v _ { S } \\in \\mathcal N ( u _ { S } ) } ) .\n$$",
358
+ "text_format": "latex",
359
+ "bbox": [
360
+ 333,
361
+ 390,
362
+ 663,
363
+ 409
364
+ ],
365
+ "page_idx": 3
366
+ },
367
+ {
368
+ "type": "text",
369
+ "text": "3.1.2 Structure Message Passing Network ",
370
+ "text_level": 1,
371
+ "bbox": [
372
+ 174,
373
+ 417,
374
+ 475,
375
+ 433
376
+ ],
377
+ "page_idx": 3
378
+ },
379
+ {
380
+ "type": "text",
381
+ "text": "For each node $u _ { B }$ in the structure layer $\\mathcal { G } _ { B }$ , we first prepare the input to the MPN (with parameters $\\theta _ { B } ,$ ) by using an MLP (with parameters $\\theta$ ) on the concatenated version of its initial features $\\mathbf { f } _ { u B }$ and the mean of the surface node vectors with the same residue identifier $S = \\{ \\mathbf { h } _ { u _ { s } } | \\mathrm { i d } ( u _ { S } ) = \\mathrm { i d } ( \\bar { u } _ { B } ) \\}$ ",
382
+ "bbox": [
383
+ 173,
384
+ 440,
385
+ 826,
386
+ 484
387
+ ],
388
+ "page_idx": 3
389
+ },
390
+ {
391
+ "type": "equation",
392
+ "img_path": "images/5236c802d3ff384d0d0523b3859d3ab77b0bd998eb2e36da1ef9feecf77f50e7.jpg",
393
+ "text": "$$\n\\begin{array} { r } { { \\bf x } _ { u s } = \\mathrm { M L P } _ { \\theta } \\big ( { \\bf f } _ { u s } , \\Sigma _ { s } { \\bf h } _ { u _ { S } } \\big / | S | \\big ) . } \\end{array}\n$$",
394
+ "text_format": "latex",
395
+ "bbox": [
396
+ 392,
397
+ 494,
398
+ 606,
399
+ 512
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "Given the edge features $\\mathbf { f } _ { u B v s }$ , we then run $K$ iterations of message passing, to compute the representations $\\mathbf { h } _ { u _ { B } }$ for each structure node $u _ { B }$ , ",
406
+ "bbox": [
407
+ 174,
408
+ 522,
409
+ 826,
410
+ 551
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "equation",
416
+ "img_path": "images/401f3120a27d8cc4cd0365665c7feaab209282d8210f47efed06fc42b0d56ff4.jpg",
417
+ "text": "$$\n\\begin{array} { r } { \\{ \\mathbf { h } _ { u _ { B } } \\} = \\mathrm { M P N } _ { \\theta _ { B } } ( \\mathcal G _ { B } , \\{ \\mathbf { x } _ { u _ { B } } \\} , \\{ \\mathbf { f } _ { u _ { B } v _ { B } } \\} _ { v _ { B } \\in \\mathcal N ( u _ { B } ) } ) . } \\end{array}\n$$",
418
+ "text_format": "latex",
419
+ "bbox": [
420
+ 331,
421
+ 561,
422
+ 665,
423
+ 580
424
+ ],
425
+ "page_idx": 3
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "The graph representation $\\mathbf { c } _ { \\mathcal { G } _ { \\mathcal { P } } }$ is an aggregation of structure node representations, ",
430
+ "bbox": [
431
+ 171,
432
+ 589,
433
+ 705,
434
+ 604
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "equation",
440
+ "img_path": "images/a66639d9d5a2bfd6afe0ae15c032d0a0fc367cf3a159c7f66178259ba72a30ad.jpg",
441
+ "text": "$$\n\\mathbf { c } _ { \\mathcal { G } _ { \\mathcal { P } } } = \\sum _ { u _ { B } \\in \\mathcal { G } _ { B } } \\mathbf { h } _ { u _ { B } } .\n$$",
442
+ "text_format": "latex",
443
+ "bbox": [
444
+ 434,
445
+ 608,
446
+ 563,
447
+ 643
448
+ ],
449
+ "page_idx": 3
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "3.2 Task Specific Training ",
454
+ "text_level": 1,
455
+ "bbox": [
456
+ 174,
457
+ 657,
458
+ 369,
459
+ 672
460
+ ],
461
+ "page_idx": 3
462
+ },
463
+ {
464
+ "type": "text",
465
+ "text": "This multi-scale encoding allows us to learn a structured representation of a protein tying different scales together, which can then be utilized for any downstream task. In this work, we evaluate our method on two rather distinct tasks (i.) protein-ligand binding affinity regression, and (ii.) enzyme– catalyzed reaction classification. The architectural details for both downstream tasks are described below. These modules can be adapted and modified in order to utilize HOLOPROT for other use cases. ",
466
+ "bbox": [
467
+ 173,
468
+ 683,
469
+ 826,
470
+ 752
471
+ ],
472
+ "page_idx": 3
473
+ },
474
+ {
475
+ "type": "text",
476
+ "text": "3.2.1 Protein-Ligand Binding Affinity ",
477
+ "text_level": 1,
478
+ "bbox": [
479
+ 176,
480
+ 765,
481
+ 447,
482
+ 781
483
+ ],
484
+ "page_idx": 3
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "Protein-ligand binding affinity prediction depends on the interaction of a protein, encoded using the HOLOPROT framework, and a corresponding ligand, in most cases small molecules. To encode the ligand represented as a graph $\\mathcal { G } _ { \\mathcal { L } }$ , we use another MPN (with parameters $\\theta _ { \\mathcal { L } }$ ) and aggregate its node representations to obtain a graph representation $c _ { \\mathcal { G } _ { \\mathcal { L } } }$ . We concatenate the graph representations $\\mathbf { c } _ { \\mathcal { G } _ { \\mathcal { P } } }$ (Equation 1) of the protein and $c _ { \\mathcal { G } _ { \\mathcal { L } } }$ of the ligand, and use that as input to a MLP (with parameters $\\phi$ ) to obtain predictions, ",
489
+ "bbox": [
490
+ 173,
491
+ 790,
492
+ 825,
493
+ 873
494
+ ],
495
+ "page_idx": 3
496
+ },
497
+ {
498
+ "type": "equation",
499
+ "img_path": "images/adfe33b9064aa40806df526331111f1d1f0fd746866edafd566e3b1b75b4e345.jpg",
500
+ "text": "$$\ns _ { a } = \\mathrm { M L P } _ { \\phi } ( c _ { \\mathcal { G } _ { \\mathcal { P } } } , c _ { \\mathcal { G } _ { \\mathcal { L } } } ) .\n$$",
501
+ "text_format": "latex",
502
+ "bbox": [
503
+ 419,
504
+ 872,
505
+ 580,
506
+ 888
507
+ ],
508
+ "page_idx": 3
509
+ },
510
+ {
511
+ "type": "text",
512
+ "text": "The model is trained by minimizing the mean squared error. ",
513
+ "bbox": [
514
+ 173,
515
+ 896,
516
+ 566,
517
+ 912
518
+ ],
519
+ "page_idx": 3
520
+ },
521
+ {
522
+ "type": "image",
523
+ "img_path": "images/1518ae65077d66b5b2215419766472d99a9f67542e99ac93ec6d5410a8442047.jpg",
524
+ "image_caption": [
525
+ "Figure 2: Molecular Superpixels and Surface Features of the HIV-1 Protease (PDB ID: 2AVQ). a. Molecular superpixels, indicated by different colors $k = 2 0$ ), and the corresponding surface features, i.e., b. hydropathy, c. shape index, and d. free electrons. As highlighted, molecular superpixels are spatially compact and overlap with surface regions dominated by single features such as hydrophobic patches while capturing coherent areas across all surface features. The protein complex contains 198 residues. "
526
+ ],
527
+ "image_footnote": [],
528
+ "bbox": [
529
+ 205,
530
+ 87,
531
+ 818,
532
+ 218
533
+ ],
534
+ "page_idx": 4
535
+ },
536
+ {
537
+ "type": "text",
538
+ "text": "3.2.2 Enzyme-Catalyzed Reaction Classification ",
539
+ "text_level": 1,
540
+ "bbox": [
541
+ 173,
542
+ 343,
543
+ 519,
544
+ 358
545
+ ],
546
+ "page_idx": 4
547
+ },
548
+ {
549
+ "type": "text",
550
+ "text": "To predict the enzyme-catalyzed reaction class, we use the graph representation $\\mathbf { c } _ { \\mathcal { G } _ { \\mathcal { P } } }$ of the protein obtained via HOLOPROT as the input to a MLP (with parameters $\\phi$ ) to obtain the prediction logits, ",
551
+ "bbox": [
552
+ 173,
553
+ 367,
554
+ 823,
555
+ 395
556
+ ],
557
+ "page_idx": 4
558
+ },
559
+ {
560
+ "type": "equation",
561
+ "img_path": "images/016ef0499403ea4c714407f8eb4ce7d3bd9cbc83db31f7ba253ad9a2b9f73946.jpg",
562
+ "text": "$$\np _ { k } = \\mathrm { M L P } _ { \\phi } ( c _ { \\mathcal { G } } ) .\n$$",
563
+ "text_format": "latex",
564
+ "bbox": [
565
+ 437,
566
+ 406,
567
+ 560,
568
+ 424
569
+ ],
570
+ "page_idx": 4
571
+ },
572
+ {
573
+ "type": "text",
574
+ "text": "The model is trained by minimizing the cross-entropy loss. ",
575
+ "bbox": [
576
+ 173,
577
+ 428,
578
+ 560,
579
+ 444
580
+ ],
581
+ "page_idx": 4
582
+ },
583
+ {
584
+ "type": "text",
585
+ "text": "4 Superpixels on Molecular Surfaces ",
586
+ "text_level": 1,
587
+ "bbox": [
588
+ 173,
589
+ 462,
590
+ 496,
591
+ 479
592
+ ],
593
+ "page_idx": 4
594
+ },
595
+ {
596
+ "type": "text",
597
+ "text": "Protein surface manifolds are complex and represented via large meshes. In order to improve the computational and memory efficiency of our construction, we introduce the notion of molecular superpixels. Originally developed in computer vision [Ren and Malik, 2003, Mori et al., 2004, Kohli et al., 2009], superpixels are defined as perceptually uniform regions in the image. In the molecular context, we refer to superpixels as segments on the protein surface capturing higher-level fingerprint features and protein motifs such as hydrophobic binding sites. ",
598
+ "bbox": [
599
+ 173,
600
+ 492,
601
+ 825,
602
+ 577
603
+ ],
604
+ "page_idx": 4
605
+ },
606
+ {
607
+ "type": "text",
608
+ "text": "In order to apply the segmentation principle to three-dimensional molecular surfaces, we employ graph-based superpixel algorithms on triangulated surface meshes. The superpixel representation of the protein surface needs to satisfy several requirements, as (i.) molecular superpixels should not reduce the overall achievable performance of HOLOPROT, and (ii.) molecular superpixels need to form geometrically compact clusters, and overlap with surface regions that are coherent in physiological surface properties, e.g., capture hydrophobic binding sides or highly charged areas. Popular graph-based segmentation tools such as Felzenszwalb and Huttenlocher [2004, FH], mean shift [Comaniciu and Meer, 2002], and watershed [Vincent and Soille, 1991], however, produce non-compact superpixels of irregular sizes and shapes. By posing the segmentation task as a maximization problem on a graph maximizing over (i.) the entropy rate of the random walk on the surface graph $\\bar { \\mathcal { G } } s = ( \\gamma _ { S } , \\mathcal { E } _ { S } )$ favoring the formation of compact and homogeneous clusters, and (ii.) a balancing term encouraging clusters with similar sizes, the entropy rate superpixel (ERS) segmentation algorithm [Liu et al., 2011] outperforms previous methods across different tasks [Stutz et al., 2018] and achieves the desired properties of molecular superpixels. ",
609
+ "bbox": [
610
+ 173,
611
+ 582,
612
+ 825,
613
+ 776
614
+ ],
615
+ "page_idx": 4
616
+ },
617
+ {
618
+ "type": "text",
619
+ "text": "In order to incorporate geometric and chemical features of the surface $\\mathbf { F } _ { S }$ , we extend the surface graph $\\mathcal { G } _ { S } = ( \\nu _ { S } , \\mathcal { E } _ { S } )$ with a non-negative similarity measure $w$ , given as $\\begin{array} { r } { w _ { i j } = \\sum _ { \\mathbf { f } \\in \\mathbf { F } _ { \\mathcal { S } } } | \\mathbf { f } _ { v _ { i } } \\mathbf { f } _ { v _ { j } } | } \\end{array}$ for nodes $v _ { i }$ and $v _ { j }$ if connected by an edge $e _ { i j }$ . We simulate a random walk $\\mathbf { X } = \\{ X _ { t } | t \\in T , X _ { t } \\in \\mathcal { V } _ { S } \\}$ on a protein surface mesh, where the transition probability $p _ { i j }$ between two nodes $v _ { i }$ and $v _ { j }$ is defined as $p _ { i j } = P ( X _ { t + 1 } = v _ { j } | X _ { t } = v _ { i } ) = w _ { i j } / w _ { i }$ , where $\\begin{array} { r } { \\boldsymbol { w } _ { i } = \\sum _ { k : e _ { i k } \\in \\mathcal { E } _ { S } } \\boldsymbol { w } _ { i k } } \\end{array}$ .The corresponding stationary distributions of nodes $\\gamma _ { s }$ are given by ",
620
+ "bbox": [
621
+ 174,
622
+ 781,
623
+ 825,
624
+ 868
625
+ ],
626
+ "page_idx": 4
627
+ },
628
+ {
629
+ "type": "equation",
630
+ "img_path": "images/949b9a279b68db7832706d204afba2ed96d72ba3a20aebd39fc1bf52eec214db.jpg",
631
+ "text": "$$\n\\pmb { \\mu } = \\left( \\mu _ { 1 } , \\mu _ { 2 } , . . . , \\mu _ { | \\mathcal { V } s | } \\right) ^ { \\top } = \\left( \\frac { w _ { 1 } } { w _ { T } } , \\frac { w _ { 2 } } { w _ { T } } , . . . , \\frac { w _ { | \\mathcal { V } s | } } { w _ { T } } \\right) ^ { \\top } .\n$$",
632
+ "text_format": "latex",
633
+ "bbox": [
634
+ 310,
635
+ 872,
636
+ 686,
637
+ 910
638
+ ],
639
+ "page_idx": 4
640
+ },
641
+ {
642
+ "type": "text",
643
+ "text": "Molecular superpixels are then defined by a subset of edges $\\mathcal { M } \\subseteq \\mathcal { E } _ { S }$ such that the resulting graph, $\\mathcal { G } _ { S } = ( \\nu _ { S } , \\bar { \\mathcal { M } } )$ , contains exactly $k$ connected subgraphs. Computing molecular superpixels is achieved via optimizing the objective function with respect to the edge set $\\mathcal { M }$ ",
644
+ "bbox": [
645
+ 174,
646
+ 90,
647
+ 826,
648
+ 133
649
+ ],
650
+ "page_idx": 5
651
+ },
652
+ {
653
+ "type": "equation",
654
+ "img_path": "images/660e2c101c66713e38eca277160c8ed4fa84fa0323770da5eb192cfee6582e13.jpg",
655
+ "text": "$$\n\\operatorname* { m a x } _ { \\mathcal { M } } - \\sum _ { i } \\mu _ { i } \\sum _ { j } p _ { i j } ( \\mathcal { M } ) \\log \\left( p _ { i j } ( \\mathcal { M } ) \\right) - \\sum _ { i } p _ { Z _ { \\mathcal { M } } } ( i ) \\log \\left( p _ { Z _ { \\mathcal { M } } } ( i ) \\right) - n _ { \\mathcal { M } }\n$$",
656
+ "text_format": "latex",
657
+ "bbox": [
658
+ 251,
659
+ 135,
660
+ 748,
661
+ 169
662
+ ],
663
+ "page_idx": 5
664
+ },
665
+ {
666
+ "type": "text",
667
+ "text": "s.t. $\\mathcal { M } \\subseteq \\mathcal { E } _ { S }$ and $n _ { \\mathcal { M } } \\geq k$ , ",
668
+ "text_level": 1,
669
+ "bbox": [
670
+ 251,
671
+ 195,
672
+ 429,
673
+ 210
674
+ ],
675
+ "page_idx": 5
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "where $n _ { \\mathcal { M } }$ is the number of connected components in the graph, $p _ { Z _ { \\mathcal { M } } }$ denotes the distribution of cluster memberships $Z _ { \\mathcal { M } }$ , and $\\lambda \\geq 0$ is the weight of the balancing term. Both terms satisfy monotonicity and submodularity and can thus be efficiently optimized based on techniques from submodular optimization [Nemhauser et al., 1978]. For further details on the entropy rate superpixel algorithm, see Liu et al. [2011]. ",
680
+ "bbox": [
681
+ 173,
682
+ 213,
683
+ 825,
684
+ 282
685
+ ],
686
+ "page_idx": 5
687
+ },
688
+ {
689
+ "type": "text",
690
+ "text": "A molecular superpixel $m$ comprising $k$ surface vertices is then given as $\\mathbf { f } _ { m } = ( \\mathbf { f } _ { v _ { 1 } } , \\ldots , \\mathbf { f } _ { v _ { k } } )$ for all f $\\in \\mathbf { F } _ { \\mathcal { S } }$ . We summarize the feature representation of each molecular superpixel via the graph $\\mathcal { G _ { M } } = ( \\nu _ { \\mathcal { M } } , \\mathcal { E _ { M } } )$ , where each node $m \\in \\mathcal { V } _ { \\mathcal { M } }$ is represented via $( \\mathrm { m e a n } ( \\mathbf { f } _ { m } )$ , std $( \\mathbf { f } _ { m } )$ , $\\mathtt { m a x } ( \\mathbf { f } _ { m } )$ $\\mathfrak { m i n } ( \\mathbf { f } _ { m } ) )$ for all $\\mathbf { f } \\in \\mathbf { F } _ { \\mathcal { S } }$ and an edge $e \\in \\mathcal { E } _ { \\mathcal { M } }$ via the Wasserstein distance between neighboring superpixels. ",
691
+ "bbox": [
692
+ 173,
693
+ 287,
694
+ 825,
695
+ 358
696
+ ],
697
+ "page_idx": 5
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "Figure 2 demonstrates molecular superpixels for the enzyme HIV-1 protease [Brik and Wong, 2003]. Besides being spatially compact, superpixels overlap with surface regions dominated by single features such as hydrophobic patches, while capturing coherent areas across all surface features. Further examples of superpixels are displayed in Appendix ??. ",
702
+ "bbox": [
703
+ 174,
704
+ 364,
705
+ 825,
706
+ 420
707
+ ],
708
+ "page_idx": 5
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "5 Evaluation ",
713
+ "text_level": 1,
714
+ "bbox": [
715
+ 174,
716
+ 438,
717
+ 295,
718
+ 455
719
+ ],
720
+ "page_idx": 5
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "Successful protein engineering requires optimization of multiple objectives. When searching for a protein with desired functionality, auxiliary but crucial properties such as stability measured in terms of free energy of folding also need to be satisfied. Furthermore, the field is also subject to a plethora of potential tasks and applications. In order to capture the multi-objective and multi-task nature of protein engineering, we evaluate our method on two representative tasks: regression of the binding affinity between proteins and their ligands, and classification of enzyme proteins based on the type of reaction they catalyze. ",
725
+ "bbox": [
726
+ 174,
727
+ 468,
728
+ 825,
729
+ 566
730
+ ],
731
+ "page_idx": 5
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "5.1 Protein-Ligand Binding Affinity Prediction ",
736
+ "text_level": 1,
737
+ "bbox": [
738
+ 174,
739
+ 580,
740
+ 513,
741
+ 595
742
+ ],
743
+ "page_idx": 5
744
+ },
745
+ {
746
+ "type": "text",
747
+ "text": "Studying the interaction between proteins and small molecules is crucial for many downstream tasks, e.g., accelerating virtual screening for potential candidates in drug discovery or protein design to improve the output of an enzyme-catalyzed reaction. The architecture of the regression module is described in Equation 2. ",
748
+ "bbox": [
749
+ 174,
750
+ 606,
751
+ 825,
752
+ 661
753
+ ],
754
+ "page_idx": 5
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "Dataset. The PDBBIND database (version 2019) [Liu et al., 2017] is a collection of the experimentally measured binding affinity data for all types of biomolecular complexes deposited in the Protein Data Bank [Berman et al., 2000]. After quality filtering for resolution and surface construction, the refined subset comprises a total of 4, 709 biomolecular complexes. The binding affinity provided in PDBBIND is experimentally determined and expressed in molar units of the inhibition constant $( K _ { i } )$ or dissociation constant $( K _ { d } )$ . Similar to previous methods [Öztürk et al., 2018, Townshend et al., 2020], we do not distinguish both constants and predict negative log-transformed binding affinity $p K _ { d } / p K _ { i }$ . We split the dataset into training, test and validation splits based on the scaffolds of the corresponding ligands (scaffold), or a $30 \\%$ and a $60 \\%$ sequence identity threshold (identity $30 \\%$ , identity $60 \\%$ ) to limit homologous ligands or proteins appearing in both train and test sets. ",
759
+ "bbox": [
760
+ 173,
761
+ 675,
762
+ 825,
763
+ 814
764
+ ],
765
+ "page_idx": 5
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "Baselines. For evaluating the overall performance on the regression task, we compare HOLOPROT against several baselines including current state-of-the-art methods on both tasks. This comprises sequence-based methods [Öztürk et al., 2018, Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods based on the three-dimensional structure of proteins [Townshend et al., 2020, Hermosilla et al., 2021], and recent methods using geometric deep learning on protein molecular surfaces [Gainza et al., 2020]. ",
770
+ "bbox": [
771
+ 174,
772
+ 828,
773
+ 823,
774
+ 911
775
+ ],
776
+ "page_idx": 5
777
+ },
778
+ {
779
+ "type": "table",
780
+ "img_path": "images/733f62a83ced4a11f81ccceee5397fb93b2d3797cbae22e6616b652c872a8305.jpg",
781
+ "table_caption": [
782
+ "Table 1: Protein-Ligand Binding Affinity Prediction Results Comparison predictive performance of ligand binding affinity using the PDBbind dataset [Liu et al., 2017] of HOLOPROT against other methods. Results are reported for 3 experimental runs. "
783
+ ],
784
+ "table_footnote": [],
785
+ "table_body": "<table><tr><td>Model</td><td>#Params</td><td colspan=\"3\">Sequence Identity (30 %)</td><td colspan=\"3\">Sequence Identity (60 %)</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93M</td><td>1.866 ± 0.080</td><td>0.472 ± 0.022</td><td>0.471 ± 0.024</td><td>1.762 ± 0.261</td><td>0.666 ± 0.012</td><td>0.663 ± 0.015</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M 93.0M</td><td>1.985 ± 0.006</td><td>0.165 ± 0.006</td><td>0.152 ± 0.024</td><td>1.891 ± 0.004</td><td>0.249 ± 0.006</td><td>0.275 ± 0.008</td></tr><tr><td>Rao et al. [2019]</td><td>2.4M1</td><td>1.890 ± 0.035 1.544 ± 0.015</td><td>0.338 ± 0.044</td><td>0.286 ± 0.124 0.434± 0.058</td><td>1.633 ± 0.016 1.641 ± 0.016</td><td>0.568± 0.033</td><td>0.571 ± 0.021</td></tr><tr><td>Elnaggar et al.[2020] Surface-based Methods</td><td></td><td></td><td>0.438 ± 0.053</td><td></td><td></td><td>0.595 ± 0.014</td><td>0.588 ± 0.009</td></tr><tr><td>Gainza et al. [2020]</td><td>0.62M</td><td>1.484 ± 0.018</td><td>0.467 ± 0.020</td><td>0.455 ± 0.014</td><td>1.426 ± 0.017</td><td>0.709 ±0.008</td><td>0.701 ± 0.011</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Townshend et al. [2020]2</td><td></td><td>1.429 ± 0.042</td><td>0.541 ± 0.029</td><td>0.532 ± 0.033</td><td>1.450 ± 0.024</td><td>0.716 ± 0.008</td><td>0.714 ± 0.009</td></tr><tr><td>Townshend et al.[2020]3</td><td>5.80M</td><td>1.936 ± 0.120 1.554 ± 0.016</td><td>0.581 ± 0.039 0.414 ± 0.053</td><td>0.647± 0.071</td><td>1.493 ± 0.010 1.473 ± 0.024</td><td>0.669 ± 0.013</td><td>0.691± 0.010</td></tr><tr><td>Hermosilla et al. [2021]</td><td></td><td></td><td></td><td>0.428 ±0.032</td><td></td><td>0.667 ± 0.011</td><td>0.675 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>1.365 ± 0.038</td><td>0.749 ± 0.014</td><td>0.742 ± 0.011</td></tr><tr><td>HOLOPROT()</td><td>1.76 M</td><td>1.491 ± 0.004</td><td>0.491 ± 0.014</td><td>0.482 ± 0.017</td><td>1.416 ± 0.022</td><td>0.724 ± 0.011</td><td>0.715 ± 0.006</td></tr></table>",
786
+ "bbox": [
787
+ 176,
788
+ 138,
789
+ 856,
790
+ 314
791
+ ],
792
+ "page_idx": 6
793
+ },
794
+ {
795
+ "type": "table",
796
+ "img_path": "images/1a0199312c40b54b78cd25a0b9776e3b3d950a2ef5aed7c473e0ea2bb89b7630.jpg",
797
+ "table_caption": [],
798
+ "table_footnote": [
799
+ "full surface molecular superpixels "
800
+ ],
801
+ "table_body": "<table><tr><td>Model</td><td>#Params</td><td colspan=\"3\">Scaffold</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93 M</td><td>1.908 ± 0.145</td><td>0.384 ± 0.014</td><td>0.387 ± 0.016</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M</td><td>1.864 ± 0.009</td><td>0.269 ±0.002</td><td>0.285 ± 0.019</td></tr><tr><td>Rao et al. [2019]</td><td>93.0M</td><td>1.680 ± 0.055</td><td>0.487 ± 0.029</td><td>0.462 ± 0.051</td></tr><tr><td>Elnaggar et al. [2020]</td><td>2.4M1</td><td>1.592 ± 0.009</td><td>0.398 ± 0.027</td><td>0.409 ± 0.029</td></tr><tr><td>Surface-based Methods Gainza et al. [2020]</td><td>0.62 M</td><td>1.583 ± 0.132</td><td>0.416 ± 0.111</td><td>0.412 ± 0.126</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Hermosilla et al. [2021]</td><td>5.80M</td><td>1.592 ± 0.012</td><td>0.365 ± 0.024</td><td>0.373 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.523 ± 0.028</td><td>0.489 ± 0.019</td><td>0.491 ± 0.020</td></tr><tr><td>HOLOPROT()</td><td>1.28M</td><td>1.516 ± 0.014</td><td>0.491 ± 0.016</td><td>0.493 ± 0.014</td></tr></table>",
802
+ "bbox": [
803
+ 176,
804
+ 323,
805
+ 612,
806
+ 479
807
+ ],
808
+ "page_idx": 6
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "Evaluation metrics. For evaluating different methods, we use three metrics – root mean squared error (RMSE), Pearson correlation coefficient, and Spearman correlation coefficient. We also include the mean and standard deviation across 3 experimental runs. ",
813
+ "bbox": [
814
+ 176,
815
+ 516,
816
+ 825,
817
+ 558
818
+ ],
819
+ "page_idx": 6
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "Results. Table 1 displays the results on protein-ligand binding affinity. HOLOPROT $( \\circ , \\bullet )$ performs consistently well across different tasks and dataset splits, outperforming all methods on the splits scaffold and identity $60 \\%$ . On identity $30 \\%$ , our method outperforms most baselines, while having lower variability across the evaluated metrics. HOLOPROT with molecular superpixels $( \\bullet )$ performs similar to HOLOPROT on the entire surface, with no or little performance loss, suggesting that molecular superpixels capture meaningful biological motifs. We include the models from [Townshend et al., 2020] for completeness, but note that these models were trained only using the protein binding pocket. Binding sites on proteins are often structurally highly conserved regions [Panjkovich and Daura, 2010]. Considering only binding pockets, which vary less between the train and test splits, provides an additional simplification making the task less challenging. All other baselines were tested on the full proteins. ",
824
+ "bbox": [
825
+ 173,
826
+ 579,
827
+ 825,
828
+ 731
829
+ ],
830
+ "page_idx": 6
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "5.2 Enzyme-Catalyzed Reaction Classification ",
835
+ "text_level": 1,
836
+ "bbox": [
837
+ 174,
838
+ 752,
839
+ 508,
840
+ 768
841
+ ],
842
+ "page_idx": 6
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "Predicting the reaction class of enzymes without the use of sequence similarity allows for efficient screening of de novo proteins, i.e., macromolecules without evolutionary homologs, for catalytic properties [des Jardins et al., 1997]. The architecture of the classification module is described in Equation 3). ",
847
+ "bbox": [
848
+ 174,
849
+ 781,
850
+ 825,
851
+ 837
852
+ ],
853
+ "page_idx": 6
854
+ },
855
+ {
856
+ "type": "table",
857
+ "img_path": "images/80b805565079930b3aed1a8c61bc355e6b0eb44f5c9631d388460a7743368fde.jpg",
858
+ "table_caption": [
859
+ "Table 2: Enzyme-Catalyzed Reaction Classification Results Comparison of classification accuracy of HOLOPROT against other methods. "
860
+ ],
861
+ "table_footnote": [
862
+ "full surface molecular superpixels "
863
+ ],
864
+ "table_body": "<table><tr><td>Model</td><td>Parameters</td><td>Reaction Class Accuracy</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td></tr><tr><td>Hou et al. [2018]</td><td>41.7M</td><td>70.9 %</td></tr><tr><td>Bepler and Berger [2019]</td><td>31.7 M</td><td>66.7 %</td></tr><tr><td>Rao et al.[2019] (Transformer)</td><td>38.4M</td><td>69.8 %</td></tr><tr><td>Elnaggar et al. [2020]</td><td>420.0M</td><td>72.2 %</td></tr><tr><td>Structure-basedMethods</td><td></td><td></td></tr><tr><td>Kipf and Welling [2017]</td><td>1.0 M</td><td>67.3 %</td></tr><tr><td>Derevyanko et al. [2018]</td><td>6.0M</td><td>78.8 %</td></tr><tr><td>Hermosilla et al. [2021]</td><td>9.8M</td><td>87.2 %</td></tr><tr><td>HOLOPROT(O)</td><td>0.64M</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>0.64 M</td><td>78.9 %</td></tr></table>",
865
+ "bbox": [
866
+ 284,
867
+ 131,
868
+ 712,
869
+ 325
870
+ ],
871
+ "page_idx": 7
872
+ },
873
+ {
874
+ "type": "text",
875
+ "text": "Dataset. Enzyme Commission (EC) numbers constitute an ontological system with the purpose of defining and organizing enzyme functions [Webb, 1992]. The four digits of an EC number are related in a functional hierarchy, where the first level annotates the main enzymatic classes, while the next levels constitute subclasses, e.g. the EC number of the HIV-1 protease is 3.4.23.16. This task aims at predicting the enzyme-catalyzed reaction class of a protein based on according to all four levels of the EC number. We use the same dataset and splits as provided by [Hermosilla et al., 2021], comprising 37, 428 proteins from 384 EC numbers, with 29, 215 instances for training, 2, 562 instances for validation, and 5, 651 for testing. For more details on dataset construction, we refer to Hermosilla et al. [2021, Appendix C]. ",
876
+ "bbox": [
877
+ 173,
878
+ 375,
879
+ 825,
880
+ 500
881
+ ],
882
+ "page_idx": 7
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "Baselines. For the classification task, we again compare HOLOPROT against several baselines including sequence-based methods [Hou et al., 2018], methods partially pretrained on millions of sequences [Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods utilizing principles of geometric deep learning [Kipf and Welling, 2017, Derevyanko et al., 2018, Hermosilla et al., 2021]. The values for different baselines are taken from [Hermosilla et al., 2021]. ",
887
+ "bbox": [
888
+ 174,
889
+ 513,
890
+ 825,
891
+ 583
892
+ ],
893
+ "page_idx": 7
894
+ },
895
+ {
896
+ "type": "text",
897
+ "text": "Evaluation metric. Model performance is measured via the mean accuracy score. ",
898
+ "bbox": [
899
+ 176,
900
+ 598,
901
+ 722,
902
+ 612
903
+ ],
904
+ "page_idx": 7
905
+ },
906
+ {
907
+ "type": "text",
908
+ "text": "Results. We report the results of enzyme-catalyzed reaction classification in Table 2. While our method $( \\circ , \\bullet )$ is unable to outperform the current state-of-the-art method [Hermosilla et al., 2021], we achieve equivalent, if not better results to other methods at a fraction of the parameters used. Molecular superpixels also capture biologically meaningful protein surface motifs, as evidenced by a small increase in the overall classification performance. ",
909
+ "bbox": [
910
+ 174,
911
+ 627,
912
+ 826,
913
+ 696
914
+ ],
915
+ "page_idx": 7
916
+ },
917
+ {
918
+ "type": "text",
919
+ "text": "5.3 Ablation Studies ",
920
+ "text_level": 1,
921
+ "bbox": [
922
+ 174,
923
+ 713,
924
+ 328,
925
+ 728
926
+ ],
927
+ "page_idx": 7
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "To further evaluate the contribution of HOLOPROT to learning multi-scale protein representations, we conduct several ablation studies. First, we analyze if the performance of the multi-scale model outperforms its isolated components, i.e. when using only structure or surface representation for subsequent downstream tasks. The second ablation axis analyzes the construction of molecular superpixel representations. Besides computing summary features for each molecular superpixel as described in Section 4, we learn patch representations via a MPN on the superpixel graph. The ablation study were conducted on both tasks, ligand binding affinity (Section 5.1) and enzyme catalytic function classification (Section 5.2). ",
932
+ "bbox": [
933
+ 174,
934
+ 738,
935
+ 825,
936
+ 849
937
+ ],
938
+ "page_idx": 7
939
+ },
940
+ {
941
+ "type": "text",
942
+ "text": "As displayed in Table 3, HOLOPROT with $( \\bullet )$ and without molecular superpixels ( ) improve over the performance of structure and surface representations. Further, the results of the ablation study clearly show that different protein scales are more relevant for particular downstream tasks, e.g., predicting the enzyme-catalyzed reaction class from surface only results in poor performance. We further see no ",
943
+ "bbox": [
944
+ 176,
945
+ 856,
946
+ 823,
947
+ 911
948
+ ],
949
+ "page_idx": 7
950
+ },
951
+ {
952
+ "type": "table",
953
+ "img_path": "images/4318a3796cb6f0456dbcb1b5dcaf7881657e33cdeef0c4828de4cb38a48e035a.jpg",
954
+ "table_caption": [
955
+ "Table 3: Ablation Studies Results Evaluation of architectural design choices of HOLOPROT by analyzing the performance of its individual components as well as feature summarization of molecular superpixels. "
956
+ ],
957
+ "table_footnote": [
958
+ "full surface ? molecular superpixels molecular superpixel with MPN "
959
+ ],
960
+ "table_body": "<table><tr><td>Model</td><td colspan=\"3\">Ligand Binding Affinity Sequence Identity (30 %)</td><td>Enzyme Class</td></tr><tr><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>Accuracy</td></tr><tr><td>Structure</td><td>1.476 ± 0.027</td><td>0.51 ± 0.029</td><td>0.503 ± 0.027</td><td>74.2 %</td></tr><tr><td>Surface</td><td>1.482 ± 0.015</td><td>0.512 ± 0.022</td><td>0.505 ± 0.017</td><td>28.6 %</td></tr><tr><td>HOLOPROT(O)</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.004</td><td>0.491 ±0.014</td><td>0.482 ± 0.017</td><td>78.9 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.027</td><td>0.503 ±0.005</td><td>0.492 ± 0.004</td><td>75.7 %</td></tr></table>",
961
+ "bbox": [
962
+ 236,
963
+ 138,
964
+ 759,
965
+ 261
966
+ ],
967
+ "page_idx": 8
968
+ },
969
+ {
970
+ "type": "text",
971
+ "text": "improvement in applying a MPN within a molecular superpixel ( ) over using summary features ( ). \nFurther ablation studies are presented in Appendix ??. ",
972
+ "bbox": [
973
+ 176,
974
+ 309,
975
+ 823,
976
+ 337
977
+ ],
978
+ "page_idx": 8
979
+ },
980
+ {
981
+ "type": "text",
982
+ "text": "5.4 Limitations ",
983
+ "text_level": 1,
984
+ "bbox": [
985
+ 174,
986
+ 353,
987
+ 294,
988
+ 368
989
+ ],
990
+ "page_idx": 8
991
+ },
992
+ {
993
+ "type": "text",
994
+ "text": "Despite the reported success of HOLOPROT, our method faces some limitations. First, HOLOPROT relies on existing protein structures and the corresponding generated surface manifolds. However, protein sequence data still remains the most abundant data source, and in protein design, conformations of mutated macromolecules are unknown. This limitation could however be partly remedied, (i.) by the recent advancements in protein structure prediction [Senior et al., 2020, Jumper et al., 2021, AlphaFold] [Baek et al., 2021, RoseTTAFold] and protein structure determination methods such as cryo-electron microscopy [Callaway, 2020], and (ii.) by utilizing homology modeling algorithms on available wild type structures for mutant analysis [Schymkowitz et al., 2005]. Second, our method requires precomputed surface meshes, resulting in an additional preprocessing step before deploying HOLOPROT to the desired application. This bottleneck can be bypassed by utilizing techniques developed in the concurrent work by Sverrisson et al. [2020], which allow computation and sampling of the molecular surface on-the-fly. ",
995
+ "bbox": [
996
+ 173,
997
+ 378,
998
+ 826,
999
+ 545
1000
+ ],
1001
+ "page_idx": 8
1002
+ },
1003
+ {
1004
+ "type": "text",
1005
+ "text": "6 Conclusion ",
1006
+ "text_level": 1,
1007
+ "bbox": [
1008
+ 174,
1009
+ 564,
1010
+ 299,
1011
+ 580
1012
+ ],
1013
+ "page_idx": 8
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "In this work, we present a novel multi-scale protein graph construction, HOLOPROT, which integrates finer and coarser representation details of a protein by connecting sequence and structure with surface. We further establish molecular superpixels, which capture higher-level fingerprint motifs on the protein surface, improving the memory efficiency of our construction without reducing the overall performance. We validate HOLOPROT’s effectiveness and versatility through representative tasks on protein-ligand binding affinity and enzyme-catalyzed reaction class prediction. While being significantly more parameter-efficient, HOLOPROT performs consistently well across different tasks and dataset splits, partly outperforming current state-of-the-art methods. This will potentially be of great benefit and advantage when working with datasets of reduced size, e.g., comprising experiments on mutational fitness of proteins, thus opening up new possibilities within protein engineering and design, which we leave for future work. ",
1018
+ "bbox": [
1019
+ 174,
1020
+ 594,
1021
+ 825,
1022
+ 747
1023
+ ],
1024
+ "page_idx": 8
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "Acknowledgments ",
1029
+ "text_level": 1,
1030
+ "bbox": [
1031
+ 176,
1032
+ 767,
1033
+ 328,
1034
+ 784
1035
+ ],
1036
+ "page_idx": 8
1037
+ },
1038
+ {
1039
+ "type": "text",
1040
+ "text": "This project received funding from the Swiss National Science Foundation under the National Center of Competence in Research (NCCR) Catalysis under grant agreement 51NF40 180544. Moreover, we thank Mojmír Mutný and Clemens Isert for their valuable feedback. ",
1041
+ "bbox": [
1042
+ 176,
1043
+ 797,
1044
+ 825,
1045
+ 839
1046
+ ],
1047
+ "page_idx": 8
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "text": "References ",
1052
+ "text_level": 1,
1053
+ "bbox": [
1054
+ 174,
1055
+ 859,
1056
+ 266,
1057
+ 876
1058
+ ],
1059
+ "page_idx": 8
1060
+ },
1061
+ {
1062
+ "type": "text",
1063
+ "text": "M. Baek, F. DiMaio, I. Anishchenko, J. Dauparas, S. Ovchinnikov, G. R. Lee, J. Wang, Q. Cong, L. N. Kinch, R. D. Schaeffer, et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science, 373(6557), 2021. ",
1064
+ "bbox": [
1065
+ 178,
1066
+ 883,
1067
+ 821,
1068
+ 911
1069
+ ],
1070
+ "page_idx": 8
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "",
1075
+ "bbox": [
1076
+ 191,
1077
+ 92,
1078
+ 557,
1079
+ 106
1080
+ ],
1081
+ "page_idx": 9
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "F. Baldassarre, D. Menéndez Hurtado, A. Elofsson, and H. Azizpour. GraphQA: protein model quality assessment using graph convolutional networks. Bioinformatics, 37(3), 2021. ",
1086
+ "bbox": [
1087
+ 173,
1088
+ 114,
1089
+ 823,
1090
+ 143
1091
+ ],
1092
+ "page_idx": 9
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "T. Bepler and B. Berger. Learning Protein Sequence Embeddings using Information From Structure. In International Conference on Learning Representations (ICLR), 2019. ",
1097
+ "bbox": [
1098
+ 171,
1099
+ 151,
1100
+ 823,
1101
+ 181
1102
+ ],
1103
+ "page_idx": 9
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "H. M. Berman, J. Westbrook, Z. Feng, G. Gilliland, T. N. Bhat, H. Weissig, I. N. Shindyalov, and P. E. Bourne. The Protein Data Bank. Nucleic Acids Research, 28(1), 2000. ",
1108
+ "bbox": [
1109
+ 171,
1110
+ 189,
1111
+ 823,
1112
+ 219
1113
+ ],
1114
+ "page_idx": 9
1115
+ },
1116
+ {
1117
+ "type": "text",
1118
+ "text": "A. Brik and C.-H. Wong. HIV-1 protease: mechanism and drug discovery. Organic & Biomolecular Chemistry, 1(1), 2003. ",
1119
+ "bbox": [
1120
+ 169,
1121
+ 227,
1122
+ 825,
1123
+ 256
1124
+ ],
1125
+ "page_idx": 9
1126
+ },
1127
+ {
1128
+ "type": "text",
1129
+ "text": "E. Callaway. ’It will change everything’: DeepMind’s AI makes gigantic leap in solving protein structures. Nature, 2020. ",
1130
+ "bbox": [
1131
+ 171,
1132
+ 263,
1133
+ 825,
1134
+ 294
1135
+ ],
1136
+ "page_idx": 9
1137
+ },
1138
+ {
1139
+ "type": "text",
1140
+ "text": "V. Cantoni, R. Gatti, and L. Lombardi. Segmentation of SES for Protein Structure Analysis. In Bioinformatics, 2010. ",
1141
+ "bbox": [
1142
+ 173,
1143
+ 301,
1144
+ 825,
1145
+ 332
1146
+ ],
1147
+ "page_idx": 9
1148
+ },
1149
+ {
1150
+ "type": "text",
1151
+ "text": "V. Cantoni, R. Gatti, and L. Lombardi. 3D Protein Surface Segmentation through Mathematical Morphology. In International Joint Conference on Biomedical Engineering Systems and Technologies. Springer, 2011. ",
1152
+ "bbox": [
1153
+ 176,
1154
+ 339,
1155
+ 825,
1156
+ 382
1157
+ ],
1158
+ "page_idx": 9
1159
+ },
1160
+ {
1161
+ "type": "text",
1162
+ "text": "D. Comaniciu and P. Meer. Mean Shift: A Robust Approach Toward Feature Space Analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5), 2002. ",
1163
+ "bbox": [
1164
+ 173,
1165
+ 390,
1166
+ 823,
1167
+ 420
1168
+ ],
1169
+ "page_idx": 9
1170
+ },
1171
+ {
1172
+ "type": "text",
1173
+ "text": "M. L. Connolly. Solvent-accessible surfaces of proteins and nucleic acids. Science, 221(4612), 1983. ",
1174
+ "bbox": [
1175
+ 169,
1176
+ 428,
1177
+ 826,
1178
+ 444
1179
+ ],
1180
+ "page_idx": 9
1181
+ },
1182
+ {
1183
+ "type": "text",
1184
+ "text": "A. Dalkiran, A. S. Rifaioglu, M. J. Martin, R. Cetin-Atalay, V. Atalay, and T. Dogan. ECPred: a tool ˘ for the prediction of the enzymatic functions of protein sequences based on the EC nomenclature. BMC Bioinformatics, 19(1), 2018. ",
1185
+ "bbox": [
1186
+ 174,
1187
+ 452,
1188
+ 820,
1189
+ 494
1190
+ ],
1191
+ "page_idx": 9
1192
+ },
1193
+ {
1194
+ "type": "text",
1195
+ "text": "G. Derevyanko, S. Grudinin, Y. Bengio, and G. Lamoureux. Deep convolutional networks for quality assessment of protein folds. Bioinformatics, 34(23), 2018. ",
1196
+ "bbox": [
1197
+ 171,
1198
+ 503,
1199
+ 823,
1200
+ 534
1201
+ ],
1202
+ "page_idx": 9
1203
+ },
1204
+ {
1205
+ "type": "text",
1206
+ "text": "M. des Jardins, P. D. Karp, M. Krummenacker, T. J. Lee, and C. A. Ouzounis. Prediction of enzyme classification from protein sequence without the use of sequence similarity. In Proceedings. International Conference on Intelligent Systems for Molecular Biology, volume 5, 1997. ",
1207
+ "bbox": [
1208
+ 173,
1209
+ 540,
1210
+ 825,
1211
+ 584
1212
+ ],
1213
+ "page_idx": 9
1214
+ },
1215
+ {
1216
+ "type": "text",
1217
+ "text": "P. D. Dobson and A. J. Doig. Predicting Enzyme Class From Protein Structure Without Alignments. Journal of Molecular Biology, 345(1), 2005. ",
1218
+ "bbox": [
1219
+ 169,
1220
+ 592,
1221
+ 825,
1222
+ 622
1223
+ ],
1224
+ "page_idx": 9
1225
+ },
1226
+ {
1227
+ "type": "text",
1228
+ "text": "A. Elnaggar, M. Heinzinger, C. Dallago, G. Rihawi, Y. Wang, L. Jones, T. Gibbs, T. Feher, C. Angerer, D. Bhowmik, et al. ProtTrans: Towards Cracking the Language of Life’s Code Through SelfSupervised Deep Learning and High Performance Computing. arXiv Preprint, 2020. ",
1229
+ "bbox": [
1230
+ 176,
1231
+ 630,
1232
+ 825,
1233
+ 672
1234
+ ],
1235
+ "page_idx": 9
1236
+ },
1237
+ {
1238
+ "type": "text",
1239
+ "text": "P. F. Felzenszwalb and D. P. Huttenlocher. Efficient Graph-Based Image Segmentation. International Journal of Computer Vision, 59(2), 2004. ",
1240
+ "bbox": [
1241
+ 174,
1242
+ 681,
1243
+ 823,
1244
+ 710
1245
+ ],
1246
+ "page_idx": 9
1247
+ },
1248
+ {
1249
+ "type": "text",
1250
+ "text": "M. Fessenden. Protein maps chart the causes of disease. Nature, 549(7671), 2017. ",
1251
+ "bbox": [
1252
+ 173,
1253
+ 718,
1254
+ 714,
1255
+ 734
1256
+ ],
1257
+ "page_idx": 9
1258
+ },
1259
+ {
1260
+ "type": "text",
1261
+ "text": "A. Fout, J. Byrd, B. Shariat, and A. Ben-Hur. Protein Interface Prediction using Graph Convolutional Networks. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017. ",
1262
+ "bbox": [
1263
+ 169,
1264
+ 742,
1265
+ 823,
1266
+ 772
1267
+ ],
1268
+ "page_idx": 9
1269
+ },
1270
+ {
1271
+ "type": "text",
1272
+ "text": "P. Gainza, F. Sverrisson, F. Monti, E. Rodola, D. Boscaini, M. Bronstein, and B. Correia. Deciphering interaction fingerprints from protein molecular surfaces using geometric deep learning. Nature Methods, 17(2), 2020. ",
1273
+ "bbox": [
1274
+ 174,
1275
+ 780,
1276
+ 823,
1277
+ 823
1278
+ ],
1279
+ "page_idx": 9
1280
+ },
1281
+ {
1282
+ "type": "text",
1283
+ "text": "J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural Message Passing for Quantum Chemistry. In International Conference on Machine Learning (ICML), 2017. ",
1284
+ "bbox": [
1285
+ 173,
1286
+ 830,
1287
+ 823,
1288
+ 861
1289
+ ],
1290
+ "page_idx": 9
1291
+ },
1292
+ {
1293
+ "type": "text",
1294
+ "text": "V. Gligorijevic, P. D. Renfrew, T. Kosciolek, J. K. Leman, K. Cho, T. Vatanen, D. Berenberg, B. Taylor, I. M. Fisk, R. J. Xavier, R. Knight, and R. Bonneau. Structure-Based Function Prediction using Graph Convolutional Networks. Nature Communications, 12(1), 2021. ",
1295
+ "bbox": [
1296
+ 174,
1297
+ 868,
1298
+ 826,
1299
+ 912
1300
+ ],
1301
+ "page_idx": 9
1302
+ },
1303
+ {
1304
+ "type": "text",
1305
+ "text": "A. Golovin and K. Henrick. MSDmotif: exploring protein sites and motifs. BMC Bioinformatics, 9 (1), 2008. \nP. Hermosilla, M. Schäfer, M. Lang, G. Fackelmann, P.-P. Vázquez, B. Kozlikova, M. Krone, T. Ritschel, and T. Ropinski. Intrinsic-Extrinsic Convolution and Pooling for Learning on 3D Protein Structures. In International Conference on Learning Representations (ICLR), 2021. \nJ. Hou, B. Adhikari, and J. Cheng. DeepSF: deep convolutional neural network for mapping protein sequences to folds. Bioinformatics, 34(8), 2018. \nJ. Jiménez, M. Skalic, G. Martinez-Rosell, and G. De Fabritiis. KDEEP: Protein–Ligand Absolute Binding Affinity Prediction via 3D-Convolutional Neural Networks. Journal of Chemical Information and Modeling, 58(2), 2018. \nW. Jin, R. Barzilay, and T. Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In International Conference on Machine Learning, pages 4839–4848. PMLR, 2020. \nJ. Jumper, R. Evans, A. Pritzel, T. Green, M. Figurnov, O. Ronneberger, K. Tunyasuvunakool, R. Bates, A. Žídek, A. Potapenko, et al. Highly accurate protein structure prediction with AlphaFold. Nature, 596(7873), 2021. \nT. N. Kipf and M. Welling. Semi-Supervised Classification with Graph Convolutional Networks. In International Conference on Learning Representations (ICLR), 2017. \nP. Kohli, P. H. Torr, et al. Robust Higher Order Potentials for Enforcing Label Consistency. International Conference on Computer Vision (ICCV), 82(3), 2009. \nT. Lei, W. Jin, R. Barzilay, and T. Jaakkola. Deriving Neural Architectures from Sequence and Graph Kernels. In International Conference on Machine Learning (ICML), 2017. \nM.-Y. Liu, O. Tuzel, S. Ramalingam, and R. Chellappa. Entropy Rate Superpixel Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011. \nZ. Liu, M. Su, L. Han, J. Liu, Q. Yang, Y. Li, and R. Wang. Forging the Basis for Developing Protein–Ligand Interaction Scoring Functions. Accounts of Chemical Research, 50(2), 2017. \nG. Mori, X. Ren, A. A. Efros, and J. Malik. Recovering Human Body Configurations: Combining Segmentation and Recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2004. \nG. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions. Mathematical programming, 14(1), 1978. \nH. Öztürk, A. Özgür, and E. Ozkirimli. DeepDTA: deep drug–target binding affinity prediction. Bioinformatics, 34(17), 2018. \nA. Panjkovich and X. Daura. Assessing the structural conservation of protein pockets to study functional and allosteric sites: implications for drug discovery. BMC structural biology, 10(1): 1–14, 2010. \nM. Ragoza, J. Hochuli, E. Idrobo, J. Sunseri, and D. R. Koes. Protein–ligand scoring with convolutional neural networks. Journal of chemical information and modeling, 57(4):942–957, 2017. \nR. Rao, N. Bhattacharya, N. Thomas, Y. Duan, X. Chen, J. Canny, P. Abbeel, and Y. S. Song. Evaluating Protein Transfer Learning with TAPE. In Advances in Neural Information Processing Systems (NeurIPS), 2019. \nX. Ren and J. Malik. Learning a Classification Model for Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2003. \nM. F. Sanner, A. J. Olson, and J.-C. Spehner. Reduced Surface: An Efficient Way to Compute Molecular Surfaces. Biopolymers, 38(3), 1996. \nJ. Schymkowitz, J. Borg, F. Stricher, R. Nys, F. Rousseau, and L. Serrano. The FoldX web server: an online force field. Nucleic Acids Research, 33, 2005. \nA. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, C. Qin, A. Žídek, A. W. Nelson, A. Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792), 2020. \nM. M. Stepniewska-Dziubinska, P. Zielenkiewicz, and P. Siedlecki. Improving detection of proteinligand binding sites with 3d segmentation. Scientific Reports, 10(1), 2020. \nD. Stutz, A. Hermans, and B. Leibe. Superpixels: An evaluation of the state-of-the-art. Computer Vision and Image Understanding, 166, 2018. \nF. Sverrisson, J. Feydy, B. Correia, and M. Bronstein. Fast end-to-end learning on protein surfaces. bioRxiv, 2020. \nR. Townshend, R. Bedi, P. Suriana, and R. Dror. End-to-End Learning on 3D Protein Structure for Interface Prediction. Advances in Neural Information Processing Systems (NeurIPS), 32, 2019. \nR. J. Townshend, M. Vögele, P. Suriana, A. Derry, A. Powers, Y. Laloudakis, S. Balachandar, B. Anderson, S. Eismann, R. Kondor, et al. ATOM3D: Tasks On Molecules in Three Dimensions. NeurIPS Workshop of Learning Meaningful Representations of Life (LMRL), 2020. \nL. Vincent and P. Soille. Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations. IEEE Computer Architecture Letters, 13(06), 1991. \nE. C. Webb. Enzyme Nomenclature 1992. Recommendations of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology on the Nomenclature and Classification of Enzymes. Academic Press, 1992. \nK. K. Yang, Z. Wu, and F. H. Arnold. Machine-learning-guided directed evolution for protein engineering. Nature Methods, 16(8), 2019. ",
1306
+ "bbox": [
1307
+ 169,
1308
+ 56,
1309
+ 828,
1310
+ 921
1311
+ ],
1312
+ "page_idx": 10
1313
+ },
1314
+ {
1315
+ "type": "text",
1316
+ "text": "",
1317
+ "bbox": [
1318
+ 169,
1319
+ 92,
1320
+ 828,
1321
+ 463
1322
+ ],
1323
+ "page_idx": 11
1324
+ }
1325
+ ]
parse/train/-xEk43f_EO6/-xEk43f_EO6_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/-xEk43f_EO6/-xEk43f_EO6_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/3Aoft6NWFej/3Aoft6NWFej.md ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PMI-MASKING: PRINCIPLED MASKING OF CORRELATED SPANS
2
+
3
+ Yoav Levine Barak Lenz Opher Lieber Omri Abend
4
+
5
+ Kevin Leyton-Brown Moshe Tennenholtz Yoav Shoham
6
+
7
+ AI21 Labs, Tel Aviv, Israel
8
+
9
+ {yoavl,barakl,opherl,omria,...}@ai21.com
10
+
11
+ # ABSTRACT
12
+
13
+ Masking tokens uniformly at random constitutes a common flaw in the pretraining of Masked Language Models (MLMs) such as BERT. We show that such uniform masking allows an MLM to minimize its training objective by latching onto shallow local signals, leading to pretraining inefficiency and suboptimal downstream performance. To address this flaw, we propose PMI-Masking, a principled masking strategy based on the concept of Pointwise Mutual Information (PMI), which jointly masks a token $n$ -gram if it exhibits high collocation over the corpus. PMIMasking motivates, unifies, and improves upon prior more heuristic approaches that attempt to address the drawback of random uniform token masking, such as whole-word masking, entity/phrase masking, and random-span masking. Specifically, we show experimentally that PMI-Masking reaches the performance of prior masking approaches in half the training time, and consistently improves performance at the end of training.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ In the couple of years since BERT was introduced in a seminal paper by Devlin et al. (2019a), Masked Language Models (MLMs) have rapidly advanced the NLP frontier (Sun et al., 2019; Liu et al., 2019; Joshi et al., 2020; Raffel et al., 2019). At the heart of the MLM approach is the task of predicting a masked subset of the text given the remaining, unmasked text. The text itself is broken up into tokens, each token consisting of a word or part of a word; thus “chair” constitutes a single token, but out-of-vocabulary words like “e-igen-val-ue” are broken up into several sub-word tokens. In BERT, $1 5 \%$ of tokens are chosen to be masked uniformly at random. It is the random choice of single tokens that we address in this paper: we show that this approach is suboptimal and offer a principled alternative.
18
+
19
+ To see why Random-Token Masking is suboptimal, consider the special case of sub-word tokens. Given the masked sentence “To approximate the matrix, we use the eigenvector corresponding to its largest e-[mask]-val-ue”, an MLM will quickly learn to predict “igen” based only on the context “e[mask]-val-ue”, rendering the rest of the sentence redundant. The question is whether the network will also learn to relate the broader context to the tokens comprising “eigenvalue”. When they are masked together, the network is forced to do so, but such masking occurs with vanishingly small probability. One might hypothesize that the network would nonetheless be able to piece such meaning together from local cues; however, we show that it often struggles to do so.
20
+
21
+ We establish this via a controlled experiment, in which we reduced the size of the vocabulary, thereby breaking more words into sub-word tokens. We compared the extent to which such vocabulary reduction degraded regular BERT relative to so-called Whole-Word Masking BERT (WWBERT) (Devlin et al., 2019b), a version of BERT that jointly masks all sub-word tokens comprising an out-of-vocabulary word during training. We show that vanilla BERT’s performance degrades much more rapidly than that of WWBERT as the vocabulary size shrinks. The intuitive explanation is that Random-Token Masking is wasteful; it overtrains on easy sub-word tasks (such as predicting “igen”) and undertrains on harder whole-word tasks (predicting “eigenvalue”).
22
+
23
+ The advantage of Whole-Word Masking over Random-Token Masking is relatively modest for standard vocabularies, because out-of-vocabulary words are rare. However, the tokenization of words is a very special case of a much broader statistical linguistic phenomenon of collocation: the cooccurrence of series of tokens at levels much greater than would be predicted simply by their individual frequencies in the corpus. There are millions of collocated word $n$ -grams — multi-word expressions, phrases, and other common word combinations — whereas there are only tens of thousands of words in frequent use. So it is reasonable to hypothesize that Random-Token Masking generates many wastefully easy problems and too few usefully harder problems because of multiword collocations, and that this affects performance even more than the rarer case of tokenized words; we show that this indeed is the case.
24
+
25
+ Several prior works have considered the idea of masking across spans longer than a single word. Sun et al. (2019) and Guu et al. (2020) proposed Knowledge Masking and Salient Span Masking, respectively, in which tokens comprising entities or phrases, as identified by external parsers, are jointly masked. While extending the scope of Whole-Word Masking, the restriction to specific types of correlated $n$ -grams, along with the reliance on imperfect tools for their identification, has limited the gains achievable by these approaches. With a similar motivation in mind, SpanBERT of Joshi et al. (2020) introduced Random-Span Masking, which masks word spans of lengths sampled from a geometric distribution at random positions in the text. Random-Span Masking was shown to consistently outperform Knowledge Masking, is simple to implement, and inspired prominent MLMs (Raffel et al., 2019). However, while Random-Span Masking increases the chances of masking collocations, with high probability the selected spans break up correlated n-grams, such that the prediction task can often be performed by relying on local cues.
26
+
27
+ In this paper we offer a principled approach to masking spans that consistently provide high signal, unifying the intuitions behind the above approaches while also outperforming them. Our approach, dubbed PMI-Masking, uses Pointwise Mutual Information (PMI) to identify collocations, which we then mask jointly. At a high level, PMI-Masking consists of two stages. First, given any pretraining corpus, we identify a set of contiguous $n$ -grams that exhibit high cooccurrence probability relative to the individual occurrence probabilities of their components. We for
28
+
29
+ ![](images/61899b510f84d853a68448677ec1542dfe191ab01c3bd9672a10266c688770cb.jpg)
30
+ Figure 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with different masking schemes, evaluated every 200K steps during pretraining.
31
+
32
+ malize this notion by proposing an extended definition of Pointwise Mutual Information from bigrams to longer $n$ -grams. Second, we treat these collocated $n$ -grams as single units; the masking strategy selects at random both from these units and from standard tokens that do not participate in such units. Figure 1, detailed and reinforced by further experiments in section 5, shows that (1) PMI-Masking dramatically accelerates training, matching the end-of-pretraining performance of existing approaches in roughly half of the training time; and (2) PMI-Masking improves upon previous masking approaches at the end of pretraining.
33
+
34
+ # 2 MOTIVATION: MLMS ARE SENSITIVE TO TOKENIZATION
35
+
36
+ In this section we describe a simple experiment that motivates our PMI-Masking approach. We examined BERT’s ability to learn effective representations for words consisting of multiple subword tokens, treating this setting as an easily controlled analogue for the multi-word collocation problem that truly interests us. Our experiment sought to assess the performance gain obtained from always masking whole words as opposed to masking each individual token uniformly at random. We compared performance across a range of vocabulary sizes, using the same WordPiece Tokenizer1 that produced the original vocabulary of $\sim 3 0 \mathrm { K }$ tokens. As we decreased a 30K-token vocabulary to 10K and 2K tokens, the average length of a word over the pretraining corpus increased from 1.08 tokens to 1.22 and 2.06 tokens, respectively. Thus, by reducing the vocabulary size, we increased the frequency of multi-token words by a large factor.
37
+
38
+ Table 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with Random-Token and Whole-Word masking schemes and with different vocabulary sizes (30K; 10K; 2K).
39
+
40
+ <table><tr><td></td><td>1.08 tokens per word (30K vocabulary)</td><td>1.22 tokens per word (10K vocabulary)</td><td>2.06 tokens per word (2K vocabulary)</td></tr><tr><td>Random-Token Masking</td><td>79.3</td><td>77.8</td><td>72.8</td></tr><tr><td>Whole-Word Masking</td><td>79.7</td><td>79.5</td><td>77.6</td></tr></table>
41
+
42
+ Table 1 presents the performance of BERT models trained with these vocabularies, measured as score on the SQuAD2.0 development set (the experimental setup is described in section 4). The downstream performance of Random-Token Masking substantially degraded as vocabulary size decreased and the number of spans of sub-word tokens increased. One reason for such degradation might be the model seeing less text as context (512 input tokens cover less text when more words are broken into multiple tokens). This possibly plays a role; however, for models with the same vocabularies trained via Whole-Word Masking, this degradation was significantly attenuated. We therefore conjecture that this degradation occurred primarily because of the random masking strategy, which allows the model to use “shortcuts” for minimizing its loss, thus hindering its ability to learn the distribution of the entire multi-token word.
43
+
44
+ If our conjecture is correct, such shortcuts are just as problematic in the case of inter-word collocations. In fact, for the regular 30K-token vocabulary, divided words are rare, so inter-word collocations would pose a larger problem than intra-word collocations in the common setting. One possible mitigation might be to expand the vocabulary to include multi-word collocations. However, there are millions of these, and such vocabulary sizes are currently infeasible. Even if we could get around the practical issue of size, this approach may suffer from generalization problems: the frequency of each multi-word collocation can be lower than the sample complexity for learning a meaningful representation. An alternative, more practical approach is to leave the vocabulary as is, but jointly mask co-located words, with the intention of cutting off local statistical “shortcuts” and allowing the model to improve further by learning from broader context. This is the approach we take in this paper. In what follows we detail such a masking approach and show its advantages experimentally.
45
+
46
+ # 3 MASKING CORRELATED $n$ -GRAMS
47
+
48
+ # 3.1 EXISTING MASKING APPROACHES
49
+
50
+ We now more formally present the MLM setup as well as existing masking approaches, which we implement as baselines. Given text tokenized into a sequence of tokens, Masked Language Models are trained to predict a set fraction of “masked” tokens, where this fraction is called the masking budget and is traditionally set to $1 5 \%$ . The modified input is inserted into the Transformer-based architecture (Vaswani et al., 2017) of BERT, and the pretraining task is to predict the original identity of each chosen token. Several alternatives have been proposed for choosing the set of tokens to mask.
51
+
52
+ Random-Token Masking (Devlin et al., 2019a) The original BERT implementation selects tokens for masking independently at random, where $80 \%$ of the $1 5 \%$ chosen tokens are replaced with [MASK], $10 \%$ are replaced with a random token, and $10 \%$ are kept unchanged.
53
+
54
+ Whole-Word Masking (Devlin et al., 2019b) The sequence of input tokens is segmented into units corresponding to whole words. Tokens for masking are then chosen by sampling entire units at random until the masking budget is met. Following Devlin et al. (2019a), for $8 0 \% / 1 0 \% / 1 0 \%$ of the units, all tokens are replaced with [MASK]tokens/ random tokens/ the original tokens, respectively.
55
+
56
+ Random-Span Masking (Joshi et al., 2020) Contiguous random spans are selected iteratively until the $1 5 \%$ masking budget is spent. At each iteration, a span length (in words) is sampled from a geometric distribution $\ell \sim \mathrm { G e o } ( 0 . 2 )$ , and capped at 10 words. Then, the starting point for the span to be masked is randomly selected. Replacement with [MASK], random, or original tokens is done as above, where spans constitute the units.
57
+
58
+ # 3.2 PMI: FROM BIGRAMS TO $n$ -GRAMS
59
+
60
+ Our aim is to define a masking strategy that targets correlated sequences of tokens in a principled way. Of course, modeling such correlations in large corpora was widely studied in computational linguistics (Zuidema (2006); Ramisch et al. (2012); inter alia). Particularly relevant to our work is the notion of Pointwise Mutual Information (Fano, 1961), which quantifies how often two events occur, compared with what we would expect if they were independent. Define the probability of any $n$ -gram as the number of its occurrences in the corpus divided by the number of all the $n$ -grams in the corpus. PMI leverages these probabilities to give a natural measure of collocation of bigrams: how surprising the bigram $w _ { 1 } w _ { 2 }$ is, given the unigram probabilities of $w _ { 1 }$ and $w _ { 2 }$ . Formally, given two tokens $w _ { 1 }$ and $w _ { 2 }$ , the PMI of the bigram “ $\cdot _ { w _ { 1 } w _ { 2 } }$ ” is
61
+
62
+ $$
63
+ \mathrm { P M I } ( w _ { 1 } w _ { 2 } ) = \log \frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) } .
64
+ $$
65
+
66
+ Importantly, PMI is qualitatively different from pure frequency: a relatively frequent bigram may not have a very high PMI score, and vice versa. For example, the bigram “book is” appears 34772 times in the WIKIPEDIA $+ \mathbf { B }$ OOKCORPUS dataset but is ranked around position 760K in the PMI ranking for bi-grams over this corpus, while the bigram “boolean algebra” appears 849 times in the corpus but is ranked around position 16K in the PMI ranking.
67
+
68
+ What about contiguous spans of more than two tokens? For a given $n$ -gram, we would again like to measure how strongly its components indicate one another. We thus require a measure that captures correlations among more than two variables. A standard and direct extension of the PMI measure to more than two variables, referred to as ‘specific correlation’ in Van de Cruys (2011), and as ‘Naive$\mathrm { P M I } _ { n } $ in this paper, is based on the ratio between the $n$ -gram’s probability and the probabilities of its component unigrams:
69
+
70
+ $$
71
+ \mathrm { N a i v e \mathrm { - } P M I } _ { n } ( w _ { 1 } \ldots w _ { n } ) = \log { \frac { p ( w _ { 1 } \ldots w _ { n } ) } { \prod _ { j = 1 } ^ { n } p ( w _ { j } ) } }
72
+ $$
73
+
74
+ As in the bivariate case, this measure compares the actual empirical probability of the $n$ -gram in the corpus with the probability it would have if its components occurred independently. However, the above definition suffers from an inherent flaw: an $n$ -gram’s Naive- $\mathrm { P M I } _ { n }$ will be high if it contains a segment with high PMI, even if that segment is not particularly correlated with the rest of the $n$ -gram. Consider for example the case of trigrams:
75
+
76
+ $$
77
+ \begin{array} { r } { \operatorname { i v e - P M I } _ { 3 } ( w _ { 1 } w _ { 2 } w _ { 3 } ) = \log \{ \frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) p ( w _ { 3 } ) } \cdot \frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } w _ { 2 } ) } \} = \operatorname { P M I } ( w _ { 1 } w _ { 2 } ) + \log \frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } w _ { 2 } ) p ( w _ { 3 } ) } } \end{array}
78
+ $$
79
+
80
+ Where $\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is defined in eq. 1. When $\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is high, the Naive- $\mathrm { P M I _ { 3 } }$ measure of the trigram “w1w2w3” will start at this high baseline. The added term of log p(w1w2w3)p(w1w2)p(w3) quantifies the actual added information of “ $w _ { 3 } \mathrm { ^ { , } }$ to this correlated bigram, i.e., it quantifies how far $p ( w _ { 1 } w _ { 2 } w _ { 3 } )$ is from being separable w.r.t. the segmentation into $" w _ { 1 } w _ { 2 } "$ and $^ { 6 6 } w _ { 3 } \ '$ . For example, since the PMI of the bigram “Kuala Lumpur” is very high, the Naive- $\mathrm { P M I } _ { n }$ of the trigram “Kuala Lumpur is” is misleadingly high, placing it at position 43K out of all trigrams in the WIKIPEDIA $^ +$ BOOKCORPUS dataset. It is in fact placed much higher than obvious collocations such as the trigram “editor in chief ”, which is ranked at position 210K out of all trigrams.
81
+
82
+ In order to favor $n$ -grams that cannot be easily subdivided into shorter unrelated spans, we propose a measure of distance from separability with respect to all of an $n$ -gram’s possible segmentations rather than with respect only to the segmentation into single tokens:
83
+
84
+ $$
85
+ \operatorname { \mathbf { P M I } } _ { n } ( w _ { 1 } \dots w _ { n } ) = \operatorname* { m i n } _ { \substack { \sigma \in \sec ( w _ { 1 } \dots w _ { n } ) } } \log \frac { p ( w _ { 1 } \dots w _ { n } ) } { \prod _ { s \in \sigma } p ( s ) }
86
+ $$
87
+
88
+ Here, $\sec ( w _ { 1 } \ldots w _ { n } )$ is the set of all contiguous segmentations of the $n$ -gram $^ { \bullet } w _ { 1 } \ldots w _ { n } ^ { \quad \bullet }$ (excluding the identity segmentation), where any segmentation $\sigma \in \sec ( w _ { 1 } \ldots w _ { n } )$ is composed of sub-spans which together give $^ { } w _ { 1 } \dots w _ { n } ^ { \quad \prime \prime }$ . Intuitively, this measure effectively discards the contribution of high PMI segments; the minimum in Eq. 3 implies that an $n$ -gram’s collocation score is given by its weakest link, i.e., by the segmentation that is closest to separability. When ranked by the above $\mathrm { P M I } _ { n }$ measure, the trigram “Kuala Lumpur is” is demoted to position 1.6M, since the segmentation into “Kuala Lumpur” and “is” yields unrelated segments, while the trigram “editor in chief ” is upgraded to position 33K since its segmentations yield correlated components. As we will see, this definition is not only conceptually cleaner, but also leads to improved performance.
89
+
90
+ # 3.2.1 PMI-MASKING
91
+
92
+ We implement our strategy of treating highly collocating $n$ -grams as units for masking by assembling a list of $n$ -grams as a masking vocabulary in parallel to the 30K-token vocabulary. Specifically, we make use of the entire pretraining corpus for compiling a list of collocations. We consider word $n$ -grams of lengths 2–5 having over 10 occurrences in the corpus, and include the highest ranking collocations over the corpus, as measured via our proposed $\mathrm { P M I } _ { n }$ measure (Eq. 3). Noticing that the $\mathrm { P M I } _ { n }$ measure is sensitive to the length of the $n$ -gram, we assemble per-length rankings for each $n \in \{ 2 , 3 , 4 , 5 \}$ , and integrate these rankings to compose the masking vocabulary. After conducting a preliminary evaluation of how an $n$ -gram’s quality as a collocation degrades with its $\mathrm { P M I } _ { n }$ rank (detailed in the appendix), we chose the masking vocabulary size to be 800K, for which approximately half of pretraining corpus tokens were identified as part of some correlated $n$ -gram.
93
+
94
+ In order to get some sense of the differences between the attained masking vocabulary and prior approaches, we annotated a random sample of 500 bigrams and 500 trigrams from the masking vocabulary with Entity/Not-Entity labels. We found that only around $14 \%$ of the entries in the bigrams/trigrams lists were annotated as entities, while the rest are other types of collocations. Moreover, we found that while named entities are very prevalent at the very top of the list, they are scarce otherwise. By refining the view into highest and lowest ranking PMI bigram groups, we get that $50 \%$ of the top $20 \%$ are entities while only $1 \%$ of the bottom $20 \%$ are entities, and similar trends are attained for trigrams. This breakdown can illuminate a natural intuition regarding high ranking PMI n-grams representing entities (employed also by previous works (Downey et al., 2007; Korkontzelos et al., 2008)) – indeed the top ranking PMI entries are largely entities. But we chose a much larger PMI-based masking vocabulary (see appendix 1 on the process of choosing its size), and the proportion of entities drops to around 1/7, with many of the added entries representing other types of collocations (the annotated lists are given as supplementary material).
95
+
96
+ After composing the masking vocabulary, we treat its entries as units to be masked together. All input tokens not identified with entries from the masking vocabulary are treated independently as units for masking according to the Whole-Word Masking scheme. If one masking vocabulary entry contains another entry in a given input, we treat the larger one as the unit for masking, e.g., if the masking vocabulary contains the $n$ -grams “the united states”, “air force”, and “the united states air force”, the latter will be one unit for masking when it appears. In the case of overlapping entries, we choose one at random as a unit for masking and treat the remaining tokens as independent units, e.g., if the input text contains “by the way out” and the masking vocabulary contains the $n$ -grams “by the way” and “the way out”, we can choose either “by the way” and “out” or “by” and “the way out” as units for masking.
97
+
98
+ After we segment the sequence of input tokens into units for masking, we then choose tokens for masking by sampling units uniformly at random until $1 5 \%$ of the tokens (the standard tokens of the 30K-token vocabulary) in the input are selected. As in the prior methods, replacement with [MASK] $( 8 0 \% )$ , random $( 1 0 \% )$ , or original $( 1 0 \% )$ ) tokens is done at the unit level.
99
+
100
+ # 4 EXPERIMENTAL SETUP
101
+
102
+ To evaluate the impact of PMI-Masking, we trained Base-sized BERT models (Devlin et al., 2019a) with each of the masking schemes presented in Section 3. Rather than relying on existing implementations for baseline masking schemes, which vary in training specifics, we reimplemented each scheme within the same framework used to train our PMI-Masked models. For control, we trained within the same framework models with Naive-PMI-Masking and Frequency-Masking, following the procedure described above for PMI-Masking, but ranking by the Naive- $\mathrm { P M I } _ { n }$ measure (Eq. 2) and by pure-frequency, respectively. In Section 5, we compare our PMI-Masking to all internallytrained masking schemes (Table 2) as well as with externally released models (Table 3).
103
+
104
+ # 4.1 PRETRAINING
105
+
106
+ We trained uncased models with a 30K-sized vocabulary that we constructed over WIKIPEDIA +BOOKCORPUS via the WordPiece Tokenizer used in BERT. We omitted the Next Sentence Prediction task, as it was shown to be superfluous (Joshi et al., 2020), and trained only on the Masked Language Model task during pretraining. We trained with a sequence length of 512 tokens, batch size of 256, and a varying number of steps detailed in Section 5. For pretraining, after a warmup of 10, 000 steps we used a linear learning rate decay, therefore models that ran for a different overall amount of steps are not precisely comparable after a given amount of steps. We set remaining parameters to values similar to those used in the original BERT pretraining, detailed in the appendix.
107
+
108
+ We performed the baseline pretraining over the original corpus used to train BERT: the 16GB WIKIPEDIA $^ +$ BOOKCORPUS dataset. We show that PMI-Masking achieved even larger performance gains relative to the baselines when training over more data, by adding the 38GB OPENWEBTEXT (Gokaslan & Cohen, 2019) dataset, an open-source recreation of the WebText corpus described in Radford et al. (2019). As described in section 3, we compose our $\mathrm { P M I } _ { n }$ -based masking vocabulary according to the pretraining corpus in use.
109
+
110
+ # 4.2 EVALUATION
111
+
112
+ We evaluate our pretrained models on two question answering benchmarks: the Stanford Question Answering Dataset (SQuAD) and the ReAding Comprehension from Examinations (RACE), as well as on the General Language Understanding Evaluation (GLUE) benchmark. Additionally, we report the Single-Token perplexity of our pretrained models.
113
+
114
+ • SQuAD (Rajpurkar et al., 2016) has served as a major question answering benchmark for pretrained models. It provides a paragraph of context and a question, and the task is to answer the question by extracting the relevant span from the context. We focus on the latest more challenging variant, SQuAD2.0 (Rajpurkar et al., 2018), in which some questions are not answered in the provided context, and the task includes identifying such cases.
115
+ • RACE (Lai et al., 2017) is a large-scale reading comprehension dataset collected from English examinations in China, designed for middle and high school students. Each passage is associated with multiple questions; for each, the task is to select one correct answer from four options. RACE has significantly longer context than other popular reading comprehension datasets and the proportion of questions that requires reasoning is very large.
116
+ GLUE (Wang et al., 2018) 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. For full details, please see the appendix.
117
+ • Single-Token perplexity We evaluate an MLM’s ability to predict single-tokens by measuring perplexity over a held out test set of 110K tokens from OPENWEBTEXT. For each test example, a single token for prediction is masked and the remainder of the input tokens are unmasked.
118
+
119
+ In Tables 2 and 3, for every downstream task we swept 8 different hyperparameter configurations (batch sizes $\in \{ 1 6 , 3 2 \}$ and learning rates $\in \{ 1 , 2 , 3 , 5 \} \cdot 1 0 ^ { - 5 } )$ . We report the best median development set score over five random initializations per hyper-parameter. When applicable, the model with this score was evaluated on the test set. The development set score of each configuration was attained by fine-tuning the model over 4 epochs (SQuAD2.0 and RACE) or 3 epochs (all GLUE tasks except RTE and $\mathrm { S T S } - 1 0 $ epochs) and performing early stopping based on each task’s evaluation metric on the development set. In the preliminary experiments of Table 1, and in Figures 1 and 2 for which we evaluate many pretraining checkpoints per model, we report the average of the three middle scores out of 5 random initializations for a single set of hyper-parameters (batch size 32 and learning rate $3 \cdot 1 0 ^ { - 5 }$ ).
120
+
121
+ ![](images/a330be6b915f032bf993f3d195b0eb70a2212df4db8582f2f24c8755393a4e35.jpg)
122
+ 2.4M steps on Wikipedia+BookCorpus (16G)
123
+
124
+ ![](images/ff22dcce96e5e9216ef4ff439dc18b2fe7fbdf4dfa322a2b8548b6d65f135296.jpg)
125
+ Figure 2: Scores on $\mathrm { S Q u A D 2 . 0 }$ development set of BERTBASE models trained for $2 . 4 \mathbf { M }$ steps, as done by Joshi et al. (2020) when proposing Random-Span Masking. Left: PMI-Masking efficiently elicits information from limited data. Right: More data, PMI-Masking continues to improve. See numerical scores in the appendix, along with the same trends on the RACE benchmark.
126
+
127
+ # 5 EXPERIMENTAL RESULTS
128
+
129
+ We evaluated the different masking strategies in two key ways. First, we measured their effect on downstream performance throughout pretraining to assess how efficiently they used the pretraining phase. Second, we more exhaustively evaluated downstream performance of different approaches at the end of pretraining. We examine how the advantage of PMI-Masking is affected by the size of the pretraining corpus and by amount of examples seen during pretraining (batch size $\times$ training steps).
130
+
131
+ # 5.1 EVALUATING DOWNSTREAM PERFORMANCE THROUGHOUT PRETRAINING
132
+
133
+ By examining the model’s downstream performance after each 200K steps of pretraining, we demonstrate that PMI-Masking speeds up MLM training. Figure 1 investigates the standard BERT setting of pretraining on the Wikipedia $^ +$ BookCorpus dataset for 1M training steps with batch size 256. It shows that the PMI-Masking method clearly outperformed a variety of prior approaches, as well as the baseline pure frequency based masking, on the SQuAD2.0 development set for all examined checkpoints (these patterns are consistent on RACE, see detailed scores in the appendix). PMIMasking achieved the score of Random-Span Masking, the best of the existing approaches, after roughly half as many steps of pretraining.
134
+
135
+ We ran a second experiment that increased the number of steps from 1M to 2.4M, while maintaining the batch size and the pretraining corpus; this was the setting used by Joshi et al. (2020) when proposing Random-Span Masking. We observed that while PMI-masking learned much more quickly, it eventually reached a plateau, and Random-Span Masking caught up after enough training steps. Figure 2 (left) details these results.
136
+
137
+ Finally, we increased the amount of training data by adding the OPENWEBTEXT corpus $( \sim 3 . 5 \times$ more data). Figure 2 (right) demonstrates that the plateau we previously observed in PMIMasking’s performance was due to limited training data. When training for $2 . 4 \mathbf { M }$ training steps on the Wikipedia+BookCorpus $+$ OpenWebText dataset, PMI-masking reached the same score that Random-Span Masking did at the end of training after roughly half of the pretraining, and continued to improve. Thus, PMI-Masking definitively outperformed Random-Span masking in a scenario where data was not a bottleneck, as is ideally the case in MLM pretraining (Raffel et al., 2019).
138
+
139
+ # 5.2 EVALUATING DOWNSTREAM PERFORMANCE AFTER PRETRAINING
140
+
141
+ Table 2 shows that after pretraining was complete, PMI-Masking outperformed prior masking approaches in downstream performance on the SQuAD2.0, RACE, and GLUE benchmarks. In agreement with Figure 2, for longer pretraining (2.4M training steps) the absolute advantage of PMIMasking is boosted across all tasks when pretraining over a larger corpus (adding OPENWEBTEXT). The table also shows that Naive-PMI Masking, based on the straightforward extension in eq. 2 to the standard bivariate PMI, significantly falls behind our more nuanced definition in eq. 3, and is often on par with Random-Span Masking.
142
+
143
+ Table 2: Dev/Test performance on the SQuAD, RACE, and GLUE benchmarks of BERT Base sized models pretrained and evaluated according to section 4. We report EM (exact match) and F1 scores for SQuAD2 and accuracy for RACE. For GLUE we report the average scores on the development set and the official leaderboard scores on the test set (see the per-task scores in the appendix).
144
+
145
+ <table><tr><td>BERTBasewith different maskings</td><td colspan="2">SQuAD2.0 EM F1</td><td>RACE Acc.</td><td>GLUE Avg</td></tr><tr><td>1M training steps on WIKIPEDIA+BOOKCORPUS(16G):</td><td colspan="4"></td></tr><tr><td>Random-Token Masking</td><td colspan="4">76.4/- 79.6/-</td></tr><tr><td>Random-Span Masking Naive-PMI-Masking</td><td>77.1/-</td><td>80.3/-</td><td>67.8/66.2 68.6/66.9 69.7/67.8</td><td>83.1/- 83/-</td></tr><tr><td>PMI-Masking</td><td>78.2/- 78.5/-</td><td>81.3/- 81.4/-</td><td>70.1/68.4</td><td>84.1/- 84.1/-</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS(16G)</td><td colspan="4"></td></tr><tr><td>Random-Span Masking</td><td>79.7/80.0</td><td>82.7/82.8</td><td>71.9/69.5</td><td>84.8/79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>80.3/80.2</td><td>83.2/83.2</td><td>71.7/69.8</td><td>84.5/80.0</td></tr><tr><td>PMI-Masking</td><td>80.2/80.9</td><td>83.3/ 83.6</td><td>72.3/70.9</td><td>84.7/80.3</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT(54G):</td><td colspan="4"></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>80.1/80.4</td><td>83.2/83.3</td><td>74.0/72.2</td><td>85.1/80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>80.4/80.0</td><td>83.3/83.0</td><td>73.9/71.4</td><td>85.6/80.3</td></tr><tr><td>PMI-Masking</td><td>80.9/82.0</td><td>83.9/84.9</td><td>74.8/73.2</td><td>86.0/80.8</td></tr></table>
146
+
147
+ Table 3: Comparing the RACE scores of our PMI-Masked models with comparable published Basesized models. The scores of prior MLMs were attained by finetuning released models in the same setup of the PMI-Masked models (Section 4), except for those marked in $^ { \bullet } \dag ^ { \bullet }$ , reported in Zhang & Li (2020). The number of examples reflects the amounts of text examined during training, as all prior models train over the same sequence length as our PMI-Masked models, namely 512. AMBERT was trained over WIKIPEDIA $^ +$ OPENWEBTEXT (47G), SpanBERT over WIKIPEDIA $^ +$ BOOKCORPUS (16G), and RoBERTa over WIKIPEDIA $^ +$ BOOKCORPUS $^ +$ OPENWEBTEXT $^ +$ STORIES $^ +$ CCNEWS (160G – see details in Liu et al. (2019)).
148
+
149
+ <table><tr><td>PMI vsPrior BASE MLMs</td><td>Corpus size</td><td>Batch × Steps = Examples</td><td>RACE dev/test</td></tr><tr><td> PMI vs n-grams in vocabulary</td><td></td><td></td><td></td></tr><tr><td>AMBERT (Zhang&amp; Li, 2020)</td><td>47G</td><td>1024 × 0.5M= 512G</td><td>68.9†/66.8t</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 ×1M =256M</td><td>70.1/68.4</td></tr><tr><td>PMI vs Random-Span Masking</td><td></td><td></td><td></td></tr><tr><td>SpanBERTBASE (Joshi et al., 2020)</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>70.5/68.7</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>72.3/70.9</td></tr><tr><td colspan="4">PMI vs Random-Token Masking with 3X more data and 6X more training examples</td></tr><tr><td>RoBERTaBAsE (Liu et al.,2019)</td><td>160G</td><td>8K × 0.5M=4G</td><td>74.9/73</td></tr><tr><td>PMI-Masking</td><td>54G</td><td>256 × 2.4M= 614.4M</td><td>74.8/73.2</td></tr></table>
150
+
151
+ We also compared our PMI-Masking Base-sized models to published Base-sized models (Table 3), and again saw PMI-Masking increase both pretraining efficiency and end-of-training downstream performance. Zhang & Li (2020) trained their ‘AMBERT’ model over a vocabulary of $n$ -grams in parallel to the regular word/subword level vocabulary, performing the hard task of $n$ -gram prediction in parallel to the easy Random-Token level prediction task during pretraining. This approach yielded a model with $7 5 \%$ more parameters than the common Base size of our PMI-Masking model. By using the PMI-masking scheme on a regular BERT architecture and vocabulary, we attained a significantly higher score on the RACE benchmark, despite training over a corpus $3 \times$ smaller and showing the model $2 \times$ fewer examples during pretraining.
152
+
153
+ Joshi et al. (2020) and Liu et al. (2019) only reported scores for SpanBERT and RoBERTa (respectively) for Large-sized models in their original papers, but did release weights for Base-sized models. We fine-tuned these models on the RACE development set via the same fine-tuning procedure we employed for our PMI-Masking models (described in Section 4), and evaluated the best performing model on the publicly available RACE test set. A PMI-Masking Base-sized model scored more than 2 points higher than the SpanBERTBASE trained by Random-Span Masking over the same pretraining corpus when shown the same number of examples. Remarkably, a PMI-Masking Base-sized model scored slightly higher than RoBERTaBASE trained by Random-Token Masking, even though RoBERTa was given access to a pretraining corpus $3 \times$ larger and shown $6 \times$ more training examples.
154
+
155
+ Lastly, we note that the measure of Single-Token perplexity is not indicative of downstream performance, when reported for models trained with different masking schemes. Comparing the adjacent table with the downstream evaluation of the same models in Table 2, it is clear that the ability to predict single tokens from context is not correlated with performance. This reinforces our observation that by minimizing their training objective, standard MLMs, which mask tokens randomly, train to excel on relatively many easy tasks that do not reflect the knowledge required for downstream understanding.
156
+
157
+ Table 4: The Single-Token perplexity of MLMs trained for 1M steps over WIKI+BOOKCORPUS.
158
+
159
+ <table><tr><td colspan="2">Single-Token Perplexity</td></tr><tr><td>Random-Token Masking</td><td>2.96</td></tr><tr><td>Random-Span Masking</td><td>4.30</td></tr><tr><td>Naive-PMI-Masking</td><td>7.35</td></tr><tr><td>PMI-Masking</td><td>21.85</td></tr></table>
160
+
161
+ # 6 CONCLUSION
162
+
163
+ Bidirectional language models hold the potential to unlock greater signal from the training data than unidirectional models (such as GPT). BERT-based MLMs are historically the first (and still the most prominent) implementation of inherently bidirectional language models, but they come at a price. A hint of this price is the fact that Single-Token perplexity, which captures the ability to predict single tokens and which has a natural probabilistic interpretation in the autoregressive unidirectional case, ceases to correlate with downstream performance across different MLMs (see Table 4). This means that the original MLM task, which is focused on single token prediction, should be reconsidered. This has been the focus of this paper, which points to the inefficiency of random-token masking, and offers PMI-masking as an alternative with several advantages: (i) It is a principled approach, based on a nuanced extension of binary PMI to the n-ary case. (ii) It leads to better downstream performance, for example it surpasses RoBERTa (which uses vanilla random token masking) on the challenging reading comprehension RACE test with $6 \times$ less training over a $3 \times$ smaller corpus, and it dominates the more naive, heuristic approach of random span masking at any point during pretraining, matches its end-of-training performance halfway during its own pretraining, and at the end of training improves on it by 1-2 points across a variety of downstream tasks. Perhaps due to their conceptual simplicity, unidirectional models were the first to break the 100B parameter limit with the recent GPT3 (Brown et al., 2020). Bidirectional models will soon follow, and this paper can accelerate their development by offering a way to significantly lower their training costs while boosting performance.
164
+
165
+ # REFERENCES
166
+
167
+ Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. In Proceedings of the second PASCAL challenges workshop on recognising textual entailment, pp. 6–4, 2006. 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. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task ˜ 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In International Workshop on Semantic Evaluation (SemEval), pp. 1–14, Vancouver, Canada, 2017. Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Springer, 2005.
168
+
169
+ 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), 2019a.
170
+
171
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Original bert github repository. https://github.com/google-research/bert, 2019b.
172
+
173
+ William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
174
+
175
+ Doug Downey, Matthew Broadhead, and Oren Etzioni. Locating complex named entities in web text. In Proceedings of the 20th International Joint Conference on Artifical Intelligence, IJCAI’07, pp. 2733–2739, San Francisco, CA, USA, 2007. Morgan Kaufmann Publishers Inc.
176
+
177
+ R.M Fano. Transmission of Information: A Statistical Theory of Communications. Transmission of Information: A Statistical Theory of Communications. M.I.T. Press, 1961. ISBN 9780262060011. URL https://books.google.co.il/books?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ VSYIAQAAIAAJ.
178
+
179
+ 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, 2007.
180
+
181
+ Aaron Gokaslan and Vanya Cohen. Openwebtext corpus, 2019.
182
+
183
+ Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
184
+
185
+ Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64–77, 2020.
186
+
187
+ Ioannis Korkontzelos, Ioannis P Klapaftis, and Suresh Manandhar. Reviewing and evaluating automatic term recognition techniques. In International Conference on Natural Language Processing, pp. 248–259. Springer, 2008.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. arXiv preprint, 2019.
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018.
202
+
203
+ Carlos Ramisch, Vitor De Araujo, and Aline Villavicencio. A broad evaluation of techniques for automatic acquisition of multiword expressions. In Proceedings of ACL 2012 Student Research Workshop, pp. 1–6, 2012.
204
+
205
+ 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), pp. 1631–1642, 2013.
206
+
207
+ 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.
208
+
209
+ Tim Van de Cruys. Two multivariate generalizations of pointwise mutual information. In Proceedings of the Workshop on Distributional Semantics and Compositionality, pp. 16–20, 2011.
210
+
211
+ 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 (NIPS), 2017.
212
+
213
+ 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. arXiv preprint arXiv:1804.07461, 2018.
214
+
215
+ Alex Wang, Amapreet 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), 2019.
216
+
217
+ Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471, 2018.
218
+
219
+ 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), pp. 1112–1122, 2018.
220
+
221
+ Xinsong Zhang and Hang Li. Ambert: A pre-trained language model with multi-grained tokenization. arXiv preprint arXiv:2008.11869, 2020.
222
+
223
+ Willem Zuidema. What are the productive units of natural language grammar? a dop approach to the automatic identification of constructions. In Proceedings of the Tenth Conference on Computational Natural Language Learning (CoNLL-X), pp. 29–36, 2006.
224
+
225
+ ![](images/0f865b35f9f01980623319a1c0c0de56d8e5ec7d6509b5db275085772b6d88c3.jpg)
226
+ Figure 3: Quality measures of top ranking $\mathrm { P M I } _ { n }$ $n$ -grams lists increased in increments of 50K. The masking vocabulary size was chosen such that it includes as many $n$ -grams labeled as collocation as possible, while not including too many $n$ -grams labeled as not a collocation, in an internally constructed test set detailed below. $r$ is the percent of all positively labeled examples from the test set that appear within the given list (recall), $c$ is the percent of all negatively labeled examples from the test set that do not appear within the given list (complement-recall). We aim for a list size for which both $r$ and $c$ are high enough, and employ $f$ as a measure for this, finally choosing a list size of $8 0 0 \mathrm { K }$ .
227
+
228
+ # A DETERMINING THE MASKING VOCABULARY SIZE
229
+
230
+ The $\mathrm { P M I } _ { n }$ measure, defined in eq. 3, provides an $n$ -gram ranking function that is intended to rank an $n$ -gram higher if its components are more indicative of one another. However, this measure alone is not enough for composing a masking vocabulary: we need to decide on its size $M$ (the masking vocabulary will be composed of the top- $M$ ranked $n$ -grams). One could advocate for an ablation study in which $M$ is varied, and models are pretrained per $M$ and evaluated. This can be done in future work, and perhaps an even stronger result can be shown for PMI-Masking with masking vocabulary size chosen by such optimization.
231
+
232
+ As a proxy, we determined the masking vocabulary size $M$ via a small scale evaluation of an $n$ - gram’s “collocation quality” as a function of its $\mathrm { P M I } _ { n }$ rank. Specifically, we created an ad hoc test set composed of $1 0 0 0 ~ n$ -grams that we labeled either as collocation or not a collocation (available upon request). We did that by choosing at random 10 words with frequency above 10000 in WIKIPEDIA $^ +$ BOOKCORPUS, and for each word sampled 25 $n$ -grams per length $n \in \{ 2 , 3 , 4 , 5 \}$ that contain it. Finally, we manually labeled each collected $n$ -gram, where the textbook definition of collocation was given to the annotators (the annotator agreement was $80 \%$ over 100 shared examples).
233
+
234
+ Then, we increased a list size $M$ in steps of $5 0 \mathrm { K }$ , adding $n$ -grams from the top ranking $\mathrm { P M I } _ { n }$ downwards. For each $M$ -sized list we computed two different scores on the test set. The first is the recall of the positive examples in the list, denoted $r$ : the percent of all positively labeled examples from the test set that appear within the given list. The second is the recall of the negative examples in the complement of the list, dubbed complement-recall, denoted $c$ : the percent of all negatively labeled examples from the test set that do not appear within the given list. By these definitions, the recall $r$ starts low and increases with list size and the complement-recall $c$ follows an opposite trend, as can be seen in Figure 3. Our desired masking vocabulary size should yield a list with many $n$ -grams labeled as collocation while containing little $n$ -grams labeled not a collocation. we define $\textstyle f { \overset { } { = } } { \frac { 2 r \cdot c } { r + c } }$ as a measure for optimization which balances the two requirements, and Figure 3 shows that this measure is highest at sizes of around 700-800, so we set the masking vocabulary size to be 800K.
235
+
236
+ Table 5 shows the pretraining hyper-parameters we used, as well as the architecture specifics, both follow the standard implementation of BERT.
237
+
238
+ Number of Layers 12
239
+ Hidden Size 768
240
+ Sequence Length 512
241
+ FFN Inner Hidden Size 3072
242
+ Attention Heads 1 2
243
+ Attention Head Size 64
244
+ Dropout 0.1
245
+ Attention Dropout 0.1
246
+ Warmup Steps 10,000
247
+ Peak Learning Rate 1e-4
248
+ Batch Size 256
249
+ Weight Decay 0.01
250
+ Initializer Range 0.02
251
+ Learning Rate Decay Linear
252
+ Adam  1e-6
253
+ Adam $\beta _ { 1 }$ 0.9
254
+ Adam $\beta _ { 2 }$ 0.999
255
+
256
+ # C EVALUATION OF DIFFERENT CHECKPOINTS DURING PRETRAINING
257
+
258
+ Tables 6 and 7 respectively present the development set scores on SQuAD2.0 and RACE, attained for models at different checkpoints during pretraining. The SQuAD2.0 scores are depicted in Figures 1 and 2.
259
+
260
+ <table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan="10">1M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>74.4</td><td>76.7</td><td>77.9</td><td>78.9</td><td>79.3</td><td>一</td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>74.8</td><td>77.9</td><td>78.4</td><td>79.1</td><td>79.6</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>75.5</td><td>78</td><td>79.2</td><td>79.4</td><td>79.7</td><td>1</td><td>1</td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>74.8</td><td>77.4</td><td>78.9</td><td>79.6</td><td>80.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>77.0</td><td>78.8</td><td>80.3</td><td>81.1</td><td>81.3</td><td>1</td><td></td><td></td><td></td></tr><tr><td colspan="10"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>75.8</td><td>78.4</td><td></td><td></td><td>80.9</td><td>81.8</td><td>82.2</td><td></td><td>83.1</td></tr><tr><td>PMI-Masking</td><td>77.2</td><td>79.8</td><td>79.8 81.0</td><td>80.4 81.6</td><td>81.8</td><td>82.4</td><td>83.1</td><td>82.9 83.0</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>83.3</td></tr><tr><td colspan="10"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>77.1</td><td>78.9</td><td>80.9</td><td>81.0</td><td>81.8</td><td>82.3</td><td>82.7</td><td>83.1</td><td>83.2</td></tr><tr><td>PMI-Masking</td><td>78.4</td><td>80.7</td><td>82.1</td><td>82.4</td><td>82.9</td><td>83.3</td><td>83.8</td><td>84.0</td><td>84.3</td></tr></table>
261
+
262
+ Table 6: The F1 score on the SQuAD2.0 development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. These scores are depicted in Figures 1 and 2. We finetuned on SQuAD2.0 with batch size of 32 and learning rate of $3 \cdot 1 0 ^ { \bar { - } 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores.
263
+
264
+ <table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan="10">1M training steps on WIKIPEDIA+BoOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>61.2</td><td>64.3</td><td>65.6</td><td>66.4</td><td>67.1</td><td></td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>62.0</td><td>64.9</td><td>66.0</td><td>67.0</td><td>67.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>63.7</td><td>65.7</td><td>67.3</td><td>68.5</td><td>68.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>61.7</td><td>64.7</td><td>66.8</td><td>67.9</td><td>68.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>63.5</td><td>66.8</td><td>68.4</td><td>68.9</td><td>69.7</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>62.3</td><td>64.3</td><td>65.6</td><td>67.8</td><td>69.0</td><td>68.9</td><td>70.3</td><td>71.0</td><td>71.4</td></tr><tr><td>PMI-Masking</td><td>63.6</td><td>66.7</td><td>67.3</td><td>68.5</td><td>69.2</td><td>70.4</td><td>70.5</td><td>71.2</td><td>72.2</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>64.6</td><td>67.0</td><td>69.2</td><td>69.9</td><td>70.5</td><td>71.3</td><td>72.9</td><td>73.5</td><td>73.4</td></tr><tr><td>PMI-Masking</td><td>66.5</td><td>68.6</td><td>70.7</td><td>71.4</td><td>72.4</td><td>72.5</td><td>73.6</td><td>74.1</td><td>74.5</td></tr></table>
265
+
266
+ Table 7: The accuracy score on the RACE development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. We finetuned on RACE with batch size of 32 and learning rate of $3 \cdot 1 0 ^ { - 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores.
267
+
268
+ # D GLUE TASKS AND DETAILED SCORES
269
+
270
+ The General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019) consists of 9 sentence-level tasks. Sentence-level classification tasks: CoLA (Warstadt et al., 2018) (evaluating linguistic acceptability) and SST-2 (Socher et al., 2013) (sentiment classification). Sentencepair similarity tasks: MRPC (Dolan & Brockett, 2005) (binary paraphrasing classification task), STS-B (Cer et al., 2017): (graded similarity scoring task), and $\mathrm { \bar { Q } O P ^ { 2 } }$ (binary paraphrasing classification task). Natural language inference tasks: MNLI (Williams et al., 2018), QNLI (Rajpurkar et al., 2016), RTE (Dagan et al., 2005; Bar-Haim et al., 2006; Giampiccolo et al., 2007) and WNLI (Levesque et al., 2011). Table 8 shows the detailed per-task scores of our examined models.
271
+
272
+ Table 8: Results on the different tasks of the GLUE benchmark. For all tasks the scores reflect accuracy, except for STS-B (spearman score) and CoLA (Mathews Correlation). For results reported on the development set (1M training steps), the average score is simply the average of reported scores. For results reported on the test sets (2.4M training steps), the average score is the official GLUE leaderboard score. The official score includes averaging of F1 scores for QQP and MRPC, as well as the default majority submission score of 65.1 for WNLI.
273
+
274
+ <table><tr><td>GLUE</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>Avg</td></tr><tr><td colspan="10">1Mtraining steps on Wikipedia+BookCorpus; ondev</td></tr><tr><td>Random-Span Masking</td><td>84.0/-</td><td>91.4</td><td>90.8</td><td>69.0</td><td>92.8</td><td>88.5</td><td>58.5</td><td>88.9</td><td>83.0</td></tr><tr><td>Naive-PMI-Masking</td><td>85.1/-</td><td>91.9</td><td>91.0</td><td>74.0</td><td>93.3</td><td>88.2</td><td>60.3</td><td>89.3</td><td>84.1</td></tr><tr><td>PMI-Masking</td><td>85.2/-</td><td>91.8</td><td>91.0</td><td>72.2</td><td>92.7</td><td>89.7</td><td>60.6</td><td>89.3</td><td>84.1</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BoOKCORPUS; ( on</td></tr><tr><td>Random-Span Masking</td><td>85.7/84.7</td><td>92.9</td><td>89.4</td><td>test 69.8</td><td>93</td><td>85.4</td><td>56.5</td><td>86.6</td><td>79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>85.5/85.3</td><td>92.2</td><td>89.2</td><td>68.9</td><td>93.6</td><td>85.4</td><td>59.4</td><td>87.3</td><td>80.0</td></tr><tr><td>PMI-Masking</td><td>85.3/85.0</td><td>92.0</td><td>89.2</td><td>69.0</td><td>94.0</td><td>85.6</td><td>61.8</td><td>86.8</td><td>80.3</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT; on test</td></tr><tr><td>Random-Span Masking</td><td>86.3/85.1</td><td>92.2</td><td>89.4</td><td>71.1</td><td>94.6</td><td>85.6</td><td>56.8</td><td>87.2</td><td>80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>86/85.4</td><td>91.7</td><td>89.4</td><td>69.2</td><td>95.1</td><td>87.8</td><td>57.5</td><td>87.9</td><td>80.3</td></tr><tr><td>PMI-Masking</td><td>86.6/85.8</td><td>93.1</td><td>89.5</td><td>72.9</td><td>94.7</td><td>87.7</td><td>57.4</td><td>87.7</td><td>80.8</td></tr></table>
parse/train/3Aoft6NWFej/3Aoft6NWFej_content_list.json ADDED
@@ -0,0 +1,1396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "PMI-MASKING: PRINCIPLED MASKING OF CORRELATED SPANS ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 98,
9
+ 735,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Yoav Levine Barak Lenz Opher Lieber Omri Abend ",
17
+ "bbox": [
18
+ 281,
19
+ 169,
20
+ 740,
21
+ 184
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Kevin Leyton-Brown Moshe Tennenholtz Yoav Shoham ",
28
+ "bbox": [
29
+ 292,
30
+ 196,
31
+ 738,
32
+ 212
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "AI21 Labs, Tel Aviv, Israel ",
39
+ "bbox": [
40
+ 413,
41
+ 224,
42
+ 589,
43
+ 239
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "{yoavl,barakl,opherl,omria,...}@ai21.com ",
50
+ "bbox": [
51
+ 356,
52
+ 252,
53
+ 635,
54
+ 267
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "ABSTRACT ",
61
+ "text_level": 1,
62
+ "bbox": [
63
+ 454,
64
+ 304,
65
+ 544,
66
+ 319
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "Masking tokens uniformly at random constitutes a common flaw in the pretraining of Masked Language Models (MLMs) such as BERT. We show that such uniform masking allows an MLM to minimize its training objective by latching onto shallow local signals, leading to pretraining inefficiency and suboptimal downstream performance. To address this flaw, we propose PMI-Masking, a principled masking strategy based on the concept of Pointwise Mutual Information (PMI), which jointly masks a token $n$ -gram if it exhibits high collocation over the corpus. PMIMasking motivates, unifies, and improves upon prior more heuristic approaches that attempt to address the drawback of random uniform token masking, such as whole-word masking, entity/phrase masking, and random-span masking. Specifically, we show experimentally that PMI-Masking reaches the performance of prior masking approaches in half the training time, and consistently improves performance at the end of training. ",
73
+ "bbox": [
74
+ 233,
75
+ 339,
76
+ 764,
77
+ 518
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "1 INTRODUCTION ",
84
+ "text_level": 1,
85
+ "bbox": [
86
+ 176,
87
+ 555,
88
+ 336,
89
+ 570
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "In the couple of years since BERT was introduced in a seminal paper by Devlin et al. (2019a), Masked Language Models (MLMs) have rapidly advanced the NLP frontier (Sun et al., 2019; Liu et al., 2019; Joshi et al., 2020; Raffel et al., 2019). At the heart of the MLM approach is the task of predicting a masked subset of the text given the remaining, unmasked text. The text itself is broken up into tokens, each token consisting of a word or part of a word; thus “chair” constitutes a single token, but out-of-vocabulary words like “e-igen-val-ue” are broken up into several sub-word tokens. In BERT, $1 5 \\%$ of tokens are chosen to be masked uniformly at random. It is the random choice of single tokens that we address in this paper: we show that this approach is suboptimal and offer a principled alternative. ",
96
+ "bbox": [
97
+ 174,
98
+ 589,
99
+ 825,
100
+ 714
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "To see why Random-Token Masking is suboptimal, consider the special case of sub-word tokens. Given the masked sentence “To approximate the matrix, we use the eigenvector corresponding to its largest e-[mask]-val-ue”, an MLM will quickly learn to predict “igen” based only on the context “e[mask]-val-ue”, rendering the rest of the sentence redundant. The question is whether the network will also learn to relate the broader context to the tokens comprising “eigenvalue”. When they are masked together, the network is forced to do so, but such masking occurs with vanishingly small probability. One might hypothesize that the network would nonetheless be able to piece such meaning together from local cues; however, we show that it often struggles to do so. ",
107
+ "bbox": [
108
+ 174,
109
+ 722,
110
+ 825,
111
+ 833
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "We establish this via a controlled experiment, in which we reduced the size of the vocabulary, thereby breaking more words into sub-word tokens. We compared the extent to which such vocabulary reduction degraded regular BERT relative to so-called Whole-Word Masking BERT (WWBERT) (Devlin et al., 2019b), a version of BERT that jointly masks all sub-word tokens comprising an out-of-vocabulary word during training. We show that vanilla BERT’s performance degrades much more rapidly than that of WWBERT as the vocabulary size shrinks. The intuitive explanation is that Random-Token Masking is wasteful; it overtrains on easy sub-word tasks (such as predicting “igen”) and undertrains on harder whole-word tasks (predicting “eigenvalue”). ",
118
+ "bbox": [
119
+ 174,
120
+ 840,
121
+ 823,
122
+ 922
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "",
129
+ "bbox": [
130
+ 173,
131
+ 103,
132
+ 821,
133
+ 132
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "The advantage of Whole-Word Masking over Random-Token Masking is relatively modest for standard vocabularies, because out-of-vocabulary words are rare. However, the tokenization of words is a very special case of a much broader statistical linguistic phenomenon of collocation: the cooccurrence of series of tokens at levels much greater than would be predicted simply by their individual frequencies in the corpus. There are millions of collocated word $n$ -grams — multi-word expressions, phrases, and other common word combinations — whereas there are only tens of thousands of words in frequent use. So it is reasonable to hypothesize that Random-Token Masking generates many wastefully easy problems and too few usefully harder problems because of multiword collocations, and that this affects performance even more than the rarer case of tokenized words; we show that this indeed is the case. ",
140
+ "bbox": [
141
+ 174,
142
+ 138,
143
+ 825,
144
+ 277
145
+ ],
146
+ "page_idx": 1
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "Several prior works have considered the idea of masking across spans longer than a single word. Sun et al. (2019) and Guu et al. (2020) proposed Knowledge Masking and Salient Span Masking, respectively, in which tokens comprising entities or phrases, as identified by external parsers, are jointly masked. While extending the scope of Whole-Word Masking, the restriction to specific types of correlated $n$ -grams, along with the reliance on imperfect tools for their identification, has limited the gains achievable by these approaches. With a similar motivation in mind, SpanBERT of Joshi et al. (2020) introduced Random-Span Masking, which masks word spans of lengths sampled from a geometric distribution at random positions in the text. Random-Span Masking was shown to consistently outperform Knowledge Masking, is simple to implement, and inspired prominent MLMs (Raffel et al., 2019). However, while Random-Span Masking increases the chances of masking collocations, with high probability the selected spans break up correlated n-grams, such that the prediction task can often be performed by relying on local cues. ",
151
+ "bbox": [
152
+ 174,
153
+ 285,
154
+ 825,
155
+ 450
156
+ ],
157
+ "page_idx": 1
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "In this paper we offer a principled approach to masking spans that consistently provide high signal, unifying the intuitions behind the above approaches while also outperforming them. Our approach, dubbed PMI-Masking, uses Pointwise Mutual Information (PMI) to identify collocations, which we then mask jointly. At a high level, PMI-Masking consists of two stages. First, given any pretraining corpus, we identify a set of contiguous $n$ -grams that exhibit high cooccurrence probability relative to the individual occurrence probabilities of their components. We for",
162
+ "bbox": [
163
+ 174,
164
+ 458,
165
+ 406,
166
+ 694
167
+ ],
168
+ "page_idx": 1
169
+ },
170
+ {
171
+ "type": "image",
172
+ "img_path": "images/61899b510f84d853a68448677ec1542dfe191ab01c3bd9672a10266c688770cb.jpg",
173
+ "image_caption": [
174
+ "Figure 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with different masking schemes, evaluated every 200K steps during pretraining. "
175
+ ],
176
+ "image_footnote": [],
177
+ "bbox": [
178
+ 416,
179
+ 460,
180
+ 818,
181
+ 638
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "malize this notion by proposing an extended definition of Pointwise Mutual Information from bigrams to longer $n$ -grams. Second, we treat these collocated $n$ -grams as single units; the masking strategy selects at random both from these units and from standard tokens that do not participate in such units. Figure 1, detailed and reinforced by further experiments in section 5, shows that (1) PMI-Masking dramatically accelerates training, matching the end-of-pretraining performance of existing approaches in roughly half of the training time; and (2) PMI-Masking improves upon previous masking approaches at the end of pretraining. ",
188
+ "bbox": [
189
+ 173,
190
+ 694,
191
+ 825,
192
+ 791
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "2 MOTIVATION: MLMS ARE SENSITIVE TO TOKENIZATION ",
199
+ "text_level": 1,
200
+ "bbox": [
201
+ 174,
202
+ 818,
203
+ 674,
204
+ 834
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "In this section we describe a simple experiment that motivates our PMI-Masking approach. We examined BERT’s ability to learn effective representations for words consisting of multiple subword tokens, treating this setting as an easily controlled analogue for the multi-word collocation problem that truly interests us. Our experiment sought to assess the performance gain obtained from always masking whole words as opposed to masking each individual token uniformly at random. We compared performance across a range of vocabulary sizes, using the same WordPiece Tokenizer1 that produced the original vocabulary of $\\sim 3 0 \\mathrm { K }$ tokens. As we decreased a 30K-token vocabulary to 10K and 2K tokens, the average length of a word over the pretraining corpus increased from 1.08 tokens to 1.22 and 2.06 tokens, respectively. Thus, by reducing the vocabulary size, we increased the frequency of multi-token words by a large factor. ",
211
+ "bbox": [
212
+ 174,
213
+ 854,
214
+ 823,
215
+ 924
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "table",
221
+ "img_path": "images/8a85a5878503d19ba5a5240623085db8fc4c5f1bea1f9524691342fa8ddcc075.jpg",
222
+ "table_caption": [
223
+ "Table 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with Random-Token and Whole-Word masking schemes and with different vocabulary sizes (30K; 10K; 2K). "
224
+ ],
225
+ "table_footnote": [],
226
+ "table_body": "<table><tr><td></td><td>1.08 tokens per word (30K vocabulary)</td><td>1.22 tokens per word (10K vocabulary)</td><td>2.06 tokens per word (2K vocabulary)</td></tr><tr><td>Random-Token Masking</td><td>79.3</td><td>77.8</td><td>72.8</td></tr><tr><td>Whole-Word Masking</td><td>79.7</td><td>79.5</td><td>77.6</td></tr></table>",
227
+ "bbox": [
228
+ 173,
229
+ 101,
230
+ 851,
231
+ 172
232
+ ],
233
+ "page_idx": 2
234
+ },
235
+ {
236
+ "type": "text",
237
+ "text": "",
238
+ "bbox": [
239
+ 174,
240
+ 236,
241
+ 823,
242
+ 306
243
+ ],
244
+ "page_idx": 2
245
+ },
246
+ {
247
+ "type": "text",
248
+ "text": "Table 1 presents the performance of BERT models trained with these vocabularies, measured as score on the SQuAD2.0 development set (the experimental setup is described in section 4). The downstream performance of Random-Token Masking substantially degraded as vocabulary size decreased and the number of spans of sub-word tokens increased. One reason for such degradation might be the model seeing less text as context (512 input tokens cover less text when more words are broken into multiple tokens). This possibly plays a role; however, for models with the same vocabularies trained via Whole-Word Masking, this degradation was significantly attenuated. We therefore conjecture that this degradation occurred primarily because of the random masking strategy, which allows the model to use “shortcuts” for minimizing its loss, thus hindering its ability to learn the distribution of the entire multi-token word. ",
249
+ "bbox": [
250
+ 174,
251
+ 313,
252
+ 825,
253
+ 452
254
+ ],
255
+ "page_idx": 2
256
+ },
257
+ {
258
+ "type": "text",
259
+ "text": "If our conjecture is correct, such shortcuts are just as problematic in the case of inter-word collocations. In fact, for the regular 30K-token vocabulary, divided words are rare, so inter-word collocations would pose a larger problem than intra-word collocations in the common setting. One possible mitigation might be to expand the vocabulary to include multi-word collocations. However, there are millions of these, and such vocabulary sizes are currently infeasible. Even if we could get around the practical issue of size, this approach may suffer from generalization problems: the frequency of each multi-word collocation can be lower than the sample complexity for learning a meaningful representation. An alternative, more practical approach is to leave the vocabulary as is, but jointly mask co-located words, with the intention of cutting off local statistical “shortcuts” and allowing the model to improve further by learning from broader context. This is the approach we take in this paper. In what follows we detail such a masking approach and show its advantages experimentally. ",
260
+ "bbox": [
261
+ 174,
262
+ 459,
263
+ 825,
264
+ 612
265
+ ],
266
+ "page_idx": 2
267
+ },
268
+ {
269
+ "type": "text",
270
+ "text": "3 MASKING CORRELATED $n$ -GRAMS ",
271
+ "text_level": 1,
272
+ "bbox": [
273
+ 174,
274
+ 632,
275
+ 493,
276
+ 647
277
+ ],
278
+ "page_idx": 2
279
+ },
280
+ {
281
+ "type": "text",
282
+ "text": "3.1 EXISTING MASKING APPROACHES ",
283
+ "text_level": 1,
284
+ "bbox": [
285
+ 176,
286
+ 662,
287
+ 447,
288
+ 678
289
+ ],
290
+ "page_idx": 2
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "We now more formally present the MLM setup as well as existing masking approaches, which we implement as baselines. Given text tokenized into a sequence of tokens, Masked Language Models are trained to predict a set fraction of “masked” tokens, where this fraction is called the masking budget and is traditionally set to $1 5 \\%$ . The modified input is inserted into the Transformer-based architecture (Vaswani et al., 2017) of BERT, and the pretraining task is to predict the original identity of each chosen token. Several alternatives have been proposed for choosing the set of tokens to mask. ",
295
+ "bbox": [
296
+ 174,
297
+ 689,
298
+ 825,
299
+ 772
300
+ ],
301
+ "page_idx": 2
302
+ },
303
+ {
304
+ "type": "text",
305
+ "text": "Random-Token Masking (Devlin et al., 2019a) The original BERT implementation selects tokens for masking independently at random, where $80 \\%$ of the $1 5 \\%$ chosen tokens are replaced with [MASK], $10 \\%$ are replaced with a random token, and $10 \\%$ are kept unchanged. ",
306
+ "bbox": [
307
+ 174,
308
+ 787,
309
+ 823,
310
+ 830
311
+ ],
312
+ "page_idx": 2
313
+ },
314
+ {
315
+ "type": "text",
316
+ "text": "Whole-Word Masking (Devlin et al., 2019b) The sequence of input tokens is segmented into units corresponding to whole words. Tokens for masking are then chosen by sampling entire units at random until the masking budget is met. Following Devlin et al. (2019a), for $8 0 \\% / 1 0 \\% / 1 0 \\%$ of the units, all tokens are replaced with [MASK]tokens/ random tokens/ the original tokens, respectively. ",
317
+ "bbox": [
318
+ 176,
319
+ 844,
320
+ 823,
321
+ 901
322
+ ],
323
+ "page_idx": 2
324
+ },
325
+ {
326
+ "type": "text",
327
+ "text": "Random-Span Masking (Joshi et al., 2020) Contiguous random spans are selected iteratively until the $1 5 \\%$ masking budget is spent. At each iteration, a span length (in words) is sampled from a geometric distribution $\\ell \\sim \\mathrm { G e o } ( 0 . 2 )$ , and capped at 10 words. Then, the starting point for the span to be masked is randomly selected. Replacement with [MASK], random, or original tokens is done as above, where spans constitute the units. ",
328
+ "bbox": [
329
+ 173,
330
+ 103,
331
+ 825,
332
+ 174
333
+ ],
334
+ "page_idx": 3
335
+ },
336
+ {
337
+ "type": "text",
338
+ "text": "3.2 PMI: FROM BIGRAMS TO $n$ -GRAMS",
339
+ "text_level": 1,
340
+ "bbox": [
341
+ 176,
342
+ 190,
343
+ 457,
344
+ 204
345
+ ],
346
+ "page_idx": 3
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "Our aim is to define a masking strategy that targets correlated sequences of tokens in a principled way. Of course, modeling such correlations in large corpora was widely studied in computational linguistics (Zuidema (2006); Ramisch et al. (2012); inter alia). Particularly relevant to our work is the notion of Pointwise Mutual Information (Fano, 1961), which quantifies how often two events occur, compared with what we would expect if they were independent. Define the probability of any $n$ -gram as the number of its occurrences in the corpus divided by the number of all the $n$ -grams in the corpus. PMI leverages these probabilities to give a natural measure of collocation of bigrams: how surprising the bigram $w _ { 1 } w _ { 2 }$ is, given the unigram probabilities of $w _ { 1 }$ and $w _ { 2 }$ . Formally, given two tokens $w _ { 1 }$ and $w _ { 2 }$ , the PMI of the bigram “ $\\cdot _ { w _ { 1 } w _ { 2 } }$ ” is ",
351
+ "bbox": [
352
+ 173,
353
+ 215,
354
+ 825,
355
+ 342
356
+ ],
357
+ "page_idx": 3
358
+ },
359
+ {
360
+ "type": "equation",
361
+ "img_path": "images/82e84a5cd6cf280e7268f618590847e57014119b5e03f9fce5e2d9283f46b5c2.jpg",
362
+ "text": "$$\n\\mathrm { P M I } ( w _ { 1 } w _ { 2 } ) = \\log \\frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) } .\n$$",
363
+ "text_format": "latex",
364
+ "bbox": [
365
+ 390,
366
+ 347,
367
+ 607,
368
+ 381
369
+ ],
370
+ "page_idx": 3
371
+ },
372
+ {
373
+ "type": "text",
374
+ "text": "Importantly, PMI is qualitatively different from pure frequency: a relatively frequent bigram may not have a very high PMI score, and vice versa. For example, the bigram “book is” appears 34772 times in the WIKIPEDIA $+ \\mathbf { B }$ OOKCORPUS dataset but is ranked around position 760K in the PMI ranking for bi-grams over this corpus, while the bigram “boolean algebra” appears 849 times in the corpus but is ranked around position 16K in the PMI ranking. ",
375
+ "bbox": [
376
+ 173,
377
+ 392,
378
+ 825,
379
+ 463
380
+ ],
381
+ "page_idx": 3
382
+ },
383
+ {
384
+ "type": "text",
385
+ "text": "What about contiguous spans of more than two tokens? For a given $n$ -gram, we would again like to measure how strongly its components indicate one another. We thus require a measure that captures correlations among more than two variables. A standard and direct extension of the PMI measure to more than two variables, referred to as ‘specific correlation’ in Van de Cruys (2011), and as ‘Naive$\\mathrm { P M I } _ { n } $ in this paper, is based on the ratio between the $n$ -gram’s probability and the probabilities of its component unigrams: ",
386
+ "bbox": [
387
+ 173,
388
+ 468,
389
+ 825,
390
+ 554
391
+ ],
392
+ "page_idx": 3
393
+ },
394
+ {
395
+ "type": "equation",
396
+ "img_path": "images/b6dd4997b2c8edc6b4030d13b4f63e921a3ebd543d0bb55eb7b106a24cd59575.jpg",
397
+ "text": "$$\n\\mathrm { N a i v e \\mathrm { - } P M I } _ { n } ( w _ { 1 } \\ldots w _ { n } ) = \\log { \\frac { p ( w _ { 1 } \\ldots w _ { n } ) } { \\prod _ { j = 1 } ^ { n } p ( w _ { j } ) } }\n$$",
398
+ "text_format": "latex",
399
+ "bbox": [
400
+ 349,
401
+ 558,
402
+ 647,
403
+ 594
404
+ ],
405
+ "page_idx": 3
406
+ },
407
+ {
408
+ "type": "text",
409
+ "text": "As in the bivariate case, this measure compares the actual empirical probability of the $n$ -gram in the corpus with the probability it would have if its components occurred independently. However, the above definition suffers from an inherent flaw: an $n$ -gram’s Naive- $\\mathrm { P M I } _ { n }$ will be high if it contains a segment with high PMI, even if that segment is not particularly correlated with the rest of the $n$ -gram. Consider for example the case of trigrams: ",
410
+ "bbox": [
411
+ 173,
412
+ 606,
413
+ 825,
414
+ 676
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "equation",
420
+ "img_path": "images/53f980160fe59555a0a2624e28bb84e1e767280a346f51072c619f15b3cc416d.jpg",
421
+ "text": "$$\n\\begin{array} { r } { \\operatorname { i v e - P M I } _ { 3 } ( w _ { 1 } w _ { 2 } w _ { 3 } ) = \\log \\{ \\frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) p ( w _ { 3 } ) } \\cdot \\frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } w _ { 2 } ) } \\} = \\operatorname { P M I } ( w _ { 1 } w _ { 2 } ) + \\log \\frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } w _ { 2 } ) p ( w _ { 3 } ) } } \\end{array}\n$$",
422
+ "text_format": "latex",
423
+ "bbox": [
424
+ 191,
425
+ 681,
426
+ 830,
427
+ 715
428
+ ],
429
+ "page_idx": 3
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "Where $\\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is defined in eq. 1. When $\\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is high, the Naive- $\\mathrm { P M I _ { 3 } }$ measure of the trigram “w1w2w3” will start at this high baseline. The added term of log p(w1w2w3)p(w1w2)p(w3) quantifies the actual added information of “ $w _ { 3 } \\mathrm { ^ { , } }$ to this correlated bigram, i.e., it quantifies how far $p ( w _ { 1 } w _ { 2 } w _ { 3 } )$ is from being separable w.r.t. the segmentation into $\" w _ { 1 } w _ { 2 } \"$ and $^ { 6 6 } w _ { 3 } \\ '$ . For example, since the PMI of the bigram “Kuala Lumpur” is very high, the Naive- $\\mathrm { P M I } _ { n }$ of the trigram “Kuala Lumpur is” is misleadingly high, placing it at position 43K out of all trigrams in the WIKIPEDIA $^ +$ BOOKCORPUS dataset. It is in fact placed much higher than obvious collocations such as the trigram “editor in chief ”, which is ranked at position 210K out of all trigrams. ",
434
+ "bbox": [
435
+ 173,
436
+ 719,
437
+ 825,
438
+ 839
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "text",
444
+ "text": "In order to favor $n$ -grams that cannot be easily subdivided into shorter unrelated spans, we propose a measure of distance from separability with respect to all of an $n$ -gram’s possible segmentations rather than with respect only to the segmentation into single tokens: ",
445
+ "bbox": [
446
+ 174,
447
+ 845,
448
+ 825,
449
+ 888
450
+ ],
451
+ "page_idx": 3
452
+ },
453
+ {
454
+ "type": "equation",
455
+ "img_path": "images/6f4ae418a67ec9f0a0b6376951de7d3fdf7b171192479dfd6d2ccbb1fd98337d.jpg",
456
+ "text": "$$\n\\operatorname { \\mathbf { P M I } } _ { n } ( w _ { 1 } \\dots w _ { n } ) = \\operatorname* { m i n } _ { \\substack { \\sigma \\in \\sec ( w _ { 1 } \\dots w _ { n } ) } } \\log \\frac { p ( w _ { 1 } \\dots w _ { n } ) } { \\prod _ { s \\in \\sigma } p ( s ) }\n$$",
457
+ "text_format": "latex",
458
+ "bbox": [
459
+ 326,
460
+ 893,
461
+ 669,
462
+ 929
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "Here, $\\sec ( w _ { 1 } \\ldots w _ { n } )$ is the set of all contiguous segmentations of the $n$ -gram $^ { \\bullet } w _ { 1 } \\ldots w _ { n } ^ { \\quad \\bullet }$ (excluding the identity segmentation), where any segmentation $\\sigma \\in \\sec ( w _ { 1 } \\ldots w _ { n } )$ is composed of sub-spans which together give $^ { } w _ { 1 } \\dots w _ { n } ^ { \\quad \\prime \\prime }$ . Intuitively, this measure effectively discards the contribution of high PMI segments; the minimum in Eq. 3 implies that an $n$ -gram’s collocation score is given by its weakest link, i.e., by the segmentation that is closest to separability. When ranked by the above $\\mathrm { P M I } _ { n }$ measure, the trigram “Kuala Lumpur is” is demoted to position 1.6M, since the segmentation into “Kuala Lumpur” and “is” yields unrelated segments, while the trigram “editor in chief ” is upgraded to position 33K since its segmentations yield correlated components. As we will see, this definition is not only conceptually cleaner, but also leads to improved performance. ",
469
+ "bbox": [
470
+ 174,
471
+ 103,
472
+ 825,
473
+ 229
474
+ ],
475
+ "page_idx": 4
476
+ },
477
+ {
478
+ "type": "text",
479
+ "text": "3.2.1 PMI-MASKING ",
480
+ "text_level": 1,
481
+ "bbox": [
482
+ 176,
483
+ 243,
484
+ 336,
485
+ 257
486
+ ],
487
+ "page_idx": 4
488
+ },
489
+ {
490
+ "type": "text",
491
+ "text": "We implement our strategy of treating highly collocating $n$ -grams as units for masking by assembling a list of $n$ -grams as a masking vocabulary in parallel to the 30K-token vocabulary. Specifically, we make use of the entire pretraining corpus for compiling a list of collocations. We consider word $n$ -grams of lengths 2–5 having over 10 occurrences in the corpus, and include the highest ranking collocations over the corpus, as measured via our proposed $\\mathrm { P M I } _ { n }$ measure (Eq. 3). Noticing that the $\\mathrm { P M I } _ { n }$ measure is sensitive to the length of the $n$ -gram, we assemble per-length rankings for each $n \\in \\{ 2 , 3 , 4 , 5 \\}$ , and integrate these rankings to compose the masking vocabulary. After conducting a preliminary evaluation of how an $n$ -gram’s quality as a collocation degrades with its $\\mathrm { P M I } _ { n }$ rank (detailed in the appendix), we chose the masking vocabulary size to be 800K, for which approximately half of pretraining corpus tokens were identified as part of some correlated $n$ -gram. ",
492
+ "bbox": [
493
+ 174,
494
+ 267,
495
+ 825,
496
+ 406
497
+ ],
498
+ "page_idx": 4
499
+ },
500
+ {
501
+ "type": "text",
502
+ "text": "In order to get some sense of the differences between the attained masking vocabulary and prior approaches, we annotated a random sample of 500 bigrams and 500 trigrams from the masking vocabulary with Entity/Not-Entity labels. We found that only around $14 \\%$ of the entries in the bigrams/trigrams lists were annotated as entities, while the rest are other types of collocations. Moreover, we found that while named entities are very prevalent at the very top of the list, they are scarce otherwise. By refining the view into highest and lowest ranking PMI bigram groups, we get that $50 \\%$ of the top $20 \\%$ are entities while only $1 \\%$ of the bottom $20 \\%$ are entities, and similar trends are attained for trigrams. This breakdown can illuminate a natural intuition regarding high ranking PMI n-grams representing entities (employed also by previous works (Downey et al., 2007; Korkontzelos et al., 2008)) – indeed the top ranking PMI entries are largely entities. But we chose a much larger PMI-based masking vocabulary (see appendix 1 on the process of choosing its size), and the proportion of entities drops to around 1/7, with many of the added entries representing other types of collocations (the annotated lists are given as supplementary material). ",
503
+ "bbox": [
504
+ 174,
505
+ 414,
506
+ 825,
507
+ 594
508
+ ],
509
+ "page_idx": 4
510
+ },
511
+ {
512
+ "type": "text",
513
+ "text": "After composing the masking vocabulary, we treat its entries as units to be masked together. All input tokens not identified with entries from the masking vocabulary are treated independently as units for masking according to the Whole-Word Masking scheme. If one masking vocabulary entry contains another entry in a given input, we treat the larger one as the unit for masking, e.g., if the masking vocabulary contains the $n$ -grams “the united states”, “air force”, and “the united states air force”, the latter will be one unit for masking when it appears. In the case of overlapping entries, we choose one at random as a unit for masking and treat the remaining tokens as independent units, e.g., if the input text contains “by the way out” and the masking vocabulary contains the $n$ -grams “by the way” and “the way out”, we can choose either “by the way” and “out” or “by” and “the way out” as units for masking. ",
514
+ "bbox": [
515
+ 174,
516
+ 602,
517
+ 825,
518
+ 741
519
+ ],
520
+ "page_idx": 4
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "After we segment the sequence of input tokens into units for masking, we then choose tokens for masking by sampling units uniformly at random until $1 5 \\%$ of the tokens (the standard tokens of the 30K-token vocabulary) in the input are selected. As in the prior methods, replacement with [MASK] $( 8 0 \\% )$ , random $( 1 0 \\% )$ , or original $( 1 0 \\% )$ ) tokens is done at the unit level. ",
525
+ "bbox": [
526
+ 176,
527
+ 747,
528
+ 825,
529
+ 803
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "4 EXPERIMENTAL SETUP ",
536
+ "text_level": 1,
537
+ "bbox": [
538
+ 176,
539
+ 824,
540
+ 397,
541
+ 838
542
+ ],
543
+ "page_idx": 4
544
+ },
545
+ {
546
+ "type": "text",
547
+ "text": "To evaluate the impact of PMI-Masking, we trained Base-sized BERT models (Devlin et al., 2019a) with each of the masking schemes presented in Section 3. Rather than relying on existing implementations for baseline masking schemes, which vary in training specifics, we reimplemented each scheme within the same framework used to train our PMI-Masked models. For control, we trained within the same framework models with Naive-PMI-Masking and Frequency-Masking, following the procedure described above for PMI-Masking, but ranking by the Naive- $\\mathrm { P M I } _ { n }$ measure (Eq. 2) and by pure-frequency, respectively. In Section 5, we compare our PMI-Masking to all internallytrained masking schemes (Table 2) as well as with externally released models (Table 3). ",
548
+ "bbox": [
549
+ 174,
550
+ 853,
551
+ 823,
552
+ 924
553
+ ],
554
+ "page_idx": 4
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "",
559
+ "bbox": [
560
+ 174,
561
+ 103,
562
+ 823,
563
+ 146
564
+ ],
565
+ "page_idx": 5
566
+ },
567
+ {
568
+ "type": "text",
569
+ "text": "4.1 PRETRAINING ",
570
+ "text_level": 1,
571
+ "bbox": [
572
+ 174,
573
+ 167,
574
+ 310,
575
+ 181
576
+ ],
577
+ "page_idx": 5
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "We trained uncased models with a 30K-sized vocabulary that we constructed over WIKIPEDIA +BOOKCORPUS via the WordPiece Tokenizer used in BERT. We omitted the Next Sentence Prediction task, as it was shown to be superfluous (Joshi et al., 2020), and trained only on the Masked Language Model task during pretraining. We trained with a sequence length of 512 tokens, batch size of 256, and a varying number of steps detailed in Section 5. For pretraining, after a warmup of 10, 000 steps we used a linear learning rate decay, therefore models that ran for a different overall amount of steps are not precisely comparable after a given amount of steps. We set remaining parameters to values similar to those used in the original BERT pretraining, detailed in the appendix. ",
582
+ "bbox": [
583
+ 174,
584
+ 195,
585
+ 825,
586
+ 306
587
+ ],
588
+ "page_idx": 5
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "We performed the baseline pretraining over the original corpus used to train BERT: the 16GB WIKIPEDIA $^ +$ BOOKCORPUS dataset. We show that PMI-Masking achieved even larger performance gains relative to the baselines when training over more data, by adding the 38GB OPENWEBTEXT (Gokaslan & Cohen, 2019) dataset, an open-source recreation of the WebText corpus described in Radford et al. (2019). As described in section 3, we compose our $\\mathrm { P M I } _ { n }$ -based masking vocabulary according to the pretraining corpus in use. ",
593
+ "bbox": [
594
+ 174,
595
+ 314,
596
+ 823,
597
+ 397
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "4.2 EVALUATION ",
604
+ "text_level": 1,
605
+ "bbox": [
606
+ 176,
607
+ 419,
608
+ 305,
609
+ 433
610
+ ],
611
+ "page_idx": 5
612
+ },
613
+ {
614
+ "type": "text",
615
+ "text": "We evaluate our pretrained models on two question answering benchmarks: the Stanford Question Answering Dataset (SQuAD) and the ReAding Comprehension from Examinations (RACE), as well as on the General Language Understanding Evaluation (GLUE) benchmark. Additionally, we report the Single-Token perplexity of our pretrained models. ",
616
+ "bbox": [
617
+ 174,
618
+ 446,
619
+ 825,
620
+ 502
621
+ ],
622
+ "page_idx": 5
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "• SQuAD (Rajpurkar et al., 2016) has served as a major question answering benchmark for pretrained models. It provides a paragraph of context and a question, and the task is to answer the question by extracting the relevant span from the context. We focus on the latest more challenging variant, SQuAD2.0 (Rajpurkar et al., 2018), in which some questions are not answered in the provided context, and the task includes identifying such cases. \n• RACE (Lai et al., 2017) is a large-scale reading comprehension dataset collected from English examinations in China, designed for middle and high school students. Each passage is associated with multiple questions; for each, the task is to select one correct answer from four options. RACE has significantly longer context than other popular reading comprehension datasets and the proportion of questions that requires reasoning is very large. \nGLUE (Wang et al., 2018) 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. For full details, please see the appendix. \n• Single-Token perplexity We evaluate an MLM’s ability to predict single-tokens by measuring perplexity over a held out test set of 110K tokens from OPENWEBTEXT. For each test example, a single token for prediction is masked and the remainder of the input tokens are unmasked. ",
627
+ "bbox": [
628
+ 173,
629
+ 518,
630
+ 825,
631
+ 768
632
+ ],
633
+ "page_idx": 5
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "In Tables 2 and 3, for every downstream task we swept 8 different hyperparameter configurations (batch sizes $\\in \\{ 1 6 , 3 2 \\}$ and learning rates $\\in \\{ 1 , 2 , 3 , 5 \\} \\cdot 1 0 ^ { - 5 } )$ . We report the best median development set score over five random initializations per hyper-parameter. When applicable, the model with this score was evaluated on the test set. The development set score of each configuration was attained by fine-tuning the model over 4 epochs (SQuAD2.0 and RACE) or 3 epochs (all GLUE tasks except RTE and $\\mathrm { S T S } - 1 0 $ epochs) and performing early stopping based on each task’s evaluation metric on the development set. In the preliminary experiments of Table 1, and in Figures 1 and 2 for which we evaluate many pretraining checkpoints per model, we report the average of the three middle scores out of 5 random initializations for a single set of hyper-parameters (batch size 32 and learning rate $3 \\cdot 1 0 ^ { - 5 }$ ). ",
638
+ "bbox": [
639
+ 173,
640
+ 785,
641
+ 825,
642
+ 924
643
+ ],
644
+ "page_idx": 5
645
+ },
646
+ {
647
+ "type": "image",
648
+ "img_path": "images/a330be6b915f032bf993f3d195b0eb70a2212df4db8582f2f24c8755393a4e35.jpg",
649
+ "image_caption": [
650
+ "2.4M steps on Wikipedia+BookCorpus (16G) "
651
+ ],
652
+ "image_footnote": [],
653
+ "bbox": [
654
+ 174,
655
+ 119,
656
+ 496,
657
+ 228
658
+ ],
659
+ "page_idx": 6
660
+ },
661
+ {
662
+ "type": "image",
663
+ "img_path": "images/ff22dcce96e5e9216ef4ff439dc18b2fe7fbdf4dfa322a2b8548b6d65f135296.jpg",
664
+ "image_caption": [
665
+ "Figure 2: Scores on $\\mathrm { S Q u A D 2 . 0 }$ development set of BERTBASE models trained for $2 . 4 \\mathbf { M }$ steps, as done by Joshi et al. (2020) when proposing Random-Span Masking. Left: PMI-Masking efficiently elicits information from limited data. Right: More data, PMI-Masking continues to improve. See numerical scores in the appendix, along with the same trends on the RACE benchmark. "
666
+ ],
667
+ "image_footnote": [],
668
+ "bbox": [
669
+ 504,
670
+ 118,
671
+ 823,
672
+ 229
673
+ ],
674
+ "page_idx": 6
675
+ },
676
+ {
677
+ "type": "text",
678
+ "text": "5 EXPERIMENTAL RESULTS ",
679
+ "text_level": 1,
680
+ "bbox": [
681
+ 178,
682
+ 325,
683
+ 415,
684
+ 340
685
+ ],
686
+ "page_idx": 6
687
+ },
688
+ {
689
+ "type": "text",
690
+ "text": "We evaluated the different masking strategies in two key ways. First, we measured their effect on downstream performance throughout pretraining to assess how efficiently they used the pretraining phase. Second, we more exhaustively evaluated downstream performance of different approaches at the end of pretraining. We examine how the advantage of PMI-Masking is affected by the size of the pretraining corpus and by amount of examples seen during pretraining (batch size $\\times$ training steps). ",
691
+ "bbox": [
692
+ 174,
693
+ 359,
694
+ 825,
695
+ 430
696
+ ],
697
+ "page_idx": 6
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "5.1 EVALUATING DOWNSTREAM PERFORMANCE THROUGHOUT PRETRAINING ",
702
+ "text_level": 1,
703
+ "bbox": [
704
+ 178,
705
+ 454,
706
+ 720,
707
+ 467
708
+ ],
709
+ "page_idx": 6
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "By examining the model’s downstream performance after each 200K steps of pretraining, we demonstrate that PMI-Masking speeds up MLM training. Figure 1 investigates the standard BERT setting of pretraining on the Wikipedia $^ +$ BookCorpus dataset for 1M training steps with batch size 256. It shows that the PMI-Masking method clearly outperformed a variety of prior approaches, as well as the baseline pure frequency based masking, on the SQuAD2.0 development set for all examined checkpoints (these patterns are consistent on RACE, see detailed scores in the appendix). PMIMasking achieved the score of Random-Span Masking, the best of the existing approaches, after roughly half as many steps of pretraining. ",
714
+ "bbox": [
715
+ 174,
716
+ 481,
717
+ 825,
718
+ 593
719
+ ],
720
+ "page_idx": 6
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "We ran a second experiment that increased the number of steps from 1M to 2.4M, while maintaining the batch size and the pretraining corpus; this was the setting used by Joshi et al. (2020) when proposing Random-Span Masking. We observed that while PMI-masking learned much more quickly, it eventually reached a plateau, and Random-Span Masking caught up after enough training steps. Figure 2 (left) details these results. ",
725
+ "bbox": [
726
+ 174,
727
+ 599,
728
+ 825,
729
+ 670
730
+ ],
731
+ "page_idx": 6
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "Finally, we increased the amount of training data by adding the OPENWEBTEXT corpus $( \\sim 3 . 5 \\times$ more data). Figure 2 (right) demonstrates that the plateau we previously observed in PMIMasking’s performance was due to limited training data. When training for $2 . 4 \\mathbf { M }$ training steps on the Wikipedia+BookCorpus $+$ OpenWebText dataset, PMI-masking reached the same score that Random-Span Masking did at the end of training after roughly half of the pretraining, and continued to improve. Thus, PMI-Masking definitively outperformed Random-Span masking in a scenario where data was not a bottleneck, as is ideally the case in MLM pretraining (Raffel et al., 2019). ",
736
+ "bbox": [
737
+ 174,
738
+ 676,
739
+ 825,
740
+ 773
741
+ ],
742
+ "page_idx": 6
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "5.2 EVALUATING DOWNSTREAM PERFORMANCE AFTER PRETRAINING ",
747
+ "text_level": 1,
748
+ "bbox": [
749
+ 176,
750
+ 799,
751
+ 669,
752
+ 811
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "Table 2 shows that after pretraining was complete, PMI-Masking outperformed prior masking approaches in downstream performance on the SQuAD2.0, RACE, and GLUE benchmarks. In agreement with Figure 2, for longer pretraining (2.4M training steps) the absolute advantage of PMIMasking is boosted across all tasks when pretraining over a larger corpus (adding OPENWEBTEXT). The table also shows that Naive-PMI Masking, based on the straightforward extension in eq. 2 to the standard bivariate PMI, significantly falls behind our more nuanced definition in eq. 3, and is often on par with Random-Span Masking. ",
759
+ "bbox": [
760
+ 174,
761
+ 825,
762
+ 825,
763
+ 924
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "table",
769
+ "img_path": "images/32761c2a652cadd3875d7e65cc9c54a1d6d5b186a09b38d9675a3500b7032ac1.jpg",
770
+ "table_caption": [
771
+ "Table 2: Dev/Test performance on the SQuAD, RACE, and GLUE benchmarks of BERT Base sized models pretrained and evaluated according to section 4. We report EM (exact match) and F1 scores for SQuAD2 and accuracy for RACE. For GLUE we report the average scores on the development set and the official leaderboard scores on the test set (see the per-task scores in the appendix). "
772
+ ],
773
+ "table_footnote": [],
774
+ "table_body": "<table><tr><td>BERTBasewith different maskings</td><td colspan=\"2\">SQuAD2.0 EM F1</td><td>RACE Acc.</td><td>GLUE Avg</td></tr><tr><td>1M training steps on WIKIPEDIA+BOOKCORPUS(16G):</td><td colspan=\"4\"></td></tr><tr><td>Random-Token Masking</td><td colspan=\"4\">76.4/- 79.6/-</td></tr><tr><td>Random-Span Masking Naive-PMI-Masking</td><td>77.1/-</td><td>80.3/-</td><td>67.8/66.2 68.6/66.9 69.7/67.8</td><td>83.1/- 83/-</td></tr><tr><td>PMI-Masking</td><td>78.2/- 78.5/-</td><td>81.3/- 81.4/-</td><td>70.1/68.4</td><td>84.1/- 84.1/-</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS(16G)</td><td colspan=\"4\"></td></tr><tr><td>Random-Span Masking</td><td>79.7/80.0</td><td>82.7/82.8</td><td>71.9/69.5</td><td>84.8/79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>80.3/80.2</td><td>83.2/83.2</td><td>71.7/69.8</td><td>84.5/80.0</td></tr><tr><td>PMI-Masking</td><td>80.2/80.9</td><td>83.3/ 83.6</td><td>72.3/70.9</td><td>84.7/80.3</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT(54G):</td><td colspan=\"4\"></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>80.1/80.4</td><td>83.2/83.3</td><td>74.0/72.2</td><td>85.1/80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>80.4/80.0</td><td>83.3/83.0</td><td>73.9/71.4</td><td>85.6/80.3</td></tr><tr><td>PMI-Masking</td><td>80.9/82.0</td><td>83.9/84.9</td><td>74.8/73.2</td><td>86.0/80.8</td></tr></table>",
775
+ "bbox": [
776
+ 232,
777
+ 98,
778
+ 766,
779
+ 333
780
+ ],
781
+ "page_idx": 7
782
+ },
783
+ {
784
+ "type": "table",
785
+ "img_path": "images/e9516357ef887376897ed82df183e77bacaa46350d07840b2bb4d983247a67ce.jpg",
786
+ "table_caption": [
787
+ "Table 3: Comparing the RACE scores of our PMI-Masked models with comparable published Basesized models. The scores of prior MLMs were attained by finetuning released models in the same setup of the PMI-Masked models (Section 4), except for those marked in $^ { \\bullet } \\dag ^ { \\bullet }$ , reported in Zhang & Li (2020). The number of examples reflects the amounts of text examined during training, as all prior models train over the same sequence length as our PMI-Masked models, namely 512. AMBERT was trained over WIKIPEDIA $^ +$ OPENWEBTEXT (47G), SpanBERT over WIKIPEDIA $^ +$ BOOKCORPUS (16G), and RoBERTa over WIKIPEDIA $^ +$ BOOKCORPUS $^ +$ OPENWEBTEXT $^ +$ STORIES $^ +$ CCNEWS (160G – see details in Liu et al. (2019)). "
788
+ ],
789
+ "table_footnote": [],
790
+ "table_body": "<table><tr><td>PMI vsPrior BASE MLMs</td><td>Corpus size</td><td>Batch × Steps = Examples</td><td>RACE dev/test</td></tr><tr><td> PMI vs n-grams in vocabulary</td><td></td><td></td><td></td></tr><tr><td>AMBERT (Zhang&amp; Li, 2020)</td><td>47G</td><td>1024 × 0.5M= 512G</td><td>68.9†/66.8t</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 ×1M =256M</td><td>70.1/68.4</td></tr><tr><td>PMI vs Random-Span Masking</td><td></td><td></td><td></td></tr><tr><td>SpanBERTBASE (Joshi et al., 2020)</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>70.5/68.7</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>72.3/70.9</td></tr><tr><td colspan=\"4\">PMI vs Random-Token Masking with 3X more data and 6X more training examples</td></tr><tr><td>RoBERTaBAsE (Liu et al.,2019)</td><td>160G</td><td>8K × 0.5M=4G</td><td>74.9/73</td></tr><tr><td>PMI-Masking</td><td>54G</td><td>256 × 2.4M= 614.4M</td><td>74.8/73.2</td></tr></table>",
791
+ "bbox": [
792
+ 176,
793
+ 436,
794
+ 825,
795
+ 627
796
+ ],
797
+ "page_idx": 7
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "We also compared our PMI-Masking Base-sized models to published Base-sized models (Table 3), and again saw PMI-Masking increase both pretraining efficiency and end-of-training downstream performance. Zhang & Li (2020) trained their ‘AMBERT’ model over a vocabulary of $n$ -grams in parallel to the regular word/subword level vocabulary, performing the hard task of $n$ -gram prediction in parallel to the easy Random-Token level prediction task during pretraining. This approach yielded a model with $7 5 \\%$ more parameters than the common Base size of our PMI-Masking model. By using the PMI-masking scheme on a regular BERT architecture and vocabulary, we attained a significantly higher score on the RACE benchmark, despite training over a corpus $3 \\times$ smaller and showing the model $2 \\times$ fewer examples during pretraining. ",
802
+ "bbox": [
803
+ 173,
804
+ 797,
805
+ 825,
806
+ 924
807
+ ],
808
+ "page_idx": 7
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "Joshi et al. (2020) and Liu et al. (2019) only reported scores for SpanBERT and RoBERTa (respectively) for Large-sized models in their original papers, but did release weights for Base-sized models. We fine-tuned these models on the RACE development set via the same fine-tuning procedure we employed for our PMI-Masking models (described in Section 4), and evaluated the best performing model on the publicly available RACE test set. A PMI-Masking Base-sized model scored more than 2 points higher than the SpanBERTBASE trained by Random-Span Masking over the same pretraining corpus when shown the same number of examples. Remarkably, a PMI-Masking Base-sized model scored slightly higher than RoBERTaBASE trained by Random-Token Masking, even though RoBERTa was given access to a pretraining corpus $3 \\times$ larger and shown $6 \\times$ more training examples. ",
813
+ "bbox": [
814
+ 173,
815
+ 103,
816
+ 825,
817
+ 229
818
+ ],
819
+ "page_idx": 8
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "Lastly, we note that the measure of Single-Token perplexity is not indicative of downstream performance, when reported for models trained with different masking schemes. Comparing the adjacent table with the downstream evaluation of the same models in Table 2, it is clear that the ability to predict single tokens from context is not correlated with performance. This reinforces our observation that by minimizing their training objective, standard MLMs, which mask tokens randomly, train to excel on relatively many easy tasks that do not reflect the knowledge required for downstream understanding. ",
824
+ "bbox": [
825
+ 174,
826
+ 236,
827
+ 580,
828
+ 375
829
+ ],
830
+ "page_idx": 8
831
+ },
832
+ {
833
+ "type": "table",
834
+ "img_path": "images/af100fece500e7704bfc06b0744480b738e06b504b5a36afeeb6a74d3b368a49.jpg",
835
+ "table_caption": [
836
+ "Table 4: The Single-Token perplexity of MLMs trained for 1M steps over WIKI+BOOKCORPUS. "
837
+ ],
838
+ "table_footnote": [],
839
+ "table_body": "<table><tr><td colspan=\"2\">Single-Token Perplexity</td></tr><tr><td>Random-Token Masking</td><td>2.96</td></tr><tr><td>Random-Span Masking</td><td>4.30</td></tr><tr><td>Naive-PMI-Masking</td><td>7.35</td></tr><tr><td>PMI-Masking</td><td>21.85</td></tr></table>",
840
+ "bbox": [
841
+ 593,
842
+ 236,
843
+ 833,
844
+ 318
845
+ ],
846
+ "page_idx": 8
847
+ },
848
+ {
849
+ "type": "text",
850
+ "text": "6 CONCLUSION ",
851
+ "text_level": 1,
852
+ "bbox": [
853
+ 176,
854
+ 395,
855
+ 318,
856
+ 411
857
+ ],
858
+ "page_idx": 8
859
+ },
860
+ {
861
+ "type": "text",
862
+ "text": "Bidirectional language models hold the potential to unlock greater signal from the training data than unidirectional models (such as GPT). BERT-based MLMs are historically the first (and still the most prominent) implementation of inherently bidirectional language models, but they come at a price. A hint of this price is the fact that Single-Token perplexity, which captures the ability to predict single tokens and which has a natural probabilistic interpretation in the autoregressive unidirectional case, ceases to correlate with downstream performance across different MLMs (see Table 4). This means that the original MLM task, which is focused on single token prediction, should be reconsidered. This has been the focus of this paper, which points to the inefficiency of random-token masking, and offers PMI-masking as an alternative with several advantages: (i) It is a principled approach, based on a nuanced extension of binary PMI to the n-ary case. (ii) It leads to better downstream performance, for example it surpasses RoBERTa (which uses vanilla random token masking) on the challenging reading comprehension RACE test with $6 \\times$ less training over a $3 \\times$ smaller corpus, and it dominates the more naive, heuristic approach of random span masking at any point during pretraining, matches its end-of-training performance halfway during its own pretraining, and at the end of training improves on it by 1-2 points across a variety of downstream tasks. Perhaps due to their conceptual simplicity, unidirectional models were the first to break the 100B parameter limit with the recent GPT3 (Brown et al., 2020). Bidirectional models will soon follow, and this paper can accelerate their development by offering a way to significantly lower their training costs while boosting performance. ",
863
+ "bbox": [
864
+ 174,
865
+ 428,
866
+ 825,
867
+ 691
868
+ ],
869
+ "page_idx": 8
870
+ },
871
+ {
872
+ "type": "text",
873
+ "text": "REFERENCES ",
874
+ "text_level": 1,
875
+ "bbox": [
876
+ 174,
877
+ 713,
878
+ 285,
879
+ 728
880
+ ],
881
+ "page_idx": 8
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. In Proceedings of the second PASCAL challenges workshop on recognising textual entailment, pp. 6–4, 2006. 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. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task ˜ 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In International Workshop on Semantic Evaluation (SemEval), pp. 1–14, Vancouver, Canada, 2017. Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Springer, 2005. ",
886
+ "bbox": [
887
+ 173,
888
+ 737,
889
+ 828,
890
+ 924
891
+ ],
892
+ "page_idx": 8
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "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), 2019a. ",
897
+ "bbox": [
898
+ 173,
899
+ 103,
900
+ 823,
901
+ 146
902
+ ],
903
+ "page_idx": 9
904
+ },
905
+ {
906
+ "type": "text",
907
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Original bert github repository. https://github.com/google-research/bert, 2019b. ",
908
+ "bbox": [
909
+ 174,
910
+ 156,
911
+ 821,
912
+ 185
913
+ ],
914
+ "page_idx": 9
915
+ },
916
+ {
917
+ "type": "text",
918
+ "text": "William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005. ",
919
+ "bbox": [
920
+ 173,
921
+ 195,
922
+ 821,
923
+ 224
924
+ ],
925
+ "page_idx": 9
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "Doug Downey, Matthew Broadhead, and Oren Etzioni. Locating complex named entities in web text. In Proceedings of the 20th International Joint Conference on Artifical Intelligence, IJCAI’07, pp. 2733–2739, San Francisco, CA, USA, 2007. Morgan Kaufmann Publishers Inc. ",
930
+ "bbox": [
931
+ 173,
932
+ 234,
933
+ 825,
934
+ 277
935
+ ],
936
+ "page_idx": 9
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "R.M Fano. Transmission of Information: A Statistical Theory of Communications. Transmission of Information: A Statistical Theory of Communications. M.I.T. Press, 1961. ISBN 9780262060011. URL https://books.google.co.il/books?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ VSYIAQAAIAAJ. ",
941
+ "bbox": [
942
+ 173,
943
+ 287,
944
+ 825,
945
+ 332
946
+ ],
947
+ "page_idx": 9
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "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, 2007. ",
952
+ "bbox": [
953
+ 174,
954
+ 340,
955
+ 825,
956
+ 385
957
+ ],
958
+ "page_idx": 9
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "Aaron Gokaslan and Vanya Cohen. Openwebtext corpus, 2019. ",
963
+ "bbox": [
964
+ 173,
965
+ 393,
966
+ 589,
967
+ 410
968
+ ],
969
+ "page_idx": 9
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020. ",
974
+ "bbox": [
975
+ 173,
976
+ 420,
977
+ 820,
978
+ 449
979
+ ],
980
+ "page_idx": 9
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64–77, 2020. ",
985
+ "bbox": [
986
+ 174,
987
+ 458,
988
+ 825,
989
+ 502
990
+ ],
991
+ "page_idx": 9
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "Ioannis Korkontzelos, Ioannis P Klapaftis, and Suresh Manandhar. Reviewing and evaluating automatic term recognition techniques. In International Conference on Natural Language Processing, pp. 248–259. Springer, 2008. ",
996
+ "bbox": [
997
+ 173,
998
+ 511,
999
+ 825,
1000
+ 555
1001
+ ],
1002
+ "page_idx": 9
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "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. ",
1007
+ "bbox": [
1008
+ 169,
1009
+ 564,
1010
+ 823,
1011
+ 594
1012
+ ],
1013
+ "page_idx": 9
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "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. ",
1018
+ "bbox": [
1019
+ 174,
1020
+ 603,
1021
+ 823,
1022
+ 647
1023
+ ],
1024
+ "page_idx": 9
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arxiv preprint arXiv:1907.11692, 2019. ",
1029
+ "bbox": [
1030
+ 174,
1031
+ 656,
1032
+ 825,
1033
+ 700
1034
+ ],
1035
+ "page_idx": 9
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. arXiv preprint, 2019. ",
1040
+ "bbox": [
1041
+ 173,
1042
+ 710,
1043
+ 825,
1044
+ 739
1045
+ ],
1046
+ "page_idx": 9
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "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. ",
1051
+ "bbox": [
1052
+ 173,
1053
+ 750,
1054
+ 825,
1055
+ 792
1056
+ ],
1057
+ "page_idx": 9
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "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. ",
1062
+ "bbox": [
1063
+ 169,
1064
+ 803,
1065
+ 823,
1066
+ 832
1067
+ ],
1068
+ "page_idx": 9
1069
+ },
1070
+ {
1071
+ "type": "text",
1072
+ "text": "Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018. ",
1073
+ "bbox": [
1074
+ 169,
1075
+ 842,
1076
+ 825,
1077
+ 871
1078
+ ],
1079
+ "page_idx": 9
1080
+ },
1081
+ {
1082
+ "type": "text",
1083
+ "text": "Carlos Ramisch, Vitor De Araujo, and Aline Villavicencio. A broad evaluation of techniques for automatic acquisition of multiword expressions. In Proceedings of ACL 2012 Student Research Workshop, pp. 1–6, 2012. ",
1084
+ "bbox": [
1085
+ 174,
1086
+ 882,
1087
+ 825,
1088
+ 924
1089
+ ],
1090
+ "page_idx": 9
1091
+ },
1092
+ {
1093
+ "type": "text",
1094
+ "text": "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), pp. 1631–1642, 2013. ",
1095
+ "bbox": [
1096
+ 173,
1097
+ 103,
1098
+ 826,
1099
+ 159
1100
+ ],
1101
+ "page_idx": 10
1102
+ },
1103
+ {
1104
+ "type": "text",
1105
+ "text": "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. ",
1106
+ "bbox": [
1107
+ 178,
1108
+ 167,
1109
+ 820,
1110
+ 212
1111
+ ],
1112
+ "page_idx": 10
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "Tim Van de Cruys. Two multivariate generalizations of pointwise mutual information. In Proceedings of the Workshop on Distributional Semantics and Compositionality, pp. 16–20, 2011. ",
1117
+ "bbox": [
1118
+ 173,
1119
+ 219,
1120
+ 821,
1121
+ 250
1122
+ ],
1123
+ "page_idx": 10
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NIPS), 2017. ",
1128
+ "bbox": [
1129
+ 174,
1130
+ 257,
1131
+ 821,
1132
+ 301
1133
+ ],
1134
+ "page_idx": 10
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "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. arXiv preprint arXiv:1804.07461, 2018. ",
1139
+ "bbox": [
1140
+ 173,
1141
+ 309,
1142
+ 823,
1143
+ 352
1144
+ ],
1145
+ "page_idx": 10
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "Alex Wang, Amapreet 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), 2019. ",
1150
+ "bbox": [
1151
+ 174,
1152
+ 361,
1153
+ 823,
1154
+ 404
1155
+ ],
1156
+ "page_idx": 10
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471, 2018. ",
1161
+ "bbox": [
1162
+ 173,
1163
+ 412,
1164
+ 821,
1165
+ 441
1166
+ ],
1167
+ "page_idx": 10
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "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), pp. 1112–1122, 2018. ",
1172
+ "bbox": [
1173
+ 173,
1174
+ 450,
1175
+ 821,
1176
+ 493
1177
+ ],
1178
+ "page_idx": 10
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "Xinsong Zhang and Hang Li. Ambert: A pre-trained language model with multi-grained tokenization. arXiv preprint arXiv:2008.11869, 2020. ",
1183
+ "bbox": [
1184
+ 169,
1185
+ 502,
1186
+ 823,
1187
+ 531
1188
+ ],
1189
+ "page_idx": 10
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "Willem Zuidema. What are the productive units of natural language grammar? a dop approach to the automatic identification of constructions. In Proceedings of the Tenth Conference on Computational Natural Language Learning (CoNLL-X), pp. 29–36, 2006. ",
1194
+ "bbox": [
1195
+ 176,
1196
+ 540,
1197
+ 823,
1198
+ 583
1199
+ ],
1200
+ "page_idx": 10
1201
+ },
1202
+ {
1203
+ "type": "image",
1204
+ "img_path": "images/0f865b35f9f01980623319a1c0c0de56d8e5ec7d6509b5db275085772b6d88c3.jpg",
1205
+ "image_caption": [
1206
+ "Figure 3: Quality measures of top ranking $\\mathrm { P M I } _ { n }$ $n$ -grams lists increased in increments of 50K. The masking vocabulary size was chosen such that it includes as many $n$ -grams labeled as collocation as possible, while not including too many $n$ -grams labeled as not a collocation, in an internally constructed test set detailed below. $r$ is the percent of all positively labeled examples from the test set that appear within the given list (recall), $c$ is the percent of all negatively labeled examples from the test set that do not appear within the given list (complement-recall). We aim for a list size for which both $r$ and $c$ are high enough, and employ $f$ as a measure for this, finally choosing a list size of $8 0 0 \\mathrm { K }$ . "
1207
+ ],
1208
+ "image_footnote": [],
1209
+ "bbox": [
1210
+ 240,
1211
+ 99,
1212
+ 754,
1213
+ 335
1214
+ ],
1215
+ "page_idx": 11
1216
+ },
1217
+ {
1218
+ "type": "text",
1219
+ "text": "A DETERMINING THE MASKING VOCABULARY SIZE ",
1220
+ "text_level": 1,
1221
+ "bbox": [
1222
+ 174,
1223
+ 494,
1224
+ 617,
1225
+ 510
1226
+ ],
1227
+ "page_idx": 11
1228
+ },
1229
+ {
1230
+ "type": "text",
1231
+ "text": "The $\\mathrm { P M I } _ { n }$ measure, defined in eq. 3, provides an $n$ -gram ranking function that is intended to rank an $n$ -gram higher if its components are more indicative of one another. However, this measure alone is not enough for composing a masking vocabulary: we need to decide on its size $M$ (the masking vocabulary will be composed of the top- $M$ ranked $n$ -grams). One could advocate for an ablation study in which $M$ is varied, and models are pretrained per $M$ and evaluated. This can be done in future work, and perhaps an even stronger result can be shown for PMI-Masking with masking vocabulary size chosen by such optimization. ",
1232
+ "bbox": [
1233
+ 174,
1234
+ 532,
1235
+ 825,
1236
+ 631
1237
+ ],
1238
+ "page_idx": 11
1239
+ },
1240
+ {
1241
+ "type": "text",
1242
+ "text": "As a proxy, we determined the masking vocabulary size $M$ via a small scale evaluation of an $n$ - gram’s “collocation quality” as a function of its $\\mathrm { P M I } _ { n }$ rank. Specifically, we created an ad hoc test set composed of $1 0 0 0 ~ n$ -grams that we labeled either as collocation or not a collocation (available upon request). We did that by choosing at random 10 words with frequency above 10000 in WIKIPEDIA $^ +$ BOOKCORPUS, and for each word sampled 25 $n$ -grams per length $n \\in \\{ 2 , 3 , 4 , 5 \\}$ that contain it. Finally, we manually labeled each collected $n$ -gram, where the textbook definition of collocation was given to the annotators (the annotator agreement was $80 \\%$ over 100 shared examples). ",
1243
+ "bbox": [
1244
+ 174,
1245
+ 637,
1246
+ 823,
1247
+ 748
1248
+ ],
1249
+ "page_idx": 11
1250
+ },
1251
+ {
1252
+ "type": "text",
1253
+ "text": "Then, we increased a list size $M$ in steps of $5 0 \\mathrm { K }$ , adding $n$ -grams from the top ranking $\\mathrm { P M I } _ { n }$ downwards. For each $M$ -sized list we computed two different scores on the test set. The first is the recall of the positive examples in the list, denoted $r$ : the percent of all positively labeled examples from the test set that appear within the given list. The second is the recall of the negative examples in the complement of the list, dubbed complement-recall, denoted $c$ : the percent of all negatively labeled examples from the test set that do not appear within the given list. By these definitions, the recall $r$ starts low and increases with list size and the complement-recall $c$ follows an opposite trend, as can be seen in Figure 3. Our desired masking vocabulary size should yield a list with many $n$ -grams labeled as collocation while containing little $n$ -grams labeled not a collocation. we define $\\textstyle f { \\overset { } { = } } { \\frac { 2 r \\cdot c } { r + c } }$ as a measure for optimization which balances the two requirements, and Figure 3 shows that this measure is highest at sizes of around 700-800, so we set the masking vocabulary size to be 800K. ",
1254
+ "bbox": [
1255
+ 174,
1256
+ 756,
1257
+ 825,
1258
+ 922
1259
+ ],
1260
+ "page_idx": 11
1261
+ },
1262
+ {
1263
+ "type": "text",
1264
+ "text": "Table 5 shows the pretraining hyper-parameters we used, as well as the architecture specifics, both follow the standard implementation of BERT. ",
1265
+ "bbox": [
1266
+ 173,
1267
+ 137,
1268
+ 825,
1269
+ 165
1270
+ ],
1271
+ "page_idx": 12
1272
+ },
1273
+ {
1274
+ "type": "text",
1275
+ "text": "Number of Layers 12 \nHidden Size 768 \nSequence Length 512 \nFFN Inner Hidden Size 3072 \nAttention Heads 1 2 \nAttention Head Size 64 \nDropout 0.1 \nAttention Dropout 0.1 \nWarmup Steps 10,000 \nPeak Learning Rate 1e-4 \nBatch Size 256 \nWeight Decay 0.01 \nInitializer Range 0.02 \nLearning Rate Decay Linear \nAdam \u000f 1e-6 \nAdam $\\beta _ { 1 }$ 0.9 \nAdam $\\beta _ { 2 }$ 0.999 ",
1276
+ "bbox": [
1277
+ 397,
1278
+ 184,
1279
+ 601,
1280
+ 440
1281
+ ],
1282
+ "page_idx": 12
1283
+ },
1284
+ {
1285
+ "type": "text",
1286
+ "text": "C EVALUATION OF DIFFERENT CHECKPOINTS DURING PRETRAINING ",
1287
+ "text_level": 1,
1288
+ "bbox": [
1289
+ 171,
1290
+ 526,
1291
+ 756,
1292
+ 542
1293
+ ],
1294
+ "page_idx": 12
1295
+ },
1296
+ {
1297
+ "type": "text",
1298
+ "text": "Tables 6 and 7 respectively present the development set scores on SQuAD2.0 and RACE, attained for models at different checkpoints during pretraining. The SQuAD2.0 scores are depicted in Figures 1 and 2. ",
1299
+ "bbox": [
1300
+ 173,
1301
+ 560,
1302
+ 823,
1303
+ 603
1304
+ ],
1305
+ "page_idx": 12
1306
+ },
1307
+ {
1308
+ "type": "table",
1309
+ "img_path": "images/5817b3e4989c3dba68079b86a60e2f107533e877acd112ce5181f69b3b39058f.jpg",
1310
+ "table_caption": [],
1311
+ "table_footnote": [],
1312
+ "table_body": "<table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan=\"10\">1M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>74.4</td><td>76.7</td><td>77.9</td><td>78.9</td><td>79.3</td><td>一</td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>74.8</td><td>77.9</td><td>78.4</td><td>79.1</td><td>79.6</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>75.5</td><td>78</td><td>79.2</td><td>79.4</td><td>79.7</td><td>1</td><td>1</td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>74.8</td><td>77.4</td><td>78.9</td><td>79.6</td><td>80.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>77.0</td><td>78.8</td><td>80.3</td><td>81.1</td><td>81.3</td><td>1</td><td></td><td></td><td></td></tr><tr><td colspan=\"10\"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>75.8</td><td>78.4</td><td></td><td></td><td>80.9</td><td>81.8</td><td>82.2</td><td></td><td>83.1</td></tr><tr><td>PMI-Masking</td><td>77.2</td><td>79.8</td><td>79.8 81.0</td><td>80.4 81.6</td><td>81.8</td><td>82.4</td><td>83.1</td><td>82.9 83.0</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>83.3</td></tr><tr><td colspan=\"10\"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>77.1</td><td>78.9</td><td>80.9</td><td>81.0</td><td>81.8</td><td>82.3</td><td>82.7</td><td>83.1</td><td>83.2</td></tr><tr><td>PMI-Masking</td><td>78.4</td><td>80.7</td><td>82.1</td><td>82.4</td><td>82.9</td><td>83.3</td><td>83.8</td><td>84.0</td><td>84.3</td></tr></table>",
1313
+ "bbox": [
1314
+ 171,
1315
+ 618,
1316
+ 813,
1317
+ 827
1318
+ ],
1319
+ "page_idx": 12
1320
+ },
1321
+ {
1322
+ "type": "text",
1323
+ "text": "Table 6: The F1 score on the SQuAD2.0 development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. These scores are depicted in Figures 1 and 2. We finetuned on SQuAD2.0 with batch size of 32 and learning rate of $3 \\cdot 1 0 ^ { \\bar { - } 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores. ",
1324
+ "bbox": [
1325
+ 173,
1326
+ 837,
1327
+ 825,
1328
+ 909
1329
+ ],
1330
+ "page_idx": 12
1331
+ },
1332
+ {
1333
+ "type": "table",
1334
+ "img_path": "images/ec3ac52bc249c0e775359079c34692df9444a8cd680daf9eeca16f8d9936e3af.jpg",
1335
+ "table_caption": [],
1336
+ "table_footnote": [],
1337
+ "table_body": "<table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan=\"10\">1M training steps on WIKIPEDIA+BoOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>61.2</td><td>64.3</td><td>65.6</td><td>66.4</td><td>67.1</td><td></td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>62.0</td><td>64.9</td><td>66.0</td><td>67.0</td><td>67.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>63.7</td><td>65.7</td><td>67.3</td><td>68.5</td><td>68.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>61.7</td><td>64.7</td><td>66.8</td><td>67.9</td><td>68.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>63.5</td><td>66.8</td><td>68.4</td><td>68.9</td><td>69.7</td><td></td><td></td><td></td><td></td></tr><tr><td colspan=\"10\">2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>62.3</td><td>64.3</td><td>65.6</td><td>67.8</td><td>69.0</td><td>68.9</td><td>70.3</td><td>71.0</td><td>71.4</td></tr><tr><td>PMI-Masking</td><td>63.6</td><td>66.7</td><td>67.3</td><td>68.5</td><td>69.2</td><td>70.4</td><td>70.5</td><td>71.2</td><td>72.2</td></tr><tr><td colspan=\"10\">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>64.6</td><td>67.0</td><td>69.2</td><td>69.9</td><td>70.5</td><td>71.3</td><td>72.9</td><td>73.5</td><td>73.4</td></tr><tr><td>PMI-Masking</td><td>66.5</td><td>68.6</td><td>70.7</td><td>71.4</td><td>72.4</td><td>72.5</td><td>73.6</td><td>74.1</td><td>74.5</td></tr></table>",
1338
+ "bbox": [
1339
+ 171,
1340
+ 101,
1341
+ 812,
1342
+ 310
1343
+ ],
1344
+ "page_idx": 13
1345
+ },
1346
+ {
1347
+ "type": "text",
1348
+ "text": "Table 7: The accuracy score on the RACE development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. We finetuned on RACE with batch size of 32 and learning rate of $3 \\cdot 1 0 ^ { - 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores. ",
1349
+ "bbox": [
1350
+ 173,
1351
+ 319,
1352
+ 825,
1353
+ 390
1354
+ ],
1355
+ "page_idx": 13
1356
+ },
1357
+ {
1358
+ "type": "text",
1359
+ "text": "D GLUE TASKS AND DETAILED SCORES ",
1360
+ "text_level": 1,
1361
+ "bbox": [
1362
+ 173,
1363
+ 415,
1364
+ 524,
1365
+ 433
1366
+ ],
1367
+ "page_idx": 13
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "The General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019) consists of 9 sentence-level tasks. Sentence-level classification tasks: CoLA (Warstadt et al., 2018) (evaluating linguistic acceptability) and SST-2 (Socher et al., 2013) (sentiment classification). Sentencepair similarity tasks: MRPC (Dolan & Brockett, 2005) (binary paraphrasing classification task), STS-B (Cer et al., 2017): (graded similarity scoring task), and $\\mathrm { \\bar { Q } O P ^ { 2 } }$ (binary paraphrasing classification task). Natural language inference tasks: MNLI (Williams et al., 2018), QNLI (Rajpurkar et al., 2016), RTE (Dagan et al., 2005; Bar-Haim et al., 2006; Giampiccolo et al., 2007) and WNLI (Levesque et al., 2011). Table 8 shows the detailed per-task scores of our examined models. ",
1372
+ "bbox": [
1373
+ 173,
1374
+ 445,
1375
+ 825,
1376
+ 559
1377
+ ],
1378
+ "page_idx": 13
1379
+ },
1380
+ {
1381
+ "type": "table",
1382
+ "img_path": "images/8e4567b124af3c20d00e7dac874eb16bef640964d9cf9f6ae4cb013cf79fb3fd.jpg",
1383
+ "table_caption": [
1384
+ "Table 8: Results on the different tasks of the GLUE benchmark. For all tasks the scores reflect accuracy, except for STS-B (spearman score) and CoLA (Mathews Correlation). For results reported on the development set (1M training steps), the average score is simply the average of reported scores. For results reported on the test sets (2.4M training steps), the average score is the official GLUE leaderboard score. The official score includes averaging of F1 scores for QQP and MRPC, as well as the default majority submission score of 65.1 for WNLI. "
1385
+ ],
1386
+ "table_footnote": [],
1387
+ "table_body": "<table><tr><td>GLUE</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>Avg</td></tr><tr><td colspan=\"10\">1Mtraining steps on Wikipedia+BookCorpus; ondev</td></tr><tr><td>Random-Span Masking</td><td>84.0/-</td><td>91.4</td><td>90.8</td><td>69.0</td><td>92.8</td><td>88.5</td><td>58.5</td><td>88.9</td><td>83.0</td></tr><tr><td>Naive-PMI-Masking</td><td>85.1/-</td><td>91.9</td><td>91.0</td><td>74.0</td><td>93.3</td><td>88.2</td><td>60.3</td><td>89.3</td><td>84.1</td></tr><tr><td>PMI-Masking</td><td>85.2/-</td><td>91.8</td><td>91.0</td><td>72.2</td><td>92.7</td><td>89.7</td><td>60.6</td><td>89.3</td><td>84.1</td></tr><tr><td colspan=\"10\">2.4M training steps on WIKIPEDIA+BoOKCORPUS; ( on</td></tr><tr><td>Random-Span Masking</td><td>85.7/84.7</td><td>92.9</td><td>89.4</td><td>test 69.8</td><td>93</td><td>85.4</td><td>56.5</td><td>86.6</td><td>79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>85.5/85.3</td><td>92.2</td><td>89.2</td><td>68.9</td><td>93.6</td><td>85.4</td><td>59.4</td><td>87.3</td><td>80.0</td></tr><tr><td>PMI-Masking</td><td>85.3/85.0</td><td>92.0</td><td>89.2</td><td>69.0</td><td>94.0</td><td>85.6</td><td>61.8</td><td>86.8</td><td>80.3</td></tr><tr><td colspan=\"10\">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT; on test</td></tr><tr><td>Random-Span Masking</td><td>86.3/85.1</td><td>92.2</td><td>89.4</td><td>71.1</td><td>94.6</td><td>85.6</td><td>56.8</td><td>87.2</td><td>80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>86/85.4</td><td>91.7</td><td>89.4</td><td>69.2</td><td>95.1</td><td>87.8</td><td>57.5</td><td>87.9</td><td>80.3</td></tr><tr><td>PMI-Masking</td><td>86.6/85.8</td><td>93.1</td><td>89.5</td><td>72.9</td><td>94.7</td><td>87.7</td><td>57.4</td><td>87.7</td><td>80.8</td></tr></table>",
1388
+ "bbox": [
1389
+ 176,
1390
+ 573,
1391
+ 826,
1392
+ 765
1393
+ ],
1394
+ "page_idx": 13
1395
+ }
1396
+ ]
parse/train/3Aoft6NWFej/3Aoft6NWFej_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/3Aoft6NWFej/3Aoft6NWFej_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1eSS3CcKX/H1eSS3CcKX.md ADDED
@@ -0,0 +1,704 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STOCHASTIC OPTIMIZATION OF SORTING NETWORKS VIA CONTINUOUS RELAXATIONS
2
+
3
+ Aditya Grover∗, Eric Wang∗, Aaron Zweig & Stefano Ermon Computer Science Department
4
+ Stanford University
5
+ {adityag,ejwang,azweig,ermon}@cs.stanford.edu
6
+
7
+ # ABSTRACT
8
+
9
+ Sorting input objects is an important step in many machine learning pipelines. However, the sorting operator is non-differentiable with respect to its inputs, which prohibits end-to-end gradient-based optimization. In this work, we propose NeuralSort, a general-purpose continuous relaxation of the output of the sorting operator from permutation matrices to the set of unimodal row-stochastic matrices, where every row sums to one and has a distinct arg max. This relaxation permits straight-through optimization of any computational graph involve a sorting operation. Further, we use this relaxation to enable gradient-based stochastic optimization over the combinatorially large space of permutations by deriving a reparameterized gradient estimator for the Plackett-Luce family of distributions over permutations. We demonstrate the usefulness of our framework on three tasks that require learning semantic orderings of high-dimensional objects, including a fully differentiable, parameterized extension of the $k$ -nearest neighbors algorithm.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Learning to automatically sort objects is useful in many machine learning applications, such as top$k$ multi-class classification (Berrada et al., 2018), ranking documents for information retrieval (Liu et al., 2009), and multi-object target tracking in computer vision (Bar-Shalom & Li, 1995). Such algorithms typically require learning informative representations of complex, high-dimensional data, such as images, before sorting and subsequent downstream processing. For instance, the $k$ -nearest neighbors image classification algorithm, which orders the neighbors based on distances in the canonical pixel basis, can be highly suboptimal for classification (Weinberger et al., 2006). Deep neural networks can instead be used to learn representations, but these representations cannot be optimized end-to-end for a downstream sorting-based objective, since the sorting operator is not differentiable with respect to its input.
14
+
15
+ In this work, we seek to remedy this shortcoming by proposing NeuralSort, a continuous relaxation to the sorting operator that is differentiable almost everywhere with respect to the inputs. The output of any sorting algorithm can be viewed as a permutation matrix, which is a square matrix with entries in $\{ 0 , 1 \}$ such that every row and every column sums to 1. Instead of a permutation matrix, NeuralSort returns a unimodal row-stochastic matrix. A unimodal row-stochastic matrix is defined as a square matrix with positive real entries, where each row sums to 1 and has a distinct arg max. All permutation matrices are unimodal row-stochastic matrices. NeuralSort has a temperature knob that controls the degree of approximation, such that in the limit of zero temperature, we recover a permutation matrix that sorts the inputs. Even for a non-zero temperature, we can efficiently project any unimodal matrix to the desired permutation matrix via a simple row-wise arg max operation. Hence, NeuralSort is also suitable for efficient straight-through gradient optimization (Bengio et al., 2013), which requires “exact” permutation matrices to evaluate learning objectives.
16
+
17
+ As the second primary contribution, we consider the use of NeuralSort for stochastic optimization over permutations. In many cases, such as latent variable models, the permutations may be latent but directly influence observed behavior, e.g., utility and choice models are often expressed as distributions over permutations which govern the observed decisions of agents (Regenwetter et al.,
18
+
19
+ 2006; Chierichetti et al., 2018). By learning distributions over unobserved permutations, we can account for the uncertainty in these permutations in a principled manner. However, the challenge with stochastic optimization over discrete distributions lies in gradient estimation with respect to the distribution parameters. Vanilla REINFORCE estimators are impractical for most cases, or necessitate custom control variates for low-variance gradient estimation (Glasserman, 2013).
20
+
21
+ In this regard, we consider the Plackett-Luce (PL) family of distributions over permutations (Plackett, 1975; Luce, 1959). A common modeling choice for ranking models, the PL distribution is parameterized by $n$ scores, with its support defined over the symmetric group consisting of $n !$ permutations. We derive a reparameterizable sampler for stochastic optimization with respect to this distribution, based on Gumbel perturbations to the $n$ (log-)scores. However, the reparameterized sampler requires sorting these perturbed scores, and hence the gradients of a downstream learning objective with respect to the scores are not defined. By using NeuralSort instead, we can approximate the objective and obtain well-defined reparameterized gradient estimates for stochastic optimization.
22
+
23
+ Finally, we apply NeuralSort to tasks that require us to learn semantic orderings of complex, highdimensional input data. First, we consider sorting images of handwritten digits, where the goal is to learn to sort images by their unobserved labels. Our second task extends the first one to quantile regression, where we want to estimate the median (50-th percentile) of a set of handwritten numbers. In addition to identifying the index of the median image in the sequence, we need to learn to map the inferred median digit to its scalar representation. In the third task, we propose an algorithm that learns a basis representation for the $k$ -nearest neighbors (kNN) classifier in an end-to-end procedure. Because the choice of the $k$ nearest neighbors requires a non-differentiable sorting, we use NeuralSort to obtain an approximate, differentiable surrogate. On all tasks, we observe significant empirical improvements due to NeuralSort over the relevant baselines and competing relaxations to permutation matrices.
24
+
25
+ # 2 PRELIMINARIES
26
+
27
+ An $n$ -dimensional permutation $\mathbf { z } = [ z _ { 1 } , z _ { 2 } , \ldots , z _ { n } ] ^ { T }$ is a list of unique indices $\{ 1 , 2 , \ldots , n \}$ . Every permutation $\mathbf { z }$ is associated with a permutation matrix $P _ { \mathbf { z } } \in \{ 0 , 1 \} ^ { n \times n }$ with entries given as:
28
+
29
+ $$
30
+ P _ { \mathbf { z } } [ i , j ] = { \Big \{ } _ { 0 } ^ { 1 { \mathrm { i f } } \ j } = z _ { i }
31
+ $$
32
+
33
+ Let ${ \mathcal { Z } } _ { n }$ denote the set of all $n !$ possible permutations in the symmetric group. We define the sort : $\mathbb { R } ^ { n } \to { \mathcal Z } _ { n }$ operator as a mapping of $n$ real-valued inputs to a permutation corresponding to a descending ordering of these inputs. E.g., if the input vector $\mathbf { s } ~ = ~ [ 9 , 1 , 5 , 2 ] ^ { T }$ , then $\mathsf { s o r t } ( \mathbf { s } ) = [ 1 , 3 , \bar { 4 } , 2 ] ^ { T }$ since the largest element is at the first index, second largest element is at the third index and so on. In case of ties, elements are assigned indices in the order they appear. We can obtain the sorted vector simply via $P _ { \mathrm { s o r t } ( \mathbf { s } ) } \mathbf { s }$ .
34
+
35
+ # 2.1 PLACKETT-LUCE DISTRIBUTIONS
36
+
37
+ The family of Plackett-Luce distributions over permutations is best described via a generative process: Consider a sequence of $n$ items, each associated with a canonical index $i = 1 , 2 , \ldots , n$ . A common assumption in ranking models is that the underlying generating process for any observed permutation of $n$ items satisfies Luce’s choice axiom (Luce, 1959). Mathematically, this axiom defines the ‘choice’ probability of an item with index $i$ as: $q ( i ) \propto s _ { i }$ where $s _ { i } > 0$ is interpreted as the score of item with index i. The normalization constant is given by Z = Pi∈{1,2,...,n} si.
38
+
39
+ If we choose the $n$ items one at a time (without replacement) based on these choice probabilities, we obtain a discrete distribution over all possible permutations. This distribution is referred to as the Plackett-Luce (PL) distribution, and its probability mass function for any $\mathbf { z } \in \mathcal { Z } _ { n }$ is given by:
40
+
41
+ $$
42
+ q ( \mathbf { z } | \mathbf { s } ) = { \frac { s _ { z _ { 1 } } } { Z } } { \frac { s _ { z _ { 2 } } } { Z - s _ { z _ { 1 } } } } \cdot \cdot \cdot { \frac { s _ { z _ { n } } } { Z - \sum _ { i = 1 } ^ { n - 1 } s _ { z _ { i } } } }
43
+ $$
44
+
45
+ where $\mathbf { s } = \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } \}$ is the vector of scores parameterizing this distribution (Plackett, 1975).
46
+
47
+ ![](images/2cd6803df10d8307ea63987420e079ffe9691fb10c934d4bb59acd67e03bfca0.jpg)
48
+ Figure 1: Stochastic computation graphs with a deterministic node z corresponding to the output of a sort operator applied to the scores s.
49
+
50
+ # 2.2 STOCHASTIC COMPUTATION GRAPHS
51
+
52
+ The abstraction of stochastic computation graphs (SCG) compactly specifies the forward value and the backward gradient computation for computational circuits. An SCG is a directed acyclic graph that consists of three kinds of nodes: input nodes which specify external inputs (including parameters), deterministic nodes which are deterministic functions of their parents, and stochastic nodes which are distributed conditionally on their parents. See Schulman et al. (2015) for a review.
53
+
54
+ To define gradients of an objective function with respect to any node in the graph, the chain rule necessitates that the gradients with respect to the intermediate nodes are well-defined. This is not the case for the sort operator. In Section 3, we propose to extend stochastic computation graphs with nodes corresponding to a relaxation of the deterministic sort operator. In Section 4, we further use this relaxation to extend computation graphs to include stochastic nodes corresponding to distributions over permutations. The proofs of all theoretical results in this work are deferred to Appendix B.
55
+
56
+ # 3 NEURALSORT: THE RELAXED SORTING OPERATOR
57
+
58
+ Our goal is to optimize training objectives involving a sort operator with gradient-based methods. Consider the optimization of objectives written in the following form:
59
+
60
+ $$
61
+ L ( \boldsymbol { \theta } , \mathbf { s } ) = f ( P _ { \mathbf { z } } ; \boldsymbol { \theta } )
62
+ $$
63
+
64
+ Here, $\mathbf { s } \in \mathbb { R } ^ { n }$ denotes a vector of $n$ real-valued scores, $\mathbf { z }$ is the permutation that (deterministically) sorts the scores s, and $f ( \cdot )$ is an arbitrary function of interest assumed to be differentiable w.r.t a set of parameters $\theta$ and $\mathbf { z }$ . For example, in a ranking application, these scores could correspond to the inferred relevances of $n$ webpages and $f ( \cdot )$ could be a ranking loss. Figure 1 shows the stochastic computation graph corresponding to the objective in Eq. 2. We note that this could represent part of a more complex computation graph, which we skip for ease of presentation while maintaining the generality of the scope of this work.
65
+
66
+ While the gradient of the above objective w.r.t. $\theta$ is well-defined and can be computed via standard backpropogation, the gradient w.r.t. the scores s is not defined since the sort operator is not differentiable w.r.t. s. Our solution is to derive a relaxation to the sort operator that leads to a surrogate objective with well-defined gradients. In particular, we seek to use such a relaxation to replace the permutation matrix $P _ { \mathbf { z } }$ in Eq. 2 with an approximation $\widehat { P } _ { \mathbf { z } }$ such that the surrogate objective $f ( \widehat { P } _ { \mathbf { z } } ; \theta )$ is differentiable w.r.t. the scores s.
67
+
68
+ The general recipe to relax non-differentiable operators with discrete codomains $\mathcal { N }$ is to consider differentiable alternatives that map the input to a larger continuous codomain $\mathcal { M }$ with desirable properties. For gradient-based optimization, we are interested in two key properties:
69
+
70
+ 1. The relaxation is continuous everywhere and differentiable (almost-)everywhere with respect to elements in the input domain. 2. There exists a computationally efficient projection from $\mathcal { M }$ back to $\mathcal { N }$ .
71
+
72
+ Relaxations satisfying the first requirement are amenable to automatic differentiation for optimizing stochastic computational graphs. The second requirement is useful for evaluating metrics and losses that necessarily require a discrete output akin to the one obtained from the original, non-relaxed operator. E.g., in straight-through gradient estimation (Bengio et al., 2013; Jang et al., 2017), the non-relaxed operator is used for evaluating the learning objective in the forward pass and the relaxed operator is used in the backward pass for gradient estimation.
73
+
74
+ ![](images/2b33b4d156c63e304957516be3f9b56be6185083ee8f581117d2b3cd636adcce.jpg)
75
+ Figure 2: Center: Venn Diagram relationships between permutation matrices $( \mathcal { P } )$ , doubly-stochastic matrices $( \mathcal { D } )$ , unimodal row stochastic matrices $( \mathcal { U } )$ , and row stochastic matrices $( { \mathcal { R } } )$ . Left: A doubly-stochastic matrix that is not unimodal. Right: A unimodal matrix that is not doublystochastic.
76
+
77
+ The canonical example is the $0 / 1$ loss used for binary classification. While the $0 / 1$ loss is discontinuous w.r.t. its inputs (real-valued predictions from a model), surrogates such as the logistic and hinge losses are continuous everywhere and differentiable almost-everywhere (property 1), and can give hard binary predictions via thresholding (property 2).
78
+
79
+ Note: For brevity, we assume that the arg max operator is applied over a set of elements with a unique maximizer and hence, the operator has well-defined semantics. With some additional bookkeeping for resolving ties, the results in this section hold even if the elements to be sorted are not unique. See Appendix C.
80
+
81
+ Unimodal Row Stochastic Matrices. The sort operator maps the input vector to a permutation, or equivalently a permutation matrix. Our relaxation to sort is motivated by the geometric structure of permutation matrices. The set of permutation matrices is a subset of doubly-stochastic matrices, i.e., a non-negative matrix such that the every row and column sums to one. If we remove the requirement that every column should sum to one, we obtain a larger set of row stochastic matrices. In this work, we propose a relaxation to sort that maps inputs to an alternate subset of row stochastic matrices, which we refer to as the unimodal row stochastic matrices.
82
+
83
+ Definition 1 (Unimodal Row Stochastic Matrices). An $n \times n$ matrix is Unimodal Row Stochastic if it satisfies the following conditions:
84
+
85
+ 1. Non-negativity: $U [ i , j ] \geq 0 \quad \forall i , j \in \{ 1 , 2 , . . . , n \} .$ .
86
+
87
+ 2. Row Affinity: $\begin{array} { r } { \sum _ { j = 1 } ^ { n } U [ i , j ] = 1 \quad \forall i \in \{ 1 , 2 , \ldots , n \} . } \end{array}$
88
+
89
+ 3. Argmax Permutation: Let u denote an $n$ -dimensional vector with entries such that $u _ { i } =$ ar $\operatorname { g m a x } _ { j } U [ i , j ] \quad \forall i \in \{ 1 , 2 , \dots , n \}$ . Then, $\mathbf { u } \in \mathcal { Z } _ { n }$ , i.e., it is a valid permuation.
90
+
91
+ We denote $\mathcal { U } _ { n }$ as the set of $n \times n$ unimodal row stochastic matrices.
92
+
93
+ All row stochastic matrices satisfy the first two conditions. The third condition is useful for gradient based optimization involving sorting-based losses. The condition provides a straightforward mechanism for extracting a permutation from a unimodal row stochastic matrix via a row-wise arg max operation. Figure 2 shows the relationships between the different subsets of square matrices.
94
+
95
+ NeuralSort. Our relaxation to the sort operator is based on a standard identity for evaluating the sum of the $k$ largest elements in any input vector.
96
+
97
+ Lemma 2. [Lemma $I$ in Ogryczak & Tamir (2003)] For an input vector $\mathbf { s } = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T }$ that is sorted as $s _ { [ 1 ] } \geq s _ { [ 2 ] } \geq . . . \geq s _ { [ n ] }$ , we have the sum of the $k$ -largest elements given as:
98
+
99
+ $$
100
+ \sum _ { i = 1 } ^ { k } s _ { [ i ] } = \operatorname* { m i n } _ { \substack { \lambda \in \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } \} } } \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) .
101
+ $$
102
+
103
+ The identity in Lemma 2 outputs the sum of the top- $k$ elements. The $k$ -th largest element itself can be recovered by taking the difference of the sum of top- $k$ elements and the top- $\left( k - 1 \right)$ elements.
104
+
105
+ ![](images/c37275c81f604eb2a689b79a4176cd1c34edda4fbe4665dd05468d4a1c167376.jpg)
106
+ Figure 3: Stochastic computation graphs with stochastic nodes corresponding to permutations. Squares denote deterministic nodes and circles denote stochastic nodes.
107
+
108
+ Corollary 3. Let $\mathbf { s } = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T }$ be a real-valued vector of length n. Let $A _ { \mathrm { s } }$ denote the matrix of absolute pairwise differences of the elements of s such that $A _ { \mathbf { s } } [ i , j ] = | s _ { i } - s _ { j } |$ . The permutation matrix $P _ { s o r t ( \mathbf { s } ) }$ corresponding to sort(s) is given by:
109
+
110
+ $$
111
+ P _ { s o r t ( \mathbf { s } ) } [ i , j ] = \left\{ { 1 i f j = \arg \operatorname* { m a x } [ ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ] } \right.
112
+ $$
113
+
114
+ where 1 denotes the column vector of all ones.
115
+
116
+ $E . g .$ , if we set $i = \lfloor ( n + 1 ) / 2 \rfloor$ then the non-zero entry in the $i$ -th row $P _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ corresponds to the element with the minimum sum of (absolute) distance to the other elements. As desired, this corresponds to the median element. The relaxation requires $O ( n ^ { 2 } )$ operations to compute $A _ { \mathrm { s } }$ , as opposed to the $O ( n \log n )$ overall complexity for the best known sorting algorithms. In practice however, it is highly parallelizable and can be implemented efficiently on GPU hardware.
117
+
118
+ The arg max operator is non-differentiable which prohibits the direct use of Corollary 3 for gradient computation. Instead, we propose to replace the arg max operator with soft max to obtain a continuous relaxation $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } ( \tau )$ . In particular, the $i$ -th row of $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } ( \tau )$ is given by:
119
+
120
+ $$
121
+ \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ] ( \tau ) = \mathrm { s o f t m a x } \left[ ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 } ) / \tau \right]
122
+ $$
123
+
124
+ where $\tau > 0$ is a temperature parameter. Our relaxation is continuous everywhere and differentiable almost everywhere with respect to the elements of s. Furthermore, we have the following result.
125
+
126
+ Theorem 4. Let $\widehat { P } _ { s o r t ( s ) }$ denote the continuous relaxation to the permutation matrix $P _ { s o r t ( \pmb { s } ) }$ for an arbitrary input vector s and temperature $\tau$ defined in Eq. 5. Then, we have:
127
+
128
+ 1. Unimodality: $\forall \tau > 0$ , $\widehat { P } _ { s o r t ( s ) }$ is a unimodal row stochastic matrix. Further, let u denote the permutation obtained by applying arg max row-wise to $\widehat { P } _ { s o r t ( s ) }$ . Then, $\mathbf { u } = s o r t ( \pmb { s } )$
129
+
130
+ 2. Limiting behavior: If we assume that the entries of s are drawn independently from a distribution that is absolutely continuous w.r.t. the Lebesgue measure in $\mathbb { R }$ , then the following convergence holds almost surely:
131
+
132
+ $$
133
+ \operatorname* { l i m } _ { \tau 0 ^ { + } } \widehat { P } _ { s o r t ( \mathbf { s } ) } [ i , : ] ( \tau ) = P _ { s o r t ( \mathbf { s } ) } [ i , : ] \quad \forall i \in \{ 1 , 2 , \ldots , n \} .
134
+ $$
135
+
136
+ Unimodality allows for efficient projection of the relaxed permutation matrix $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) }$ to the hard matrix $P _ { \mathsf { s o r t } ( \mathbf { s } ) }$ via a row-wise arg max, e.g., for straight-through gradients. For analyzing limiting behavior, independent draws ensure that the elements of s are distinct almost surely. The temperature $\tau$ controls the degree of smoothness of our approximation. At one extreme, the approximation becomes tighter as the temperature is reduced. In practice however, the trade-off is in the variance of these estimates, which is typically lower for larger temperatures.
137
+
138
+ # 4 STOCHASTIC OPTIMIZATION OVER PERMUTATIONS
139
+
140
+ In many scenarios, we would like the ability to express our uncertainty in inferring a permutation e.g., latent variable models with latent nodes corresponding to permutations. Random variables that assume values corresponding to permutations can be represented via stochastic nodes in the
141
+
142
+ stochastic computation graph. For optimizing the parameters of such a graph, consider the following class of objectives:
143
+
144
+ $$
145
+ L ( \boldsymbol { \theta } , \mathbf { s } ) = \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ f ( P _ { \mathbf { z } } ; \boldsymbol { \theta } ) \right]
146
+ $$
147
+
148
+ where $\theta$ and s denote sets of parameters, $P _ { \mathbf { z } }$ is the permutation matrix corresponding to the permutation $\mathbf { z }$ , $q ( \cdot )$ is a parameterized distribution over the elements of the symmetric group ${ \mathcal { Z } } _ { n }$ , and $f ( \cdot )$ is an arbitrary function of interest assumed to be differentiable in $\theta$ and $\mathbf { z }$ . The SCG is shown in Figure 3a. In contrast to the SCG considered in the previous section (Figure 1), here we are dealing with a distribution over permutations as opposed to a single (deterministically computed) one.
149
+
150
+ While such objectives are typically intractable to evaluate exactly since they require summing over a combinatorially large set, we can obtain unbiased estimates efficiently via Monte Carlo. Monte Carlo estimates of gradients w.r.t. $\theta$ can be derived simply via linearity of expectation. However, the gradient estimates w.r.t. s cannot be obtained directly since the sampling distribution depends on s. The REINFORCE gradient estimator (Glynn, 1990; Williams, 1992; Fu, 2006) uses the fact that $\nabla _ { \mathbf { s } } q ( \mathbf { z } | \mathbf { s } ) = q ( \mathbf { z } | \mathbf { s } ) \nabla _ { \mathbf { s } } \log q ( \mathbf { z } | \mathbf { s } )$ to derive the following Monte Carlo gradient estimates:
151
+
152
+ $$
153
+ \nabla _ { \mathbf { s } } L ( \theta , \mathbf { s } ) = \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ f ( P _ { \mathbf { z } } ; \theta ) \nabla _ { \mathbf { s } } \log q ( \mathbf { z } | \mathbf { s } ) \right] + \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ \nabla _ { \mathbf { s } } f ( P _ { \mathbf { z } } ; \theta ) \right] .
154
+ $$
155
+
156
+ # 4.1 REPARAMETERIZED GRADIENT ESTIMATORS FOR PL DISTRIBUTIONS
157
+
158
+ REINFORCE gradient estimators typically suffer from high variance (Schulman et al., 2015; Glasserman, 2013). Reparameterized samplers provide an alternate gradient estimator by expressing samples from a distribution as a deterministic function of its parameters and a fixed source of randomness (Kingma & Welling, 2014; Rezende et al., 2014; Titsias & Lazaro-Gredilla, 2014). ´ Since the randomness is from a fixed distribution, Monte Carlo gradient estimates can be derived by pushing the gradient operator inside the expectation (via linearity). In this section, we will derive a reparameterized sampler and gradient estimator for the Plackett-Luce (PL) family of distributions.
159
+
160
+ Let the score $s _ { i }$ for an item $i \in \{ 1 , 2 , \ldots , n \}$ be an unobserved random variable drawn from some underlying score distribution (Thurstone, 1927). Now for each item, we draw a score from its corresponding score distribution. Next, we generate a permutation by applying the deterministic sort operator to these $n$ randomly sampled scores. Interestingly, prior work has shown that the resulting distribution over permutations corresponds to a PL distribution if and only if the scores are sampled independently from Gumbel distributions with identical scales.
161
+
162
+ Proposition 5. [adapted from Yellott Jr (1977)] Let s be a vector of scores for the n items. For each item $i$ , sample $g _ { i } \sim { \tt G u m b e l } ( 0 , \beta )$ independently with zero mean and a fixed scale $\beta$ . Let ˜s denote the vector of Gumbel perturbed log-scores with entries such that $\tilde { s } _ { i } = \beta \log s _ { i } + g _ { i }$ . Then:
163
+
164
+ $$
165
+ q \bigl ( \tilde { s } _ { z _ { 1 } } \geq \cdot \cdot \cdot \geq \tilde { s } _ { z _ { n } } \bigr ) = \frac { s _ { z _ { 1 } } } { Z } \frac { s _ { z _ { 2 } } } { Z - s _ { z _ { 1 } } } \cdot \cdot \cdot \frac { s _ { z _ { n } } } { Z - \sum _ { i = 1 } ^ { n - 1 } s _ { z _ { i } } } .
166
+ $$
167
+
168
+ For ease of presentation, we assume $\beta = 1$ in the rest of this work. Proposition 5 provides a method for sampling from PL distributions with parameters s by adding Gumbel perturbations to the logscores and applying the sort operator to the perturbed log-scores. This procedure can be seen as a reparameterization trick that expresses a sample from the PL distribution as a deterministic function of the scores and a fixed source of randomness (Figure 3b). Letting $\mathbf { g }$ denote the vector of i.i.d. Gumbel perturbations, we can express the objective in Eq. 7 as:
169
+
170
+ $$
171
+ L ( \boldsymbol { \theta } , \mathbf { s } ) = \mathbb { E } _ { \mathbf { g } } \left[ f ( P _ { \mathrm { s o r t ( l o g \mathbf { s } + \mathbf { g } ) } } ; \boldsymbol { \theta } ) \right] .
172
+ $$
173
+
174
+ While the reparameterized sampler removes the dependence of the expectation on the parameters s, it introduces a sort operator in the computation graph such that the overall objective is nondifferentiable in s. In order to obtain a differentiable surrogate, we approximate the objective based on the NeuralSort relaxation to the sort operator:
175
+
176
+ $$
177
+ \begin{array} { r } { \mathbb { E } _ { \mathbf { g } } \left[ f \left( P _ { \mathrm { s o r t } \left( \log \mathbf { s } + \mathbf { g } \right) } ; \theta \right) \right] \approx \mathbb { E } _ { \mathbf { g } } \left[ f \left( \widehat { P } _ { \mathrm { s o r t } \left( \log \mathbf { s } + \mathbf { g } \right) } ; \theta \right) \right] : = \widehat { L } ( \theta , \mathbf { s } ) . } \end{array}
178
+ $$
179
+
180
+ Accordingly, we get the following reparameterized gradient estimates for the approximation:
181
+
182
+ $$
183
+ \nabla _ { \mathbf { s } } \widehat { L } ( \theta , \mathbf { s } ) = \mathbb { E } _ { \mathbf { g } } \left[ \nabla _ { \mathbf { s } } f ( \widehat { P } _ { \mathrm { s o r t ( l o g } \mathbf { s } + \mathbf { g } ) } ; \theta ) \right]
184
+ $$
185
+
186
+ which can be estimated efficiently via Monte Carlo because the expectation is with respect to a distribution that does not depend on s.
187
+
188
+ # 5 DISCUSSION AND RELATED WORK
189
+
190
+ The problem of learning to rank documents based on relevance has been studied extensively in the context of information retrieval. In particular, listwise approaches learn functions that map objects to scores. Much of this work concerns the PL distribution: the RankNet algorithm (Burges et al., 2005) can be interpreted as maximizing the PL likelihood of pairwise comparisons between items, while the ListMLE ranking algorithm in Xia et al. (2008) extends this with a loss that maximizes the PL likelihood of ground-truth permutations directly. The differentiable pairwise approaches to ranking, such as Rigutini et al. (2011), learn to approximate the comparator between pairs of objects. Our work considers a generalized setting where sorting based operators can be inserted anywhere in computation graphs to extend traditional pipelines e.g., kNN.
191
+
192
+ Prior works have proposed relaxations of permutation matrices to the Birkhoff polytope, which is defined as the convex hull of the set of permutation matrices a.k.a. the set of doubly-stochastic matrices. A doubly-stochastic matrix is a permutation matrix iff it is orthogonal and continuous relaxations based on these matrices have been used previously for solving NP-complete problems such as seriation and graph matching (Fogel et al., 2013; Fiori et al., 2013; Lim & Wright, 2014). Adams & Zemel (2011) proposed the use of the Sinkhorn operator to map any square matrix to the Birkhoff polytope. They interpret the resulting doubly-stochastic matrix as the marginals of a distribution over permutations. Mena et al. (2018) propose an alternate method where the square matrix defines a latent distribution over the doubly-stochastic matrices themselves. These distributions can be sampled from by adding elementwise Gumbel perturbations. Linderman et al. (2018) propose a rounding procedure that uses the Sinkhorn operator to directly sample matrices near the Birkhoff polytope. Unlike Mena et al. (2018), the resulting distribution over matrices has a tractable density. In practice, however, the approach of Mena et al. (2018) performs better and will be the main baseline we will be comparing against in our experiments in Section 6.
193
+
194
+ As discussed in Section 3, NeuralSort maps permutation matrices to the set of unimodal rowstochastic matrices. For the stochastic setting, the PL distribution permits efficient sampling, exact and tractable density estimation, making it an attractive choice for several applications, e.g., variational inference over latent permutations. Our reparameterizable sampler, while also making use of the Gumbel distribution, is based on a result unique to the PL distribution (Proposition 5).
195
+
196
+ The use of the Gumbel distribution for defining continuous relaxations to discrete distributions was first proposed concurrently by Jang et al. (2017) and Maddison et al. (2017) for categorical variables, referred to as Gumbel-Softmax. The number of possible permutations grow factorially with the dimension, and thus any distribution over $n$ -dimensional permutations can be equivalently seen as a distribution over $n !$ categories. Gumbel-softmax does not scale to a combinatorially large number of categories (Kim et al., 2016; Mussmann et al., 2017), necessitating the use of alternate relaxations, such as the one considered in this work.
197
+
198
+ # 6 EXPERIMENTS
199
+
200
+ We refer to the two approaches proposed in Sections 3, 4 as Deterministic NeuralSort and Stochastic NeuralSort, respectively. For additional hyperparameter details and analysis, see Appendix D.
201
+
202
+ # 6.1 SORTING HANDWRITTEN NUMBERS
203
+
204
+ Dataset. We first create the large-MNIST dataset, which extends the MNIST dataset of handwritten digits. The dataset consists of multi-digit images, each a concatenation of 4 randomly selected individual images from MNIST, e.g., is one such image in this dataset. Each image is associated with a real-valued label, which corresponds to its concatenated MNIST labels, e.g., the label of is 1810. Using the large-MNIST dataset, we finally create a dataset of sequences. Every sequence is this dataset consists of $n$ randomly sampled large-MNIST images.
205
+
206
+ Setup. Given a dataset of sequences of large-MNIST images, our goal is to learn to predict the permutation that sorts the labels of the sequence of images, given a training set of ground-truth permutations. Figure 4 (Task 1) illustrates this task on an example sequence of $n = 5$ large-MNIST images. This task is a challenging extension of the one considered by Mena et al. (2018) in sorting scalars, since it involves learning the semantics of high-dimensional objects prior to sorting. A good model needs to learn to dissect the individual digits in an image, rank these digits, and finally, compose such rankings based on the digit positions within an image. The available supervision, in the form of the ground-truth permutation, is very weak compared to a classification setting that gives direct access to the image labels.
207
+
208
+ ![](images/c6d1e9666849d250d4d4079d6a96b94ac019ba9d4e674cd66454cf41410549f1.jpg)
209
+ Figure 4: Sorting and quantile regression. The model is trained to sort sequences of $n = 5$ largeMNIST images $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { 5 }$ (Task 1) and regress the median value (Task 2). In the above example, the ground-truth permutation that sorts the input sequence from largest to smallest is $[ 3 , 5 , \bar { 1 } , 4 , 2 ] ^ { T }$ , 9803 being the largest and 1270 the smallest. Blue illustrates the true median image $\mathbf { x } _ { 1 }$ with ground-truth sorted index 3 and value 2960.
210
+
211
+ Table 1: Average sorting accuracy on the test set. First value is proportion of permutations correctly identified; value in parentheses is the proportion of individual element ranks correctly identified.
212
+
213
+ <table><tr><td>Algorithm</td><td>n=3</td><td>n=5</td><td>n=7</td><td>n=9</td><td>n=15</td></tr><tr><td>Vanilla RS</td><td>0.467 (0.801)</td><td>0.093 (0.603)</td><td>0.009 (0.492)</td><td>0. (0.113)</td><td>0. (0.067)</td></tr><tr><td>Sinkhorn</td><td>0.462 (0.561)</td><td>0.038 (0.293)</td><td>0.001 (0.197)</td><td>0. (0.143)</td><td>0.(0.078)</td></tr><tr><td>Gumbel-Sinkhorn</td><td>0.484 (0.575)</td><td>0.033 (0.295)</td><td>0.001 (0.189)</td><td>0. (0.146)</td><td>0. (0.078)</td></tr><tr><td>Deterministic NeuralSort</td><td>0.930 (0.951)</td><td>0.837 (0.927)</td><td>0.738 (0.909)</td><td>0.649 (0.896)</td><td>0.386 (0.857)</td></tr><tr><td>Stochastic NeuralSort</td><td>0.927 (0.950)</td><td>0.835 (0.926)</td><td>0.741 (0.909)</td><td>0.646 (0.895)</td><td>0.418 (0.862)</td></tr></table>
214
+
215
+ Baselines. All baselines use a CNN that is shared across all images in a sequence to map each large-MNIST image to a feature space. The vanilla row-stochastic (RS) baseline concatenates the CNN representations for $n$ images into a single vector that is fed into a multilayer perceptron that outputs $n$ multiclass predictions of the image probabilities for each rank. The Sinkhorn and GumbelSinkhorn baselines, as discussed in Section 5, use the Sinkhorn operator to map the stacked CNN representations for the $n$ objects into a doubly-stochastic matrix. For all methods, we minimized the cross-entropy loss between the predicted matrix and the ground-truth permutation matrix.
216
+
217
+ Results. Following Mena et al. (2018), our evaluation metric is the the proportion of correctly predicted permutations on a test set of sequences. Additionally, we evaluate the proportion of individual elements ranked correctly. Table 1 demonstrates that the approaches based on the proposed sorting relaxation significantly outperform the baseline approaches for all $n$ considered. The performance of the deterministic and stochastic variants are comparable. The vanilla RS baseline performs well in ranking individual elements, but is not good at recovering the overall square matrix.
218
+
219
+ We believe the poor performance of the Sinkhorn baselines is partly because these methods were designed and evaluated for matchings. Like the output of sort, matchings can also be represented as permutation matrices. However, distributions over matchings need not satisfy Luce’s choice axiom or imply a total ordering, which could explain the poor performance on the tasks considered.
220
+
221
+ # 6.2 QUANTILE REGRESSION
222
+
223
+ Setup. In this experiment, we extend the sorting task to regression. Again, each sequence contains $n$ large-MNIST images, and the regression target for each sequence is the 50-th quantile (i.e., the median) of the $n$ labels of the images in the sequence. Figure 4 (Task 2) illustrates this task on an example sequence of $n = 5$ large-MNIST images, where the goal is to output the third largest label. The design of this task highlights two key challenges since it explicitly requires learning both a suitable representation for sorting high-dimensional inputs and a secondary function that approximates the label itself (regression). Again, the supervision available in the form of the label of only a single image at an arbitrary and unknown location in the sequence is weak.
224
+
225
+ Table 2: Test mean squared error $( \times 1 0 ^ { - 4 } )$ ) and $R ^ { 2 }$ values (in parenthesis) for quantile regression.
226
+
227
+ <table><tr><td>Algorithm</td><td>n=5</td><td>n=9</td><td>n=15</td></tr><tr><td>Constant (Simulated)</td><td>356.79 (0.00)</td><td>227.31 (0.00)</td><td>146.94 (0.00)</td></tr><tr><td>Vanilla NN</td><td>1004.70 (0.85)</td><td>699.15 (0.82)</td><td>562.97 (0.79)</td></tr><tr><td>Sinkhorn</td><td>343.60 (0.25)</td><td>231.87 (0.19)</td><td>156.27 (0.04)</td></tr><tr><td>Gumbel-Sinkhorn</td><td>344.28 (0.25)</td><td>232.56 (0.23)</td><td>157.34 (0.06)</td></tr><tr><td>Deterministic NeuralSort</td><td>45.50 (0.95)</td><td>34.98 (0.94)</td><td>34.78 (0.92)</td></tr><tr><td>Stochastic NeuralSort</td><td>33.80 (0.94)</td><td>31.43 (0.93)</td><td>29.34 (0.90)</td></tr></table>
228
+
229
+ ![](images/59a1a5d730e00e3e97f1d5960b69519160baf7081942034f582b41f4e4bbdf21.jpg)
230
+ Figure 5: Differentiable kNN. The model is trained such that the representations $\mathbf { e } _ { i }$ for the training points $\left\{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right\}$ that have the same label $y _ { 0 }$ as $\mathbf { x } _ { \mathrm { 0 } }$ are closer to $\mathbf { e } _ { 0 }$ (included in top- $k$ ) than others.
231
+
232
+ Baselines. In addition to Sinkhorn and Gumbel-Sinkhorn, we design two more baselines. The Constant baseline always returns the median of the full range of possible outputs, ignoring the input sequence. This corresponds to 4999.5 since we are sampling large-MNIST images uniformly in the range of four-digit numbers. The vanilla neural net (NN) baseline directly maps the input sequence of images to a real-valued prediction for the median.
233
+
234
+ Results. Our evaluation metric is the mean squared error (MSE) and $R ^ { 2 }$ on a test set of sequences. Results for $n = \{ 5 , 9 , 1 5 \}$ images are shown in Table 2. The Vanilla NN baseline while incurring a large MSE, is competitive on the $R ^ { 2 }$ metric. The other baselines give comparable performance on the MSE metric. The proposed NeuralSort approaches outperform the competing methods on both the metrics considered. The stochastic NeuralSort approach is the consistent best performer on MSE, while the deterministic NeuralSort is slightly better on the $R ^ { 2 }$ metric.
235
+
236
+ # 6.3 END-TO-END, DIFFERENTIABLE $k$ -NEAREST NEIGHBORS
237
+
238
+ Setup. In this experiment, we design a fully differentiable, end-to-end $k$ -nearest neighbors (kNN) classifier. Unlike a standard kNN classifier which computes distances between points in a predefined space, we learn a representation of the data points before evaluating the $k$ -nearest neighbors.
239
+
240
+ We are given access to a dataset $\mathcal { D }$ of $( \mathbf { x } , y )$ pairs of standard input data and their class labels respectively. The differentiable kNN algorithm consists of two hyperparameters: the number of training neighbors $n$ , the number of top candidates $k$ , and the sorting temperature $\tau$ . Every sequence of items here consists of a query point $\mathbf { x }$ and a randomly sampled subset of $n$ candidate nearest neighbors from the training set, say $\left\{ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { n } \right\}$ . In principle, we could use the entire training set (excluding the query point) as candidate points, but this can hurt the learning both computationally and statistically. The query points are randomly sampled from the train/validation/test sets as appropriate but the nearest neighbors are always sampled from the training set. The loss function optimizes for a representation space $h _ { \phi } ( \cdot )$ (e.g., CNN) such that the top- $k$ candidate points with the minimum Euclidean distance to the query point in the representation space have the same label as the query point. Note that at test time, once the representation space $h _ { \phi }$ is learned, we can use the entire training set as the set of candidate points, akin to a standard kNN classifier. Figure 5 illustrates the proposed algorithm.
241
+
242
+ Formally, for any datapoint $\mathbf { x }$ , let $_ { z }$ denote a permutation of the $n$ candidate points. The uniformlyweighted kNN loss, denoted as $\ell _ { \mathrm { k N N } } ( \cdot )$ , can be written as follows:
243
+
244
+ $$
245
+ \ell _ { \mathrm { k N N } } ( \widehat { P } _ { \mathbf { z } } , y , y _ { 1 } , y _ { 2 } , \ldots , y _ { n } ) = - \frac { 1 } { k } \sum _ { j = 1 } ^ { k } \sum _ { i = 1 } ^ { n } \mathbb { 1 } ( y _ { i } = y ) \widehat { P } _ { \mathbf { z } } [ i , j ]
246
+ $$
247
+
248
+ Table 3: Average test kNN classification accuracies from $n$ neighbors for best value of $k$ .
249
+
250
+ <table><tr><td>Algorithm</td><td>MNIST</td><td>Fashion-MNIST</td><td>CIFAR-10</td></tr><tr><td>kNN</td><td>97.2%</td><td>85.8%</td><td>35.4%</td></tr><tr><td>kNN+PCA</td><td>97.6%</td><td>85.9%</td><td>40.9%</td></tr><tr><td>kNN+AE</td><td>97.6%</td><td>87.5%</td><td>44.2%</td></tr><tr><td>kNN + Deterministic NeuralSort</td><td>99.5%</td><td>93.5%</td><td>90.7%</td></tr><tr><td>kNN + Stochastic NeuralSort</td><td>99.4%</td><td>93.4%</td><td>89.5%</td></tr><tr><td>CNN (w/o kNN)</td><td>一 99.4%</td><td>93.4%</td><td>95.1%</td></tr></table>
251
+
252
+ where $\left\{ y _ { 1 } , y _ { 2 } , \ldots , y _ { n } \right\}$ are the labels for the candidate points. Note that when $\widehat { P } _ { \mathbf { z } }$ is an exact permutation matrix (i.e., temperature $\tau 0$ ), this expression is exactly the negative of the fraction of $k$ nearest neighbors that have the same label as $\mathbf { x }$ .
253
+
254
+ Using Eq. 13, the training objectives for Deterministic and Stochastic NeuralSort are given as:
255
+
256
+ $$
257
+ \operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \ell _ { \mathrm { k N N } } \big ( \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } , y , y _ { 1 } , \dots , y _ { n } \big )
258
+ $$
259
+
260
+ $$
261
+ \operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { k N N } } ( \widehat { P } _ { \mathbf { z } } , y , y _ { 1 } , y _ { 2 } , \dots , y _ { n } ) \right]
262
+ $$
263
+
264
+ where each entry of $\mathbf { s }$ is given as $s _ { j } = - \| h _ { \phi } ( \mathbf x ) - h _ { \phi } ( \mathbf x _ { j } ) \| _ { 2 } ^ { 2 }$ .
265
+
266
+ Datasets. We consider three benchmark datasetes: MNIST dataset of handwritten digits, FashionMNIST dataset of fashion apparel, and the CIFAR-10 dataset of natural images (no data augmentation) with the canonical splits for training and testing.
267
+
268
+ Baselines. We consider kNN baselines that operate in three standard representation spaces: the canonical pixel basis, the basis specified by the top 50 principal components (PCA), an autonencoder (AE). Additionally, we experimented with $k = 1 , 3 , 5 , 9$ nearest neighbors and across two distance metrics: uniform weighting of all $k$ -nearest neighbors and weighting nearest neighbors by the inverse of their distance. For completeness, we trained a CNN with the same architecture as the one used for NeuralSort (except the final layer) using the cross-entropy loss.
269
+
270
+ Results. We report the classification accuracies on the standard test sets in Table 3. On both datasets, the differentiable kNN classifier outperforms all the baseline kNN variants including the convolutional autoencoder approach. The performance is much closer to the accuracy of a standard CNN.
271
+
272
+ # 7 CONCLUSION
273
+
274
+ In this paper, we proposed NeuralSort, a continuous relaxation of the sorting operator to the set of unimodal row-stochastic matrices. Our relaxation facilitates gradient estimation on any computation graph involving a sort operator. Further, we derived a reparameterized gradient estimator for the Plackett-Luce distribution for efficient stochastic optimization over permutations. On three illustrative tasks including a fully differentiable $k$ -nearest neighbors, our proposed relaxations outperform prior work in end-to-end learning of semantic orderings of high-dimensional objects.
275
+
276
+ In the future, we would like to explore alternate relaxations to sorting as well as applications that extend widely-used algorithms such as beam search (Goyal et al., 2018). Both deterministic and stochastic NeuralSort are easy to implement. We provide reference implementations in Tensorflow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017) in Appendix A. The full codebase for this work is open-sourced at https://github.com/ermongroup/neuralsort.
277
+
278
+ # ACKNOWLEDGEMENTS
279
+
280
+ This research was supported by NSF (#1651565, #1522054, #1733686), ONR, AFOSR (FA9550- 19-1-0024), FLI, and Amazon AWS. AG is supported by MSR fellowship and Stanford Data Science scholarship. We are thankful to Jordan Alexander, Kristy Choi, Adithya Ganesh, Karan Goel, Neal Jean, Daniel Levy, Jiaming Song, Yang Song, Serena Yeung, and Hugh Zhang for feedback.
281
+
282
+ # REFERENCES
283
+
284
+ Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: a system for largescale machine learning. In Operating Systems Design and Implementation, 2016.
285
+
286
+ Ryan Prescott Adams and Richard S Zemel. Ranking via Sinkhorn propagation. arXiv preprint arXiv:1106.1925, 2011.
287
+
288
+ Matej Balog, Nilesh Tripuraneni, Zoubin Ghahramani, and Adrian Weller. Lost relatives of the Gumbel trick. In International Conference on Machine Learning, 2017.
289
+
290
+ Yaakov Bar-Shalom and Xiao-Rong Li. Multitarget-multisensor tracking: principles and techniques. 1995.
291
+
292
+ Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
293
+
294
+ Leonard Berrada, Andrew Zisserman, and M Pawan Kumar. Smooth loss functions for deep top- $\mathbf { \nabla } \cdot \mathbf { k }$ classification. In International Conference on Learning Representations, 2018.
295
+
296
+ Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learning to rank using gradient descent. In International Conference on Machine learning, 2005.
297
+
298
+ Flavio Chierichetti, Ravi Kumar, and Andrew Tomkins. Discrete choice, permutations, and reconstruction. In Symposium on Discrete Algorithms, 2018.
299
+
300
+ Marcelo Fiori, Pablo Sprechmann, Joshua Vogelstein, Pablo Muse, and Guillermo Sapiro. Robust ´ multimodal graph matching: Sparse coding meets graph matching. In Advances in Neural Information Processing Systems, 2013.
301
+
302
+ Fajwel Fogel, Rodolphe Jenatton, Francis Bach, and Alexandre d’Aspremont. Convex relaxations for permutation problems. In Advances in Neural Information Processing Systems, 2013.
303
+
304
+ Michael C Fu. Gradient estimation. Handbooks in operations research and management science, 13:575–616, 2006.
305
+
306
+ Bolin Gao and Lacra Pavel. On the properties of the softmax function with application in game theory and reinforcement learning. arXiv preprint arXiv:1704.00805, 2017.
307
+
308
+ Paul Glasserman. Monte Carlo methods in financial engineering, volume 53. Springer Science & Business Media, 2013.
309
+
310
+ Peter W Glynn. Likelihood ratio gradient estimation for stochastic systems. Communications of the ACM, 33(10):75–84, 1990.
311
+
312
+ 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 AAAI Conference on Artificial Intelligence, 2018.
313
+
314
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. In International Conference on Learning Representations, 2017.
315
+
316
+ Carolyn Kim, Ashish Sabharwal, and Stefano Ermon. Exact sampling with integer linear programs and random perturbations. In AAAI Conference on Artificial Intelligence, 2016.
317
+
318
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
319
+
320
+ Cong Han Lim and Stephen J Wright. Sorting network relaxations for vector permutation problems. arXiv preprint arXiv:1407.6609, 2014.
321
+
322
+ Scott W Linderman, Gonzalo E Mena, Hal Cooper, Liam Paninski, and John P Cunningham. Reparameterizing the birkhoff polytope for variational permutation inference. In International Conference on Artificial Intelligence and Statistics, 2018.
323
+
324
+ Tie-Yan Liu et al. Learning to rank for information retrieval. Foundations and Trends $\textsuperscript { \textregistered }$ in Information Retrieval, 3(3):225–331, 2009.
325
+
326
+ R Duncan Luce. Individual choice behavior: A theoretical analysis. Courier Corporation, 1959.
327
+
328
+ Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations, 2017.
329
+
330
+ Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning latent permutations with gumbel-sinkhorn networks. In International Conference on Learning Representations, 2018.
331
+
332
+ Stephen Mussmann, Daniel Levy, and Stefano Ermon. Fast amortized inference and learning in log-linear models with randomly perturbed nearest neighbor search. In Uncertainty in Artificial Intelligence, 2017.
333
+
334
+ Wlodzimierz Ogryczak and Arie Tamir. Minimizing the sum of the $k$ largest functions in linear time. Information Processing Letters, 85(3):117–122, 2003.
335
+
336
+ 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.
337
+
338
+ Robin L Plackett. The analysis of permutations. Applied Statistics, pp. 193–202, 1975.
339
+
340
+ Michel Regenwetter, Bernard Grofman, Ilia Tsetlin, and AAJ Marley. Behavioral social choice: probabilistic models, statistical inference, and applications. Cambridge University Press, 2006.
341
+
342
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014.
343
+
344
+ Leonardo Rigutini, Tiziano Papini, Marco Maggini, and Franco Scarselli. Sortnet: Learning to rank by a neural preference function. IEEE transactions on neural networks, 22(9):1368–1380, 2011.
345
+
346
+ John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In Advances in Neural Information Processing Systems, 2015.
347
+
348
+ Louis L Thurstone. A law of comparative judgment. Psychological review, 34(4):273, 1927.
349
+
350
+ Michalis Titsias and Miguel Lazaro-Gredilla. Doubly stochastic variational Bayes for non-conjugate ´ inference. In International Conference on Machine Learning, 2014.
351
+
352
+ Kilian Q Weinberger, John Blitzer, and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. In Advances in Neural Information Processing Systems, 2006.
353
+
354
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
355
+
356
+ Fen Xia, Tie-Yan Liu, Jue Wang, Wensheng Zhang, and Hang Li. Listwise approach to learning to rank: theory and algorithm. In International Conference on Machine Learning, 2008.
357
+
358
+ John I Yellott Jr. The relationship between luce’s choice axiom, thurstone’s theory of comparative judgment, and the double exponential distribution. Journal of Mathematical Psychology, 15(2): 109–144, 1977.
359
+
360
+ # APPENDICES
361
+
362
+ # A SORTING OPERATOR
363
+
364
+ A.1 TENSORFLOW
365
+
366
+ Sorting Relaxation for Deterministic NeuralSort:
367
+
368
+ import tensorflow as tf
369
+
370
+ def deterministic_NeuralSort(s, tau): """ s: input elements to be sorted. Shape: batch_size x n x 1 tau: temperature for relaxation. Scalar. """ $\begin{array} { r l } { \boldsymbol { \mathrm { n } } } & { { } = } \end{array}$ tf.shape(s)[1] one $=$ tf.ones((n, 1), dtype $=$ tf.float32) $\begin{array} { r l } { \mathbb { A } \_ s } & { { } = } \end{array}$ tf.abs(s - tf.transpose(s, perm $1 =$ [0, 2, 1])) $\begin{array} { r l } { \mathrm { \large ~ B ~ } } & { { } = } \end{array}$ tf.matmul(A_s, tf.matmul(one, tf.transpose(one))) scaling $=$ tf.cast(n + 1 - 2 $\star$ (tf.range(n) + 1), dtype $=$ tf.float32) ${ \mathrm { ~ \small ~ \mathscr ~ { ~ C ~ } ~ } } =$ tf.matmul(s, tf.expand_dims(scaling, 0)) P_max $=$ tf.transpose(C-B, perm ${ \_ }$ [0, 2, 1]) P_hat $=$ tf.nn.softmax(P_max / tau, $^ { - 1 }$ )
371
+
372
+ return P_hat
373
+
374
+ # Reparameterized Sampler for Stochastic NeuralSort:
375
+
376
+ def sample_gumbel(samples_shape, eps = 1e-10):
377
+
378
+ U $=$ tf.random_uniform(samples_shape, minval ${ } = 0$ , maxval $^ { = 1 }$ ) return -tf.log(-tf.log(U $^ +$ eps) $^ +$ eps)
379
+
380
+ def stochastic_NeuralSort(s, n_samples, tau):
381
+
382
+ s: parameters of the PL distribution. Shape: batch_size x n x 1. n_samples: number of samples from the PL distribution. Scalar. tau: temperature for the relaxation. Scalar.
383
+ """
384
+ batch_size $=$ tf.shape(s)[0]
385
+ $\begin{array} { r l } { \boldsymbol { \mathrm { n } } } & { { } = } \end{array}$ tf.shape(s)[1]
386
+ log_s_perturb $=$ s $^ +$ sample_gumbel([n_samples, batch_size, n, 1])
387
+ log_s_perturb $=$ tf.reshape(log_s_perturb, [n_samples $\star$ batch_size, n, 1])
388
+
389
+ P_hat $=$ deterministic_NeuralSort(log_s_perturb, tau) P_hat $=$ tf.reshape(P_hat, [n_samples, batch_size, n, n])
390
+
391
+ return P_hat
392
+
393
+ # A.2 PYTORCH
394
+
395
+ Sorting Relaxation for Deterministic NeuralSort:
396
+
397
+ # import torch
398
+
399
+ def deterministic_NeuralSort(s, tau): """ s: input elements to be sorted. Shape: batch_size x n x 1 tau: temperature for relaxation. Scalar. """ $\mathrm { ~ \scriptsize ~ n ~ } = \mathrm { ~ \scriptsize ~ s ~ }$ .size()[1] one $=$ torch.ones((n, 1), dtype $=$ torch.float32) $\begin{array} { r l } { \mathbb { A } \_ s } & { { } = } \end{array}$ torch.abs(s - s.permute(0, 2, 1)) $\begin{array} { r l } { \mathrm { \large ~ B ~ } } & { { } = } \end{array}$ torch.matmul(A_s, torch.matmul(one, torch.transpose(one, 0, 1))) scali $\begin{array} { r } { \mathbf { { \nabla } } \cdot \boldsymbol { \nabla } \mathrm { ~ ~ \psi ~ } = \mathrm { ~ ~ \psi ~ } ( \mathrm { ~ n ~ \xi ~ } + \mathrm { ~ ~ \xi ~ } ] } \end{array}$ - 2 \* (torch.arange(n) $^ { + } ~ \bot )$ ).type(torch.float32) ${ \mathrm { ~ \small ~ \mathscr ~ { ~ C ~ } ~ } } =$ torch.matmul(s, scaling.unsqueeze(0)) P_max $=$ (C-B).permute(0, 2, 1) sm $=$ torch.nn.Softmax(-1) P_hat $=$ sm(P_max / tau) return P_hat
400
+
401
+ # Reparamterized Sampler for Stochastic NeuralSort:
402
+
403
+ def sample_gumbel(samples_shape, eps $=$ 1e-10): U $=$ torch.rand(samples_shape) return -torch.log(-torch.log(U + eps) + eps)
404
+ def stochastic_NeuralSort(s, n_samples, tau): """ s: parameters of the PL distribution. Shape: batch_size x n x 1. n_samples: number of samples from the PL distribution. Scalar. tau: temperature for the relaxation. Scalar. """ batch_size $=$ s.size()[0] $\mathrm { ~ \scriptsize ~ n ~ } = \mathrm { ~ \scriptsize ~ s ~ }$ .size()[1] log_s_perturb $=$ torch.log(s) $^ +$ sample_gumbel([n_samples, batch_size, n, 1]) log_s_perturb $=$ log_s_perturb.view(n_samples $\star$ batch_size, n, 1) P_hat $=$ deterministic_NeuralSort(log_s_perturb, tau) P_hat $=$ P_hat.view(n_samples, batch_size, n, n) return P_hat
405
+
406
+ # B PROOFS OF THEORETICAL RESULTS
407
+
408
+ B.1 LEMMA 2
409
+
410
+ Proof. For any value of $\lambda$ , the following inequalities hold:
411
+
412
+ $$
413
+ \begin{array} { l } { \displaystyle \sum _ { i = 1 } ^ { k } s _ { [ i ] } = \lambda k + \sum _ { i = 1 } ^ { k } ( s _ { [ i ] } - \lambda ) } \\ { \displaystyle \qquad \leq \lambda k + \sum _ { i = 1 } ^ { k } \operatorname* { m a x } ( s _ { [ i ] } - \lambda , 0 ) } \\ { \displaystyle \qquad \leq \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) . } \end{array}
414
+ $$
415
+
416
+ Furthermore, for $\lambda = s _ { [ k ] }$ :
417
+
418
+ $$
419
+ \begin{array} { l } { { \displaystyle \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } \bigl ( s _ { i } - \lambda , 0 \bigr ) = s _ { [ k ] } k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } \bigl ( s _ { i } - s _ { [ k ] } , 0 \bigr ) } } \\ { ~ } \\ { { \displaystyle ~ = s _ { [ k ] } k + \sum _ { i = 1 } ^ { k } ( s _ { [ i ] } - s _ { [ k ] } ) } } \\ { { \displaystyle ~ = \sum _ { i = 1 } ^ { k } s _ { [ i ] } . } } \end{array}
420
+ $$
421
+
422
+ This finishes the proof.
423
+
424
+ # B.2 COROLLARY 3
425
+
426
+ Proof. We first consider at exactly what values of $\lambda$ the sum in Lemma 2 is minimized. For simplicity we will only prove the case where all values of s are distinct.
427
+
428
+ The equality Lemma 2, the $\begin{array} { r } { \sum _ { i = 1 } ^ { k } s _ { [ i ] } = \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) } \end{array}$ holds only when he equality. $s _ { [ k ] } \leq \lambda \leq s _ { [ k + 1 ] }$ . By $\lambda$
429
+
430
+ Symmetrically, if one considers the score vector $\mathbf { t } = - \mathbf { s }$ , then $\begin{array} { r } { \lambda ( n - k + 1 ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( t _ { i } - \lambda , 0 ) } \end{array}$ is minimized at t[n−k+1] ≤ λ ≤ t[n−k+2].
431
+
432
+ Replacing $\lambda$ by $- \lambda$ and using the definition of $\mathbf { t }$ implies that $\begin{array} { r } { \lambda ( k - 1 - n ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( \lambda - s _ { i } , 0 ) } \end{array}$ is minimized at s[k−1] ≤ λ ≤ s[k].
433
+
434
+ It follows that:
435
+
436
+ $$
437
+ \begin{array} { l } { { \displaystyle s _ { [ k ] } = \arg \operatorname* { m i n } _ { \lambda \in \mathbf { s } } \left( \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) \right) + \left( \lambda ( k - 1 - n ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( \lambda - s _ { i } , 0 ) \right) } } \\ { { \displaystyle \quad = \arg \operatorname* { m i n } _ { \lambda \in \mathbf { s } } \lambda ( 2 k - 1 - n ) + \sum _ { i = 1 } ^ { n } \vert s _ { i } - \lambda \vert . } } \end{array}
438
+ $$
439
+
440
+ Thus, if $s _ { i } = s _ { [ k ] }$ , then $i = \arg \operatorname* { m i n } ( 2 k - 1 - n ) \mathbf { s } + A _ { \mathbf { s } } \mathbf { 1 }$ . This finishes the proof.
441
+
442
+ # B.3 THEOREM 4
443
+
444
+ We prove the two properties in the statement of the theorem independently:
445
+
446
+ # 1. Unimodality
447
+
448
+ Proof. By definition of the softmax function, the entries ef $\widehat { P }$ are positive and sum to 1. To show that $\widehat { P }$ satisfies the argmax permutation property, . Formally, for any given row $i$ , we construct the argmax permutation vector $\mathbf { u }$ as:
449
+
450
+ $$
451
+ \begin{array} { l } { u _ { i } = \arg \operatorname* { m a x } [ \operatorname { s o f t } \operatorname* { m a x } ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ) ] } \\ { \quad = \arg \operatorname* { m a x } [ ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ] } \\ { \quad = [ i ] } \end{array}
452
+ $$
453
+
454
+ where the square notation $[ i ]$ denotes the index of the $i$ -th largest element. The first step follows from the fact that the softmax function is monotonically increasing and hence, it preserves the argmax. The second equality directly follows from Corollary 3. By definition, $\mathsf { \bar { s o r t } } ( \mathbf { s } ) = \{ [ 1 ] , [ 2 ] , \dots , [ n ] \}$ , finishing the proof. □
455
+
456
+ # 2. Limiting behavior
457
+
458
+ Proof. As shown in Gao & Pavel (2017), the softmax function may be equivalently defined as soft $\begin{array} { r } { \mathrm { m a x } ( z / \tau ) ~ = ~ \mathrm { a r g } \mathrm { m a x } _ { x \in \Delta ^ { n - 1 } } \langle x , z \rangle - \tau \sum _ { i = 1 } ^ { n } x _ { i } \log \dot { x } _ { i } } \end{array}$ . In particular, $\mathrm { l i m } _ { \tau \to 0 }$ soft $\operatorname* { m a x } ( z / \tau ) = \arg \operatorname* { m a x } x$ . The distributional assumptions ensure that the elements of s are distinct a.s., so plugging in $z = ( n + 1 - 2 k ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 }$ completes the proof. □
459
+
460
+ # B.4 PROPOSITION 5
461
+
462
+ This result follows from an earlier result by Yellott Jr (1977). We give the proof sketch below and refer the reader to Yellott Jr (1977) for more details.
463
+
464
+ Sketch. Consider random variables $\{ X _ { i } \} _ { i = 1 } ^ { n }$ such that $X _ { i } \sim \mathrm { E x p } ( s _ { z _ { i } } ) )$ .
465
+
466
+ We may prove by induction a generalization of the memoryless property:
467
+
468
+ $$
469
+ \begin{array} { r l } { { q ( X _ { 1 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) } } \\ & { = \int _ { 0 } ^ { \infty } q ( x \leq X _ { 1 } \leq x + t | x \leq \operatorname* { m i n } _ { i } X _ { i } ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) \mathrm { d } t } \\ & { = \displaystyle \int _ { 0 } ^ { \infty } q ( 0 \leq X _ { 1 } \leq t ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) \mathrm { d } t . } \end{array}
470
+ $$
471
+
472
+ If we assume as inductive hypothesis that $q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) = q ( X _ { 2 } \leq \cdots \leq$ $X _ { n } | t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } )$ , we complete the induction as:
473
+
474
+ $$
475
+ \begin{array} { l } { \displaystyle q ( X _ { 1 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) } \\ { \displaystyle = \int _ { 0 } ^ { \infty } q ( 0 \leq X _ { 1 } \leq t ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | t \leq \operatorname* { m i n } X _ { i } ) \mathrm { d } t } \\ { \displaystyle = q ( X _ { 1 } \leq X _ { 2 } \leq \cdots \leq X _ { n } | 0 \leq \operatorname* { m i n } X _ { i } ) . } \end{array}
476
+ $$
477
+
478
+ It follows from a familiar property of argmin of exponential distributions that:
479
+
480
+ $$
481
+ \begin{array} { r l } { q ( X _ { 1 } \leq X _ { 2 } \leq \cdots \leq X _ { n } ) = q ( X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) } & { } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } q ( X _ { 2 } \leq \cdots \leq X _ { n } | X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } \displaystyle \int _ { 0 } ^ { \infty } q ( X _ { 1 } = x ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) \mathrm { d } x } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } q ( X _ { 2 } \leq \cdots \leq X _ { n } ) , } \end{array}
482
+ $$
483
+
484
+ and by another induction, we have q(X1 ≤ · · · ≤ Xn) = Qni=1 sziZ−Pi−1k=1 szk .
485
+
486
+ Finally, following the argument of Balog et al. (2017), we apply the strictly decreasing function $g ( x ) = - \beta \log x$ to this identity, which from the definition of the Gumbel distribution implies:
487
+
488
+ $$
489
+ q ( \tilde { s } _ { z _ { 1 } } \geq \cdot \cdot \cdot \geq \tilde { s } _ { z _ { n } } ) = \prod _ { i = 1 } ^ { n } { \frac { s _ { z _ { i } } } { Z - \sum _ { k = 1 } ^ { i - 1 } s _ { z _ { k } } } } .
490
+ $$
491
+
492
+ # C ARG MAX SEMANTICS FOR TIED MAX ELEMENTS
493
+
494
+ While applying the arg max operator to a vector with duplicate entries attaining the max value, we need to define the operator semantics for arg max to handle ties in the context of the proposed relaxation.
495
+
496
+ Definition 6. For any vector with ties, let arg max set denote the operator that returns the set of all indices containing the max element. We define the arg max of the i-th in a matrix M recursively:
497
+
498
+ 1. If there exists an index $j \in \{ 1 , 2 , \dots , n \}$ that is a member of arg max $\mathrm { s e t } ( M [ i , : ] )$ and has not been assigned as an arg max of any row $k < i ,$ , then the arg max is the smallest such index.
499
+
500
+ 2. Otherwise, the arg max is the smallest index that is a member of the arg max $\mathrm { s e t } ( M [ i , : ] )$
501
+
502
+ This function is efficiently computable with additional bookkeeping.
503
+
504
+ Lemma 7. For an input vector s with the sort permutation matrix given as $P _ { s o r t ( \mathbf { s } ) }$ , we have $s _ { j _ { 1 } } =$ $s _ { j _ { 2 } }$ if and only if there exists a row $i$ such that $\widehat { P } [ i , j _ { 1 } ] = \widehat { P } [ i , j _ { 2 } ]$ for all $j _ { 1 } , j _ { 2 } \in \{ 1 , 2 , . . . , n \}$ .
505
+
506
+ Proof. From Eq. 5, we have the $i$ -th row of ${ \widehat P } [ i , : ]$ given as:
507
+
508
+ $$
509
+ \widehat { P } [ i , : ] = \mathrm { s o f t } \operatorname* { m a x } \left[ ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 } ) / \tau \right]
510
+ $$
511
+
512
+ . Therefore, we have the equations:
513
+
514
+ $$
515
+ { \widehat { P } } [ i , j _ { 1 } ] = { \frac { \exp ( ( ( n + 1 - 2 i ) s _ { j _ { 1 } } - ( A _ { { \mathbf { s } } } \mathbb { 1 } ) _ { i } ) / \tau ) } { Z } }
516
+ $$
517
+
518
+ $$
519
+ = \widehat { P } [ i , j _ { 2 } ] = \frac { \exp ( ( ( n + 1 - 2 i ) s _ { j _ { 2 } } - ( A _ { \mathbf { s } } \mathbf { 1 } ) _ { i } ) / \tau ) } { Z }
520
+ $$
521
+
522
+ for some fixed normalization constant Z. As the function f (x) = exp(((n+1−2i)x−(As1)i)/τ)Z is invertible, both directions of the lemma follow immediately.
523
+
524
+ Lemma 8. If arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] )$ and arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ have a non-zero intersection, then arg max $\begin{array} { r } { \mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) = \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] ) } \end{array}$ .
525
+
526
+ Proof. Assume without loss of generality that | arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) | \ > \ 1$ for some $i$ . Let $j _ { 1 } , j _ { 2 }$ be two members of $| \arg \operatorname* { m a x } \sec ( \widehat { P } [ i _ { 1 } , : ] ) |$ . By Lemma 7, $\begin{array} { r l r } { s _ { j _ { 1 } } } & { { } = } & { s _ { j _ { 2 } } } \end{array}$ , and therefore $\widehat { P } [ i _ { 2 } , j _ { 1 } ] = \widehat { P } [ i _ { 2 } , j _ { 2 } ]$ . Hence if $j _ { 1 } \in \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ , then $j _ { 2 }$ is also an element. A symmetric argument implies that if $j _ { 2 } \in \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ , then $j _ { 1 }$ is also an element for arbitrary $j _ { 1 } , j _ { 2 } \in | \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) |$ . This completes the proof. □
527
+
528
+ Proposition 9. (Argmax Permutation with Ties) For $\mathbf { s } ~ = ~ [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T } ~ \in ~ \mathbb { R } ^ { n }$ , the vector $\mathbf { z }$ defined by $z _ { i } = \arg \operatorname* { m a x } _ { j } \widehat { P } _ { s o r t ( \mathbf { s } ) } [ i , j ]$ is such that $\mathbf { z } \in \mathcal { Z } _ { n }$ .
529
+
530
+ ![](images/efda8ca4d673100428b2e5d6b9a08b9b0a4ffeb5fae1e1189db8ec49fa58ede9.jpg)
531
+ Figure 6: A stochastic computation graph for an arbitrary input $x$ , intermediate node $y$ , and a single parameter $\theta$ . Squares denote deterministic nodes and circles denote stochastic nodes.
532
+
533
+ Proof. From Corollary 3, we know that the row $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ attains its maximum (perhaps nonuniquely) at some $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , j ]$ where $s _ { j } = s _ { [ i ] }$ . Note that $s _ { [ i ] }$ is well-defined even in the case of ties.
534
+
535
+ Consider an arbitrary row $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ and let arg max $\sec ( { \widehat { P } } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ] ) = \{ j _ { 1 } , \dots , j _ { m } \}$ . It follows from Lemma 7 that there are exactly $m$ scores in s that are equal to $s _ { [ i ] }$ : $: s _ { j _ { 1 } } , \ldots , s _ { j _ { m } }$ . These scores corresponds to $m$ values of $s _ { [ i ^ { \prime } ] }$ such that $s _ { [ i ^ { \prime } ] } = s _ { [ i ] }$ , and consequently to $m$ rows $P [ i ^ { \prime } , : ]$ that are maximized with values $s _ { [ i ^ { \prime } ] } = s _ { [ i ] }$ and consequently (by Lemma 8) at indices $j _ { 1 } , \dots , j _ { m }$ .
536
+
537
+ Suppose we now chose an $i ^ { \prime }$ such that $s _ { [ i ^ { \prime } ] } \neq s _ { [ i ] }$ . Then $\widehat { P } [ i ^ { \prime } , : ]$ attains its maximum at some $\widehat { P } \mathrm { s o r t } ( \mathbf { s } ) [ i ^ { \prime } , j ^ { \prime } ]$ where $s _ { j ^ { \prime } } = s _ { [ i ^ { \prime } ] }$ . Because $s _ { j ^ { \prime } } = s _ { [ i ^ { \prime } ] } \neq s _ { [ i ] } = s _ { j }$ , Lemma 7 tells us that $\widehat { P } [ i ^ { \prime } , : ]$ does not attain its maximum at any of $j _ { 1 } , \dots , j _ { m }$ . Therefore, only $m$ rows have a non-zero arg max set intersection with arg max se $\mathrm { t } ( P [ i , : ] )$ .
538
+
539
+ Because $P [ i , : ]$ is one of these rows, there can be up to $m - 1$ such rows above it. Because each row above only has one arg max assigned via the tie-breaking protocol, it is only possible for up to $m - 1$ elements of arg max $\mathrm { s e t } ( P [ i , : ] )$ to have been an arg max of a previous row $k < i$ . As | arg max $\mathrm { s e t } ( P [ i , : ] ) | = { \bar { m } }$ , there exists at least one element that has not been specified as the arg max of a previous row (pigeon-hole principle). Thus, the arg max of each row are distinct. Because each argmax is also an element of $\{ 1 , \ldots , n \}$ , it follows that $\mathbf { z } \in \mathcal { Z } _ { n }$ . □
540
+
541
+ # D EXPERIMENTAL DETAILS AND ANALYSIS
542
+
543
+ We used Tensorflow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017) for our experiments. In Appendix A, we provide “plug-in” snippets for implementing our proposed relaxations in both Tensorflow and PyTorch. The full codebase for reproducing the experiments can be found at https://github.com/ermongroup/neuralsort.
544
+
545
+ For the sorting and quantile regression experiments, we used standard training/validation/test splits of $5 0 , 0 0 0 / 1 0 \bar { , } 0 0 0 / \bar { 1 0 } , 0 0 0$ images of MNIST for constructing the large-MNIST dataset. We ensure that only digits in the standard training/validation/test sets of the MNIST dataset are composed together to generate the corresponding sets of the large-MNIST dataset. For CIFAR-10, we used a split of 45, 000/5000/10, 000 examples for training/validation/test. With regards to the baselines considered, we note that the REINFORCE based estimators were empirically observed to be worse than almost all baselines for all our experiments.
546
+
547
+ # D.1 SORTING HANDWRITTEN NUMBERS
548
+
549
+ Architectures. We control for the choice of computer vision models by using the same convolutional network architecture for each sorting method. This architecture is as follows:
550
+
551
+ Conv[Kernel: 5x5, Stride: 1, Output: 140x28x32, Activation: Relu]
552
+ Pool[Stride: 2, Output: 70x14x32]
553
+ Conv[Kernel: 5x5, Stride: 1, Output: 70x14x64, Activation: Relu]
554
+ Pool[Stride: 2, Output: 35x7x64]
555
+ FC[Units: 64, Activation: Relu]
556
+
557
+ ![](images/985c2d270c6e8421c39e0efee995f8cc0e4b88cb794d6698b9a8553ae21b07c0.jpg)
558
+ Figure 7: Running average of the log-variance in gradient estimates during training for varying temperatures $\tau$ .
559
+
560
+ Note that the dimension of a 5-digit large-MNIST image is $1 4 0 \times 2 8$ . The primary difference between our methods is how we combine the scores to output a row-stochastic prediction matrix.
561
+
562
+ For NeuralSort-based methods, we use another fully-connected layer of dimension 1 to map the image representations to $n$ scalar scores. In the case of Stochastic NeuralSort, we then sample from the PL distribution by perturbing the scores multiple times with Gumbel noise. Finally, we use the NeuralSort operator to map the set of $n$ scores (or each set of $n$ perturbed scores) to its corresponding unimodal row-stochastic matrix.
563
+
564
+ For Sinkhorn-based methods, we use a fully-connected layer of dimension $n$ to map each image to an $n$ -dimensional vector. These vectors are then stacked into an $n \times n$ matrix. We then either map this matrix to a corresponding doubly-stochastic matrix (Sinkhorn) or sample directly from a distribution over permutation matrices via Gumbel perturbations (Gumbel-Sinkhorn). We implemented the Sinkhorn operator based on code snippets obtained from the open source implementation of Mena et al. (2018) available at https://github.com/google/gumbel sinkhorn.
565
+
566
+ For the Vanilla RS baseline, we ran each element through a fully-connected $n$ dimensional layer, concatenated the representations of each element and then fed the results through three fullyconnected $n ^ { 2 }$ -unit layers to output multiclass predictions for each rank.
567
+
568
+ All our methods yield row-stochastic $n \times n$ matrices as their final output. Our loss is the row-wise cross-entropy loss between the true permutation matrix and the row-stochastic output.
569
+
570
+ Hyperparameters. For this experiment, we used an Adam optimizer with an initial learning rate of $1 0 ^ { - 4 }$ and a batch size of 20. Continuous relaxations to sorting also introduce another hyperparameter: the temperature $\tau$ for the Sinkhorn-based and NeuralSort-based approaches. We tuned this hyperparameter on the set $\{ 1 , 2 , 4 , 8 , 1 6 \}$ by picking the model with the best validation accuracy on predicting entire permutations (as opposed to predicting individual maps between elements and ranks).
571
+
572
+ Effect of temperature. In Figure 7, we report the log-variance in gradient estimates as a function of the temperature $\tau$ . Similar to the effect of temperature observed for other continuous relaxations to discrete objects such as Gumbel-softmax (Jang et al., 2017; Maddison et al., 2017), we note that higher temperatures lead to lower variance in gradient estimates. The element-wise mean squared difference between unimodal approximations Pbsort(s) and the projected hard permutation matrices $P _ { \mathsf { s o r t } ( \mathbf { s } ) }$ for the best $\tau$ on the test set is shown in Table 4.
573
+
574
+ Table 4: Element-wise mean squared difference between unimodal approximations and the projected hard permutation matrices for the best temperature $\tau$ , averaged over the test set.
575
+
576
+ <table><tr><td>Algorithm</td><td>|n=3</td><td>n=5</td><td>n=7</td><td>n=9</td><td>n=15</td></tr><tr><td>Deterministic NeuralSort</td><td>0.0052</td><td>0.0272</td><td>0.0339</td><td>0.0105</td><td>0.0220</td></tr><tr><td>Stochastic NeuralSort</td><td>0.0095</td><td>0.0327</td><td>0.0189</td><td>0.0111</td><td>0.0179</td></tr></table>
577
+
578
+ ![](images/40110c26dcd8f27c3496d6cd157948de95c5cc523749b95878153798e3cc92be.jpg)
579
+ Figure 8: True vs. predicted medians for quantile regression on the large-MNIST dataset.
580
+
581
+ # D.2 QUANTILE REGRESSION
582
+
583
+ Architectures. Due to resource constraints, we ran the quantile regression experiment on 4-digit numbers instead of 5-digit numbers. We use the same neural network architecture as previously used in the sorting experiment.
584
+
585
+ Conv[Kernel: 5x5, Stride: 1, Output: 112x28x32, Activation: Relu]
586
+ Pool[Stride: 2, Output: 56x14x32]
587
+ Conv[Kernel: 5x5, Stride: 1, Output: 56x14x64, Activation: Relu]
588
+ Pool[Stride: 2, Output: 28x7x64]
589
+ FC[Units: 64, Activation: Relu]
590
+
591
+ The vanilla NN baseline for quantile regression was generated by feeding the CNN representations into a series of three fully-connected layers of ten units each, the last of which mapped to a singleunit estimate of the median. In the other experiments, one copy of this network was used to estimate each element’s rank through a method like Gumbel-Sinkhorn or NeuralSort that produces a rowstochastic matrix, while another copy was used to estimate each element’s value directly. Point predictions are obtained by multiplying the center row of the matrix with the column vector of estimated values, and we minimize the $\ell _ { 2 }$ loss between these point predictions and the true median, learning information about ordering and value simultaneously.
592
+
593
+ Hyperparameters. We used the Adam optimizer with an initial learning rate of $1 0 ^ { - 4 }$ and a batch size of 5. The temperature $\tau$ was tuned on the set $\{ 1 , 2 , 4 , 8 , 1 6 \}$ based on the validation loss.
594
+
595
+ Further Analysis. In Figure 8, we show the scatter plots for the true vs. predicted medians on 2000 test points from the large-MNIST dataset as we vary $n$ . For stochastic NeuralSort, we average the predictions across 5 samples. As we increase $n$ , the distribution of true medians concentrates, leading to an easier prediction problem (at an absolute scale) and hence, we observe lower MSE for larger $n$ in Table 2. However, the relatively difficulty of the problem increases with increasing $n$ , as the model is trying to learn a semantic sorting across a larger set of elements. This is reflected in the $R ^ { 2 }$ values in Table 2 which show a slight dip as $n$ increases.
596
+
597
+ D.3 END-TO-END, DIFFERENTIABLE $k$ -NEAREST NEIGHBORS
598
+
599
+ Architectures. The baseline kNN implementation for the pixel basis, PCA basis and the autoencoder basis was done using sklearn. For the autoencoder baselines for kNN, we used the following standard architectures.
600
+
601
+ MNIST and Fashion-MNIST: The dimension of the encoding used for distance computation in kNN is 50.
602
+
603
+ $$
604
+ \begin{array} { r l } & { \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ = ( e m b e d d i n g ) } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 7 8 4 , ~ A c t i v a t i o n : ~ S i g m o i d } } \end{array}
605
+ $$
606
+
607
+ CIFAR-10: The dimension of the encoding used for distance computation in kNN is 256. The architecture and training procedure follows the one available at https://github.com/shibuiwilliam/Keras Autoencoder.
608
+
609
+ Conv[Kernel: 3x3, Stride: 1, Output: 32x32x64, Activation: Relu]
610
+ Pool[Stride: 2, Output: 16x16x64]
611
+ Conv[Kernel: 3x3, Stride: 1, Output: 16x16x32, Normalization: BatchNorm, Activation: Relu]
612
+ Pool[Stride: 2, Output: 8x8x32]
613
+ Conv[Stride: 3, Output: 8x8x16, Normalization: BatchNorm, Activation: Relu]
614
+ MaxPool[Stride: 2, Output: 4x4x16]
615
+ $=$ (embedding)
616
+ Conv[Kernel: 3x3, Stride: 1, Output: 4x4x16, Normalization: BatchNorm, Activation: Relu]
617
+ UpSampling[Size: 2x2, Output: 8x8x16]
618
+ Conv[Kernel: 3x3, Stride: 1, Output: 8x8x32, Normalization: BatchNorm, Activation: Relu]
619
+ UpSampling[Size: 2x2, Output: 16x16x32]
620
+ Conv[Kernel: 3x3, Output: 16x16x64, Normalization: BatchNorm, Activation: Relu]
621
+ UpSampling[Size: 2x2, Output: 32x32x64]
622
+ Conv[Kernel: 3x3, Stride: 1, Output: 32x32x3, Normalization: BatchNorm, Activation: Sigmoid
623
+
624
+ Table 5: Accuracies of Deterministic and Stochastic NeuralSort for differentiable $k$ -nearest neighbors, broken down by $k$ .
625
+
626
+ <table><tr><td>Dataset</td><td>k</td><td>Deterministic NeuralSort</td><td>Stochastic NeuralSort</td></tr><tr><td rowspan="4">MNIST</td><td>1</td><td>99.2%</td><td>99.1%</td></tr><tr><td>35</td><td>99.5%</td><td>99.3%</td></tr><tr><td></td><td>99.3%</td><td>99.4%</td></tr><tr><td>9</td><td>99.3%</td><td>99.4%</td></tr><tr><td rowspan="4">Fashion-MNIST</td><td></td><td>92.6%</td><td>92.2%</td></tr><tr><td></td><td>93.2%</td><td>93.1%</td></tr><tr><td></td><td>93.5%</td><td>93.3%</td></tr><tr><td>1359</td><td>93.0%</td><td>93.4%</td></tr><tr><td rowspan="4">CIFAR-10</td><td>1</td><td>88.7%</td><td>85.1%</td></tr><tr><td>1359</td><td>90.0%</td><td>87.8%</td></tr><tr><td></td><td>90.2%</td><td>88.0%</td></tr><tr><td></td><td>90.7%</td><td>89.5%</td></tr></table>
627
+
628
+ For the MNIST experiments with NeuralSort, we used a network similar to the large-MNIST network used in the previous experiments:
629
+
630
+ Conv[Kernel: 5x5, Stride: 1, Output: $2 4 \mathrm { x } 2 4 \mathrm { x } 2 0$ , Activation: Relu]
631
+ Pool[Stride: 2, Output: $1 2 \mathrm { x } 1 2 \mathrm { x } 2 0 $ ]
632
+ Conv[Kernel: 5x5, Stride: 1, Output: 8x8x50, Activation: Relu]
633
+ Pool[Stride: 2, Output: 4x4x50]
634
+ FC[Units: 500, Activation: Relu]
635
+
636
+ For the Fashion-MNIST and CIFAR experiments with NeuralSort, we use the ResNet18 architecture as described in https://github.com/kuangliu/pytorch-cifar.
637
+
638
+ Hyperparameters. For this experiment, we used an SGD optimizer with a momentum parameter of 0.9, with a batch size of 100 queries and 100 neighbor candidates at a time. We chose the temperature hyperparameter from the set $\{ 1 , 1 6 , 6 4 \}$ , the constant learning rate from $\lbrace 1 0 ^ { - 4 } , 1 0 ^ { - 5 } \rbrace$ , and the number of nearest neighbors $k$ from the set $\{ 1 , 3 , 5 , 9 \}$ . The model with the best evaluation loss was evaluated on the test set. We suspect that accuracy improvements can be made by a more expensive hyperparameter search and a more fine-grained learning rate schedule.
639
+
640
+ Accuracy for different $k$ . In Table 5, we show the performance of Deterministic and Stochastic NeuralSort for different choice of the hyperparameter $k$ for the differentiable $k$ -nearest neighbors algorithm.
641
+
642
+ # E LOSS FUNCTIONS
643
+
644
+ For each of the experiments in this work, we assume we have access to a finite dataset $\mathcal { D } =$ $\{ ( { \bf x } ^ { ( 1 ) } , { \bf y } ^ { ( 1 ) } ) , ( { \bf x } ^ { ( 2 ) } , { \bf \bar { y } } ^ { ( 2 ) } ) , \dots \}$ . Our goal is to learn a predictor for $\mathbf { y }$ given $\mathbf { x }$ , as in a standard supervised learning (classification/regression) setting. Below, we state and elucidate the semantics of the training objective optimized by Deterministic and Stochastic NeuralSort for the sorting and quantile regression experiments.
645
+
646
+ # E.1 SORTING HANDWRITTEN NUMBERS
647
+
648
+ We are given a dataset $\mathcal { D }$ of sequences of large-MNIST images and the permutations that sort the sequences. That is, every datapoint in $\mathcal { D }$ consists of an input $\mathbf { x }$ , which corresponds to a sequence containing $n$ images, and the desired output label $\mathbf { y }$ , which corresponds to the permutation that sorts this sequence (as per the numerical values of the images in the input sequence). For example, Figure 4 shows one input sequence of $n = 5$ images, and the permutation $\mathbf { \bar { y } } = [ 3 , 5 , 1 , 4 , 2 ]$ that sorts this sequence.
649
+
650
+ For any datapoint $\mathbf { x }$ , let $\ell _ { \mathrm { C E } } ( \cdot )$ denote the average multiclass cross entropy (CE) error between the rows of the true permutation matrix $P _ { \mathbf { y } }$ and a permutation matrix $P _ { \widehat { \mathbf { y } } }$ corresponding to a predicted permutation, say $\widehat { \mathbf { y } }$ .
651
+
652
+ $$
653
+ \ell _ { \mathrm { { C E } } } ( P _ { \mathbf { y } } , P _ { \widehat { \mathbf { y } } } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { n } \mathbb { 1 } ( P _ { \mathbf { y } } [ i , j ] = 1 ) \log P _ { \widehat { \mathbf { y } } } [ i , j ]
654
+ $$
655
+
656
+ where $\mathbb { 1 } ( \cdot )$ denotes the indicator function. Now, we state the training objective functions for the Deterministic and Stochastic NeuralSort approaches respectively.
657
+
658
+ 1. Deterministic NeuralSort
659
+
660
+ $$
661
+ \operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \ell _ { \mathrm { C E } } ( P _ { \mathbf { y } } , \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } )
662
+ $$
663
+
664
+ where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$
665
+
666
+ 2. Stochastic NeuralSort
667
+
668
+ $$
669
+ \operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { C E } } ( P _ { \mathbf { y } } , \widehat { P } _ { \mathbf { z } } ) ) \right]
670
+ $$
671
+
672
+ where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
673
+
674
+ To ground this in our experimental setup, the score $s _ { j }$ for each large-MNIST image $\mathbf { x } _ { j }$ in any input sequence $\mathbf { x }$ of $n = 5$ images is obtained via a CNN $h _ { \phi } ( )$ with parameters $\phi$ . Note that the CNN parameters $\phi$ are shared across the different images $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { n }$ in the sequence for efficient learning.
675
+
676
+ # E.2 QUANTILE REGRESSION
677
+
678
+ In contrast to the previous experiment, here we are given a dataset $\mathcal { D }$ of sequences of large-MNIST images and only the numerical value of the median element for each sequence. For example, the desired label corresponds to $y = 2 9 6 0$ (a real-valued scalar) for the input sequence of $n = 5$ images in Figure 4.
679
+
680
+ For any datapoint $\mathbf { x }$ , let $\ell _ { \mathrm { M S E } } ( \cdot )$ denote the mean-squared error between the true median $y$ and the prediction, say $\widehat { y }$ .
681
+
682
+ $$
683
+ \ell _ { \mathrm { M S E } } ( y , \widehat { y } ) = \| y - \widehat { y } \| _ { 2 } ^ { 2 }
684
+ $$
685
+
686
+ For the NeuralSort approaches, we optimize the following objective functions.
687
+
688
+ 1. Deterministic NeuralSort
689
+
690
+ $$
691
+ \operatorname* { m i n } _ { \phi , \theta } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \ell _ { \mathrm { M S E } } \big ( y , g _ { \theta } \big ( \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } \mathbf { x } \big ) \big )
692
+ $$
693
+
694
+ where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
695
+
696
+ 2. Stochastic NeuralSort
697
+
698
+ $$
699
+ \operatorname* { m i n } _ { \phi , \theta } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { M S E } } ( y , g _ { \theta } ( \widehat { P } _ { \mathbf { z } } \mathbf { x } ) ) \right]
700
+ $$
701
+
702
+ where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
703
+
704
+ As before, the score $s _ { j }$ for each large-MNIST image $\mathbf { x } _ { j }$ in any input sequence $\mathbf { x }$ of $n$ images is obtained via a $\mathrm { C N N } h _ { \phi } ( )$ with parameters $\phi$ . Once we have a predicted permutation matrix $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) }$ (or $\widehat { P } _ { \mathbf { z } }$ ) for deterministic (or stochastic) approaches, we extract the median image via $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) \mathbf { x } }$ (or $\widehat { P } _ { \mathbf { z } } \mathbf { x } )$ . Finally, we use a neural network $g _ { \boldsymbol { \theta } } ( \cdot )$ with parameters $\theta$ to regress this image to a scalar prediction for the median.
parse/train/H1eSS3CcKX/H1eSS3CcKX_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1eSS3CcKX/H1eSS3CcKX_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1eSS3CcKX/H1eSS3CcKX_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJWLfGWRb/HJWLfGWRb.md ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MATRIX CAPSULES WITH EM ROUTING
2
+
3
+ Geoffrey Hinton, Sara Sabour, Nicholas Frosst
4
+ Google Brain
5
+ Toronto, Canada
6
+ {geoffhinton, sasabour, frosst}@google.com
7
+
8
+ # ABSTRACT
9
+
10
+ A capsule is a group of neurons whose outputs represent different properties of the same entity. Each layer in a capsule network contains many capsules. We describe a version of capsules in which each capsule has a logistic unit to represent the presence of an entity and a $4 \mathbf { x } 4$ matrix which could learn to represent the relationship between that entity and the viewer (the pose). A capsule in one layer votes for the pose matrix of many different capsules in the layer above by multiplying its own pose matrix by trainable viewpoint-invariant transformation matrices that could learn to represent part-whole relationships. Each of these votes is weighted by an assignment coefficient. These coefficients are iteratively updated for each image using the Expectation-Maximization algorithm such that the output of each capsule is routed to a capsule in the layer above that receives a cluster of similar votes. The transformation matrices are trained discriminatively by backpropagating through the unrolled iterations of EM between each pair of adjacent capsule layers. On the smallNORB benchmark, capsules reduce the number of test errors by $45 \%$ compared to the state-of-the-art. Capsules also show far more resistance to white box adversarial attacks than our baseline convolutional neural network.
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ Convolutional neural nets are based on the simple fact that a vision system needs to use the same knowledge at all locations in the image. This is achieved by tying the weights of feature detectors so that features learned at one location are available at other locations. Convolutional capsules extend the sharing of knowledge across locations to include knowledge about the part-whole relationships that characterize a familiar shape. Viewpoint changes have complicated effects on pixel intensities but simple, linear effects on the pose matrix that represents the relationship between an object or object-part and the viewer. The aim of capsules is to make good use of this underlying linearity, both for dealing with viewpoint variations and for improving segmentation decisions.
15
+
16
+ Capsules use high-dimensional coincidence filtering: a familiar object can be detected by looking for agreement between votes for its pose matrix. These votes come from parts that have already been detected. A part produces a vote by multiplying its own pose matrix by a learned transformation matrix that represents the viewpoint invariant relationship between the part and the whole. As the viewpoint changes, the pose matrices of the parts and the whole will change in a coordinated way so that any agreement between votes from different parts will persist.
17
+
18
+ Finding tight clusters of high-dimensional votes that agree in a mist of irrelevant votes is one way of solving the problem of assigning parts to wholes. This is non-trivial because we cannot grid the high-dimensional pose space in the way the low-dimensional translation space is gridded to facilitate convolutions. To solve this challenge, we use a fast iterative process called “routingby-agreement” that updates the probability with which a part is assigned to a whole based on the proximity of the vote coming from that part to the votes coming from other parts that are assigned to that whole. This is a powerful segmentation principle that allows knowledge of familiar shapes to derive segmentation, rather than just using low-level cues such as proximity or agreement in color or velocity. An important difference between capsules and standard neural nets is that the activation of a capsule is based on a comparison between multiple incoming pose predictions whereas in a standard neural net it is based on a comparison between a single incoming activity vector and a learned weight vector.
19
+
20
+ # 2 HOW CAPSULES WORK
21
+
22
+ Neural nets typically use simple non-linearities in which a non-linear function is applied to the scalar output of a linear filter. They may also use softmax non-linearities that convert a whole vector of logits into a vector of probabilities. Capsules use a much more complicated non-linearity that converts the whole set of activation probabilities and poses of the capsules in one layer into the activation probabilities and poses of capsules in the next layer.
23
+
24
+ A capsule network consists of several layers of capsules. The set of capsules in layer $L$ is denoted as $\Omega _ { L }$ . Each capsule has a 4x4 pose matrix, $M$ , and an activation probability, $a$ . These are like the activities in a standard neural net: they depend on the current input and are not stored. In between each capsule $i$ in layer $L$ and each capsule $j$ in layer $L + 1$ is a 4x4 trainable transformation matrix, $W _ { i j }$ . These $W _ { i j } { \bf s }$ (and two learned biases per capsule) are the only stored parameters and they are learned discriminatively. The pose matrix of capsule $i$ is transformed by $W _ { i j }$ to cast a vote $V _ { i j } = M _ { i } W _ { i j }$ for the pose matrix of capsule $j$ . The poses and activations of all the capsules in layer $L + 1$ are calculated by using a non-linear routing procedure which gets as input $V _ { i j }$ and $a _ { i }$ for all $i \in \Omega _ { L } , j \in \Omega _ { L + 1 }$ .
25
+
26
+ The non-linear procedure is a version of the Expectation-Maximization procedure. It iteratively adjusts the means, variances, and activation probabilities of the capsules in layer $L + 1$ and the assignment probabilities between all $i \in \Omega _ { L } , j \in \Omega _ { L + 1 }$ . In appendix 1, we give a gentle intuitive introduction to routing-by-agreement and describe in detail how it relates to the EM algorithm for fitting a mixture of Gaussians.
27
+
28
+ # 3 USING EM FOR ROUTING-BY-AGREEMENT
29
+
30
+ Let us suppose that we have already decided on the poses and activation probabilities of all the capsules in a layer and we now want to decide which capsules to activate in the layer above and how to assign each active lower-level capsule to one active higher-level capsule. Each capsule in the higher-layer corresponds to a Gaussian and the pose of each active capsule in the lower-layer (converted to a vector) corresponds to a data-point (or a fraction of a data-point if the capsule is partially active).
31
+
32
+ Using the minimum description length principle we have a choice when deciding whether or not to activate a higher-level capsule. Choice 0: if we do not activate it, we must pay a fixed cost of $- \beta _ { u }$ per data-point for describing the poses of all the lower-level capsules that are assigned to the higher-level capsule. This cost is the negative log probability density of the data-point under an improper uniform prior. For fractional assignments we pay that fraction of the fixed cost. Choice 1: if we do activate the higher-level capsule we must pay a fixed cost of $- \beta _ { a }$ for coding its mean and variance and the fact that it is active and then pay additional costs, pro-rated by the assignment probabilities, for describing the discrepancies between the lower-level means and the values predicted for them when the mean of the higher-level capsule is used to predict them via the inverse of the transformation matrix. A much simpler way to compute the cost of describing a datapoint is to use the negative log probability density of that datapoint’s vote under the Gaussian distribution fitted by whatever higher-level capsule it gets assigned to. This is incorrect for reasons explained in appendix 1, but we use it because it requires much less computation (also explained in the appendix). The difference in cost between choice 0 and choice 1, is then put through the logistic function on each iteration to determine the higher-level capsule’s activation probability. Appendix 1 explains why the logistic is the correct function to use.
33
+
34
+ Using our efficient approximation for choice 1 above, the incremental cost of explaining a whole data-point $i$ by using an active capsule $j$ that has an axis-aligned covariance matrix is simply the sum over all dimensions of the cost of explaining each dimension, $h$ , of the vote $V _ { i j }$ . This is simply $- l n ( P _ { i | j } ^ { h } )$ where $P _ { i | j } ^ { h }$ is the probability density of the $h ^ { t h }$ component of the vectorized vote $V _ { i j }$ under $j$ ’s Gaussian model for dimension $h$ which has variance $( \sigma _ { j } ^ { h } ) ^ { 2 }$ and mean $\mu _ { j } ^ { h }$ where $\mu _ { j }$ is the vectorized version of $j$ ’s pose matrix $M _ { j }$ .
35
+
36
+ $$
37
+ { \bf \Phi } _ { i \vert j } ^ { o h } = \frac { 1 } { \sqrt { 2 \pi ( \sigma _ { j } ^ { h } ) ^ { 2 } } } \exp \left( - \frac { ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } \right) , \quad \quad \quad l n ( P _ { i \vert j } ^ { h } ) = - \frac { ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } - l n ( \sigma _ { j } ^ { h } ) - l n ( 2 \pi ) / 2
38
+ $$
39
+
40
+ Summing over all lower-level capsules for a single dimension, $h$ , of $j$ we get:
41
+
42
+ $$
43
+ \begin{array} { l } { { c o s t _ { j } ^ { h } = \displaystyle \sum _ { i } - r _ { i j } l n ( P _ { i | j } ^ { h } ) } } \\ { { = \displaystyle \frac { \sum _ { i } r _ { i j } ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } + \left( l n ( \sigma _ { j } ^ { h } ) + \displaystyle \frac { l n ( 2 \pi ) } { 2 } \right) \sum _ { i } r _ { i j } } } \\ { { = \left( l n ( \sigma _ { j } ^ { h } ) + \displaystyle \frac { 1 } { 2 } + \frac { l n ( 2 \pi ) } { 2 } \right) \sum _ { i } r _ { i j } } } \end{array}
44
+ $$
45
+
46
+ where $\sum _ { i } r _ { i j }$ is the amount of data assigned to $j$ and $V _ { i j } ^ { h }$ is the value on dimension $h$ of $V _ { i j }$ . Turningon capsule $j$ increases the description length for the means of the lower-level capsules assigned to $j$ from $- \beta _ { u }$ per lower-level capsule to $- \beta _ { a }$ plus the sum of the cost over all dimensions so we define the activation function of capsule $j$ to be:
47
+
48
+ $$
49
+ a _ { j } = l o g i s t i c \left( \lambda \left( \beta _ { a } - \beta _ { u } \sum _ { i } r _ { i j } - \sum _ { h } c o s t _ { j } ^ { h } \right) \right)
50
+ $$
51
+
52
+ where $\beta _ { a }$ is the same for all capsules and $\lambda$ is an inverse temperature parameter. We learn $\beta _ { a }$ and $\beta _ { u }$ discriminatively and set a fixed schedule for $\lambda$ as a hyper-parameter.
53
+
54
+ For finalizing the pose parameters and activations of the capsules in layer $L + 1$ we run the EM algorithm for few iterations (normally 3) after the pose parameters and activations have already been finalized in layer $L$ . The non-linearity implemented by a whole capsule layer is a form of cluster finding using the EM algorithm, so we call it EM Routing.
55
+
56
+ Procedure 1 Routing algorithm returns activation and pose of the capsules in layer $L + 1$ given the activations and votes of capsules in layer $L$ . $V _ { i j } ^ { h }$ is the $h ^ { t h }$ dimension of the vote from capsule $i$ with activation $a _ { i }$ in layer $L$ to capsule $j$ in layer $\boldsymbol { L } + 1$ . $\beta _ { a }$ , $\beta _ { u }$ are learned discriminatively and the inverse temperature $\lambda$ increases at each iteration with a fixed schedule.
57
+
58
+ <table><tr><td colspan="2">1: procedure EM RoUTING(a, V)</td></tr><tr><td>2:</td><td>∀i∈ΩL,j∈ΩL+1:Rij←1/|ΩL+1l</td></tr><tr><td>3:</td><td>for t iterations do</td></tr><tr><td>4:</td><td>∀j ∈ ΩL+1: M-STEP(a,R,V,j)</td></tr><tr><td>5: return a, M</td><td>∀i∈ΩL:E-STEP(μ,σ,a,V,i)</td></tr><tr><td>1: procedure M-sTEP(a,R, V, j)</td><td>for one higher-level capsule, j</td></tr><tr><td>2:</td><td>∀i∈ΩL:Rij ←Rij *ai</td></tr><tr><td>3:</td><td>Ah:←RV ∑Rij</td></tr><tr><td>4:</td><td>Vh:(o)²∑Rij(V-μ)²</td></tr><tr><td>5:</td><td>∑Rij costh ←(βu+log(o))∑Rij</td></tr><tr><td>6:</td><td>aj ← logistic(λ(βa -∑ncostʰ))</td></tr><tr><td>1: procedure E-STEP(μ,σ,a,V,i)</td><td></td></tr><tr><td>1</td><td>&gt;for one lower-level capsule, i H exp £h</td></tr><tr><td>2: ∀j ∈ΩL+1: Pj ← √II 2π()2</td><td>2()</td></tr><tr><td>3:</td><td>j ∈ΩL+1: Rij ← ∑κeΩL+1 ajpj akPk</td></tr></table>
59
+
60
+ # 4 THE CAPSULES ARCHITECTURE
61
+
62
+ The general architecture of our model is shown in Fig. 1. The model starts with a 5x5 convolutional layer with 32 channels $\scriptstyle ( \mathrm { A } = 3 2 )$ and a stride of 2 with a ReLU non-linearity. All the other layers are capsule layers starting with the primary capsule layer. The 4x4 pose of each of the $\scriptstyle \mathbf { B } = 3 2$ primary capsule types is a learned linear transformation of the output of all the lower-layer ReLUs centered at that location. The activations of the primary capsules are produced by applying the sigmoid function to the weighted sums of the same set of lower-layer ReLUs.
63
+
64
+ ![](images/a2c6d4f8620b305d4fa78a8a298083d07d8afb958f0e06f571bd0bde4277aca1.jpg)
65
+ Figure 1: A network with one ReLU convolutional layer followed by a primary convolutional capsule layer and two more convolutional capsule layers.
66
+
67
+ The primary capsules are followed by two $3 { \bf x } 3$ convolutional capsule layers $\left( \mathrm { K } \mathrm { = } 3 \right)$ , each with 32 capsule types $\mathrm { ( C = D } { = } 3 2$ ) with strides of 2 and one, respectively. The last layer of convolutional capsules is connected to the final capsule layer which has one capsule per output class.
68
+
69
+ When connecting the last convolutional capsule layer to the final layer we do not want to throw away information about the location of the convolutional capsules but we also want to make use of the fact that all capsules of the same type are extracting the same entity at different positions. We therefore share the transformation matrices between different positions of the same capsule type and add the scaled coordinate (row, column) of the center of the receptive field of each capsule to the first two elements of the right-hand column of its vote matrix. We refer to this technique as Coordinate Addition. This should encourage the shared final transformations to produce values for those two elements that represent the fine position of the entity relative to the center of the capsule’s receptive field.
70
+
71
+ The routing procedure is used between each adjacent pair of capsule layers. For convolutional capsules, each capsule in layer $L + 1$ sends feedback only to capsules within its receptive field in layer $L$ . Therefore each convolutional instance of a capsule in layer $L$ receives at most kernel size X kernel size feedback from each capsule type in layer $L + 1$ . The instances closer to the border of the image receive fewer feedbacks with corner ones receiving only one feedback per capsule type in layer $L + 1$ .
72
+
73
+ # 4.1 SPREAD LOSS
74
+
75
+ In order to make the training less sensitive to the initialization and hyper-parameters of the model, we use “spread loss” to directly maximize the gap between the activation of the target class $\left( { { a } _ { t } } \right)$ and the activation of the other classes. If the activation of a wrong class, $a _ { i }$ , is closer than the margin, $m$ , to $a _ { t }$ then it is penalized by the squared distance to the margin:
76
+
77
+ $$
78
+ L _ { i } = ( m a x ( 0 , m - ( a _ { t } - a _ { i } ) ) ^ { 2 } , L = \sum _ { i \neq t } L _ { i }
79
+ $$
80
+
81
+ By starting with a small margin of 0.2 and linearly increasing it during training to 0.9, we avoid dead capsules in the earlier layers. Spread loss is equivalent to squared Hinge loss with $m = 1$ . Guermeur & Monfrini (2011) studies a variant of this loss in the context of multi class SVMs.
82
+
83
+ # 5 EXPERIMENTS
84
+
85
+ The smallNORB dataset (LeCun et al. (2004)) has gray-level stereo images of 5 classes of toys: airplanes, cars, trucks, humans and animals. There are 10 physical instances of each class which are painted matte green. 5 physical instances of a class are selected for the training data and the other 5 for the test data. Every individual toy is pictured at 18 different azimuths (0-340), 9 elevations and 6 lighting conditions, so the training and test sets each contain 24,300 stereo pairs of 96x96 images. We selected smallNORB as a benchmark for developing our capsules system because it is carefully designed to be a pure shape recognition task that is not confounded by context and color, but it is much closer to natural images than MNIST.
86
+
87
+ Table 1: The effect of varying different components of our capsules architecture on smallNORB.
88
+
89
+ <table><tr><td>Routing iterations</td><td>Pose structure</td><td>Loss</td><td>Coordinate Addition</td><td>Test error rate</td></tr><tr><td>1</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>9.7%</td></tr><tr><td>2</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>2.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>1.8%</td></tr><tr><td>5</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>3.9%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>Yes</td><td>2.9%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>No</td><td>2.6%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>No</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Margin1</td><td>Yes</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>CrossEnt</td><td>Yes</td><td>5.8%</td></tr><tr><td colspan="3">Baseline CNN with 4.2M parameters</td><td></td><td>5.2%</td></tr><tr><td colspan="4">CNN of Ciresan et al. (2O11) with extra input images &amp; deformations</td><td>2.56%</td></tr><tr><td colspan="3">Our Best model (third row), with multiple crops during testing</td><td></td><td>1.4%</td></tr></table>
90
+
91
+ We downsample smallNORB to $4 8 \times 4 8$ pixels and normalize each image to have zero mean and unit variance. During training, we randomly crop $3 2 \times 3 2$ patches and add random brightness and contrast to the cropped images. During test, we crop a $3 2 \times 3 2$ patch from the center of the image and achieve $\mathbf { 1 . 8 \% }$ test error on smallNORB. If we average the class activations over multiple crops at test time we achieve $1 . 4 \%$ . The best reported result on smallNORB without using meta data is $2 . 5 6 \%$ (Cires¸an et al. (2011)). To achieve this, they added two additional stereo pairs of input images that are created by using an on-center off-surround filter and an off-center on-surround filter. They also applied affine distortions to the images. Our work also beats the Sabour et al. (2017) capsule work which achieves $2 . 7 \%$ on smallNORB. We also tested our model on NORB which is a jittered version of smallNORB with added background and we achieved a $2 . 6 \%$ error rate which is on par with the state-of-the-art of $2 . 7 \%$ (Ciresan et al. (2012)).
92
+
93
+ As the baseline for our experiments on generalization to novel viewpoints we train a CNN which has two convolutional layers with 32 and 64 channels respectively. Both layers have a kernel size of 5 and a stride of 1 with a $2 \times 2$ max pooling. The third layer is a 1024 unit fully connected layer with dropout and connects to the 5-way softmax output layer. All hidden units use the ReLU non-linearity. We use the same image preparation for the CNN baseline as described above for the capsule network. Our baseline CNN was the result of an extensive hyperparameter search over filter sizes, numbers of channels and learning rates.
94
+
95
+ The CNN baseline achieves $5 . 2 \%$ test error rate on smallNORB and has $4 . 2 \mathbf { M }$ parameters. We deduce that the Cires¸an et al. (2011) network has $2 . 7 \mathbf { M }$ parameters. By using small matrix multiplies, we reduced the number of parameters by a factor of 15 to 310K compared with our baseline CNN (and a factor of 9 w.r.t Cires¸an et al. (2011)). A smaller capsule network of $A = 6 4 , B = 8 , C =$ $D = 1 6$ with only 68K trainable parameters achieves $2 . 2 \%$ test error rate which also beats the prior state-of-the-art.
96
+
97
+ Fig. 2 shows how EM routing adjusts the vote assignments and the capsule means to find the tight clusters in the votes. The histograms show the distribution of vote distances to the mean (pose) of each class capsule during routing iterations. At the first iteration, votes are distributed equally between 5 final layer capsules. Therefore, all capsules receive votes closer than 0.05 to their calculated mean. In the second iteration, the assignment probability for agreeing votes increases. Therefore, most of the votes are assigned to the detected clusters, the animal and human class in the middle row, and the other capsules only receive scattered votes which are further than 0.05 from the calculated mean. The zoomed-out version of Fig. 2 in the Appendix shows the full distribution of vote distances at each routing iteration.
98
+
99
+ Instead of using our MDL-derived capsule activation term which computes a separate activation probability per capsule, we could view the capsule activations like the mixing proportions in a mixture of Gaussians and set them to be proportional to the sum of the assignment probabilities of a capsule and to sum to 1 over all the capsules in a layer. This increases the test error rate on smallNORB to $4 . 5 \%$ . Tab. 1 summarizes the effects of the number of routing iterations, the type of loss, and the use of matrices rather than vectors for the poses.
100
+
101
+ ![](images/8be3ea0bab1e25a6aa71bd0340609a27c13551bcb7eab555f8c2f16e24393e2e.jpg)
102
+ Figure 2: Histogram of distances of votes to the mean of each of the 5 final capsules after each routing iteration. Each distance point is weighted by its assignment probability. All three images are selected from the smallNORB test set. The routing procedure correctly routes the votes in the truck and the human example. The plane example shows a rare failure case of the model where the plane is confused with a car in the third routing iteration. The histograms are zoomed-in to visualize only votes with distances less than 0.05. Fig. B.2 shows the complete histograms for the ”human” capsule without clipping the $\mathbf { X } ^ { } -$ -axis or fixing the scale of the y-axis.
103
+
104
+ Table 2: A comparison of the smallNORB test error rate of the baseline CNN and the capsules model on novel viewpoints when both models are matched on error rate for familiar viewpoints.
105
+
106
+ <table><tr><td rowspan="2">Test set</td><td colspan="2">Azimuth</td><td colspan="2">Elevation</td></tr><tr><td>CNN</td><td>Capsules</td><td>1 CNN</td><td>Capsules</td></tr><tr><td>Novel viewpoints</td><td>20%</td><td>13.5%</td><td>17.8%</td><td>12.3%</td></tr><tr><td>Familiar viewpoints</td><td>3.7%</td><td>3.7%</td><td>4.3%</td><td>4.3%</td></tr></table>
107
+
108
+ The same capsules architecture as Fig. 1 achieves $0 . 4 4 \%$ test error rate on MNIST. If the number of channels in the first hidden layer is increased to 256, it achieves $1 1 . 9 \%$ test error rate on Cifar10 (Krizhevsky & Hinton (2009)).
109
+
110
+ # 5.1 GENERALIZATION TO NOVEL VIEWPOINTS
111
+
112
+ A more severe test of generalization is to use a limited range of viewpoints for training and to test on a much wider range. We trained both our convolutional baseline and our capsule model on one-third of the training data containing azimuths of (300, 320, 340, 0, 20, 40) and tested on the two-thirds of the test data that contained azimuths from 60 to 280. In a separate experiment, we trained on the 3 smaller elevations and tested on the 6 larger elevations.
113
+
114
+ It is hard to decide if the capsules model is better at generalizing to novel viewpoints because it achieves better test accuracy on all viewpoints. To eliminate this confounding factor, we stopped training the capsule model when its performance matched the baseline CNN on the third of the test set that used the training viewpoints. Then, we compared these matched models on the twothirds of the test set with novel viewpoints. Results in Tab. 2 show that compared with the baseline CNN capsules with matched performance on familiar viewpoints reduce the test error rate on novel viewpoints by about $3 0 \%$ for both novel azimuths and novel elevations.
115
+
116
+ # 6 ADVERSARIAL ROBUSTNESS
117
+
118
+ There is growing interest in the vulnerability of neural networks to adversarial examples; inputs that have been slightly changed by an attacker to trick a neural net classifier into making the wrong classification. These inputs can be created in a variety of ways, but straightforward strategies such as FGSM (Goodfellow et al. (2014)) have been shown to drastically decrease accuracy in convolutional neural networks on image classification tasks. We compare our capsule model and a traditional convolutional model on their ability to withstand such attacks.
119
+
120
+ FGSM computes the gradient of the loss w.r.t. each pixel intensity and then changes the pixel intensity by a fixed amount $\epsilon$ in the direction that increases the loss. So the changes only depend on the sign of the gradient at each pixel. This can be extended to a targeted attack by updating the input to maximize the classification probability of a particular wrong class. We generated adversarial attacks using FGSM because it has only one hyper-parameter and it is easy to compare models that have very different gradient magnitudes. To test the robustness of our model, we generated adversarial images from the test set using a fully trained model. We then reported the accuracy of the model on these images.
121
+
122
+ We found that our model is significantly less vulnerable to both general and targeted FGSM adversarial attacks; a small $\epsilon$ can be used to reduce a convolutional model’s accuracy much more than an equivalent $\epsilon$ can on the capsule model (Fig. 3). It should also be noted that the capsule model’s accuracy after the untargeted attack never drops below chance $( 2 0 \% )$ whereas the convolutional model’s accuracy is reduced to significantly below chance with an $\epsilon$ as small as 0.2.
123
+
124
+ We also tested our model on the slightly more sophisticated adversarial attack of the Basic Iterative Method (Kurakin et al. (2016)), which is simply the aforementioned attack except it takes multiple smaller steps when creating the adversarial image. Here too we find that our model is much more robust to the attack than the traditional convolutional model.
125
+
126
+ ![](images/beef58cad854849bc8c253f9108a4d2c51f1152db1fc48d7ca3c09464317b0d7.jpg)
127
+ Figure 3: Accuracy against $\epsilon$ after an adversarial attack (left) and Success Rate after a targeted adversarial attack (right). The targeted attack results were evaluated by averaging the success rate after the attack for each of the 5 possible classes.
128
+
129
+ It has been shown that some robustness to adversarial attacks in models can be due to simple numerical instability in the calculation of the gradient Brendel & Bethge (2017). To ensure that this was not the sole cause of our model’s robustness, we calculated the percentage of zero values in the gradient with respect to the image in the capsule model and found it to be smaller than that of the CNN. Furthermore, the capsule gradients, although smaller that those of the CNN, are only smaller by 2 orders of magnitude, as opposed to 16 orders of magnitude seen in Brendel & Bethge (2017)’s work.
130
+
131
+ Finally we tested our model’s robustness to black box attacks by generating adversarial examples with a CNN and testing them on both our capsule model and a different CNN. We found that the capsule model did not perform noticeably better at this task than the CNN.
132
+
133
+ # 7 RELATED WORK
134
+
135
+ Among the multiple recent attempts at improving the ability of neural networks to deal with viewpoint variations, there are two main streams. One stream attempts to achieve viewpoint invariance and the other aims for viewpoint equivariance. The work presented by Jaderberg et al. (2015)), Spatial Transformer Networks, seeks viewpoint invariance by changing the sampling of CNNs according to a selection of affine transformations. De Brabandere et al. (2016) extends spatial transformer networks where the filters are adapted during inference depending on the input. They generate different filters for each locality in the feature map rather than applying the same transformation to all filters. Their approach is a step toward input covariance detection from traditional pattern matching frameworks like standard CNNs (LeCun et al. (1990)). Dai et al. (2017) improves upon spatial transformer networks by generalizing the sampling method of filters. Our work differs substantially in that a unit is not activated based on the matching score with a filter (either fixed or dynamically changing during inference). In our case, a capsule is activated only if the transformed poses coming from the layer below match each other. This is a more effective way to capture covariance and leads to models with many fewer parameters that generalize better.
136
+
137
+ The success of CNNs has motivated many researchers to extend the translational equivariance built in to CNNs to include rotational equivariance (Cohen & Welling (2016), Dieleman et al. (2016), Oyallon & Mallat (2015)). The recent approach in Harmonic Networks (Worrall et al. (2017)) achieves rotation equivariant feature maps by using circular harmonic filters and returning both the maximal response and orientation using complex numbers. This shares the basic representational idea of capsules: By assuming that there is only one instance of the entity at a location, we can use several different numbers to represent its properties. They use a fixed number of streams of rotation orders. By enforcing the equality of the sum of rotation orders along any path, they achieve patch-wise rotation equivariance. This approach is more parameter-efficient than data augmentation approaches, duplicating feature maps, or duplicating filters (Fasel & Gatica-Perez (2006), Laptev et al. (2016)). Our approach encodes general viewpoint equivariance rather than only affine 2D rotations. Symmetry networks (Gens & Domingos (2014)) use iterative Lucas-Kanade optimization to find poses that are supported by the most low-level features. Their key weakness is that the iterative algorithm always starts at the same pose, rather than the mean of the bottom-up votes.
138
+
139
+ Lenc & Vedaldi (2016) proposes a feature detection mechanism (DetNet) that is equivariant to affine transformations. DetNet is designed to detect the same points in the image under different viewpoint variations. This effort is orthogonal to our work but DetNet might be a good way to implement the de-rendering first-stage that activates the layer of primary capsules.
140
+
141
+ Our routing algorithm can be seen as an attention mechanism. In this view, it is related to the work of Gregor et al. (2015), where they improved the decoder performance in a generative model by using Gaussian kernels to attend to different parts of the feature map generated by the encoder. Vaswani et al. (2017) uses a softmax attention mechanism to match parts of the query sequence to parts of the input sequence for the translation task and when generating an encoding for the query. They show improvement upon previous translation efforts using recurrent architectures. Our algorithm has attention in the opposite direction. The competition is not between the lower-level capsules that a higher-level capsule might attend to. It is between the higher-level capsules that a lower-level capsule might send its vote to.
142
+
143
+ # 7.1 PREVIOUS WORK ON CAPSULES
144
+
145
+ Hinton et al. (2011) used a transformation matrix in a transforming autoencoder that learned to transform a stereo pair of images into a stereo pair from a slightly different viewpoint. However, that system requires the transformation matrix to be supplied externally. More recently, routing-byagreement was shown to be effective for segmenting highly overlapping digits (Sabour et al. (2017)), but that system has several deficiencies that we have overcome in this paper:
146
+
147
+ 1. It uses the length of the pose vector to represent the probability that the entity represented by a capsule is present. To keep the length less than 1, requires an unprincipled non-linearity and this prevents the existence of any sensible objective function that is minimized by the iterative routing procedure.
148
+ 2. It uses the cosine of the angle between two pose vectors to measure their agreement. Unlike the negative log variance of a Gaussian cluster, the cosine saturates at 1, which makes it insensitive to the difference between a quite good agreement and a very good agreement.
149
+ 3. It uses a vector of length $n$ rather than a matrix with $n$ elements to represent a pose, so its transformation matrices have $n ^ { 2 }$ parameters rather than just $n$ .
150
+
151
+ # 8 CONCLUSION
152
+
153
+ Building on the work of Sabour et al. (2017), we have proposed a new type of capsule system in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 pose matrix to represent the pose of that entity. We also introduced a new iterative routing procedure between capsule layers, based on the EM algorithm, which allows the output of each lower-level capsule to be routed to a capsule in the layer above in such a way that active capsules receive a cluster of similar pose votes. This new system achieves significantly better accuracy on the smallNORB data set than the state-of-the-art CNN, reducing the number of errors by $45 \%$ . We have also shown it to be significantly more robust to white box adversarial attacks than a baseline CNN.
154
+
155
+ SmallNORB is an ideal data-set for developing new shape-recognition models precisely because it lacks many of the additional features of images in the wild. Now that our capsules model works well on NORB, we plan to implement an efficient version to test much larger models on much larger data-sets such as ImageNet.
156
+
157
+ ACKNOWLEDGMENTS Thanks to Robert Gens, Eric Langlois, Taco Cohen and anonymous commentators for helpful discussions and to everyone who made TensorFlow.
158
+
159
+ # REFERENCES
160
+
161
+ Wieland Brendel and Matthias Bethge. Comment on” biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017.
162
+
163
+ Dan Ciresan, Ueli Meier, and Jurgen Schmidhuber. Multi-column deep neural networks for image ¨ classification. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 3642–3649. IEEE, 2012.
164
+
165
+ Dan C Cires¸an, Ueli Meier, Jonathan Masci, Luca M Gambardella, and Jurgen Schmidhuber. High- ¨ performance neural networks for visual object classification. arXiv preprint arXiv:1102.0183, 2011.
166
+
167
+ Taco Cohen and Max Welling. Group equivariant convolutional networks. In International Conference on Machine Learning, pp. 2990–2999, 2016.
168
+
169
+ Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. arXiv preprint arXiv:1703.06211, 2017.
170
+
171
+ Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In Neural Information Processing Systems (NIPS), 2016.
172
+
173
+ Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1889–1898. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id=3045390.3045590.
174
+
175
+ Beat Fasel and Daniel Gatica-Perez. Rotation-invariant neoperceptron. In Pattern Recognition, 2006. ICPR 2006. 18th International Conference on, volume 3, pp. 336–339. IEEE, 2006.
176
+
177
+ Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014.
178
+
179
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
180
+
181
+ Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, pp. 1462–1471, 2015.
182
+
183
+ Yann Guermeur and Emmanuel Monfrini. A quadratic loss multi-class svm for which a radius– margin bound applies. Informatica, 22(1):73–96, 2011.
184
+
185
+ Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
186
+
187
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
188
+
189
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
190
+
191
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
192
+
193
+ Dmitry Laptev, Nikolay Savinov, Joachim M Buhmann, and Marc Pollefeys. Ti-pooling: transformation-invariant pooling for feature learning in convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 289–297, 2016.
194
+
195
+ Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pp. 396–404, 1990.
196
+
197
+ Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, volume 2, pp. II–104. IEEE, 2004.
198
+
199
+ Karel Lenc and Andrea Vedaldi. Learning covariant feature detectors. In Computer Vision–ECCV 2016 Workshops, pp. 100–117. Springer, 2016.
200
+
201
+ Edouard Oyallon and Stephane Mallat. Deep roto-translation scattering for object classification. ´ In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865– 2873, 2015.
202
+
203
+ Sara Sabour, Nicholas Fross, and Geoffrey E Hinton. Dynamic routing between capsules. In Neural Information Processing Systems (NIPS), 2017.
204
+
205
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Neural Information Processing Systems (NIPS), 2017.
206
+
207
+ Daniel E. Worrall, Stephan J. Garbin, Daniyar Turmukhambetov, and Gabriel J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
208
+
209
+ # A APPENDIX 1: AN INTUITIVE EXPLANATION OF THE COST FUNCTION THATIS MINIMIZED DURING DYNAMIC ROUTING
210
+
211
+ Dynamic routing is performed between two adjacent layers of capsules. We will refer to these layers as the higher-level and the lower-level. We complete the routing between one pair of layers before starting the routing between the next pair of layers. The routing process has a strong resemblance to fitting a mixture of Gaussians using EM, where the higher-level capsules play the role of the Gaussians and the means of the activated lower-level capsules for a single input image play the role of the datapoints.
212
+
213
+ We start by explaining the cost function that is minimized when using the EM procedure to fit a mixture of Gaussians. We then derive our dynamic routing procedure by making two modifications to the procedure for fitting a mixture of Gaussians.
214
+
215
+ # A.1 THE COST FUNCTION FOR FITTING A MIXTURE OF GAUSSIANS
216
+
217
+ The EM algorithm for fitting a mixture of Gaussians alternates between an E-step and an M-step. The E-step is used to determine, for each datapoint, the probability with which it is assigned to each of the Gaussians. These assignment probabilities act as weights and the M-step for each Gaussian consists of finding the mean of these weighted datapoints and the variance about that mean. If we are also fitting mixing proportions for each Gaussian, they are set to the fraction of the data assigned to the Gaussian.
218
+
219
+ The M-step holds the assignment probabilities constant and adjusts each Gaussian to maximize the sum of the weighted log probabilities that the Gaussian would generate the datapoints assigned to it. The negative log probability density of a datapoint under a Gaussian can be treated like the energy of a physical system and the M-step is minimizing the expected energy where the expectations are taken using the assignment probabilities.
220
+
221
+ The E-step adjusts the assignment probabilities for each datapoint to minimize a quantity called “free energy” which is the expected energy minus the entropy. We can minimize the expected energy by assigning each datapoint with probabilty 1 to whichever Gaussian gives it the lowest energy (i. e. the highest probability density). We can maximize the entropy by assigning each datapoint with equal probability to every Gaussian ignoring the energy. The best trade-off is to make the assignment probabilities be proportional to $e x p ( - E )$ . This is known as the Boltzmann distribution in physics or the posterior distribution in statistics. Since the $\mathrm { E }$ -step minimizes the free energy w.r.t. the assignment distribution and the M-step leaves the entropy term unchanged and minimizes the expected energy w.r.t. the parameters of the Gaussians, the free energy is an objective function for both steps.
222
+
223
+ The softmax function computes the distribution that minimizes free energy when the logits are viewed as negative energies. So when we use a softmax in our routing procedure to recompute assignment probabilities we are minimizing a free energy. When we refit the Gaussian model of each capsule we are minimizing the same free energy provided the logits of the softmax are based on the same energies as are optimized when refitting the Gaussians. The energies we use are the negative log probabilities of the votes coming from a lower-level capsule under the Gaussian model of a higher-level capsule. These are not the correct energies for maximizing the log probability of the data (see the discussion of determinants below) but this does not matter for convergence so long as we use the same energies for fitting the Gaussians and for revising the assignment probabilities.
224
+
225
+ The objective function minimizes Eq. 4 which consists of:
226
+
227
+ • MDL cost $- \beta _ { a }$ scaled by the probability of presence of capsules in layer $L + 1 ( a _ { j } , j \in$ $\Omega _ { L + 1 } )$ .
228
+ • Negative entropy of activations $a _ { j } , j \in \Omega _ { L + 1 }$ .
229
+ • The expected energy minimized in M-step: sum of the weighted log probabilities $( c o s t _ { j } ^ { h } )$ .
230
+ • Negative entropy of routing softmax assignments $( R _ { i j } )$ ) scaled by the probability of presence of the datapoint $( a _ { i } , i \in \Omega _ { L } )$ .
231
+
232
+ $$
233
+ \sum _ { j \in \Omega _ { L + 1 } } { a _ { j } ( - \beta _ { a } ) } + a _ { j } l n ( a _ { j } ) + ( 1 - a _ { j } ) l n ( 1 - a _ { j } ) + \sum _ { h } { c o s t _ { j } ^ { h } } + \beta _ { u } \sum _ { i \in \Omega _ { L } } { r _ { i j } } + \sum _ { i \in \Omega _ { L } } { a _ { i } * r _ { i j } } * l n ( { r _ { i j } } )
234
+ $$
235
+
236
+ # A.2 MODIFICATION 1: MIXTURES OF TRANSFORMING GAUSSIANS
237
+
238
+ In a standard mixture of Gaussians, each Gaussian only has a subset of the datapoints assigned to it but all of the Gaussians see the same data. If we view the capsules in the higher-layer as the Gaussians and the means of the active capsules in the lower-layer as the dataset, each Gaussian sees a dataset in which the datapoints have been transformed by transformation matrices and these matrices are different for different Gaussians. For one higher-level capsule, two transformed datapoints may be close together and for another higher-level capsule the same two datapoints may be transformed into points that are far apart. Every Gaussian has a different view of the data. This is a far more effective way to break symmetry than simply initializing the Gaussians with different means and it generally leads to much faster convergence.
239
+
240
+ If the fitting procedure is allowed to modify the transformation matrices, there is a trivial solution in which the transformation matrices all collapse to zero and the transformed data points are all identical. We avoid this problem by learning the transformation matrices discriminatively in an outer loop and we restrict the dynamic routing to modifying the means and variances of the Gaussians and the probabilities with which the datapoints are assigned to the Gaussians.
241
+
242
+ There is a more subtle version of the collapse problem that arises when different transformation matrices have different determinants. Suppose that the datapoints in a particular subset are transformed into a cluster of points in the pose space of higher-level capsule $j$ and they are transformed into a different but equally tight cluster of points in the pose space of higher-level capsule $k$ . It may seem that $j$ and $k$ provide equally good models of this subset of the datapoints, but this is not correct from a generative modeling perspective. If the transformation matrices that map the datapoints into the pose space used by capsule $j$ have bigger determinants, then $j$ provides a better model. This is because the probability density of a point in the pose space of a lower-level capsule gets diluted by the determinant of the relevant transformation matrix when it is mapped to the pose of a higherlevel capsule. This would be a serious issue if we wanted to learn the transformation matrices by maximizing the probability of the observed datapoints, but we are learning the transformation matrices discriminatively so it does not matter. It does, however, mean that when the dynamic routing maximizes the probability of the transformed datapoints it cannot be viewed as also maximizing the probability of the untransformed points.
243
+
244
+ The obvious way to avoid the determinant issue is to take the mean in pose space of a higher-level capsule and to map this mean back into the pose space of each lower-level capsule using the inverses of the transformation matrices. A mean in a higher-level pose space will generally map to different points in the pose spaces of different lower-level capsules because the pose of a whole will generally make different predictions for the poses of the different parts of that whole. If we use the lowerlevel pose space when measuring the misfit between the actual pose of a lower-level capsule and the top-down prediction of that pose obtained by applying the inverse transformation matrix to the mean of the higher-level capsule, the collapse problem disappears and we can base decisions about routing on a fair comparison of how well two different top-down predictions fit the actual pose of the lower-level capsule. We do not use this correct method for two reasons. First, it involves inverting the transformation matrices. Second, it requires a new multiplication by the inverse transformation matrices every time the higher-level mean is modified during the dynamic routing. By measuring misfits in the higher-level pose space we avoid matrix inversions and, more importantly, we avoid having to multiply by the inverses in each iteration of the dynamic routing. This allows us to do many iterations of dynamic routing for the same computational cost as one forward propagation through the transformation matrices.
245
+
246
+ # A.3 MODIFICATION 2: MIXTURES OF SWITCHABLE TRANSFORMING GAUSSIANS
247
+
248
+ In a standard mixture of Gaussians, the modifiable parameters are the means, (co)variances, and mixing proportions and the only thing that distinguishes different Gaussians is the values of these parameters. In a mixture of transforming Gaussians, however, Gaussians also differ in the transformation matrices they use. If these transformation matrices are fixed during the fitting of the other parameters, it makes sense to have a large set of transforming Gaussians available but to only use the small subset of them that have appropriate transformation matrices for explaining the data at hand. Fitting to a dataset will then involve deciding which of the transforming Gaussians should be “switched on”. We therefore give each transforming Gaussian an additional activation parameter which is its probability of being switched on for the current dataset. The activation parameters are not mixing proportions because they do not sum to 1.
249
+
250
+ To set the activation probability for a particular higher-level capsule, $j$ , we compare the description lengths of two different ways of coding the poses of the activated lower-level capsules assigned to $j$ by the routing, as described in section 3. “Description length” is just another term for energy. The difference in the two description lengths (in nats) is put through a logistic function to determine the activation probability of capsule $j$ . The logistic function computes the distribution $( p , 1 - p )$ that minimizes free energy when the difference in the energies of the two alternatives is the argument of the logistic function. The energies we use for determining the activation probabilities are the same energies as we use for fitting the Gaussians and computing the assignment probabilities. So all three steps minimize the same free energy but with respect to different parameters for each step.
251
+
252
+ In some of the explanations above we have implicitly assumed that the lower-level capsules have activities of 1 or 0 and the assignment probabilities computed during the dynamic routing are also 1 or 0. In fact, these numbers are both probabilities and we use the product of these two probabilities as a multiplier on both the baseline description length of each lower-level mean and its alternative description length obtained by making use of the Gaussian fitted by a higher-level capsule.
253
+
254
+ # B SUPPLEMENTARY FIGURES
255
+
256
+ ![](images/f93f00c30c72d1121379190595a15099a4a67e12f27f4a9a06010f17d052d406.jpg)
257
+ Figure B.1: Sample smallNORB images at different viewpoints. All images in first row are at azimuth 0 and elevation 0. The second row shows a set of images at a higher-elevation and different azimuth.
258
+
259
+ ![](images/321861167ad93da7ba755cfb32ff47de35eba2b33847857ce9b7947343e7a219.jpg)
260
+ Figure B.2: Log scale histogram of distances between the receiving votes and the center of each of the 5 final capsules. The three rows show the 5 histograms for iterations 1, 2 and 3. Unlike Fig. 2 the histograms are independently log scaled so that small and large counts can both be seen. Also, the considered distance range is 60 and the number of bins is much larger.
261
+
262
+ ![](images/8816d3a83013d88e794acdbae80f4df9d941a6d0449e90bba9d4c43d58c6a99c.jpg)
263
+ Figure B.3: Adverserial images generated with FGSM with $\epsilon = 0 . 1$ and $\epsilon = 0 . 4$ on the CNN model and the Capsule model.
264
+ (a) $\epsilon = 0 . 1$ on CNN (b) $\epsilon = 0 . 4$ on CNN (c) $\epsilon = 0 . 1$ on Capsules (d) $\epsilon = 0 . 4$ on Capsules
parse/train/HJWLfGWRb/HJWLfGWRb_content_list.json ADDED
@@ -0,0 +1,1400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MATRIX CAPSULES WITH EM ROUTING",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 647,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Geoffrey Hinton, Sara Sabour, Nicholas Frosst \nGoogle Brain \nToronto, Canada \n{geoffhinton, sasabour, frosst}@google.com ",
17
+ "bbox": [
18
+ 184,
19
+ 145,
20
+ 598,
21
+ 202
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 237,
32
+ 544,
33
+ 252
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "A capsule is a group of neurons whose outputs represent different properties of the same entity. Each layer in a capsule network contains many capsules. We describe a version of capsules in which each capsule has a logistic unit to represent the presence of an entity and a $4 \\mathbf { x } 4$ matrix which could learn to represent the relationship between that entity and the viewer (the pose). A capsule in one layer votes for the pose matrix of many different capsules in the layer above by multiplying its own pose matrix by trainable viewpoint-invariant transformation matrices that could learn to represent part-whole relationships. Each of these votes is weighted by an assignment coefficient. These coefficients are iteratively updated for each image using the Expectation-Maximization algorithm such that the output of each capsule is routed to a capsule in the layer above that receives a cluster of similar votes. The transformation matrices are trained discriminatively by backpropagating through the unrolled iterations of EM between each pair of adjacent capsule layers. On the smallNORB benchmark, capsules reduce the number of test errors by $45 \\%$ compared to the state-of-the-art. Capsules also show far more resistance to white box adversarial attacks than our baseline convolutional neural network. ",
40
+ "bbox": [
41
+ 233,
42
+ 268,
43
+ 764,
44
+ 491
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 517,
55
+ 336,
56
+ 532
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Convolutional neural nets are based on the simple fact that a vision system needs to use the same knowledge at all locations in the image. This is achieved by tying the weights of feature detectors so that features learned at one location are available at other locations. Convolutional capsules extend the sharing of knowledge across locations to include knowledge about the part-whole relationships that characterize a familiar shape. Viewpoint changes have complicated effects on pixel intensities but simple, linear effects on the pose matrix that represents the relationship between an object or object-part and the viewer. The aim of capsules is to make good use of this underlying linearity, both for dealing with viewpoint variations and for improving segmentation decisions. ",
63
+ "bbox": [
64
+ 174,
65
+ 547,
66
+ 825,
67
+ 660
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Capsules use high-dimensional coincidence filtering: a familiar object can be detected by looking for agreement between votes for its pose matrix. These votes come from parts that have already been detected. A part produces a vote by multiplying its own pose matrix by a learned transformation matrix that represents the viewpoint invariant relationship between the part and the whole. As the viewpoint changes, the pose matrices of the parts and the whole will change in a coordinated way so that any agreement between votes from different parts will persist. ",
74
+ "bbox": [
75
+ 174,
76
+ 666,
77
+ 823,
78
+ 750
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Finding tight clusters of high-dimensional votes that agree in a mist of irrelevant votes is one way of solving the problem of assigning parts to wholes. This is non-trivial because we cannot grid the high-dimensional pose space in the way the low-dimensional translation space is gridded to facilitate convolutions. To solve this challenge, we use a fast iterative process called “routingby-agreement” that updates the probability with which a part is assigned to a whole based on the proximity of the vote coming from that part to the votes coming from other parts that are assigned to that whole. This is a powerful segmentation principle that allows knowledge of familiar shapes to derive segmentation, rather than just using low-level cues such as proximity or agreement in color or velocity. An important difference between capsules and standard neural nets is that the activation of a capsule is based on a comparison between multiple incoming pose predictions whereas in a standard neural net it is based on a comparison between a single incoming activity vector and a learned weight vector. ",
85
+ "bbox": [
86
+ 174,
87
+ 757,
88
+ 825,
89
+ 922
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "2 HOW CAPSULES WORK ",
96
+ "text_level": 1,
97
+ "bbox": [
98
+ 176,
99
+ 102,
100
+ 395,
101
+ 117
102
+ ],
103
+ "page_idx": 1
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "Neural nets typically use simple non-linearities in which a non-linear function is applied to the scalar output of a linear filter. They may also use softmax non-linearities that convert a whole vector of logits into a vector of probabilities. Capsules use a much more complicated non-linearity that converts the whole set of activation probabilities and poses of the capsules in one layer into the activation probabilities and poses of capsules in the next layer. ",
108
+ "bbox": [
109
+ 174,
110
+ 133,
111
+ 825,
112
+ 203
113
+ ],
114
+ "page_idx": 1
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "A capsule network consists of several layers of capsules. The set of capsules in layer $L$ is denoted as $\\Omega _ { L }$ . Each capsule has a 4x4 pose matrix, $M$ , and an activation probability, $a$ . These are like the activities in a standard neural net: they depend on the current input and are not stored. In between each capsule $i$ in layer $L$ and each capsule $j$ in layer $L + 1$ is a 4x4 trainable transformation matrix, $W _ { i j }$ . These $W _ { i j } { \\bf s }$ (and two learned biases per capsule) are the only stored parameters and they are learned discriminatively. The pose matrix of capsule $i$ is transformed by $W _ { i j }$ to cast a vote $V _ { i j } = M _ { i } W _ { i j }$ for the pose matrix of capsule $j$ . The poses and activations of all the capsules in layer $L + 1$ are calculated by using a non-linear routing procedure which gets as input $V _ { i j }$ and $a _ { i }$ for all $i \\in \\Omega _ { L } , j \\in \\Omega _ { L + 1 }$ . ",
119
+ "bbox": [
120
+ 174,
121
+ 209,
122
+ 825,
123
+ 337
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "The non-linear procedure is a version of the Expectation-Maximization procedure. It iteratively adjusts the means, variances, and activation probabilities of the capsules in layer $L + 1$ and the assignment probabilities between all $i \\in \\Omega _ { L } , j \\in \\Omega _ { L + 1 }$ . In appendix 1, we give a gentle intuitive introduction to routing-by-agreement and describe in detail how it relates to the EM algorithm for fitting a mixture of Gaussians. ",
130
+ "bbox": [
131
+ 174,
132
+ 342,
133
+ 825,
134
+ 411
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "3 USING EM FOR ROUTING-BY-AGREEMENT",
141
+ "text_level": 1,
142
+ "bbox": [
143
+ 174,
144
+ 433,
145
+ 558,
146
+ 448
147
+ ],
148
+ "page_idx": 1
149
+ },
150
+ {
151
+ "type": "text",
152
+ "text": "Let us suppose that we have already decided on the poses and activation probabilities of all the capsules in a layer and we now want to decide which capsules to activate in the layer above and how to assign each active lower-level capsule to one active higher-level capsule. Each capsule in the higher-layer corresponds to a Gaussian and the pose of each active capsule in the lower-layer (converted to a vector) corresponds to a data-point (or a fraction of a data-point if the capsule is partially active). ",
153
+ "bbox": [
154
+ 173,
155
+ 463,
156
+ 825,
157
+ 547
158
+ ],
159
+ "page_idx": 1
160
+ },
161
+ {
162
+ "type": "text",
163
+ "text": "Using the minimum description length principle we have a choice when deciding whether or not to activate a higher-level capsule. Choice 0: if we do not activate it, we must pay a fixed cost of $- \\beta _ { u }$ per data-point for describing the poses of all the lower-level capsules that are assigned to the higher-level capsule. This cost is the negative log probability density of the data-point under an improper uniform prior. For fractional assignments we pay that fraction of the fixed cost. Choice 1: if we do activate the higher-level capsule we must pay a fixed cost of $- \\beta _ { a }$ for coding its mean and variance and the fact that it is active and then pay additional costs, pro-rated by the assignment probabilities, for describing the discrepancies between the lower-level means and the values predicted for them when the mean of the higher-level capsule is used to predict them via the inverse of the transformation matrix. A much simpler way to compute the cost of describing a datapoint is to use the negative log probability density of that datapoint’s vote under the Gaussian distribution fitted by whatever higher-level capsule it gets assigned to. This is incorrect for reasons explained in appendix 1, but we use it because it requires much less computation (also explained in the appendix). The difference in cost between choice 0 and choice 1, is then put through the logistic function on each iteration to determine the higher-level capsule’s activation probability. Appendix 1 explains why the logistic is the correct function to use. ",
164
+ "bbox": [
165
+ 174,
166
+ 555,
167
+ 825,
168
+ 775
169
+ ],
170
+ "page_idx": 1
171
+ },
172
+ {
173
+ "type": "text",
174
+ "text": "Using our efficient approximation for choice 1 above, the incremental cost of explaining a whole data-point $i$ by using an active capsule $j$ that has an axis-aligned covariance matrix is simply the sum over all dimensions of the cost of explaining each dimension, $h$ , of the vote $V _ { i j }$ . This is simply $- l n ( P _ { i | j } ^ { h } )$ where $P _ { i | j } ^ { h }$ is the probability density of the $h ^ { t h }$ component of the vectorized vote $V _ { i j }$ under $j$ ’s Gaussian model for dimension $h$ which has variance $( \\sigma _ { j } ^ { h } ) ^ { 2 }$ and mean $\\mu _ { j } ^ { h }$ where $\\mu _ { j }$ is the vectorized version of $j$ ’s pose matrix $M _ { j }$ . ",
175
+ "bbox": [
176
+ 173,
177
+ 782,
178
+ 825,
179
+ 875
180
+ ],
181
+ "page_idx": 1
182
+ },
183
+ {
184
+ "type": "equation",
185
+ "img_path": "images/7cb012d06972056f3936cfc75fe6ab2fdae42124b29eae3af547380b128478da.jpg",
186
+ "text": "$$\n{ \\bf \\Phi } _ { i \\vert j } ^ { o h } = \\frac { 1 } { \\sqrt { 2 \\pi ( \\sigma _ { j } ^ { h } ) ^ { 2 } } } \\exp \\left( - \\frac { ( V _ { i j } ^ { h } - \\mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \\sigma _ { j } ^ { h } ) ^ { 2 } } \\right) , \\quad \\quad \\quad l n ( P _ { i \\vert j } ^ { h } ) = - \\frac { ( V _ { i j } ^ { h } - \\mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \\sigma _ { j } ^ { h } ) ^ { 2 } } - l n ( \\sigma _ { j } ^ { h } ) - l n ( 2 \\pi ) / 2\n$$",
187
+ "text_format": "latex",
188
+ "bbox": [
189
+ 181,
190
+ 880,
191
+ 826,
192
+ 928
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "Summing over all lower-level capsules for a single dimension, $h$ , of $j$ we get: ",
199
+ "bbox": [
200
+ 173,
201
+ 103,
202
+ 679,
203
+ 119
204
+ ],
205
+ "page_idx": 2
206
+ },
207
+ {
208
+ "type": "equation",
209
+ "img_path": "images/11810e5598bf8037e292344530d5d73eb94956e23dd86d54fb453143cbb19b03.jpg",
210
+ "text": "$$\n\\begin{array} { l } { { c o s t _ { j } ^ { h } = \\displaystyle \\sum _ { i } - r _ { i j } l n ( P _ { i | j } ^ { h } ) } } \\\\ { { = \\displaystyle \\frac { \\sum _ { i } r _ { i j } ( V _ { i j } ^ { h } - \\mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \\sigma _ { j } ^ { h } ) ^ { 2 } } + \\left( l n ( \\sigma _ { j } ^ { h } ) + \\displaystyle \\frac { l n ( 2 \\pi ) } { 2 } \\right) \\sum _ { i } r _ { i j } } } \\\\ { { = \\left( l n ( \\sigma _ { j } ^ { h } ) + \\displaystyle \\frac { 1 } { 2 } + \\frac { l n ( 2 \\pi ) } { 2 } \\right) \\sum _ { i } r _ { i j } } } \\end{array}\n$$",
211
+ "text_format": "latex",
212
+ "bbox": [
213
+ 299,
214
+ 125,
215
+ 697,
216
+ 241
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "where $\\sum _ { i } r _ { i j }$ is the amount of data assigned to $j$ and $V _ { i j } ^ { h }$ is the value on dimension $h$ of $V _ { i j }$ . Turningon capsule $j$ increases the description length for the means of the lower-level capsules assigned to $j$ from $- \\beta _ { u }$ per lower-level capsule to $- \\beta _ { a }$ plus the sum of the cost over all dimensions so we define the activation function of capsule $j$ to be: ",
223
+ "bbox": [
224
+ 173,
225
+ 248,
226
+ 826,
227
+ 306
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "equation",
233
+ "img_path": "images/80e8221e9f687d0138b61ee4480b9de711e2620ea935ce24d62bfa539a79dbbd.jpg",
234
+ "text": "$$\na _ { j } = l o g i s t i c \\left( \\lambda \\left( \\beta _ { a } - \\beta _ { u } \\sum _ { i } r _ { i j } - \\sum _ { h } c o s t _ { j } ^ { h } \\right) \\right)\n$$",
235
+ "text_format": "latex",
236
+ "bbox": [
237
+ 325,
238
+ 313,
239
+ 673,
240
+ 356
241
+ ],
242
+ "page_idx": 2
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "where $\\beta _ { a }$ is the same for all capsules and $\\lambda$ is an inverse temperature parameter. We learn $\\beta _ { a }$ and $\\beta _ { u }$ discriminatively and set a fixed schedule for $\\lambda$ as a hyper-parameter. ",
247
+ "bbox": [
248
+ 173,
249
+ 362,
250
+ 825,
251
+ 391
252
+ ],
253
+ "page_idx": 2
254
+ },
255
+ {
256
+ "type": "text",
257
+ "text": "For finalizing the pose parameters and activations of the capsules in layer $L + 1$ we run the EM algorithm for few iterations (normally 3) after the pose parameters and activations have already been finalized in layer $L$ . The non-linearity implemented by a whole capsule layer is a form of cluster finding using the EM algorithm, so we call it EM Routing. ",
258
+ "bbox": [
259
+ 173,
260
+ 397,
261
+ 825,
262
+ 454
263
+ ],
264
+ "page_idx": 2
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "Procedure 1 Routing algorithm returns activation and pose of the capsules in layer $L + 1$ given the activations and votes of capsules in layer $L$ . $V _ { i j } ^ { h }$ is the $h ^ { t h }$ dimension of the vote from capsule $i$ with activation $a _ { i }$ in layer $L$ to capsule $j$ in layer $\\boldsymbol { L } + 1$ . $\\beta _ { a }$ , $\\beta _ { u }$ are learned discriminatively and the inverse temperature $\\lambda$ increases at each iteration with a fixed schedule. ",
269
+ "bbox": [
270
+ 173,
271
+ 468,
272
+ 825,
273
+ 526
274
+ ],
275
+ "page_idx": 2
276
+ },
277
+ {
278
+ "type": "table",
279
+ "img_path": "images/2d89bd92fae71e0e99bbe9088558a5062ddb74adda0b437b926ea751443906b8.jpg",
280
+ "table_caption": [],
281
+ "table_footnote": [],
282
+ "table_body": "<table><tr><td colspan=\"2\">1: procedure EM RoUTING(a, V)</td></tr><tr><td>2:</td><td>∀i∈ΩL,j∈ΩL+1:Rij←1/|ΩL+1l</td></tr><tr><td>3:</td><td>for t iterations do</td></tr><tr><td>4:</td><td>∀j ∈ ΩL+1: M-STEP(a,R,V,j)</td></tr><tr><td>5: return a, M</td><td>∀i∈ΩL:E-STEP(μ,σ,a,V,i)</td></tr><tr><td>1: procedure M-sTEP(a,R, V, j)</td><td>for one higher-level capsule, j</td></tr><tr><td>2:</td><td>∀i∈ΩL:Rij ←Rij *ai</td></tr><tr><td>3:</td><td>Ah:←RV ∑Rij</td></tr><tr><td>4:</td><td>Vh:(o)²∑Rij(V-μ)²</td></tr><tr><td>5:</td><td>∑Rij costh ←(βu+log(o))∑Rij</td></tr><tr><td>6:</td><td>aj ← logistic(λ(βa -∑ncostʰ))</td></tr><tr><td>1: procedure E-STEP(μ,σ,a,V,i)</td><td></td></tr><tr><td>1</td><td>&gt;for one lower-level capsule, i H exp £h</td></tr><tr><td>2: ∀j ∈ΩL+1: Pj ← √II 2π()2</td><td>2()</td></tr><tr><td>3:</td><td>j ∈ΩL+1: Rij ← ∑κeΩL+1 ajpj akPk</td></tr></table>",
283
+ "bbox": [
284
+ 179,
285
+ 527,
286
+ 828,
287
+ 805
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "4 THE CAPSULES ARCHITECTURE ",
294
+ "text_level": 1,
295
+ "bbox": [
296
+ 174,
297
+ 835,
298
+ 473,
299
+ 852
300
+ ],
301
+ "page_idx": 2
302
+ },
303
+ {
304
+ "type": "text",
305
+ "text": "The general architecture of our model is shown in Fig. 1. The model starts with a 5x5 convolutional layer with 32 channels $\\scriptstyle ( \\mathrm { A } = 3 2 )$ and a stride of 2 with a ReLU non-linearity. All the other layers are capsule layers starting with the primary capsule layer. The 4x4 pose of each of the $\\scriptstyle \\mathbf { B } = 3 2$ primary capsule types is a learned linear transformation of the output of all the lower-layer ReLUs centered at that location. The activations of the primary capsules are produced by applying the sigmoid function to the weighted sums of the same set of lower-layer ReLUs. ",
306
+ "bbox": [
307
+ 174,
308
+ 867,
309
+ 825,
310
+ 924
311
+ ],
312
+ "page_idx": 2
313
+ },
314
+ {
315
+ "type": "image",
316
+ "img_path": "images/a2c6d4f8620b305d4fa78a8a298083d07d8afb958f0e06f571bd0bde4277aca1.jpg",
317
+ "image_caption": [
318
+ "Figure 1: A network with one ReLU convolutional layer followed by a primary convolutional capsule layer and two more convolutional capsule layers. "
319
+ ],
320
+ "image_footnote": [],
321
+ "bbox": [
322
+ 174,
323
+ 98,
324
+ 825,
325
+ 224
326
+ ],
327
+ "page_idx": 3
328
+ },
329
+ {
330
+ "type": "text",
331
+ "text": "",
332
+ "bbox": [
333
+ 174,
334
+ 275,
335
+ 821,
336
+ 303
337
+ ],
338
+ "page_idx": 3
339
+ },
340
+ {
341
+ "type": "text",
342
+ "text": "The primary capsules are followed by two $3 { \\bf x } 3$ convolutional capsule layers $\\left( \\mathrm { K } \\mathrm { = } 3 \\right)$ , each with 32 capsule types $\\mathrm { ( C = D } { = } 3 2$ ) with strides of 2 and one, respectively. The last layer of convolutional capsules is connected to the final capsule layer which has one capsule per output class. ",
343
+ "bbox": [
344
+ 174,
345
+ 309,
346
+ 825,
347
+ 352
348
+ ],
349
+ "page_idx": 3
350
+ },
351
+ {
352
+ "type": "text",
353
+ "text": "When connecting the last convolutional capsule layer to the final layer we do not want to throw away information about the location of the convolutional capsules but we also want to make use of the fact that all capsules of the same type are extracting the same entity at different positions. We therefore share the transformation matrices between different positions of the same capsule type and add the scaled coordinate (row, column) of the center of the receptive field of each capsule to the first two elements of the right-hand column of its vote matrix. We refer to this technique as Coordinate Addition. This should encourage the shared final transformations to produce values for those two elements that represent the fine position of the entity relative to the center of the capsule’s receptive field. ",
354
+ "bbox": [
355
+ 174,
356
+ 358,
357
+ 825,
358
+ 484
359
+ ],
360
+ "page_idx": 3
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "The routing procedure is used between each adjacent pair of capsule layers. For convolutional capsules, each capsule in layer $L + 1$ sends feedback only to capsules within its receptive field in layer $L$ . Therefore each convolutional instance of a capsule in layer $L$ receives at most kernel size X kernel size feedback from each capsule type in layer $L + 1$ . The instances closer to the border of the image receive fewer feedbacks with corner ones receiving only one feedback per capsule type in layer $L + 1$ . ",
365
+ "bbox": [
366
+ 173,
367
+ 491,
368
+ 825,
369
+ 574
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "4.1 SPREAD LOSS ",
376
+ "text_level": 1,
377
+ "bbox": [
378
+ 174,
379
+ 590,
380
+ 313,
381
+ 606
382
+ ],
383
+ "page_idx": 3
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "In order to make the training less sensitive to the initialization and hyper-parameters of the model, we use “spread loss” to directly maximize the gap between the activation of the target class $\\left( { { a } _ { t } } \\right)$ and the activation of the other classes. If the activation of a wrong class, $a _ { i }$ , is closer than the margin, $m$ , to $a _ { t }$ then it is penalized by the squared distance to the margin: ",
388
+ "bbox": [
389
+ 173,
390
+ 617,
391
+ 825,
392
+ 674
393
+ ],
394
+ "page_idx": 3
395
+ },
396
+ {
397
+ "type": "equation",
398
+ "img_path": "images/f33fc8c80ff3e32afe10fc1761ce73838399b2eccfe59c376b7682ec8be1d7db.jpg",
399
+ "text": "$$\nL _ { i } = ( m a x ( 0 , m - ( a _ { t } - a _ { i } ) ) ^ { 2 } , L = \\sum _ { i \\neq t } L _ { i }\n$$",
400
+ "text_format": "latex",
401
+ "bbox": [
402
+ 346,
403
+ 679,
404
+ 651,
405
+ 714
406
+ ],
407
+ "page_idx": 3
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "By starting with a small margin of 0.2 and linearly increasing it during training to 0.9, we avoid dead capsules in the earlier layers. Spread loss is equivalent to squared Hinge loss with $m = 1$ . Guermeur & Monfrini (2011) studies a variant of this loss in the context of multi class SVMs. ",
412
+ "bbox": [
413
+ 174,
414
+ 718,
415
+ 825,
416
+ 761
417
+ ],
418
+ "page_idx": 3
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "5 EXPERIMENTS ",
423
+ "text_level": 1,
424
+ "bbox": [
425
+ 176,
426
+ 781,
427
+ 326,
428
+ 797
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "The smallNORB dataset (LeCun et al. (2004)) has gray-level stereo images of 5 classes of toys: airplanes, cars, trucks, humans and animals. There are 10 physical instances of each class which are painted matte green. 5 physical instances of a class are selected for the training data and the other 5 for the test data. Every individual toy is pictured at 18 different azimuths (0-340), 9 elevations and 6 lighting conditions, so the training and test sets each contain 24,300 stereo pairs of 96x96 images. We selected smallNORB as a benchmark for developing our capsules system because it is carefully designed to be a pure shape recognition task that is not confounded by context and color, but it is much closer to natural images than MNIST. ",
435
+ "bbox": [
436
+ 173,
437
+ 811,
438
+ 825,
439
+ 924
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "table",
445
+ "img_path": "images/1be990f61f2d989b8c6565c7ad359b94a2eb673286c961fec5f553b1b653a423.jpg",
446
+ "table_caption": [
447
+ "Table 1: The effect of varying different components of our capsules architecture on smallNORB. "
448
+ ],
449
+ "table_footnote": [],
450
+ "table_body": "<table><tr><td>Routing iterations</td><td>Pose structure</td><td>Loss</td><td>Coordinate Addition</td><td>Test error rate</td></tr><tr><td>1</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>9.7%</td></tr><tr><td>2</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>2.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>1.8%</td></tr><tr><td>5</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>3.9%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>Yes</td><td>2.9%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>No</td><td>2.6%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>No</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Margin1</td><td>Yes</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>CrossEnt</td><td>Yes</td><td>5.8%</td></tr><tr><td colspan=\"3\">Baseline CNN with 4.2M parameters</td><td></td><td>5.2%</td></tr><tr><td colspan=\"4\">CNN of Ciresan et al. (2O11) with extra input images &amp; deformations</td><td>2.56%</td></tr><tr><td colspan=\"3\">Our Best model (third row), with multiple crops during testing</td><td></td><td>1.4%</td></tr></table>",
451
+ "bbox": [
452
+ 210,
453
+ 127,
454
+ 789,
455
+ 330
456
+ ],
457
+ "page_idx": 4
458
+ },
459
+ {
460
+ "type": "text",
461
+ "text": "We downsample smallNORB to $4 8 \\times 4 8$ pixels and normalize each image to have zero mean and unit variance. During training, we randomly crop $3 2 \\times 3 2$ patches and add random brightness and contrast to the cropped images. During test, we crop a $3 2 \\times 3 2$ patch from the center of the image and achieve $\\mathbf { 1 . 8 \\% }$ test error on smallNORB. If we average the class activations over multiple crops at test time we achieve $1 . 4 \\%$ . The best reported result on smallNORB without using meta data is $2 . 5 6 \\%$ (Cires¸an et al. (2011)). To achieve this, they added two additional stereo pairs of input images that are created by using an on-center off-surround filter and an off-center on-surround filter. They also applied affine distortions to the images. Our work also beats the Sabour et al. (2017) capsule work which achieves $2 . 7 \\%$ on smallNORB. We also tested our model on NORB which is a jittered version of smallNORB with added background and we achieved a $2 . 6 \\%$ error rate which is on par with the state-of-the-art of $2 . 7 \\%$ (Ciresan et al. (2012)). ",
462
+ "bbox": [
463
+ 173,
464
+ 356,
465
+ 825,
466
+ 508
467
+ ],
468
+ "page_idx": 4
469
+ },
470
+ {
471
+ "type": "text",
472
+ "text": "As the baseline for our experiments on generalization to novel viewpoints we train a CNN which has two convolutional layers with 32 and 64 channels respectively. Both layers have a kernel size of 5 and a stride of 1 with a $2 \\times 2$ max pooling. The third layer is a 1024 unit fully connected layer with dropout and connects to the 5-way softmax output layer. All hidden units use the ReLU non-linearity. We use the same image preparation for the CNN baseline as described above for the capsule network. Our baseline CNN was the result of an extensive hyperparameter search over filter sizes, numbers of channels and learning rates. ",
473
+ "bbox": [
474
+ 174,
475
+ 516,
476
+ 825,
477
+ 613
478
+ ],
479
+ "page_idx": 4
480
+ },
481
+ {
482
+ "type": "text",
483
+ "text": "The CNN baseline achieves $5 . 2 \\%$ test error rate on smallNORB and has $4 . 2 \\mathbf { M }$ parameters. We deduce that the Cires¸an et al. (2011) network has $2 . 7 \\mathbf { M }$ parameters. By using small matrix multiplies, we reduced the number of parameters by a factor of 15 to 310K compared with our baseline CNN (and a factor of 9 w.r.t Cires¸an et al. (2011)). A smaller capsule network of $A = 6 4 , B = 8 , C =$ $D = 1 6$ with only 68K trainable parameters achieves $2 . 2 \\%$ test error rate which also beats the prior state-of-the-art. ",
484
+ "bbox": [
485
+ 174,
486
+ 621,
487
+ 825,
488
+ 704
489
+ ],
490
+ "page_idx": 4
491
+ },
492
+ {
493
+ "type": "text",
494
+ "text": "Fig. 2 shows how EM routing adjusts the vote assignments and the capsule means to find the tight clusters in the votes. The histograms show the distribution of vote distances to the mean (pose) of each class capsule during routing iterations. At the first iteration, votes are distributed equally between 5 final layer capsules. Therefore, all capsules receive votes closer than 0.05 to their calculated mean. In the second iteration, the assignment probability for agreeing votes increases. Therefore, most of the votes are assigned to the detected clusters, the animal and human class in the middle row, and the other capsules only receive scattered votes which are further than 0.05 from the calculated mean. The zoomed-out version of Fig. 2 in the Appendix shows the full distribution of vote distances at each routing iteration. ",
495
+ "bbox": [
496
+ 174,
497
+ 710,
498
+ 825,
499
+ 837
500
+ ],
501
+ "page_idx": 4
502
+ },
503
+ {
504
+ "type": "text",
505
+ "text": "Instead of using our MDL-derived capsule activation term which computes a separate activation probability per capsule, we could view the capsule activations like the mixing proportions in a mixture of Gaussians and set them to be proportional to the sum of the assignment probabilities of a capsule and to sum to 1 over all the capsules in a layer. This increases the test error rate on smallNORB to $4 . 5 \\%$ . Tab. 1 summarizes the effects of the number of routing iterations, the type of loss, and the use of matrices rather than vectors for the poses. ",
506
+ "bbox": [
507
+ 174,
508
+ 843,
509
+ 825,
510
+ 900
511
+ ],
512
+ "page_idx": 4
513
+ },
514
+ {
515
+ "type": "image",
516
+ "img_path": "images/8be3ea0bab1e25a6aa71bd0340609a27c13551bcb7eab555f8c2f16e24393e2e.jpg",
517
+ "image_caption": [
518
+ "Figure 2: Histogram of distances of votes to the mean of each of the 5 final capsules after each routing iteration. Each distance point is weighted by its assignment probability. All three images are selected from the smallNORB test set. The routing procedure correctly routes the votes in the truck and the human example. The plane example shows a rare failure case of the model where the plane is confused with a car in the third routing iteration. The histograms are zoomed-in to visualize only votes with distances less than 0.05. Fig. B.2 shows the complete histograms for the ”human” capsule without clipping the $\\mathbf { X } ^ { } -$ -axis or fixing the scale of the y-axis. "
519
+ ],
520
+ "image_footnote": [],
521
+ "bbox": [
522
+ 258,
523
+ 285,
524
+ 736,
525
+ 636
526
+ ],
527
+ "page_idx": 5
528
+ },
529
+ {
530
+ "type": "table",
531
+ "img_path": "images/4ac06d07c23538216698ac26c5f0df68428a410a0e8fc0095080c642b198b3af.jpg",
532
+ "table_caption": [
533
+ "Table 2: A comparison of the smallNORB test error rate of the baseline CNN and the capsules model on novel viewpoints when both models are matched on error rate for familiar viewpoints. "
534
+ ],
535
+ "table_footnote": [],
536
+ "table_body": "<table><tr><td rowspan=\"2\">Test set</td><td colspan=\"2\">Azimuth</td><td colspan=\"2\">Elevation</td></tr><tr><td>CNN</td><td>Capsules</td><td>1 CNN</td><td>Capsules</td></tr><tr><td>Novel viewpoints</td><td>20%</td><td>13.5%</td><td>17.8%</td><td>12.3%</td></tr><tr><td>Familiar viewpoints</td><td>3.7%</td><td>3.7%</td><td>4.3%</td><td>4.3%</td></tr></table>",
537
+ "bbox": [
538
+ 292,
539
+ 141,
540
+ 705,
541
+ 219
542
+ ],
543
+ "page_idx": 6
544
+ },
545
+ {
546
+ "type": "text",
547
+ "text": "",
548
+ "bbox": [
549
+ 171,
550
+ 243,
551
+ 825,
552
+ 271
553
+ ],
554
+ "page_idx": 6
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "The same capsules architecture as Fig. 1 achieves $0 . 4 4 \\%$ test error rate on MNIST. If the number of channels in the first hidden layer is increased to 256, it achieves $1 1 . 9 \\%$ test error rate on Cifar10 (Krizhevsky & Hinton (2009)). ",
559
+ "bbox": [
560
+ 173,
561
+ 277,
562
+ 823,
563
+ 320
564
+ ],
565
+ "page_idx": 6
566
+ },
567
+ {
568
+ "type": "text",
569
+ "text": "5.1 GENERALIZATION TO NOVEL VIEWPOINTS ",
570
+ "text_level": 1,
571
+ "bbox": [
572
+ 174,
573
+ 338,
574
+ 508,
575
+ 352
576
+ ],
577
+ "page_idx": 6
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "A more severe test of generalization is to use a limited range of viewpoints for training and to test on a much wider range. We trained both our convolutional baseline and our capsule model on one-third of the training data containing azimuths of (300, 320, 340, 0, 20, 40) and tested on the two-thirds of the test data that contained azimuths from 60 to 280. In a separate experiment, we trained on the 3 smaller elevations and tested on the 6 larger elevations. ",
582
+ "bbox": [
583
+ 174,
584
+ 363,
585
+ 825,
586
+ 433
587
+ ],
588
+ "page_idx": 6
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "It is hard to decide if the capsules model is better at generalizing to novel viewpoints because it achieves better test accuracy on all viewpoints. To eliminate this confounding factor, we stopped training the capsule model when its performance matched the baseline CNN on the third of the test set that used the training viewpoints. Then, we compared these matched models on the twothirds of the test set with novel viewpoints. Results in Tab. 2 show that compared with the baseline CNN capsules with matched performance on familiar viewpoints reduce the test error rate on novel viewpoints by about $3 0 \\%$ for both novel azimuths and novel elevations. ",
593
+ "bbox": [
594
+ 174,
595
+ 440,
596
+ 825,
597
+ 537
598
+ ],
599
+ "page_idx": 6
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "6 ADVERSARIAL ROBUSTNESS ",
604
+ "text_level": 1,
605
+ "bbox": [
606
+ 176,
607
+ 558,
608
+ 444,
609
+ 573
610
+ ],
611
+ "page_idx": 6
612
+ },
613
+ {
614
+ "type": "text",
615
+ "text": "There is growing interest in the vulnerability of neural networks to adversarial examples; inputs that have been slightly changed by an attacker to trick a neural net classifier into making the wrong classification. These inputs can be created in a variety of ways, but straightforward strategies such as FGSM (Goodfellow et al. (2014)) have been shown to drastically decrease accuracy in convolutional neural networks on image classification tasks. We compare our capsule model and a traditional convolutional model on their ability to withstand such attacks. ",
616
+ "bbox": [
617
+ 174,
618
+ 582,
619
+ 825,
620
+ 665
621
+ ],
622
+ "page_idx": 6
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "FGSM computes the gradient of the loss w.r.t. each pixel intensity and then changes the pixel intensity by a fixed amount $\\epsilon$ in the direction that increases the loss. So the changes only depend on the sign of the gradient at each pixel. This can be extended to a targeted attack by updating the input to maximize the classification probability of a particular wrong class. We generated adversarial attacks using FGSM because it has only one hyper-parameter and it is easy to compare models that have very different gradient magnitudes. To test the robustness of our model, we generated adversarial images from the test set using a fully trained model. We then reported the accuracy of the model on these images. ",
627
+ "bbox": [
628
+ 174,
629
+ 672,
630
+ 825,
631
+ 784
632
+ ],
633
+ "page_idx": 6
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "We found that our model is significantly less vulnerable to both general and targeted FGSM adversarial attacks; a small $\\epsilon$ can be used to reduce a convolutional model’s accuracy much more than an equivalent $\\epsilon$ can on the capsule model (Fig. 3). It should also be noted that the capsule model’s accuracy after the untargeted attack never drops below chance $( 2 0 \\% )$ whereas the convolutional model’s accuracy is reduced to significantly below chance with an $\\epsilon$ as small as 0.2. ",
638
+ "bbox": [
639
+ 174,
640
+ 791,
641
+ 823,
642
+ 861
643
+ ],
644
+ "page_idx": 6
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "We also tested our model on the slightly more sophisticated adversarial attack of the Basic Iterative Method (Kurakin et al. (2016)), which is simply the aforementioned attack except it takes multiple smaller steps when creating the adversarial image. Here too we find that our model is much more robust to the attack than the traditional convolutional model. ",
649
+ "bbox": [
650
+ 174,
651
+ 867,
652
+ 823,
653
+ 922
654
+ ],
655
+ "page_idx": 6
656
+ },
657
+ {
658
+ "type": "image",
659
+ "img_path": "images/beef58cad854849bc8c253f9108a4d2c51f1152db1fc48d7ca3c09464317b0d7.jpg",
660
+ "image_caption": [
661
+ "Figure 3: Accuracy against $\\epsilon$ after an adversarial attack (left) and Success Rate after a targeted adversarial attack (right). The targeted attack results were evaluated by averaging the success rate after the attack for each of the 5 possible classes. "
662
+ ],
663
+ "image_footnote": [],
664
+ "bbox": [
665
+ 181,
666
+ 102,
667
+ 818,
668
+ 241
669
+ ],
670
+ "page_idx": 7
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "It has been shown that some robustness to adversarial attacks in models can be due to simple numerical instability in the calculation of the gradient Brendel & Bethge (2017). To ensure that this was not the sole cause of our model’s robustness, we calculated the percentage of zero values in the gradient with respect to the image in the capsule model and found it to be smaller than that of the CNN. Furthermore, the capsule gradients, although smaller that those of the CNN, are only smaller by 2 orders of magnitude, as opposed to 16 orders of magnitude seen in Brendel & Bethge (2017)’s work. ",
675
+ "bbox": [
676
+ 174,
677
+ 325,
678
+ 825,
679
+ 422
680
+ ],
681
+ "page_idx": 7
682
+ },
683
+ {
684
+ "type": "text",
685
+ "text": "Finally we tested our model’s robustness to black box attacks by generating adversarial examples with a CNN and testing them on both our capsule model and a different CNN. We found that the capsule model did not perform noticeably better at this task than the CNN. ",
686
+ "bbox": [
687
+ 176,
688
+ 430,
689
+ 821,
690
+ 472
691
+ ],
692
+ "page_idx": 7
693
+ },
694
+ {
695
+ "type": "text",
696
+ "text": "7 RELATED WORK ",
697
+ "text_level": 1,
698
+ "bbox": [
699
+ 176,
700
+ 496,
701
+ 341,
702
+ 511
703
+ ],
704
+ "page_idx": 7
705
+ },
706
+ {
707
+ "type": "text",
708
+ "text": "Among the multiple recent attempts at improving the ability of neural networks to deal with viewpoint variations, there are two main streams. One stream attempts to achieve viewpoint invariance and the other aims for viewpoint equivariance. The work presented by Jaderberg et al. (2015)), Spatial Transformer Networks, seeks viewpoint invariance by changing the sampling of CNNs according to a selection of affine transformations. De Brabandere et al. (2016) extends spatial transformer networks where the filters are adapted during inference depending on the input. They generate different filters for each locality in the feature map rather than applying the same transformation to all filters. Their approach is a step toward input covariance detection from traditional pattern matching frameworks like standard CNNs (LeCun et al. (1990)). Dai et al. (2017) improves upon spatial transformer networks by generalizing the sampling method of filters. Our work differs substantially in that a unit is not activated based on the matching score with a filter (either fixed or dynamically changing during inference). In our case, a capsule is activated only if the transformed poses coming from the layer below match each other. This is a more effective way to capture covariance and leads to models with many fewer parameters that generalize better. ",
709
+ "bbox": [
710
+ 174,
711
+ 529,
712
+ 825,
713
+ 723
714
+ ],
715
+ "page_idx": 7
716
+ },
717
+ {
718
+ "type": "text",
719
+ "text": "The success of CNNs has motivated many researchers to extend the translational equivariance built in to CNNs to include rotational equivariance (Cohen & Welling (2016), Dieleman et al. (2016), Oyallon & Mallat (2015)). The recent approach in Harmonic Networks (Worrall et al. (2017)) achieves rotation equivariant feature maps by using circular harmonic filters and returning both the maximal response and orientation using complex numbers. This shares the basic representational idea of capsules: By assuming that there is only one instance of the entity at a location, we can use several different numbers to represent its properties. They use a fixed number of streams of rotation orders. By enforcing the equality of the sum of rotation orders along any path, they achieve patch-wise rotation equivariance. This approach is more parameter-efficient than data augmentation approaches, duplicating feature maps, or duplicating filters (Fasel & Gatica-Perez (2006), Laptev et al. (2016)). Our approach encodes general viewpoint equivariance rather than only affine 2D rotations. Symmetry networks (Gens & Domingos (2014)) use iterative Lucas-Kanade optimization to find poses that are supported by the most low-level features. Their key weakness is that the iterative algorithm always starts at the same pose, rather than the mean of the bottom-up votes. ",
720
+ "bbox": [
721
+ 174,
722
+ 729,
723
+ 825,
724
+ 924
725
+ ],
726
+ "page_idx": 7
727
+ },
728
+ {
729
+ "type": "text",
730
+ "text": "Lenc & Vedaldi (2016) proposes a feature detection mechanism (DetNet) that is equivariant to affine transformations. DetNet is designed to detect the same points in the image under different viewpoint variations. This effort is orthogonal to our work but DetNet might be a good way to implement the de-rendering first-stage that activates the layer of primary capsules. ",
731
+ "bbox": [
732
+ 174,
733
+ 103,
734
+ 823,
735
+ 160
736
+ ],
737
+ "page_idx": 8
738
+ },
739
+ {
740
+ "type": "text",
741
+ "text": "Our routing algorithm can be seen as an attention mechanism. In this view, it is related to the work of Gregor et al. (2015), where they improved the decoder performance in a generative model by using Gaussian kernels to attend to different parts of the feature map generated by the encoder. Vaswani et al. (2017) uses a softmax attention mechanism to match parts of the query sequence to parts of the input sequence for the translation task and when generating an encoding for the query. They show improvement upon previous translation efforts using recurrent architectures. Our algorithm has attention in the opposite direction. The competition is not between the lower-level capsules that a higher-level capsule might attend to. It is between the higher-level capsules that a lower-level capsule might send its vote to. ",
742
+ "bbox": [
743
+ 174,
744
+ 166,
745
+ 825,
746
+ 291
747
+ ],
748
+ "page_idx": 8
749
+ },
750
+ {
751
+ "type": "text",
752
+ "text": "7.1 PREVIOUS WORK ON CAPSULES ",
753
+ "text_level": 1,
754
+ "bbox": [
755
+ 176,
756
+ 308,
757
+ 433,
758
+ 321
759
+ ],
760
+ "page_idx": 8
761
+ },
762
+ {
763
+ "type": "text",
764
+ "text": "Hinton et al. (2011) used a transformation matrix in a transforming autoencoder that learned to transform a stereo pair of images into a stereo pair from a slightly different viewpoint. However, that system requires the transformation matrix to be supplied externally. More recently, routing-byagreement was shown to be effective for segmenting highly overlapping digits (Sabour et al. (2017)), but that system has several deficiencies that we have overcome in this paper: ",
765
+ "bbox": [
766
+ 176,
767
+ 334,
768
+ 825,
769
+ 404
770
+ ],
771
+ "page_idx": 8
772
+ },
773
+ {
774
+ "type": "text",
775
+ "text": "1. It uses the length of the pose vector to represent the probability that the entity represented by a capsule is present. To keep the length less than 1, requires an unprincipled non-linearity and this prevents the existence of any sensible objective function that is minimized by the iterative routing procedure. \n2. It uses the cosine of the angle between two pose vectors to measure their agreement. Unlike the negative log variance of a Gaussian cluster, the cosine saturates at 1, which makes it insensitive to the difference between a quite good agreement and a very good agreement. \n3. It uses a vector of length $n$ rather than a matrix with $n$ elements to represent a pose, so its transformation matrices have $n ^ { 2 }$ parameters rather than just $n$ . ",
776
+ "bbox": [
777
+ 212,
778
+ 414,
779
+ 825,
780
+ 536
781
+ ],
782
+ "page_idx": 8
783
+ },
784
+ {
785
+ "type": "text",
786
+ "text": "8 CONCLUSION ",
787
+ "text_level": 1,
788
+ "bbox": [
789
+ 174,
790
+ 555,
791
+ 318,
792
+ 571
793
+ ],
794
+ "page_idx": 8
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "Building on the work of Sabour et al. (2017), we have proposed a new type of capsule system in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 pose matrix to represent the pose of that entity. We also introduced a new iterative routing procedure between capsule layers, based on the EM algorithm, which allows the output of each lower-level capsule to be routed to a capsule in the layer above in such a way that active capsules receive a cluster of similar pose votes. This new system achieves significantly better accuracy on the smallNORB data set than the state-of-the-art CNN, reducing the number of errors by $45 \\%$ . We have also shown it to be significantly more robust to white box adversarial attacks than a baseline CNN. ",
799
+ "bbox": [
800
+ 174,
801
+ 587,
802
+ 825,
803
+ 696
804
+ ],
805
+ "page_idx": 8
806
+ },
807
+ {
808
+ "type": "text",
809
+ "text": "SmallNORB is an ideal data-set for developing new shape-recognition models precisely because it lacks many of the additional features of images in the wild. Now that our capsules model works well on NORB, we plan to implement an efficient version to test much larger models on much larger data-sets such as ImageNet. ",
810
+ "bbox": [
811
+ 174,
812
+ 704,
813
+ 825,
814
+ 761
815
+ ],
816
+ "page_idx": 8
817
+ },
818
+ {
819
+ "type": "text",
820
+ "text": "ACKNOWLEDGMENTS Thanks to Robert Gens, Eric Langlois, Taco Cohen and anonymous commentators for helpful discussions and to everyone who made TensorFlow. ",
821
+ "bbox": [
822
+ 174,
823
+ 775,
824
+ 823,
825
+ 803
826
+ ],
827
+ "page_idx": 8
828
+ },
829
+ {
830
+ "type": "text",
831
+ "text": "REFERENCES ",
832
+ "text_level": 1,
833
+ "bbox": [
834
+ 176,
835
+ 824,
836
+ 285,
837
+ 838
838
+ ],
839
+ "page_idx": 8
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "Wieland Brendel and Matthias Bethge. Comment on” biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017. ",
844
+ "bbox": [
845
+ 176,
846
+ 845,
847
+ 821,
848
+ 875
849
+ ],
850
+ "page_idx": 8
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "Dan Ciresan, Ueli Meier, and Jurgen Schmidhuber. Multi-column deep neural networks for image ¨ classification. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 3642–3649. IEEE, 2012. ",
855
+ "bbox": [
856
+ 176,
857
+ 881,
858
+ 823,
859
+ 922
860
+ ],
861
+ "page_idx": 8
862
+ },
863
+ {
864
+ "type": "text",
865
+ "text": "Dan C Cires¸an, Ueli Meier, Jonathan Masci, Luca M Gambardella, and Jurgen Schmidhuber. High- ¨ performance neural networks for visual object classification. arXiv preprint arXiv:1102.0183, 2011. ",
866
+ "bbox": [
867
+ 173,
868
+ 103,
869
+ 823,
870
+ 146
871
+ ],
872
+ "page_idx": 9
873
+ },
874
+ {
875
+ "type": "text",
876
+ "text": "Taco Cohen and Max Welling. Group equivariant convolutional networks. In International Conference on Machine Learning, pp. 2990–2999, 2016. ",
877
+ "bbox": [
878
+ 173,
879
+ 154,
880
+ 823,
881
+ 184
882
+ ],
883
+ "page_idx": 9
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. arXiv preprint arXiv:1703.06211, 2017. ",
888
+ "bbox": [
889
+ 173,
890
+ 190,
891
+ 823,
892
+ 220
893
+ ],
894
+ "page_idx": 9
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In Neural Information Processing Systems (NIPS), 2016. ",
899
+ "bbox": [
900
+ 173,
901
+ 228,
902
+ 823,
903
+ 257
904
+ ],
905
+ "page_idx": 9
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1889–1898. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id=3045390.3045590. ",
910
+ "bbox": [
911
+ 173,
912
+ 265,
913
+ 825,
914
+ 321
915
+ ],
916
+ "page_idx": 9
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "Beat Fasel and Daniel Gatica-Perez. Rotation-invariant neoperceptron. In Pattern Recognition, 2006. ICPR 2006. 18th International Conference on, volume 3, pp. 336–339. IEEE, 2006. ",
921
+ "bbox": [
922
+ 171,
923
+ 330,
924
+ 823,
925
+ 359
926
+ ],
927
+ "page_idx": 9
928
+ },
929
+ {
930
+ "type": "text",
931
+ "text": "Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014. ",
932
+ "bbox": [
933
+ 173,
934
+ 367,
935
+ 823,
936
+ 396
937
+ ],
938
+ "page_idx": 9
939
+ },
940
+ {
941
+ "type": "text",
942
+ "text": "Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. ",
943
+ "bbox": [
944
+ 171,
945
+ 404,
946
+ 823,
947
+ 434
948
+ ],
949
+ "page_idx": 9
950
+ },
951
+ {
952
+ "type": "text",
953
+ "text": "Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, pp. 1462–1471, 2015. ",
954
+ "bbox": [
955
+ 176,
956
+ 440,
957
+ 823,
958
+ 484
959
+ ],
960
+ "page_idx": 9
961
+ },
962
+ {
963
+ "type": "text",
964
+ "text": "Yann Guermeur and Emmanuel Monfrini. A quadratic loss multi-class svm for which a radius– margin bound applies. Informatica, 22(1):73–96, 2011. ",
965
+ "bbox": [
966
+ 171,
967
+ 492,
968
+ 823,
969
+ 522
970
+ ],
971
+ "page_idx": 9
972
+ },
973
+ {
974
+ "type": "text",
975
+ "text": "Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011. ",
976
+ "bbox": [
977
+ 173,
978
+ 529,
979
+ 823,
980
+ 559
981
+ ],
982
+ "page_idx": 9
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015. ",
987
+ "bbox": [
988
+ 173,
989
+ 565,
990
+ 821,
991
+ 595
992
+ ],
993
+ "page_idx": 9
994
+ },
995
+ {
996
+ "type": "text",
997
+ "text": "Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. ",
998
+ "bbox": [
999
+ 173,
1000
+ 603,
1001
+ 823,
1002
+ 619
1003
+ ],
1004
+ "page_idx": 9
1005
+ },
1006
+ {
1007
+ "type": "text",
1008
+ "text": "Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. ",
1009
+ "bbox": [
1010
+ 171,
1011
+ 627,
1012
+ 821,
1013
+ 655
1014
+ ],
1015
+ "page_idx": 9
1016
+ },
1017
+ {
1018
+ "type": "text",
1019
+ "text": "Dmitry Laptev, Nikolay Savinov, Joachim M Buhmann, and Marc Pollefeys. Ti-pooling: transformation-invariant pooling for feature learning in convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 289–297, 2016. ",
1020
+ "bbox": [
1021
+ 174,
1022
+ 662,
1023
+ 825,
1024
+ 719
1025
+ ],
1026
+ "page_idx": 9
1027
+ },
1028
+ {
1029
+ "type": "text",
1030
+ "text": "Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pp. 396–404, 1990. ",
1031
+ "bbox": [
1032
+ 178,
1033
+ 728,
1034
+ 821,
1035
+ 772
1036
+ ],
1037
+ "page_idx": 9
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, volume 2, pp. II–104. IEEE, 2004. ",
1042
+ "bbox": [
1043
+ 174,
1044
+ 780,
1045
+ 825,
1046
+ 835
1047
+ ],
1048
+ "page_idx": 9
1049
+ },
1050
+ {
1051
+ "type": "text",
1052
+ "text": "Karel Lenc and Andrea Vedaldi. Learning covariant feature detectors. In Computer Vision–ECCV 2016 Workshops, pp. 100–117. Springer, 2016. ",
1053
+ "bbox": [
1054
+ 173,
1055
+ 844,
1056
+ 820,
1057
+ 873
1058
+ ],
1059
+ "page_idx": 9
1060
+ },
1061
+ {
1062
+ "type": "text",
1063
+ "text": "Edouard Oyallon and Stephane Mallat. Deep roto-translation scattering for object classification. ´ In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865– 2873, 2015. ",
1064
+ "bbox": [
1065
+ 174,
1066
+ 882,
1067
+ 825,
1068
+ 924
1069
+ ],
1070
+ "page_idx": 9
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "Sara Sabour, Nicholas Fross, and Geoffrey E Hinton. Dynamic routing between capsules. In Neural Information Processing Systems (NIPS), 2017. ",
1075
+ "bbox": [
1076
+ 171,
1077
+ 103,
1078
+ 825,
1079
+ 132
1080
+ ],
1081
+ "page_idx": 10
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Neural Information Processing Systems (NIPS), 2017. ",
1086
+ "bbox": [
1087
+ 174,
1088
+ 140,
1089
+ 823,
1090
+ 183
1091
+ ],
1092
+ "page_idx": 10
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "Daniel E. Worrall, Stephan J. Garbin, Daniyar Turmukhambetov, and Gabriel J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. ",
1097
+ "bbox": [
1098
+ 176,
1099
+ 193,
1100
+ 823,
1101
+ 236
1102
+ ],
1103
+ "page_idx": 10
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "A APPENDIX 1: AN INTUITIVE EXPLANATION OF THE COST FUNCTION THATIS MINIMIZED DURING DYNAMIC ROUTING",
1108
+ "text_level": 1,
1109
+ "bbox": [
1110
+ 178,
1111
+ 103,
1112
+ 820,
1113
+ 136
1114
+ ],
1115
+ "page_idx": 11
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "Dynamic routing is performed between two adjacent layers of capsules. We will refer to these layers as the higher-level and the lower-level. We complete the routing between one pair of layers before starting the routing between the next pair of layers. The routing process has a strong resemblance to fitting a mixture of Gaussians using EM, where the higher-level capsules play the role of the Gaussians and the means of the activated lower-level capsules for a single input image play the role of the datapoints. ",
1120
+ "bbox": [
1121
+ 174,
1122
+ 154,
1123
+ 825,
1124
+ 238
1125
+ ],
1126
+ "page_idx": 11
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "We start by explaining the cost function that is minimized when using the EM procedure to fit a mixture of Gaussians. We then derive our dynamic routing procedure by making two modifications to the procedure for fitting a mixture of Gaussians. ",
1131
+ "bbox": [
1132
+ 174,
1133
+ 244,
1134
+ 825,
1135
+ 286
1136
+ ],
1137
+ "page_idx": 11
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "A.1 THE COST FUNCTION FOR FITTING A MIXTURE OF GAUSSIANS ",
1142
+ "text_level": 1,
1143
+ "bbox": [
1144
+ 174,
1145
+ 309,
1146
+ 647,
1147
+ 323
1148
+ ],
1149
+ "page_idx": 11
1150
+ },
1151
+ {
1152
+ "type": "text",
1153
+ "text": "The EM algorithm for fitting a mixture of Gaussians alternates between an E-step and an M-step. The E-step is used to determine, for each datapoint, the probability with which it is assigned to each of the Gaussians. These assignment probabilities act as weights and the M-step for each Gaussian consists of finding the mean of these weighted datapoints and the variance about that mean. If we are also fitting mixing proportions for each Gaussian, they are set to the fraction of the data assigned to the Gaussian. ",
1154
+ "bbox": [
1155
+ 174,
1156
+ 335,
1157
+ 825,
1158
+ 420
1159
+ ],
1160
+ "page_idx": 11
1161
+ },
1162
+ {
1163
+ "type": "text",
1164
+ "text": "The M-step holds the assignment probabilities constant and adjusts each Gaussian to maximize the sum of the weighted log probabilities that the Gaussian would generate the datapoints assigned to it. The negative log probability density of a datapoint under a Gaussian can be treated like the energy of a physical system and the M-step is minimizing the expected energy where the expectations are taken using the assignment probabilities. ",
1165
+ "bbox": [
1166
+ 174,
1167
+ 426,
1168
+ 825,
1169
+ 496
1170
+ ],
1171
+ "page_idx": 11
1172
+ },
1173
+ {
1174
+ "type": "text",
1175
+ "text": "The E-step adjusts the assignment probabilities for each datapoint to minimize a quantity called “free energy” which is the expected energy minus the entropy. We can minimize the expected energy by assigning each datapoint with probabilty 1 to whichever Gaussian gives it the lowest energy (i. e. the highest probability density). We can maximize the entropy by assigning each datapoint with equal probability to every Gaussian ignoring the energy. The best trade-off is to make the assignment probabilities be proportional to $e x p ( - E )$ . This is known as the Boltzmann distribution in physics or the posterior distribution in statistics. Since the $\\mathrm { E }$ -step minimizes the free energy w.r.t. the assignment distribution and the M-step leaves the entropy term unchanged and minimizes the expected energy w.r.t. the parameters of the Gaussians, the free energy is an objective function for both steps. ",
1176
+ "bbox": [
1177
+ 174,
1178
+ 503,
1179
+ 825,
1180
+ 642
1181
+ ],
1182
+ "page_idx": 11
1183
+ },
1184
+ {
1185
+ "type": "text",
1186
+ "text": "The softmax function computes the distribution that minimizes free energy when the logits are viewed as negative energies. So when we use a softmax in our routing procedure to recompute assignment probabilities we are minimizing a free energy. When we refit the Gaussian model of each capsule we are minimizing the same free energy provided the logits of the softmax are based on the same energies as are optimized when refitting the Gaussians. The energies we use are the negative log probabilities of the votes coming from a lower-level capsule under the Gaussian model of a higher-level capsule. These are not the correct energies for maximizing the log probability of the data (see the discussion of determinants below) but this does not matter for convergence so long as we use the same energies for fitting the Gaussians and for revising the assignment probabilities. ",
1187
+ "bbox": [
1188
+ 174,
1189
+ 648,
1190
+ 825,
1191
+ 775
1192
+ ],
1193
+ "page_idx": 11
1194
+ },
1195
+ {
1196
+ "type": "text",
1197
+ "text": "The objective function minimizes Eq. 4 which consists of: ",
1198
+ "bbox": [
1199
+ 174,
1200
+ 781,
1201
+ 555,
1202
+ 796
1203
+ ],
1204
+ "page_idx": 11
1205
+ },
1206
+ {
1207
+ "type": "text",
1208
+ "text": "• MDL cost $- \\beta _ { a }$ scaled by the probability of presence of capsules in layer $L + 1 ( a _ { j } , j \\in$ $\\Omega _ { L + 1 } )$ . \n• Negative entropy of activations $a _ { j } , j \\in \\Omega _ { L + 1 }$ . \n• The expected energy minimized in M-step: sum of the weighted log probabilities $( c o s t _ { j } ^ { h } )$ . \n• Negative entropy of routing softmax assignments $( R _ { i j } )$ ) scaled by the probability of presence of the datapoint $( a _ { i } , i \\in \\Omega _ { L } )$ . ",
1209
+ "bbox": [
1210
+ 210,
1211
+ 810,
1212
+ 825,
1213
+ 924
1214
+ ],
1215
+ "page_idx": 11
1216
+ },
1217
+ {
1218
+ "type": "equation",
1219
+ "img_path": "images/ec6358f0c4fb00dc50e0b0328b35477c3388042f902bc2711908b4926aa9c4a9.jpg",
1220
+ "text": "$$\n\\sum _ { j \\in \\Omega _ { L + 1 } } { a _ { j } ( - \\beta _ { a } ) } + a _ { j } l n ( a _ { j } ) + ( 1 - a _ { j } ) l n ( 1 - a _ { j } ) + \\sum _ { h } { c o s t _ { j } ^ { h } } + \\beta _ { u } \\sum _ { i \\in \\Omega _ { L } } { r _ { i j } } + \\sum _ { i \\in \\Omega _ { L } } { a _ { i } * r _ { i j } } * l n ( { r _ { i j } } )\n$$",
1221
+ "text_format": "latex",
1222
+ "bbox": [
1223
+ 178,
1224
+ 98,
1225
+ 800,
1226
+ 135
1227
+ ],
1228
+ "page_idx": 12
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "A.2 MODIFICATION 1: MIXTURES OF TRANSFORMING GAUSSIANS ",
1233
+ "text_level": 1,
1234
+ "bbox": [
1235
+ 174,
1236
+ 151,
1237
+ 648,
1238
+ 166
1239
+ ],
1240
+ "page_idx": 12
1241
+ },
1242
+ {
1243
+ "type": "text",
1244
+ "text": "In a standard mixture of Gaussians, each Gaussian only has a subset of the datapoints assigned to it but all of the Gaussians see the same data. If we view the capsules in the higher-layer as the Gaussians and the means of the active capsules in the lower-layer as the dataset, each Gaussian sees a dataset in which the datapoints have been transformed by transformation matrices and these matrices are different for different Gaussians. For one higher-level capsule, two transformed datapoints may be close together and for another higher-level capsule the same two datapoints may be transformed into points that are far apart. Every Gaussian has a different view of the data. This is a far more effective way to break symmetry than simply initializing the Gaussians with different means and it generally leads to much faster convergence. ",
1245
+ "bbox": [
1246
+ 174,
1247
+ 178,
1248
+ 825,
1249
+ 303
1250
+ ],
1251
+ "page_idx": 12
1252
+ },
1253
+ {
1254
+ "type": "text",
1255
+ "text": "If the fitting procedure is allowed to modify the transformation matrices, there is a trivial solution in which the transformation matrices all collapse to zero and the transformed data points are all identical. We avoid this problem by learning the transformation matrices discriminatively in an outer loop and we restrict the dynamic routing to modifying the means and variances of the Gaussians and the probabilities with which the datapoints are assigned to the Gaussians. ",
1256
+ "bbox": [
1257
+ 174,
1258
+ 309,
1259
+ 825,
1260
+ 378
1261
+ ],
1262
+ "page_idx": 12
1263
+ },
1264
+ {
1265
+ "type": "text",
1266
+ "text": "There is a more subtle version of the collapse problem that arises when different transformation matrices have different determinants. Suppose that the datapoints in a particular subset are transformed into a cluster of points in the pose space of higher-level capsule $j$ and they are transformed into a different but equally tight cluster of points in the pose space of higher-level capsule $k$ . It may seem that $j$ and $k$ provide equally good models of this subset of the datapoints, but this is not correct from a generative modeling perspective. If the transformation matrices that map the datapoints into the pose space used by capsule $j$ have bigger determinants, then $j$ provides a better model. This is because the probability density of a point in the pose space of a lower-level capsule gets diluted by the determinant of the relevant transformation matrix when it is mapped to the pose of a higherlevel capsule. This would be a serious issue if we wanted to learn the transformation matrices by maximizing the probability of the observed datapoints, but we are learning the transformation matrices discriminatively so it does not matter. It does, however, mean that when the dynamic routing maximizes the probability of the transformed datapoints it cannot be viewed as also maximizing the probability of the untransformed points. ",
1267
+ "bbox": [
1268
+ 174,
1269
+ 386,
1270
+ 825,
1271
+ 580
1272
+ ],
1273
+ "page_idx": 12
1274
+ },
1275
+ {
1276
+ "type": "text",
1277
+ "text": "The obvious way to avoid the determinant issue is to take the mean in pose space of a higher-level capsule and to map this mean back into the pose space of each lower-level capsule using the inverses of the transformation matrices. A mean in a higher-level pose space will generally map to different points in the pose spaces of different lower-level capsules because the pose of a whole will generally make different predictions for the poses of the different parts of that whole. If we use the lowerlevel pose space when measuring the misfit between the actual pose of a lower-level capsule and the top-down prediction of that pose obtained by applying the inverse transformation matrix to the mean of the higher-level capsule, the collapse problem disappears and we can base decisions about routing on a fair comparison of how well two different top-down predictions fit the actual pose of the lower-level capsule. We do not use this correct method for two reasons. First, it involves inverting the transformation matrices. Second, it requires a new multiplication by the inverse transformation matrices every time the higher-level mean is modified during the dynamic routing. By measuring misfits in the higher-level pose space we avoid matrix inversions and, more importantly, we avoid having to multiply by the inverses in each iteration of the dynamic routing. This allows us to do many iterations of dynamic routing for the same computational cost as one forward propagation through the transformation matrices. ",
1278
+ "bbox": [
1279
+ 174,
1280
+ 588,
1281
+ 825,
1282
+ 809
1283
+ ],
1284
+ "page_idx": 12
1285
+ },
1286
+ {
1287
+ "type": "text",
1288
+ "text": "A.3 MODIFICATION 2: MIXTURES OF SWITCHABLE TRANSFORMING GAUSSIANS ",
1289
+ "text_level": 1,
1290
+ "bbox": [
1291
+ 178,
1292
+ 828,
1293
+ 743,
1294
+ 842
1295
+ ],
1296
+ "page_idx": 12
1297
+ },
1298
+ {
1299
+ "type": "text",
1300
+ "text": "In a standard mixture of Gaussians, the modifiable parameters are the means, (co)variances, and mixing proportions and the only thing that distinguishes different Gaussians is the values of these parameters. In a mixture of transforming Gaussians, however, Gaussians also differ in the transformation matrices they use. If these transformation matrices are fixed during the fitting of the other parameters, it makes sense to have a large set of transforming Gaussians available but to only use the small subset of them that have appropriate transformation matrices for explaining the data at hand. Fitting to a dataset will then involve deciding which of the transforming Gaussians should be “switched on”. We therefore give each transforming Gaussian an additional activation parameter which is its probability of being switched on for the current dataset. The activation parameters are not mixing proportions because they do not sum to 1. ",
1301
+ "bbox": [
1302
+ 174,
1303
+ 854,
1304
+ 823,
1305
+ 924
1306
+ ],
1307
+ "page_idx": 12
1308
+ },
1309
+ {
1310
+ "type": "text",
1311
+ "text": "",
1312
+ "bbox": [
1313
+ 174,
1314
+ 103,
1315
+ 825,
1316
+ 174
1317
+ ],
1318
+ "page_idx": 13
1319
+ },
1320
+ {
1321
+ "type": "text",
1322
+ "text": "To set the activation probability for a particular higher-level capsule, $j$ , we compare the description lengths of two different ways of coding the poses of the activated lower-level capsules assigned to $j$ by the routing, as described in section 3. “Description length” is just another term for energy. The difference in the two description lengths (in nats) is put through a logistic function to determine the activation probability of capsule $j$ . The logistic function computes the distribution $( p , 1 - p )$ that minimizes free energy when the difference in the energies of the two alternatives is the argument of the logistic function. The energies we use for determining the activation probabilities are the same energies as we use for fitting the Gaussians and computing the assignment probabilities. So all three steps minimize the same free energy but with respect to different parameters for each step. ",
1323
+ "bbox": [
1324
+ 174,
1325
+ 180,
1326
+ 825,
1327
+ 306
1328
+ ],
1329
+ "page_idx": 13
1330
+ },
1331
+ {
1332
+ "type": "text",
1333
+ "text": "In some of the explanations above we have implicitly assumed that the lower-level capsules have activities of 1 or 0 and the assignment probabilities computed during the dynamic routing are also 1 or 0. In fact, these numbers are both probabilities and we use the product of these two probabilities as a multiplier on both the baseline description length of each lower-level mean and its alternative description length obtained by making use of the Gaussian fitted by a higher-level capsule. ",
1334
+ "bbox": [
1335
+ 174,
1336
+ 313,
1337
+ 825,
1338
+ 382
1339
+ ],
1340
+ "page_idx": 13
1341
+ },
1342
+ {
1343
+ "type": "text",
1344
+ "text": "B SUPPLEMENTARY FIGURES ",
1345
+ "text_level": 1,
1346
+ "bbox": [
1347
+ 176,
1348
+ 402,
1349
+ 431,
1350
+ 417
1351
+ ],
1352
+ "page_idx": 13
1353
+ },
1354
+ {
1355
+ "type": "image",
1356
+ "img_path": "images/f93f00c30c72d1121379190595a15099a4a67e12f27f4a9a06010f17d052d406.jpg",
1357
+ "image_caption": [
1358
+ "Figure B.1: Sample smallNORB images at different viewpoints. All images in first row are at azimuth 0 and elevation 0. The second row shows a set of images at a higher-elevation and different azimuth. "
1359
+ ],
1360
+ "image_footnote": [],
1361
+ "bbox": [
1362
+ 209,
1363
+ 435,
1364
+ 789,
1365
+ 650
1366
+ ],
1367
+ "page_idx": 13
1368
+ },
1369
+ {
1370
+ "type": "image",
1371
+ "img_path": "images/321861167ad93da7ba755cfb32ff47de35eba2b33847857ce9b7947343e7a219.jpg",
1372
+ "image_caption": [
1373
+ "Figure B.2: Log scale histogram of distances between the receiving votes and the center of each of the 5 final capsules. The three rows show the 5 histograms for iterations 1, 2 and 3. Unlike Fig. 2 the histograms are independently log scaled so that small and large counts can both be seen. Also, the considered distance range is 60 and the number of bins is much larger. "
1374
+ ],
1375
+ "image_footnote": [],
1376
+ "bbox": [
1377
+ 171,
1378
+ 166,
1379
+ 823,
1380
+ 324
1381
+ ],
1382
+ "page_idx": 14
1383
+ },
1384
+ {
1385
+ "type": "image",
1386
+ "img_path": "images/8816d3a83013d88e794acdbae80f4df9d941a6d0449e90bba9d4c43d58c6a99c.jpg",
1387
+ "image_caption": [
1388
+ "Figure B.3: Adverserial images generated with FGSM with $\\epsilon = 0 . 1$ and $\\epsilon = 0 . 4$ on the CNN model and the Capsule model. ",
1389
+ "(a) $\\epsilon = 0 . 1$ on CNN (b) $\\epsilon = 0 . 4$ on CNN (c) $\\epsilon = 0 . 1$ on Capsules (d) $\\epsilon = 0 . 4$ on Capsules "
1390
+ ],
1391
+ "image_footnote": [],
1392
+ "bbox": [
1393
+ 174,
1394
+ 575,
1395
+ 823,
1396
+ 829
1397
+ ],
1398
+ "page_idx": 14
1399
+ }
1400
+ ]
parse/train/HJWLfGWRb/HJWLfGWRb_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJWLfGWRb/HJWLfGWRb_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkeuD34KPH/HkeuD34KPH.md ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SSE-PT: SEQUENTIAL RECOMMENDATION VIA PERSONALIZED TRANSFORMER
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Temporal information is crucial for recommendation problems because user preferences are naturally dynamic in the real world. Recent advances in deep learning, especially the discovery of various attention mechanisms and newer architectures in addition to widely used RNN and CNN in natural language processing, have allowed for better use of the temporal ordering of items that each user has engaged with. In particular, the SASRec model, inspired by the popular Transformer model in natural languages processing, has achieved state-of-the-art results. However, SASRec, just like the original Transformer model, is inherently an un-personalized model and does not include personalized user embeddings. To overcome this limitation, we propose a Personalized Transformer (SSE-PT) model, outperforming SASRec by almost $5 \%$ in terms of NDCG $@ 1 0$ on 5 real-world datasets. Furthermore, after examining some random users’ engagement history, we find our model not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call $\mathrm { S S E – P T + + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements. Our novel application of the Stochastic Shared Embeddings (SSE) regularization is essential to the success of personalization. Code and data are open-sourced at https://github.com/SSE-PT/SSE-PT.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The sequential recommendation problem has been an important open research question, yet using temporal information to improve recommendation performance has proven to be challenging. SASRec, proposed by (Kang and McAuley, 2018) for sequential recommendation problems, has achieved stateof-the-art results and enjoyed more than 10x speed-up when compared to earlier CNN/RNN-based methods. However, the model used in SASRec is the standard Transformer which is inherently an un-personalized model. In practice, it is important to include a personalized Transformer in SASRec especially for recommender systems, but (Kang and McAuley, 2018) found that adding additional personalized embeddings did not improve the performance of their Transformer model, and postulate that the failure of adding personalization is due to the fact that they already use the user history and the user embeddings only contribute to overfitting. In this work, we propose a novel method, Personalized Transformer (SSE-PT), that successfully introduces personalization into self-attentive neural network architectures.
12
+
13
+ Introducing user embeddings into the standard transformer model is intrinsically difficult with existing regularization techniques, as unavoidably a large number of user parameters are introduced, which is often at the same scale of the number of training data. But we show that personalization can greatly improve ranking performance with a recent regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The personalized Transformer (SSE-PT) model with SSE regularization works well for all 5 real-world datasets we consider without overfitting, outperforming previous state-of-the-art algorithm SASRec by almost $5 \%$ in terms of ${ \mathrm { N D C G } } @ 1 0 .$ . Furthermore, after examining some random users’ engagement history, we find our model is not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call SSE- $\mathrm { \cdot P T } { + } { + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements.
14
+
15
+ # 2 RELATED WORK
16
+
17
+ # 2.1 SESSION-BASED AND SEQUENTIAL RECOMMENDATION
18
+
19
+ Both session-based and sequential (i.e., next-basket) recommendation algorithms take advantage of additional temporal information to make better personalized recommendations. The main difference between session-based recommendations (Hidasi et al., 2015) and sequential recommendations (Kang and McAuley, 2018) is that the former assumes that the user ids are not recorded and therefore the length of engagement sequences are relatively short. Therefore, session-based recommendations normally do not consider user factors. On the other hand, sequential recommendation treats each sequence as a user’s engagement history (Kang and McAuley, 2018). Both settings, do not explicitly require time-stamps: only the relative temporal orderings are assumed known (in contrast to, for example, timeS $\mathrm { V D } { + } { + }$ (Koren, 2009) using time-stamps). Initially, sequence data in temporal order are usually modelled with Markov models, in which a future observation is conditioned on the last few observed items (Rendle et al., 2010). In (Rendle et al., 2010), a personalized Markov model with user latent factors is proposed for more personalized results.
20
+
21
+ In recent years, deep learning techniques, borrowed from natural language processing (NLP) literature, are getting widely used in tackling sequential data. Like word sentences in NLP, item sequences in recommendations can be similarly modelled by recurrent neural networks (RNN) (Hidasi et al., 2015; Hidasi and Karatzoglou, 2018) and convolutional neural network (CNN) (Tang and Wang, 2018) models. Recently, attention models are increasingly used in both NLP (Vaswani et al., 2017; Devlin et al., 2018) and recommender systems (Liu et al., 2018; Kang and McAuley, 2018). SASRec (Kang and McAuley, 2018) is a recent method with state-of-the-art performance among the many deep learning models. Motivated by the Transformer model in neural machine translation (Vaswani et al., 2017), SASRec utilizes a similar architecture to the encoder part of the Transformer model. Our proposed model, SSE-PT, is a personalized extension of the transformer model.
22
+
23
+ # 2.2 REGULARIZATION TECHNIQUES
24
+
25
+ In deep learning, models with many more parameters than data points can easily overfit to the training data. This may prevent us from adding user embeddings as additional parameters into complicated models like the Transformer model (Kang and McAuley, 2018), which can easily have 20 layers with millions of parameters for a medium-sized dataset like Movielens10M (Harper and Konstan, 2016). $\ell _ { 2 }$ regularization (Hoerl and Kennard, 1970) is the most widely used approach and has been used in many matrix factorization models in recommender systems; $\ell _ { 1 }$ regularization (Tibshirani, 1996) is used when a sparse model is preferred. For deep neural networks, it has been shown that $\ell _ { p }$ regularizations are often too weak, while dropout (Hinton et al., 2012; Srivastava et al., 2014) is more effective in practice. There are many other regularization techniques, including parameter sharing (Goodfellow et al., 2016), max-norm regularization (Srebro et al., 2005), gradient clipping (Pascanu et al., 2013), etc. Very recently, a new regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019) is proposed as a new means of regularizing embedding layers. We find that the base version SSE-SE is essential to the success of our Personalized Transformer (SSE-PT) model.
26
+
27
+ # 3 METHODOLOGY
28
+
29
+ # 3.1 SEQUENTIAL RECOMMENDATION
30
+
31
+ Given $n$ users and each user engaging with a subset of $m$ items in a temporal order, the goal of sequential recommendation is to learn a good personalized ranking of top $K$ items out of total $m$ items for any given user at any given time point. We assume data in the format of $n$ item sequences:
32
+
33
+ $$
34
+ s _ { i } = ( j _ { i 1 } , j _ { i 2 } , \ldots , j _ { i T } ) \mathrm { f o r } 1 \le i \le n .
35
+ $$
36
+
37
+ Sequences $s _ { i }$ of length $T$ contain indices of the last $T$ items that user $i$ has interacted with in the temporal order (from old to new). For different users, the sequence lengths can vary, but we can pad the shorter sequences so all of them have length $T$ . We cannot simply randomly split data points into train/validation/test sets because they come in temporal orders. Instead, we need to make sure our training data is before validation data which is before test data temporally. We use last items in sequences as test sets, second-to-last items as validation sets and the rest as training sets. We use ranking metrics such as NDCG $@ K$ and Recal $@ K$ for evaluations, which are defined in the Appendix.
38
+
39
+ # 3.2 PERSONALIZED TRANSFORMER ARCHITECTURE
40
+
41
+ Our model, which we call SSE-PT, is motivated by the Transformer model in (Vaswani et al., 2017) and (Kang and McAuley, 2018). It also utilizes a new regularization technique called stochastic shared embeddings (Wu et al., 2019). In the following sections, we are going to examine each important component of our Personalized Transformer (SSE-PT) model, especially the embedding layer, and the novel application of stochastic shared embeddings (SSE) regularization technique.
42
+
43
+ Embedding Layer We define a learnable user embedding look-up table $U \in R ^ { n \times d _ { u } }$ and item embedding look-up table $V \in R ^ { m \times d _ { i } }$ , where $d _ { u }$ , $d _ { i }$ are the number of hidden units for user and item respectively. We also specify learnable positional encoding table $P \in R ^ { T \times d }$ , where $d = d _ { u } + d _ { i }$ . So each input sequence $s _ { i } \in \dot { R ^ { T } }$ will be represented by the following embedding:
44
+
45
+ $$
46
+ E = \left[ \begin{array} { c } { \left[ v _ { j _ { i 1 } } ; u _ { i } \right] + p _ { 1 } } \\ { \left[ v _ { j _ { i 2 } } ; u _ { i } \right] + p _ { 2 } } \\ { \vdots } \\ { \left[ v _ { j _ { i T } } ; u _ { i } \right] + p _ { T } } \end{array} \right] \in R ^ { T \times d } ,
47
+ $$
48
+
49
+ where $[ v _ { j _ { i t } } ; u _ { i } ]$ represents concatenating item embedding $v _ { j _ { i t } } \in R ^ { d _ { i } }$ and user embedding $u _ { i } \in R ^ { d _ { u } }$ into embedding $E _ { t } \in R ^ { d }$ for time $t$ . Note that the main difference between our model and (Kang and McAuley, 2018) is that we introduce the user embeddings $u _ { i }$ , making our model personalized.
50
+
51
+ ![](images/b94005f421833ad6c586a61927a3d3f2134032bfb59c8c232ecf7eed3b30b663.jpg)
52
+ Figure 1: Illustration of our proposed SSE-PT model
53
+
54
+ Transformer Encoder On top of the embedding layer, we have $B$ blocks of self-attention layers and fully connected layers, where each layer extracts features for each time step based on the previous layer’s outputs. Since this part is identical to the Transformer encoder used in the original papers (Vaswani et al., 2017; Kang and McAuley, 2018), we will skip the details.
55
+
56
+ Prediction Layer At time $t$ , the predicted probability of user $i$ engaged item $l$ is:
57
+
58
+ $$
59
+ p _ { i t l } = \sigma ( r _ { i t l } ) ,
60
+ $$
61
+
62
+ where $\sigma$ is the sigmoid function and $r _ { i t l }$ is the predicted score of item $l$ by user $l$ at time point $t$ defined as:
63
+
64
+ $$
65
+ r _ { i t l } = F _ { t - 1 } ^ { B } \cdot [ v _ { l } ; u _ { i } ] ,
66
+ $$
67
+
68
+ where $F _ { t - 1 } ^ { B }$ is the output hidden units associated with the transformer encoder at the last timestamp. Although we can use another set of user and item embedding look-up tables for the $u _ { i }$ and $v _ { l }$ , we
69
+
70
+ find it better to use the same set of embedding look-up tables $U , V$ as in the embedding layer. But regularization for those embeddings can be different. To distinguish the $u _ { i }$ and $v _ { l }$ in (4) from $u _ { i } , v _ { j }$ in (2), we call embeddings in (4) output embeddings and those in (2) input embeddings.
71
+
72
+ The binary cross entropy loss between predicted probability for the positive item $l = j _ { i ( t + 1 ) }$ and one uniformly sampled negative item $k \in \Omega$ is given as $- [ \log ( p _ { i t l } ) + \log ( 1 - p _ { i t k } ) ]$ . Summing over $s _ { i }$ and $t$ , we obtain the objective function that we want to minimize is:
73
+
74
+ $$
75
+ \sum _ { i } \sum _ { t = 1 } ^ { T - 1 } \sum _ { k \in \Omega } - \big [ \log ( p _ { i t l } ) + \log ( 1 - p _ { i t k } ) \big ] .
76
+ $$
77
+
78
+ At the inference time, top- $K$ recommendations for user $i$ at time $t$ can be made by sorting scores $r _ { i t l }$ for all items $\ell$ and recommending the first $K$ items in the sorted list.
79
+
80
+ Novel Application of Stochastic Shared Embeddings The most important regularization technique to SSE-PT model is the Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The main idea of SSE is to stochastically replace embeddings with another embedding with some pre-defined probability during SGD, which has the effect of regularizing the embedding layers. Without SSE, all the existing well-known regularization techniques like layer normalization, dropout and weight decay fail and cannot prevent the model from over-fitting badly after introducing user embeddings. (Wu et al., 2019) develops two versions of SSE, SSE-Graph and SSE-SE. In the simplest uniform case, SSE-SE replaces one embedding with another embedding uniformly with probability $p$ , which is called SSE probability in (Wu et al., 2019). Since we don’t have knowledge graphs for user or items, we simply apply the SSE-SE to our SSE-PT model. We find SSE-SE makes possible training this personalized model with $O ( n d _ { u } )$ additional parameters.
81
+
82
+ There are 3 different places in our model that SSE-SE can be applied. We can apply SSE-SE to input/output user embeddings, input item embeddings, and output item embeddings with probabilities $p _ { u }$ , $p _ { i }$ and $p _ { y }$ respectively. Note that input user embedding and output user embedding are always replaced at the same time with SSE probability $p _ { u }$ . Empirically, we find that SSE-SE to user embeddings and output item embeddings always helps, but SSE-SE to input item embeddings is only useful when the average sequence length is large, e.g., more than 100 in Movielens1M and Movielens10M datasets.
83
+
84
+ Other Regularization Techniques Besides the SSE (Wu et al., 2019), we also utilized other widely used regularization techniques, including layer normalization (Ba et al., 2016), batch normalization (Ioffe and Szegedy, 2015), residual connections (He et al., 2016), weight decay (Krogh and Hertz, 1992), and dropout (Srivastava et al., 2014). Since they are used in the same way in the previous paper (Kang and McAuley, 2018), we omit the details to the Appendix.
85
+
86
+ # 3.3 HANDLING LONG SEQUENCES: SSE-PT $^ { + + }$
87
+
88
+ To handle extremely long sequences, a slight modification can be made on the base SSE-PT model in terms of how input sequences $s _ { i }$ ’s are fed into the SSE-PT neural network. We call the enhanced model SSE- $\mathrm { P T } { + } { + }$ to distinguish it from the previously discussed SSE-PT model, which cannot handle sequences longer than $T$ .
89
+
90
+ The motivation of SSE- $\mathbf { \nabla } \cdot \mathbf { P } \mathbf { T } + +$ over SSE-PT comes from: sometimes we want to make use of extremely long sequences, $s _ { i } = ( j _ { i 1 } , j _ { i 2 } , . ~ . ~ . ~ , j _ { i t } )$ for $1 \leq i \leq n$ , where $t > T$ , but our SSE-PT model can only handle sequences of maximum length of $T$ . The simplest way is to sample starting index $1 \leq v \leq t$ uniformly and use $s _ { i } = ( j _ { i v } , j _ { i ( v + 1 ) } , . ~ . ~ . , j _ { i z } )$ , where $z = \operatorname* { m i n } ( t , v + T - 1 )$ . Although sampling the starting index uniformly from $[ 1 , t ]$ can accommodate long sequences of length $t > T$ , this does not work well in practice. Uniform sampling does not take into account the importance of recent items in a long sequence. To solve this dilemma, we introduce an additional hyper-parameter $p _ { s }$ which we call sampling probability. It implies that with probability $p _ { s }$ , we sample the starting index $v$ uniformly from $[ 1 , t - T ]$ and use sequence $s _ { i } = \left( j _ { i v } , j _ { i ( v + 1 ) } , \ldots , j _ { i ( v + T - 1 ) } \right)$ as input. With probability $1 - p _ { s }$ we simply use the recent $T$ items $( j _ { i ( t - T + 1 ) } , \ldots , j _ { i t } )$ as input. If the sequence $s _ { i }$ is already shorter than $T$ , then we always use the recent input sequence for user $i$ .
91
+
92
+ Our proposed SSE- $\mathrm { P T } { + } { + }$ model can work almost as well as SSE-PT with a much smaller $T$ . One can see in Table 2 with $T = 1 0 0$ , SSE-PT++ can perform almost as well as SSE-PT. The time complexity of the SSE-PT model is of order $O ( T ^ { 2 } d + T d ^ { 2 } )$ . Therefore, reducing $T$ by one half would lead to a theoretically $4 \mathbf { x }$ speed-up in terms of the training and inference speeds. As to the model’s space complexity, both SSE-PT and SSE- $\mathrm { P T } { + } { + }$ are of order $O ( n d _ { u } + m \dot { d _ { i } } + T d + d ^ { 2 } )$ .
93
+
94
+ # 4 EXPERIMENTS
95
+
96
+ In this section, we compare our proposed algorithms, Personalized Transformer (SSE-PT) and SSE$\mathrm { P T } { + } { + }$ , with other state-of-the-art algorithms on real-world datasets. We implement our codes in Tensorflow and conduct all our experiments on a server with 40-core Intel Xeon E5-2630 v4 $@$ 2.20GHz CPU, 256G RAM and Nvidia GTX 1080 GPUs.
97
+
98
+ Datasets We use 5 datasets. The first 4 have exactly the same train/dev/test splits as in (Kang and McAuley, 2018). The datasets are: Beauty and Games categories from Amazon product review datasets1; Steam dataset introduced in (Kang and McAuley, 2018), which contains reviews crawled from a large video game distribution platform; Movielens1M dataset (Harper and Konstan, 2016), a widely used benchmark datasets containing one million user movie ratings; Movielens10M dataset with ten million user ratings cleaned by us. Detailed dataset statistics are given in Table 4. One can easily see that the first 3 datasets have short sequences (average length $< 1 2$ ) while the last 2 datasets have very long sequences $\mathrm { \Phi } > 1 0 \mathrm { \mathbf { x } }$ longer).
99
+
100
+ Evaluation Metrics The evaluation metrics we use are standard ranking metrics, namely NDCG and Recall for top recommendations (See Appendix). We follow the same evaluation setting as the previous paper (Kang and McAuley, 2018): predicting ratings at time point $t + 1$ given the previous $t$ ratings. For a large dataset with numerous users and items, the evaluation procedure would be slow because (6) would require computing the ranking of all items based on their predicted scores for every single user. As a means of speed-up evaluations, we sample a fixed number $C$ (e.g., 100) of negative candidates while always keeping the positive item that we know the user will engage next. This way, both $R _ { i j }$ and $\Pi _ { i }$ will be narrowed down to a small set of item candidates, and prediction scores will only be computed for those items through a single forward pass of the neural network.
101
+
102
+ Ideally, we want both NDCG and Recall to be as close to 1 as possible, because $\operatorname { N D C G @ } K = 1$ means the positive item is always put on the top-1 position of the top- $K$ ranking list, and Recall $\Theta K = 1$ means the positive item is always contained by the top- $K$ recommendations the model makes.
103
+
104
+ Table 1: Comparing various state-of-the-art temporal collaborative ranking algorithms on various datasets. The (A) to (E) are non-deep-learning methods, the $( \mathrm { F } )$ to (K) are deep-learning methods and the (L) to (O) are our variants. We did not report SSE- $\mathbf { \nabla } \cdot \mathbf { P } \mathbf { T } + +$ results for beauty, games and steam, as the input sequence lengths are very short (see Table 4), so there is no need for SSE- $\mathrm { P T } { + } { + }$ .
105
+
106
+ <table><tr><td rowspan="2">DATASET METRIC</td><td colspan="2">BEAUTY</td><td colspan="2">GAMES</td><td colspan="2">STEAM</td><td colspan="2"></td><td colspan="2">ML-1M</td></tr><tr><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td>RECALL@10 NDCG@10</td><td></td></tr><tr><td>(A)POPREC</td><td>0.4003</td><td>0.2277</td><td>1</td><td>0.4724</td><td>0.2779</td><td>0.7172</td><td>0.4535</td><td>1</td><td>0.4329</td><td>0.2377</td></tr><tr><td>(B)BPR</td><td>0.3775</td><td>0.2183</td><td>一 1</td><td>0.4853</td><td>0.2875</td><td>0.7061</td><td>0.4436</td><td>1 1</td><td>0.5781</td><td>0.3287</td></tr><tr><td>(C)FMC</td><td>0.3771</td><td>0.2477</td><td>一</td><td>0.6358</td><td>0.4456</td><td>0.7731</td><td>0.5193</td><td>1</td><td>0.6983</td><td>0.4676</td></tr><tr><td>(D)FPMC</td><td>0.4310</td><td>0.2891</td><td>一</td><td>0.6802</td><td>0.4680</td><td>0.7710</td><td>0.5011</td><td>1</td><td>0.7599</td><td>0.5176</td></tr><tr><td>(E)TRANSREC</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1 1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(F) GRU4REC</td><td>0.2125</td><td>0.1203</td><td>1</td><td>0.2938</td><td>0.1837</td><td>0.4190</td><td>0.2691</td><td>1</td><td>0.5581</td><td>0.3381</td></tr><tr><td>(G) STAMP</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(H) GRU4REC+</td><td>0.3949</td><td>0.2556</td><td>一 一</td><td>0.6599</td><td>0.4759</td><td>0.8018</td><td>0.5595</td><td>1 1</td><td>0.7501</td><td>0.5513</td></tr><tr><td>(I) CASER</td><td>0.4264</td><td>0.2547</td><td>1</td><td>0.5282</td><td>0.3214</td><td>0.7874</td><td>0.5381</td><td>1</td><td>0.7886</td><td>0.5538</td></tr><tr><td>(J) SASREC</td><td>0.4837</td><td>0.3220</td><td>1</td><td>0.7434</td><td>0.5401</td><td>0.8732</td><td>0.6293</td><td>1</td><td>0.8233</td><td>0.5936</td></tr><tr><td>(K)HGN</td><td>0.4469</td><td>0.2994</td><td>1 1</td><td>0.7164</td><td>0.5209</td><td>0.7426</td><td>0.4871</td><td>1 1</td><td>0.7584</td><td>0.5241</td></tr><tr><td>(L) SSE-SASREC</td><td>0.4878</td><td>0.3342</td><td>1</td><td>0.7517</td><td>0.5535</td><td>0.8697</td><td>0.6333</td><td>1</td><td>0.8230</td><td>0.5995</td></tr><tr><td>(M)PT</td><td>0.3954</td><td>0.2449</td><td>1 1</td><td>0.6427</td><td>0.4434</td><td>0.7535</td><td>0.4853</td><td>1 1</td><td>0.7658</td><td>0.5241</td></tr><tr><td>(N) SSE-PT</td><td>0.5028</td><td>0.3370</td><td>一</td><td>0.7757</td><td>0.5660</td><td>0.8772</td><td>0.6378</td><td>一</td><td>0.8341</td><td>0.6281</td></tr><tr><td>(O) SSE-PT++</td><td>二</td><td>=</td><td>一</td><td>二</td><td>二</td><td></td><td></td><td>1</td><td>0.8389</td><td>0.6292</td></tr></table>
107
+
108
+ Baselines We include 5 non-deep-learning and 6 deep-learning algorithms in our comparisons.
109
+
110
+ Table 2: Comparing SASRec, SSE-PT and SSE- $\mathbf { \nabla \cdot P T + + }$ on Movielens1M Dataset while varying the maximum length allowed and dimension of embeddings.
111
+
112
+ <table><tr><td>METHODS</td><td>NDCG@10</td><td>RECALL @10</td><td>MAX LEN</td><td>USER DIM</td><td>ITEMDIM</td></tr><tr><td>SASREC</td><td>0.5769</td><td>0.8045</td><td>100</td><td>N/A</td><td>100</td></tr><tr><td>SASREC</td><td>0.5936</td><td>0.8233</td><td>200</td><td>N/A</td><td>50</td></tr><tr><td>SASREC</td><td>0.5919</td><td>0.8202</td><td>200</td><td>N/A</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6142</td><td>0.8212</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6191</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>200</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6186</td><td>0.8318</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6208</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>200</td><td>50</td><td>100</td></tr></table>
113
+
114
+ Non-deep-learning Baselines The simplest baseline is PopRec, basically ranking items according to their popularity. More advanced methods such as matrix factorization based baselines include Bayesian personalized ranking for implicit feedback (Rendle et al., 2009), namely $B P R$ ; Factorized Markov Chains and Personalized Factorized Markov Chains models (Rendle et al., 2010) also known as FMC and PFMC; and translation based method (He et al., 2017) called TransRec.
115
+
116
+ Deep-learning Baselines Recent years have seen many advances in deep learning for sequential recommendations. GRU4Rec is the first RNN-based method proposed for this problem (Hidasi et al., 2015); $G R U 4 R e c ^ { + }$ (Hidasi and Karatzoglou, 2018) later is proposed to address some shortcomings of the initial version. Caser is the corresponding CNN-based method (Tang and Wang, 2018). STAMP (Liu et al., 2018) utilizes the attention mechanism without using RNN or CNN as building blocks. Very recently, SASRec utilizes state-of-art Transformer encoder (Vaswani et al., 2017) with selfattention mechanisms. Hierarchical gating networks, also known as HGN (Ma et al., 2019) are also proposed to solve this problem.
117
+
118
+ Table 3: Comparing Different Regularizations for SSE-PT on Movielen1M Dataset. NO REG stands for no regularization. PS stands for parameter sharing across all users while PS(AGE) means PS is used within each age group. SASRec is added to last row after all SSE-PT results as a baseline.
119
+
120
+ <table><tr><td>REGULARIZATION</td><td>NDCG@5</td><td>% GAIN</td><td>RECALL@5</td><td>%GAIN</td></tr><tr><td>NO REG (BASELINE)</td><td>0.4855</td><td>1</td><td>0.6500</td><td>-</td></tr><tr><td>PS</td><td>0.5065</td><td>4.3</td><td>0.6656</td><td>2.4</td></tr><tr><td>PS (JOB)</td><td>0.4938</td><td>1.7</td><td>0.6570</td><td>1.1</td></tr><tr><td>PS (GENDER)</td><td>0.5110</td><td>5.3</td><td>0.6672</td><td>2.6</td></tr><tr><td>PS (AGE)</td><td>0.5133</td><td>5.7</td><td>0.6743</td><td>3.7</td></tr><tr><td>l2</td><td>0.5149</td><td>6.0</td><td>0.6786</td><td>4.4</td></tr><tr><td>DROPOUT</td><td>0.5165</td><td>6.4</td><td>0.6823</td><td>5.0</td></tr><tr><td>l2+DROPOUT</td><td>0.5293</td><td>9.0</td><td>0.6921</td><td>6.5</td></tr><tr><td>SSE-SE</td><td>0.5393</td><td>11.1</td><td>0.6977</td><td>7.3</td></tr><tr><td>l2 + SSE-SE + DROPOUT</td><td>0.5870</td><td>20.9</td><td>0.7442</td><td>14.5</td></tr><tr><td>SASREC (l2+DROPOUT)</td><td>0.5601</td><td></td><td>0.7164</td><td></td></tr></table>
121
+
122
+ Experiment Setup We use the same datasets as in (Kang and McAuley, 2018) and follow the same procedure in the paper: use last items for each user as test data, second-to-last as validation data and the rest as training data. We implemented our method in Tensorflow and solve it with Adam Optimizer (Kingma and Ba, 2014) with a learning rate of 0.001, momentum exponential decay rates $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 8$ and a batch size of 128. In Table 1, since we use the same data, the performance of previous methods except STAMP have been reported in (Kang and McAuley, 2018). We tune the dropout rate, and SSE probabilities $p _ { u } , p _ { i } , p _ { y }$ for input user/item embeddings and output embeddings on validation sets and report the best NDCG and Recall for top- $K$ recommendations on test sets. For a fair comparison, we restrict all algorithms to use up to 50 hidden units for item embeddings. For the SSE-PT and SASRec models, we use the same number of transformer encoder blocks (i.e. $B = 2$ ) and set the maximum length $T = 2 0 0$ for Movielens 1M and 10M dataset and $T = 5 0$ for other datasets. We use top- $K$ with $K = 1 0$ and the number of negatives $C = 1 0 0$ in the evaluation procedure. In practice, using a different $K$ and $C$ does not affect our conclusions.
123
+
124
+ Comparisons One can easily see from Table 1 that our proposed SSE-PT has the best performance over all previous methods on all four datasets. On most datasets, our SSE-PT improves NDCG by more than $4 \%$ when compared with SASRec (Kang and McAuley, 2018) and more than $20 \%$ when compared to non-deep-learning methods. SSE-SE, together with dropout and weight decay, is the best choice for regularization, which is evident from Table 3. SSE-SE is a more effective way to regularize our neural networks than any existent techniques including parameter sharing, dropout, weight decay. In practice, these SSE probabilities, just like dropout rate, can be treated as tuning parameters and easily tuned. Movielens10M results are left to Table 6 in the Appendix.
125
+
126
+ ![](images/b2221ee0242457e902760eca3bdea35d1421ec53a04d71dab6d6fadb602280c9.jpg)
127
+
128
+ Figure 2: Illustration of how SASRec (Left) and SSE-PT (Right) differs on utilizing the Engagement History of A Random User in Movielens1M Dataset.
129
+
130
+ # 4.1 ATTENTION MECHANISM VISUALIZATION
131
+
132
+ Apart from evaluating our SSE-PT against SASRec using well-defined ranking metrics on realworld datasets, we also visualize the differences between both methods in terms of their attention mechanisms. In Figure 2, a random user’s engagement history in Movielens1M dataset is given in temporal order (column-wise). We hide the last item whose index is 26 in test set and hope that a temporal collaborative ranking model can figure out item-26 is the one this user will watch next using only previous engagement history. One can see for a typical user; they tend to look at a different style of movies at different times. Earlier on, they watched a variety of movies, including Sci-Fi, animation, thriller, romance, horror, action, comedy and adventure. But later on, in the last two columns of Figure 2, drama and thriller are the two types they like to watch most, especially the drama type. In fact, they watched 9 drama movies out of recent 10 movies. For humans, it is natural to reason that the hidden movie should probably also be drama type. So what about the machine’s reasoning?
133
+
134
+ For our SSE-PT, the hidden item indexed 26 is put in the first place among its top-5 recommendations. Intelligently, the SSE-PT recommends 3 drama movies, 2 thriller movies and mixing them up in positions. Interestingly, the top recommendation is ‘Othello’, which like the recently watched ‘Richard III’, is an adaptation of a Shakespeare play, and this dependence is reflected in the attention weight. On the contrast, SASRec cannot provide top-5 recommendations that are personalized enough. It recommends a variety of action, Sci-Fi, comedy, horror, and drama movies but none of them match item-26. Although this user has watched all these types of movies in the past, they do not watch these anymore as one can easily tell from his recent history. Unfortunately, SASRec cannot capture this and does not provide personalized recommendations for this user by focusing more on drama and thriller movies. It is easy to see that in contrast, our SSE-PT model shares with human reasoning that more emphasis should be placed on recent movies.
135
+
136
+ # 4.2 TRAINING SPEED
137
+
138
+ In (Kang and McAuley, 2018), it has been shown that SASRec is about 11 times faster than Caser and 17 times faster than $\mathrm { G R U 4 R e c ^ { + } }$ and achieves much better NDCG $@ 1 0$ results so we did not include Caser and GRU4Rec+ in our comparisons. In Figure 3, we only compare the training speeds and ranking performances among SASRec, SSEPT and SSE- $\mathrm { P T } { + } { + }$ for Movielens1M dataset. Given that we added additional user embeddings into our SSE-PT model, it is expected that it will take slightly longer to train our model than un-personalized SASRec. We find empirically that training speed of the SSE-PT and SSE$\mathrm { P T } { + } { + }$ model are comparable to that of SASRec, with SSE$\mathrm { P T } { + } { + }$ being the fastest and the best performing model. It is clear that our SSE-PT and $\mathrm { S S E – P T + + }$ achieve much better ranking performances than our baseline SASRec using the same training time.
139
+
140
+ ![](images/260c5cb5effa1da2b0db12d279620459426225bbe23a0eae5bf094562d70f44c.jpg)
141
+ Figure 3: Illustration of the speed of SSE-PT
142
+
143
+ # 4.3 ABLATION STUDY
144
+
145
+ SSE probability Given the importance of SSE regularization for our SSE-PT model, we carefully examined the SSE probability for input user embedding in Table 7 in Appendix. We find that the appropriate hyper-parameter SSE probability is not very sensitive: anywhere between 0.4 and 1.0 gives good results, better than parameter sharing and not using SSE-SE. This is also evident based on comparison results in Table 3.
146
+
147
+ Sampling Probability Recall that the sampling probability is unique to our SSE- $\mathrm { P T } { + } { + }$ model. We show in Table 8 in Appendix using an appropriate sampling probability like $0 . 2 0 . 3$ would allow it to outperform SSE-PT when the same maximum length is used.
148
+
149
+ Number of Attention Blocks We find for our SSE-PT model, a larger number of attention blocks is preferred. One can easily see in Table 9 in Appendix, the optimal ranking performances are achieved at $B = 4$ or 5 for Movielens1M dataset and at $B = 6$ for Movielens10M dataset.
150
+
151
+ Personalization and Number of Negatives Sampled Based on the results in Table 10 in Appendix, we are positive that the personalized model always outperforms the un-personalized one when we use the same regularization techniques. This holds true regardless of how many negatives sampled or what ranking metrics are used during evaluation.
152
+
153
+ # 5 CONCLUSION
154
+
155
+ In this paper, we propose a novel neural network architecture called Personalized Transformer for the temporal collaborative ranking problem. It enjoys the benefits of being a personalized model, therefore achieving better ranking results for individual users than the current state-of-the-art. By examining the attention mechanisms during inference, the model is also more interpretable and tends to pay more attention to recent items in long sequences than un-personalized deep learning models.
156
+
157
+ # REFERENCES
158
+
159
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
160
+
161
+ 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.
162
+
163
+ 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.
164
+
165
+ Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016.
166
+
167
+ F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. Acm transactions on interactive intelligent systems (tiis), 5(4):19, 2016.
168
+
169
+ 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, pages 770–778, 2016.
170
+
171
+ Ruining He, Wang-Cheng Kang, and Julian McAuley. Translation-based recommendation. In Proceedings of the Eleventh ACM Conference on Recommender Systems, pages 161–169. ACM, 2017.
172
+
173
+ Balázs Hidasi and Alexandros Karatzoglou. Recurrent neural networks with top- $\mathbf { \nabla } _ { k }$ gains for sessionbased recommendations. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management, pages 843–852. ACM, 2018.
174
+
175
+ Balázs Hidasi, Alexandros Karatzoglou, Linas Baltrunas, and Domonkos Tikk. Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939, 2015.
176
+
177
+ Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012.
178
+
179
+ Arthur E Hoerl and Robert W Kennard. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67, 1970.
180
+
181
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
182
+
183
+ Wang-Cheng Kang and Julian McAuley. Self-attentive sequential recommendation. arXiv preprint arXiv:1808.09781, 2018.
184
+
185
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
186
+
187
+ Yehuda Koren. Collaborative filtering with temporal dynamics. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 447–456. ACM, 2009.
188
+
189
+ Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pages 950–957, 1992.
190
+
191
+ Qiao Liu, Yifu Zeng, Refuoe Mokhosi, and Haibin Zhang. Stamp: short-term attention/memory priority model for session-based recommendation. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1831–1839. ACM, 2018.
192
+
193
+ Chen Ma, Peng Kang, and Xue Liu. Hierarchical gating networks for sequential recommendation. arXiv preprint arXiv:1906.09217, 2019.
194
+
195
+ Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013.
196
+
197
+ Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence, pages 452–461. AUAI Press, 2009.
198
+
199
+ Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme. Factorizing personalized markov chains for next-basket recommendation. In Proceedings of the 19th international conference on World wide web, pages 811–820. ACM, 2010.
200
+
201
+ Badrul Munir Sarwar, George Karypis, Joseph A Konstan, John Riedl, et al. Item-based collaborative filtering recommendation algorithms. Www, 1:285–295, 2001.
202
+
203
+ Nathan Srebro, Jason Rennie, and Tommi S Jaakkola. Maximum-margin matrix factorization. In Advances in neural information processing systems, pages 1329–1336, 2005.
204
+
205
+ Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
206
+
207
+ Jiaxi Tang and Ke Wang. Personalized top-n sequential recommendation via convolutional sequence embedding. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pages 565–573. ACM, 2018.
208
+
209
+ Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996.
210
+
211
+ 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, pages 5998–6008, 2017.
212
+
213
+ Liwei Wu, Cho-Jui Hsieh, and James Sharpnack. Sql-rank: A listwise approach to collaborative ranking. In Proceedings of Machine Learning Research (35th International Conference on Machine Learning), volume 80, 2018.
214
+
215
+ Liwei Wu, Shuqing Li, Cho-Jui Hsieh, and James Sharpnack. Stochastic shared embeddings: Datadriven regularization of embedding layers. arXiv preprint arXiv:1905.10630, 2019.
216
+
217
+ # 6 APPENDIX
218
+
219
+ • $\operatorname { N D C G @ } K$ : defined as:
220
+
221
+ $$
222
+ \mathrm { N D C G @ } K = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \frac { \mathrm { D C G @ } K ( i , \Pi _ { i } ) } { \mathrm { D C G @ } K ( i , \Pi _ { i } ^ { * } ) } ,
223
+ $$
224
+
225
+ where $i$ represents $i$ -th user and
226
+
227
+ $$
228
+ \mathrm { D C G @ } K ( i , \Pi _ { i } ) = \sum _ { l = 1 } ^ { K } \frac { 2 ^ { R _ { i \Pi _ { i l } } } - 1 } { \log _ { 2 } ( l + 1 ) } .
229
+ $$
230
+
231
+ In the DCG definition, $\Pi _ { i l }$ represents the index of the $l$ -th ranked item for user $i$ in test data based on the learned score matrix $X$ . $R$ is the rating matrix and $R _ { i j }$ is the rating given to item $j$ by user $i$ . $\Pi _ { i } ^ { * }$ is the ordering provided by the ground truth rating.
232
+
233
+ • Recall $@ K$ : defined as a fraction of positive items retrieved by the top $K$ recommendations the model makes:
234
+
235
+ $$
236
+ { \mathrm { R e c a l l @ } } K = { \frac { \sum _ { i = 1 } ^ { n } \mathbb { 1 } \left\{ \exists 1 \leq l \leq K : R _ { i \Pi _ { i l } } = 1 \right\} } { n } } ,
237
+ $$
238
+
239
+ here we already assume there is only a single positive item that user will engage next and the indicator function $\mathbb { 1 } \{ \exists 1 \leq l \leq k : { R _ { i \Pi _ { i l } } } = \hat { 1 } \}$ is defined to indicate whether the positive item falls into the top $K$ position in our obtained ranked list using scores predicted in (4).
240
+
241
+ Layer Normalization Layer normalization (Ba et al., 2016) normalizes neurons within a layer. Previous studies (Ba et al., 2016) show it is more effective than batch normalization for training recurrent neural networks (RNNs). One alternative is the batch normalization (Ioffe and Szegedy, 2015) but we find it does not work as well as the layer normalization in practice even for a reasonable large batch size of 128. Therefore, our SSE-PT model adopts layer normalization.
242
+
243
+ Residual Connections Residual connections are firstly proposed in ResNet for image classification problems (He et al., 2016). Recent research finds that residual connections can help training very deep neural networks even if they are not convolutional neural networks (Vaswani et al., 2017). Using residual connections allows us to train very deep neural networks here. For example, the best performing model for Movielens10M dataset in Table 9 is the SSE-PT with 6 attention blocks, in which $1 + 6 * 3 + 1 = 2 0$ layers are trained end-to-end.
244
+
245
+ Weight Decay Weight decay (Krogh and Hertz, 1992), also known as $l _ { 2 }$ regularization (Hoerl and Kennard, 1970), is applied to all embeddings, including both user and item embeddings.
246
+
247
+ Dropout Dropout (Srivastava et al., 2014) is applied to the embedding layer $E$ , self-attention layer and pointwise feed-forward layer by stochastically dropping some percentage of hidden units to prevent co-adaption of neurons. Dropout has been shown to be an effective way of regularizing deep learning models.
248
+
249
+ In summary, layer normalization and dropout are used in all layers except prediction layer. Residual connections are used in both self-attention layer and pointwise feed-forward layer. SSE-SE is used in embedding layer and prediction layer.
250
+
251
+ Table 4: Description of Datasets Used in Evaluations.
252
+
253
+ <table><tr><td>DATASET</td><td>#USERS</td><td>#ITEMS</td><td>AVG SEQUENCELEN</td><td>MAX SEQUENCE LEN</td></tr><tr><td>BEAUTY</td><td>52,024</td><td>57,289</td><td>7.6</td><td>291</td></tr><tr><td>GAMES</td><td>31,013</td><td>23,715</td><td>7.3</td><td>858</td></tr><tr><td>STEAM</td><td>334,730</td><td>13,047</td><td>11.0</td><td>1,229</td></tr><tr><td>ML-1M</td><td>6,040</td><td>3,416</td><td>163.5</td><td>2,275</td></tr><tr><td>ML-10M</td><td>69,878</td><td>65,133</td><td>141.1</td><td>7,357</td></tr></table>
254
+
255
+ Table 5: Comparing our SSE-PT, SSE- $\mathrm { P T } { + } { + }$ with SASRec on Movielen1M dataset. We use number of negatives $C = 1 0 0$ , dropout probability of 0.2 and learning rate of $1 e ^ { - 3 }$ for all experiments while varying others. $p _ { u } , p _ { i } , p _ { u }$ are SSE probabilities for user embedding, input item embedding and output item embedding respectively.
256
+
257
+ <table><tr><td rowspan="2">Model</td><td colspan="2">Movielens1m</td><td colspan="2">Dimensions</td><td colspan="2">Number of Blocks</td><td colspan="3">Sampling Probability SSE-SE Parameters</td></tr><tr><td>NDCG@10</td><td>Recall@10</td><td>du</td><td>di</td><td>b</td><td>ps</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.5961</td><td>0.8195</td><td>-</td><td>50</td><td>2</td><td></td><td>-</td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5941</td><td>0.8182</td><td>-</td><td>100</td><td>2</td><td></td><td></td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5996</td><td>0.8272</td><td>-</td><td>100</td><td>6</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>SSE-PT</td><td>0.6101</td><td>0.8343</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0</td></tr><tr><td>SSE-PT</td><td>0.6164</td><td>0.8336</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5832</td><td>0.8091</td><td>50</td><td>50</td><td>2</td><td></td><td>0</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6174</td><td>0.8351</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5949</td><td>0.8205</td><td>75</td><td>25</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6214</td><td>0.8359</td><td>25</td><td>75</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>50</td><td>100</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>50</td><td>100</td><td>2</td><td>0.3</td><td>0.92</td><td>0.1</td><td>0.1</td></tr></table>
258
+
259
+ Table 6: Comparing our SSE-PT with SASRec on Movielens10M dataset. Unlike Table 5, we use the number of negatives $C = 5 0 0$ instead of 100 as $C = 1 0 0$ is too easy for this dataset and it gets too difficult to tell the differences between different methods: Hit Ratio $@ 1 0$ approaches 1.
260
+
261
+ <table><tr><td rowspan="2"></td><td colspan="2">Movielens1m</td><td colspan="2">Dimensions</td><td colspan="2">Number of Blocks</td><td colspan="3">SSE-SE Parameters</td></tr><tr><td>Model NDCG@10</td><td>Hit Ratio@10</td><td>d</td><td>di</td><td></td><td>b</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.7268</td><td>0.9429</td><td>-</td><td>50</td><td>2</td><td></td><td>1</td><td>-</td><td>1</td></tr><tr><td>SASRec</td><td>0.7413</td><td>0.9474</td><td>1</td><td>100</td><td>2</td><td></td><td>1</td><td>1</td><td>1</td></tr><tr><td>SSE-PT</td><td>0.7199</td><td>0.9331</td><td>50</td><td>100</td><td>2</td><td></td><td>PS</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7169</td><td>0.9296</td><td>50</td><td>100</td><td>2</td><td></td><td>0.0</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7398</td><td>0.9418</td><td>50</td><td>100</td><td>2</td><td></td><td>0.2</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7500</td><td>0.9500</td><td>50</td><td>100</td><td>2</td><td></td><td>0.4</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7484</td><td>0.9480</td><td>50</td><td>100</td><td></td><td>2</td><td>0.6</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7529</td><td>0.9485</td><td>50</td><td>100</td><td></td><td>2</td><td>0.8</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7503</td><td>0.9505</td><td>50</td><td>100</td><td></td><td>2</td><td>1.0</td><td>0.01</td><td>0.01</td></tr></table>
262
+
263
+ • PopRec: ranking items according to their popularity.
264
+
265
+ • BPR: Bayesian personalized ranking for implicit feedback setting (Rendle et al., 2009). It is a low-rank matrix factorization model with a pairwise loss function. But it does not utilize the temporal information. Therefore, it serves as a strong baseline for non-temporal methods.
266
+
267
+ • FMC: Factorized Markov Chains: a first-order Markov Chain method, in which predictions are made only based on previously engaged item.
268
+
269
+ • PFMC: a personalized Markov chain model (Rendle et al., 2010) that combines matrix factorization and first-order Markov Chain to take advantage of both users’ latent long-term preferences as well as short-term item transitions.
270
+
271
+ • TransRec: a first-order sequential recommendation method (He et al., 2017) in which items are embedded into a transition space and users are modelled as translation vectors operating on item sequences.
272
+
273
+ SQL-Rank (Wu et al., 2018) and item-based recommendations (Sarwar et al., 2001) are omitted because the former is similar to BPR (Rendle et al., 2009) except using the listwise loss function instead of the pairwise loss function and the latter has been shown inferior to TransRec (He et al., 2017).
274
+
275
+ # 6.0.1 DEEP-LEARNING BASELINES
276
+
277
+ • GRU4Rec: the first RNN-based method proposed for the session-based recommendation problem (Hidasi et al., 2015). It utilizes the GRU structures (Chung et al., 2014) initially proposed for speech modelling.
278
+
279
+ • GRU4Rec+: follow-up work of GRU4Rec by the same authors: the model has a very similar architecture to GRU4Rec but has a more complicated loss function (Hidasi and Karatzoglou, 2018).
280
+
281
+ • Caser: a CNN-based method (Tang and Wang, 2018) which embeds a sequence of recent items in both time and latent spaces forming an ‘image’ before learning local features through horizontal and vertical convolutional filters. In (Tang and Wang, 2018), user embeddings are included in the prediction layer only. On the contrast, in our Personalized Transformer, user embeddings are also introduced in the lowest embedding layer so they can play an important role in self-attention mechanisms as well as in prediction stages.
282
+
283
+ • STAMP: a session-based recommendation algorithm (Liu et al., 2018) using attention mechanism. (Liu et al., 2018) only uses fully connected layers with one attention block that is not self-attentive.
284
+
285
+ • SASRec: a self-attentive sequential recommendation method (Kang and McAuley, 2018) motivated by Transformer in NLP (Vaswani et al., 2017). Unlike our method SSE-PT, SASRec does not incorporate user embedding and therefore is not a personalized method. SASRec paper (Kang and McAuley, 2018) also does not utilize SSE (Wu et al., 2019) for further regularization: only dropout and weight decay are used.
286
+
287
+ • HGN: hierarchical gating networks method to solve the sequential recommendation problem (Ma et al., 2019), which incorporates the user embeddings and gating networks for better personalization than the SASRec model.
288
+
289
+ Table 7: Comparing Different SSE probability for user embeddings for SSE-PT on Movielens1M Dataset. Embedding hidden units of 50 for users and 100 for items, attention blocks of 2, SSE probability of 0.01 for item embeddings, dropout probability of 0.2 and max length of 200 are used.
290
+
291
+ <table><tr><td>USER-SIDE SSE-SE PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>PARAMETER SHARING</td><td>0.6188</td><td>0.8294</td></tr><tr><td>1.0</td><td>0.6258</td><td>0.8346</td></tr><tr><td>0.9</td><td>0.6275</td><td>0.8321</td></tr><tr><td>0.8</td><td>0.6244</td><td>0.8359</td></tr><tr><td>0.6</td><td>0.6256</td><td>0.8341</td></tr><tr><td>0.4</td><td>0.6237</td><td>0.8369</td></tr><tr><td>0.2</td><td>0.6163</td><td>0.8281</td></tr><tr><td>0.0</td><td>0.5908</td><td>0.8048</td></tr></table>
292
+
293
+ Table 8: Comparing Different Sampling Probability, $p _ { s }$ , of SSE- $\mathrm { P T } { + } { + }$ on Movielens1M Dataset. Hyper-parameters the same as Table 7, except that the max length $T$ allowed is set 100 instead of 200 to show effects of sampling sequences.
294
+
295
+ <table><tr><td>SAMPLING PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>SASREC (T: =100)</td><td>0.5769</td><td>0.8045</td></tr><tr><td>SSE-PT(T: = 100)</td><td>0.6142</td><td>0.8212</td></tr><tr><td>1.0</td><td>0.5697</td><td>0.7977</td></tr><tr><td>0.8</td><td>0.5735</td><td>0.7801</td></tr><tr><td>0.6</td><td>0.6062</td><td>0.8242</td></tr><tr><td>0.4</td><td>0.6113</td><td>0.8273</td></tr><tr><td>0.3</td><td>0.6186</td><td>0.8318</td></tr><tr><td>0.2</td><td>0.6193</td><td>0.8233</td></tr><tr><td>0.0</td><td>0.6142</td><td>0.8212</td></tr></table>
296
+
297
+ Table 9: Comparing Different Number of Blocks for SSE-PT while Keeping The Rest Fixed on Movielens1M and Movielens10M Datasets.
298
+
299
+ <table><tr><td>DATASETS</td><td># OF BLOCKS</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td rowspan="7">MOVIELENS1M</td><td>SASREC (6 BLOCKS)</td><td>0.5984</td><td>0.8207</td></tr><tr><td>1</td><td>0.6162</td><td>0.8301</td></tr><tr><td>2</td><td>0.6280</td><td>0.8365</td></tr><tr><td>3</td><td>0.6293</td><td>0.8376</td></tr><tr><td>4</td><td>0.6270</td><td>0.8401</td></tr><tr><td>5</td><td>0.6308</td><td>0.8361</td></tr><tr><td>6</td><td>0.6270</td><td>0.8397</td></tr><tr><td rowspan="6">MOVIELENS10M</td><td>SASREC(6 BLOCKS)</td><td>0.7531</td><td>0.9490</td></tr><tr><td>1</td><td>0.7454</td><td>0.9478</td></tr><tr><td>2</td><td>0.7512</td><td>0.9522</td></tr><tr><td>3</td><td>0.7543</td><td>0.9491</td></tr><tr><td>4</td><td>0.7608</td><td>0.9485</td></tr><tr><td>5</td><td>0.7619</td><td>0.9524</td></tr><tr><td></td><td>6</td><td>0.7683</td><td>0.9537</td></tr></table>
300
+
301
+ Table 10: Varying number of negatives $C$ in evaluation on Movielens1M dataset. Other hyperparameters are fixed for a fair comparison.
302
+
303
+ <table><tr><td>METRIC</td><td>NDCG@10</td><td>RECALL @10</td><td>C</td></tr><tr><td>UN-PERSONALIZED</td><td>0.3787</td><td>0.6119</td><td>500</td></tr><tr><td>PERSONALIZED</td><td>0.3846</td><td>0.6171</td><td>500</td></tr><tr><td>UN-PERSONALIZED</td><td>0.2791</td><td>0.4781</td><td>1000</td></tr><tr><td>PERSONALIZED</td><td>0.2860</td><td>0.4929</td><td>1000</td></tr><tr><td>UN-PERSONALIZED</td><td>0.1939</td><td>0.3515</td><td>2000</td></tr><tr><td>PERSONALIZED</td><td>0.1993</td><td>0.3667</td><td>2000</td></tr></table>
parse/train/HkeuD34KPH/HkeuD34KPH_content_list.json ADDED
@@ -0,0 +1,1603 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "SSE-PT: SEQUENTIAL RECOMMENDATION VIA PERSONALIZED TRANSFORMER ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 173,
8
+ 98,
9
+ 691,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 170,
20
+ 398,
21
+ 198
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 234,
32
+ 544,
33
+ 251
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Temporal information is crucial for recommendation problems because user preferences are naturally dynamic in the real world. Recent advances in deep learning, especially the discovery of various attention mechanisms and newer architectures in addition to widely used RNN and CNN in natural language processing, have allowed for better use of the temporal ordering of items that each user has engaged with. In particular, the SASRec model, inspired by the popular Transformer model in natural languages processing, has achieved state-of-the-art results. However, SASRec, just like the original Transformer model, is inherently an un-personalized model and does not include personalized user embeddings. To overcome this limitation, we propose a Personalized Transformer (SSE-PT) model, outperforming SASRec by almost $5 \\%$ in terms of NDCG $@ 1 0$ on 5 real-world datasets. Furthermore, after examining some random users’ engagement history, we find our model not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call $\\mathrm { S S E – P T + + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements. Our novel application of the Stochastic Shared Embeddings (SSE) regularization is essential to the success of personalization. Code and data are open-sourced at https://github.com/SSE-PT/SSE-PT. ",
40
+ "bbox": [
41
+ 233,
42
+ 263,
43
+ 766,
44
+ 527
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 553,
55
+ 336,
56
+ 568
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "The sequential recommendation problem has been an important open research question, yet using temporal information to improve recommendation performance has proven to be challenging. SASRec, proposed by (Kang and McAuley, 2018) for sequential recommendation problems, has achieved stateof-the-art results and enjoyed more than 10x speed-up when compared to earlier CNN/RNN-based methods. However, the model used in SASRec is the standard Transformer which is inherently an un-personalized model. In practice, it is important to include a personalized Transformer in SASRec especially for recommender systems, but (Kang and McAuley, 2018) found that adding additional personalized embeddings did not improve the performance of their Transformer model, and postulate that the failure of adding personalization is due to the fact that they already use the user history and the user embeddings only contribute to overfitting. In this work, we propose a novel method, Personalized Transformer (SSE-PT), that successfully introduces personalization into self-attentive neural network architectures. ",
63
+ "bbox": [
64
+ 174,
65
+ 583,
66
+ 825,
67
+ 750
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Introducing user embeddings into the standard transformer model is intrinsically difficult with existing regularization techniques, as unavoidably a large number of user parameters are introduced, which is often at the same scale of the number of training data. But we show that personalization can greatly improve ranking performance with a recent regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The personalized Transformer (SSE-PT) model with SSE regularization works well for all 5 real-world datasets we consider without overfitting, outperforming previous state-of-the-art algorithm SASRec by almost $5 \\%$ in terms of ${ \\mathrm { N D C G } } @ 1 0 .$ . Furthermore, after examining some random users’ engagement history, we find our model is not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call SSE- $\\mathrm { \\cdot P T } { + } { + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements. ",
74
+ "bbox": [
75
+ 174,
76
+ 757,
77
+ 825,
78
+ 924
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "2 RELATED WORK ",
85
+ "text_level": 1,
86
+ "bbox": [
87
+ 176,
88
+ 102,
89
+ 344,
90
+ 118
91
+ ],
92
+ "page_idx": 1
93
+ },
94
+ {
95
+ "type": "text",
96
+ "text": "2.1 SESSION-BASED AND SEQUENTIAL RECOMMENDATION ",
97
+ "text_level": 1,
98
+ "bbox": [
99
+ 176,
100
+ 133,
101
+ 598,
102
+ 147
103
+ ],
104
+ "page_idx": 1
105
+ },
106
+ {
107
+ "type": "text",
108
+ "text": "Both session-based and sequential (i.e., next-basket) recommendation algorithms take advantage of additional temporal information to make better personalized recommendations. The main difference between session-based recommendations (Hidasi et al., 2015) and sequential recommendations (Kang and McAuley, 2018) is that the former assumes that the user ids are not recorded and therefore the length of engagement sequences are relatively short. Therefore, session-based recommendations normally do not consider user factors. On the other hand, sequential recommendation treats each sequence as a user’s engagement history (Kang and McAuley, 2018). Both settings, do not explicitly require time-stamps: only the relative temporal orderings are assumed known (in contrast to, for example, timeS $\\mathrm { V D } { + } { + }$ (Koren, 2009) using time-stamps). Initially, sequence data in temporal order are usually modelled with Markov models, in which a future observation is conditioned on the last few observed items (Rendle et al., 2010). In (Rendle et al., 2010), a personalized Markov model with user latent factors is proposed for more personalized results. ",
109
+ "bbox": [
110
+ 174,
111
+ 159,
112
+ 825,
113
+ 325
114
+ ],
115
+ "page_idx": 1
116
+ },
117
+ {
118
+ "type": "text",
119
+ "text": "In recent years, deep learning techniques, borrowed from natural language processing (NLP) literature, are getting widely used in tackling sequential data. Like word sentences in NLP, item sequences in recommendations can be similarly modelled by recurrent neural networks (RNN) (Hidasi et al., 2015; Hidasi and Karatzoglou, 2018) and convolutional neural network (CNN) (Tang and Wang, 2018) models. Recently, attention models are increasingly used in both NLP (Vaswani et al., 2017; Devlin et al., 2018) and recommender systems (Liu et al., 2018; Kang and McAuley, 2018). SASRec (Kang and McAuley, 2018) is a recent method with state-of-the-art performance among the many deep learning models. Motivated by the Transformer model in neural machine translation (Vaswani et al., 2017), SASRec utilizes a similar architecture to the encoder part of the Transformer model. Our proposed model, SSE-PT, is a personalized extension of the transformer model. ",
120
+ "bbox": [
121
+ 174,
122
+ 332,
123
+ 825,
124
+ 472
125
+ ],
126
+ "page_idx": 1
127
+ },
128
+ {
129
+ "type": "text",
130
+ "text": "2.2 REGULARIZATION TECHNIQUES ",
131
+ "text_level": 1,
132
+ "bbox": [
133
+ 176,
134
+ 488,
135
+ 436,
136
+ 502
137
+ ],
138
+ "page_idx": 1
139
+ },
140
+ {
141
+ "type": "text",
142
+ "text": "In deep learning, models with many more parameters than data points can easily overfit to the training data. This may prevent us from adding user embeddings as additional parameters into complicated models like the Transformer model (Kang and McAuley, 2018), which can easily have 20 layers with millions of parameters for a medium-sized dataset like Movielens10M (Harper and Konstan, 2016). $\\ell _ { 2 }$ regularization (Hoerl and Kennard, 1970) is the most widely used approach and has been used in many matrix factorization models in recommender systems; $\\ell _ { 1 }$ regularization (Tibshirani, 1996) is used when a sparse model is preferred. For deep neural networks, it has been shown that $\\ell _ { p }$ regularizations are often too weak, while dropout (Hinton et al., 2012; Srivastava et al., 2014) is more effective in practice. There are many other regularization techniques, including parameter sharing (Goodfellow et al., 2016), max-norm regularization (Srebro et al., 2005), gradient clipping (Pascanu et al., 2013), etc. Very recently, a new regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019) is proposed as a new means of regularizing embedding layers. We find that the base version SSE-SE is essential to the success of our Personalized Transformer (SSE-PT) model. ",
143
+ "bbox": [
144
+ 173,
145
+ 513,
146
+ 825,
147
+ 694
148
+ ],
149
+ "page_idx": 1
150
+ },
151
+ {
152
+ "type": "text",
153
+ "text": "3 METHODOLOGY ",
154
+ "text_level": 1,
155
+ "bbox": [
156
+ 176,
157
+ 714,
158
+ 341,
159
+ 731
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "3.1 SEQUENTIAL RECOMMENDATION ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 176,
169
+ 746,
170
+ 446,
171
+ 761
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "Given $n$ users and each user engaging with a subset of $m$ items in a temporal order, the goal of sequential recommendation is to learn a good personalized ranking of top $K$ items out of total $m$ items for any given user at any given time point. We assume data in the format of $n$ item sequences: ",
178
+ "bbox": [
179
+ 174,
180
+ 771,
181
+ 823,
182
+ 814
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "equation",
188
+ "img_path": "images/89210769a0a3d336268a38d21fccc16ca490e53cb8a3d58210ed8a2bb6eb8378.jpg",
189
+ "text": "$$\ns _ { i } = ( j _ { i 1 } , j _ { i 2 } , \\ldots , j _ { i T } ) \\mathrm { f o r } 1 \\le i \\le n .\n$$",
190
+ "text_format": "latex",
191
+ "bbox": [
192
+ 372,
193
+ 819,
194
+ 624,
195
+ 835
196
+ ],
197
+ "page_idx": 1
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "Sequences $s _ { i }$ of length $T$ contain indices of the last $T$ items that user $i$ has interacted with in the temporal order (from old to new). For different users, the sequence lengths can vary, but we can pad the shorter sequences so all of them have length $T$ . We cannot simply randomly split data points into train/validation/test sets because they come in temporal orders. Instead, we need to make sure our training data is before validation data which is before test data temporally. We use last items in sequences as test sets, second-to-last items as validation sets and the rest as training sets. We use ranking metrics such as NDCG $@ K$ and Recal $@ K$ for evaluations, which are defined in the Appendix. ",
202
+ "bbox": [
203
+ 174,
204
+ 839,
205
+ 825,
206
+ 924
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "",
213
+ "bbox": [
214
+ 173,
215
+ 103,
216
+ 823,
217
+ 132
218
+ ],
219
+ "page_idx": 2
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "3.2 PERSONALIZED TRANSFORMER ARCHITECTURE ",
224
+ "text_level": 1,
225
+ "bbox": [
226
+ 174,
227
+ 148,
228
+ 549,
229
+ 164
230
+ ],
231
+ "page_idx": 2
232
+ },
233
+ {
234
+ "type": "text",
235
+ "text": "Our model, which we call SSE-PT, is motivated by the Transformer model in (Vaswani et al., 2017) and (Kang and McAuley, 2018). It also utilizes a new regularization technique called stochastic shared embeddings (Wu et al., 2019). In the following sections, we are going to examine each important component of our Personalized Transformer (SSE-PT) model, especially the embedding layer, and the novel application of stochastic shared embeddings (SSE) regularization technique. ",
236
+ "bbox": [
237
+ 173,
238
+ 174,
239
+ 825,
240
+ 246
241
+ ],
242
+ "page_idx": 2
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "Embedding Layer We define a learnable user embedding look-up table $U \\in R ^ { n \\times d _ { u } }$ and item embedding look-up table $V \\in R ^ { m \\times d _ { i } }$ , where $d _ { u }$ , $d _ { i }$ are the number of hidden units for user and item respectively. We also specify learnable positional encoding table $P \\in R ^ { T \\times d }$ , where $d = d _ { u } + d _ { i }$ . So each input sequence $s _ { i } \\in \\dot { R ^ { T } }$ will be represented by the following embedding: ",
247
+ "bbox": [
248
+ 174,
249
+ 260,
250
+ 825,
251
+ 318
252
+ ],
253
+ "page_idx": 2
254
+ },
255
+ {
256
+ "type": "equation",
257
+ "img_path": "images/e41ee14a701be39e3e2fdd76b44a874b096393c40b8ea308f1446b67c44396ce.jpg",
258
+ "text": "$$\nE = \\left[ \\begin{array} { c } { \\left[ v _ { j _ { i 1 } } ; u _ { i } \\right] + p _ { 1 } } \\\\ { \\left[ v _ { j _ { i 2 } } ; u _ { i } \\right] + p _ { 2 } } \\\\ { \\vdots } \\\\ { \\left[ v _ { j _ { i T } } ; u _ { i } \\right] + p _ { T } } \\end{array} \\right] \\in R ^ { T \\times d } ,\n$$",
259
+ "text_format": "latex",
260
+ "bbox": [
261
+ 387,
262
+ 324,
263
+ 609,
264
+ 393
265
+ ],
266
+ "page_idx": 2
267
+ },
268
+ {
269
+ "type": "text",
270
+ "text": "where $[ v _ { j _ { i t } } ; u _ { i } ]$ represents concatenating item embedding $v _ { j _ { i t } } \\in R ^ { d _ { i } }$ and user embedding $u _ { i } \\in R ^ { d _ { u } }$ into embedding $E _ { t } \\in R ^ { d }$ for time $t$ . Note that the main difference between our model and (Kang and McAuley, 2018) is that we introduce the user embeddings $u _ { i }$ , making our model personalized. ",
271
+ "bbox": [
272
+ 174,
273
+ 400,
274
+ 823,
275
+ 445
276
+ ],
277
+ "page_idx": 2
278
+ },
279
+ {
280
+ "type": "image",
281
+ "img_path": "images/b94005f421833ad6c586a61927a3d3f2134032bfb59c8c232ecf7eed3b30b663.jpg",
282
+ "image_caption": [
283
+ "Figure 1: Illustration of our proposed SSE-PT model "
284
+ ],
285
+ "image_footnote": [],
286
+ "bbox": [
287
+ 313,
288
+ 453,
289
+ 691,
290
+ 694
291
+ ],
292
+ "page_idx": 2
293
+ },
294
+ {
295
+ "type": "text",
296
+ "text": "Transformer Encoder On top of the embedding layer, we have $B$ blocks of self-attention layers and fully connected layers, where each layer extracts features for each time step based on the previous layer’s outputs. Since this part is identical to the Transformer encoder used in the original papers (Vaswani et al., 2017; Kang and McAuley, 2018), we will skip the details. ",
297
+ "bbox": [
298
+ 173,
299
+ 733,
300
+ 825,
301
+ 791
302
+ ],
303
+ "page_idx": 2
304
+ },
305
+ {
306
+ "type": "text",
307
+ "text": "Prediction Layer At time $t$ , the predicted probability of user $i$ engaged item $l$ is: ",
308
+ "bbox": [
309
+ 173,
310
+ 805,
311
+ 715,
312
+ 820
313
+ ],
314
+ "page_idx": 2
315
+ },
316
+ {
317
+ "type": "equation",
318
+ "img_path": "images/2deb408362edbdd2c216fad0a01ba3b2acfb89221c0c2f86f9425a850d281ee7.jpg",
319
+ "text": "$$\np _ { i t l } = \\sigma ( r _ { i t l } ) ,\n$$",
320
+ "text_format": "latex",
321
+ "bbox": [
322
+ 449,
323
+ 821,
324
+ 545,
325
+ 838
326
+ ],
327
+ "page_idx": 2
328
+ },
329
+ {
330
+ "type": "text",
331
+ "text": "where $\\sigma$ is the sigmoid function and $r _ { i t l }$ is the predicted score of item $l$ by user $l$ at time point $t$ defined as: ",
332
+ "bbox": [
333
+ 171,
334
+ 845,
335
+ 825,
336
+ 872
337
+ ],
338
+ "page_idx": 2
339
+ },
340
+ {
341
+ "type": "equation",
342
+ "img_path": "images/0eb8dfc83d583b9ae3a080f3d295ec18fab4ac6d30a357b5ffa5529c936c25db.jpg",
343
+ "text": "$$\nr _ { i t l } = F _ { t - 1 } ^ { B } \\cdot [ v _ { l } ; u _ { i } ] ,\n$$",
344
+ "text_format": "latex",
345
+ "bbox": [
346
+ 428,
347
+ 871,
348
+ 568,
349
+ 890
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "text",
355
+ "text": "where $F _ { t - 1 } ^ { B }$ is the output hidden units associated with the transformer encoder at the last timestamp. Although we can use another set of user and item embedding look-up tables for the $u _ { i }$ and $v _ { l }$ , we ",
356
+ "bbox": [
357
+ 173,
358
+ 895,
359
+ 826,
360
+ 924
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "find it better to use the same set of embedding look-up tables $U , V$ as in the embedding layer. But regularization for those embeddings can be different. To distinguish the $u _ { i }$ and $v _ { l }$ in (4) from $u _ { i } , v _ { j }$ in (2), we call embeddings in (4) output embeddings and those in (2) input embeddings. ",
367
+ "bbox": [
368
+ 173,
369
+ 103,
370
+ 825,
371
+ 146
372
+ ],
373
+ "page_idx": 3
374
+ },
375
+ {
376
+ "type": "text",
377
+ "text": "The binary cross entropy loss between predicted probability for the positive item $l = j _ { i ( t + 1 ) }$ and one uniformly sampled negative item $k \\in \\Omega$ is given as $- [ \\log ( p _ { i t l } ) + \\log ( 1 - p _ { i t k } ) ]$ . Summing over $s _ { i }$ and $t$ , we obtain the objective function that we want to minimize is: ",
378
+ "bbox": [
379
+ 176,
380
+ 152,
381
+ 821,
382
+ 196
383
+ ],
384
+ "page_idx": 3
385
+ },
386
+ {
387
+ "type": "equation",
388
+ "img_path": "images/016b7ad8ea3007514c98aa56297ef9324d442fdfcfb95c1ba3b6b754673a46aa.jpg",
389
+ "text": "$$\n\\sum _ { i } \\sum _ { t = 1 } ^ { T - 1 } \\sum _ { k \\in \\Omega } - \\big [ \\log ( p _ { i t l } ) + \\log ( 1 - p _ { i t k } ) \\big ] .\n$$",
390
+ "text_format": "latex",
391
+ "bbox": [
392
+ 341,
393
+ 200,
394
+ 655,
395
+ 238
396
+ ],
397
+ "page_idx": 3
398
+ },
399
+ {
400
+ "type": "text",
401
+ "text": "At the inference time, top- $K$ recommendations for user $i$ at time $t$ can be made by sorting scores $r _ { i t l }$ for all items $\\ell$ and recommending the first $K$ items in the sorted list. ",
402
+ "bbox": [
403
+ 173,
404
+ 242,
405
+ 821,
406
+ 270
407
+ ],
408
+ "page_idx": 3
409
+ },
410
+ {
411
+ "type": "text",
412
+ "text": "Novel Application of Stochastic Shared Embeddings The most important regularization technique to SSE-PT model is the Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The main idea of SSE is to stochastically replace embeddings with another embedding with some pre-defined probability during SGD, which has the effect of regularizing the embedding layers. Without SSE, all the existing well-known regularization techniques like layer normalization, dropout and weight decay fail and cannot prevent the model from over-fitting badly after introducing user embeddings. (Wu et al., 2019) develops two versions of SSE, SSE-Graph and SSE-SE. In the simplest uniform case, SSE-SE replaces one embedding with another embedding uniformly with probability $p$ , which is called SSE probability in (Wu et al., 2019). Since we don’t have knowledge graphs for user or items, we simply apply the SSE-SE to our SSE-PT model. We find SSE-SE makes possible training this personalized model with $O ( n d _ { u } )$ additional parameters. ",
413
+ "bbox": [
414
+ 173,
415
+ 285,
416
+ 825,
417
+ 438
418
+ ],
419
+ "page_idx": 3
420
+ },
421
+ {
422
+ "type": "text",
423
+ "text": "There are 3 different places in our model that SSE-SE can be applied. We can apply SSE-SE to input/output user embeddings, input item embeddings, and output item embeddings with probabilities $p _ { u }$ , $p _ { i }$ and $p _ { y }$ respectively. Note that input user embedding and output user embedding are always replaced at the same time with SSE probability $p _ { u }$ . Empirically, we find that SSE-SE to user embeddings and output item embeddings always helps, but SSE-SE to input item embeddings is only useful when the average sequence length is large, e.g., more than 100 in Movielens1M and Movielens10M datasets. ",
424
+ "bbox": [
425
+ 173,
426
+ 444,
427
+ 825,
428
+ 542
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "Other Regularization Techniques Besides the SSE (Wu et al., 2019), we also utilized other widely used regularization techniques, including layer normalization (Ba et al., 2016), batch normalization (Ioffe and Szegedy, 2015), residual connections (He et al., 2016), weight decay (Krogh and Hertz, 1992), and dropout (Srivastava et al., 2014). Since they are used in the same way in the previous paper (Kang and McAuley, 2018), we omit the details to the Appendix. ",
435
+ "bbox": [
436
+ 174,
437
+ 558,
438
+ 825,
439
+ 627
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "3.3 HANDLING LONG SEQUENCES: SSE-PT $^ { + + }$ ",
446
+ "text_level": 1,
447
+ "bbox": [
448
+ 174,
449
+ 643,
450
+ 514,
451
+ 659
452
+ ],
453
+ "page_idx": 3
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "To handle extremely long sequences, a slight modification can be made on the base SSE-PT model in terms of how input sequences $s _ { i }$ ’s are fed into the SSE-PT neural network. We call the enhanced model SSE- $\\mathrm { P T } { + } { + }$ to distinguish it from the previously discussed SSE-PT model, which cannot handle sequences longer than $T$ . ",
458
+ "bbox": [
459
+ 174,
460
+ 670,
461
+ 825,
462
+ 726
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "The motivation of SSE- $\\mathbf { \\nabla } \\cdot \\mathbf { P } \\mathbf { T } + +$ over SSE-PT comes from: sometimes we want to make use of extremely long sequences, $s _ { i } = ( j _ { i 1 } , j _ { i 2 } , . ~ . ~ . ~ , j _ { i t } )$ for $1 \\leq i \\leq n$ , where $t > T$ , but our SSE-PT model can only handle sequences of maximum length of $T$ . The simplest way is to sample starting index $1 \\leq v \\leq t$ uniformly and use $s _ { i } = ( j _ { i v } , j _ { i ( v + 1 ) } , . ~ . ~ . , j _ { i z } )$ , where $z = \\operatorname* { m i n } ( t , v + T - 1 )$ . Although sampling the starting index uniformly from $[ 1 , t ]$ can accommodate long sequences of length $t > T$ , this does not work well in practice. Uniform sampling does not take into account the importance of recent items in a long sequence. To solve this dilemma, we introduce an additional hyper-parameter $p _ { s }$ which we call sampling probability. It implies that with probability $p _ { s }$ , we sample the starting index $v$ uniformly from $[ 1 , t - T ]$ and use sequence $s _ { i } = \\left( j _ { i v } , j _ { i ( v + 1 ) } , \\ldots , j _ { i ( v + T - 1 ) } \\right)$ as input. With probability $1 - p _ { s }$ we simply use the recent $T$ items $( j _ { i ( t - T + 1 ) } , \\ldots , j _ { i t } )$ as input. If the sequence $s _ { i }$ is already shorter than $T$ , then we always use the recent input sequence for user $i$ . ",
469
+ "bbox": [
470
+ 173,
471
+ 732,
472
+ 825,
473
+ 888
474
+ ],
475
+ "page_idx": 3
476
+ },
477
+ {
478
+ "type": "text",
479
+ "text": "Our proposed SSE- $\\mathrm { P T } { + } { + }$ model can work almost as well as SSE-PT with a much smaller $T$ . One can see in Table 2 with $T = 1 0 0$ , SSE-PT++ can perform almost as well as SSE-PT. The time complexity of the SSE-PT model is of order $O ( T ^ { 2 } d + T d ^ { 2 } )$ . Therefore, reducing $T$ by one half would lead to a theoretically $4 \\mathbf { x }$ speed-up in terms of the training and inference speeds. As to the model’s space complexity, both SSE-PT and SSE- $\\mathrm { P T } { + } { + }$ are of order $O ( n d _ { u } + m \\dot { d _ { i } } + T d + d ^ { 2 } )$ . ",
480
+ "bbox": [
481
+ 173,
482
+ 895,
483
+ 823,
484
+ 924
485
+ ],
486
+ "page_idx": 3
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "",
491
+ "bbox": [
492
+ 173,
493
+ 102,
494
+ 823,
495
+ 146
496
+ ],
497
+ "page_idx": 4
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "4 EXPERIMENTS ",
502
+ "text_level": 1,
503
+ "bbox": [
504
+ 174,
505
+ 167,
506
+ 326,
507
+ 184
508
+ ],
509
+ "page_idx": 4
510
+ },
511
+ {
512
+ "type": "text",
513
+ "text": "In this section, we compare our proposed algorithms, Personalized Transformer (SSE-PT) and SSE$\\mathrm { P T } { + } { + }$ , with other state-of-the-art algorithms on real-world datasets. We implement our codes in Tensorflow and conduct all our experiments on a server with 40-core Intel Xeon E5-2630 v4 $@$ 2.20GHz CPU, 256G RAM and Nvidia GTX 1080 GPUs. ",
514
+ "bbox": [
515
+ 174,
516
+ 200,
517
+ 825,
518
+ 256
519
+ ],
520
+ "page_idx": 4
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "Datasets We use 5 datasets. The first 4 have exactly the same train/dev/test splits as in (Kang and McAuley, 2018). The datasets are: Beauty and Games categories from Amazon product review datasets1; Steam dataset introduced in (Kang and McAuley, 2018), which contains reviews crawled from a large video game distribution platform; Movielens1M dataset (Harper and Konstan, 2016), a widely used benchmark datasets containing one million user movie ratings; Movielens10M dataset with ten million user ratings cleaned by us. Detailed dataset statistics are given in Table 4. One can easily see that the first 3 datasets have short sequences (average length $< 1 2$ ) while the last 2 datasets have very long sequences $\\mathrm { \\Phi } > 1 0 \\mathrm { \\mathbf { x } }$ longer). ",
525
+ "bbox": [
526
+ 174,
527
+ 273,
528
+ 825,
529
+ 386
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "Evaluation Metrics The evaluation metrics we use are standard ranking metrics, namely NDCG and Recall for top recommendations (See Appendix). We follow the same evaluation setting as the previous paper (Kang and McAuley, 2018): predicting ratings at time point $t + 1$ given the previous $t$ ratings. For a large dataset with numerous users and items, the evaluation procedure would be slow because (6) would require computing the ranking of all items based on their predicted scores for every single user. As a means of speed-up evaluations, we sample a fixed number $C$ (e.g., 100) of negative candidates while always keeping the positive item that we know the user will engage next. This way, both $R _ { i j }$ and $\\Pi _ { i }$ will be narrowed down to a small set of item candidates, and prediction scores will only be computed for those items through a single forward pass of the neural network. ",
536
+ "bbox": [
537
+ 174,
538
+ 402,
539
+ 825,
540
+ 527
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "Ideally, we want both NDCG and Recall to be as close to 1 as possible, because $\\operatorname { N D C G @ } K = 1$ means the positive item is always put on the top-1 position of the top- $K$ ranking list, and Recall $\\Theta K = 1$ means the positive item is always contained by the top- $K$ recommendations the model makes. ",
547
+ "bbox": [
548
+ 174,
549
+ 534,
550
+ 825,
551
+ 577
552
+ ],
553
+ "page_idx": 4
554
+ },
555
+ {
556
+ "type": "table",
557
+ "img_path": "images/2bd440253199678c79e4f30a05215c101ee8245783f1d6d88cbdcefb84623a68.jpg",
558
+ "table_caption": [
559
+ "Table 1: Comparing various state-of-the-art temporal collaborative ranking algorithms on various datasets. The (A) to (E) are non-deep-learning methods, the $( \\mathrm { F } )$ to (K) are deep-learning methods and the (L) to (O) are our variants. We did not report SSE- $\\mathbf { \\nabla } \\cdot \\mathbf { P } \\mathbf { T } + +$ results for beauty, games and steam, as the input sequence lengths are very short (see Table 4), so there is no need for SSE- $\\mathrm { P T } { + } { + }$ . "
560
+ ],
561
+ "table_footnote": [],
562
+ "table_body": "<table><tr><td rowspan=\"2\">DATASET METRIC</td><td colspan=\"2\">BEAUTY</td><td colspan=\"2\">GAMES</td><td colspan=\"2\">STEAM</td><td colspan=\"2\"></td><td colspan=\"2\">ML-1M</td></tr><tr><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td>RECALL@10 NDCG@10</td><td></td></tr><tr><td>(A)POPREC</td><td>0.4003</td><td>0.2277</td><td>1</td><td>0.4724</td><td>0.2779</td><td>0.7172</td><td>0.4535</td><td>1</td><td>0.4329</td><td>0.2377</td></tr><tr><td>(B)BPR</td><td>0.3775</td><td>0.2183</td><td>一 1</td><td>0.4853</td><td>0.2875</td><td>0.7061</td><td>0.4436</td><td>1 1</td><td>0.5781</td><td>0.3287</td></tr><tr><td>(C)FMC</td><td>0.3771</td><td>0.2477</td><td>一</td><td>0.6358</td><td>0.4456</td><td>0.7731</td><td>0.5193</td><td>1</td><td>0.6983</td><td>0.4676</td></tr><tr><td>(D)FPMC</td><td>0.4310</td><td>0.2891</td><td>一</td><td>0.6802</td><td>0.4680</td><td>0.7710</td><td>0.5011</td><td>1</td><td>0.7599</td><td>0.5176</td></tr><tr><td>(E)TRANSREC</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1 1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(F) GRU4REC</td><td>0.2125</td><td>0.1203</td><td>1</td><td>0.2938</td><td>0.1837</td><td>0.4190</td><td>0.2691</td><td>1</td><td>0.5581</td><td>0.3381</td></tr><tr><td>(G) STAMP</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(H) GRU4REC+</td><td>0.3949</td><td>0.2556</td><td>一 一</td><td>0.6599</td><td>0.4759</td><td>0.8018</td><td>0.5595</td><td>1 1</td><td>0.7501</td><td>0.5513</td></tr><tr><td>(I) CASER</td><td>0.4264</td><td>0.2547</td><td>1</td><td>0.5282</td><td>0.3214</td><td>0.7874</td><td>0.5381</td><td>1</td><td>0.7886</td><td>0.5538</td></tr><tr><td>(J) SASREC</td><td>0.4837</td><td>0.3220</td><td>1</td><td>0.7434</td><td>0.5401</td><td>0.8732</td><td>0.6293</td><td>1</td><td>0.8233</td><td>0.5936</td></tr><tr><td>(K)HGN</td><td>0.4469</td><td>0.2994</td><td>1 1</td><td>0.7164</td><td>0.5209</td><td>0.7426</td><td>0.4871</td><td>1 1</td><td>0.7584</td><td>0.5241</td></tr><tr><td>(L) SSE-SASREC</td><td>0.4878</td><td>0.3342</td><td>1</td><td>0.7517</td><td>0.5535</td><td>0.8697</td><td>0.6333</td><td>1</td><td>0.8230</td><td>0.5995</td></tr><tr><td>(M)PT</td><td>0.3954</td><td>0.2449</td><td>1 1</td><td>0.6427</td><td>0.4434</td><td>0.7535</td><td>0.4853</td><td>1 1</td><td>0.7658</td><td>0.5241</td></tr><tr><td>(N) SSE-PT</td><td>0.5028</td><td>0.3370</td><td>一</td><td>0.7757</td><td>0.5660</td><td>0.8772</td><td>0.6378</td><td>一</td><td>0.8341</td><td>0.6281</td></tr><tr><td>(O) SSE-PT++</td><td>二</td><td>=</td><td>一</td><td>二</td><td>二</td><td></td><td></td><td>1</td><td>0.8389</td><td>0.6292</td></tr></table>",
563
+ "bbox": [
564
+ 174,
565
+ 664,
566
+ 823,
567
+ 840
568
+ ],
569
+ "page_idx": 4
570
+ },
571
+ {
572
+ "type": "text",
573
+ "text": "Baselines We include 5 non-deep-learning and 6 deep-learning algorithms in our comparisons. ",
574
+ "bbox": [
575
+ 176,
576
+ 882,
577
+ 803,
578
+ 897
579
+ ],
580
+ "page_idx": 4
581
+ },
582
+ {
583
+ "type": "table",
584
+ "img_path": "images/fddfa9150aeed86f4433f8b2fe66dd084814a31ae9aaa8b660edb34e95348035.jpg",
585
+ "table_caption": [
586
+ "Table 2: Comparing SASRec, SSE-PT and SSE- $\\mathbf { \\nabla \\cdot P T + + }$ on Movielens1M Dataset while varying the maximum length allowed and dimension of embeddings. "
587
+ ],
588
+ "table_footnote": [],
589
+ "table_body": "<table><tr><td>METHODS</td><td>NDCG@10</td><td>RECALL @10</td><td>MAX LEN</td><td>USER DIM</td><td>ITEMDIM</td></tr><tr><td>SASREC</td><td>0.5769</td><td>0.8045</td><td>100</td><td>N/A</td><td>100</td></tr><tr><td>SASREC</td><td>0.5936</td><td>0.8233</td><td>200</td><td>N/A</td><td>50</td></tr><tr><td>SASREC</td><td>0.5919</td><td>0.8202</td><td>200</td><td>N/A</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6142</td><td>0.8212</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6191</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>200</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6186</td><td>0.8318</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6208</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>200</td><td>50</td><td>100</td></tr></table>",
590
+ "bbox": [
591
+ 238,
592
+ 145,
593
+ 754,
594
+ 296
595
+ ],
596
+ "page_idx": 5
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "Non-deep-learning Baselines The simplest baseline is PopRec, basically ranking items according to their popularity. More advanced methods such as matrix factorization based baselines include Bayesian personalized ranking for implicit feedback (Rendle et al., 2009), namely $B P R$ ; Factorized Markov Chains and Personalized Factorized Markov Chains models (Rendle et al., 2010) also known as FMC and PFMC; and translation based method (He et al., 2017) called TransRec. ",
601
+ "bbox": [
602
+ 173,
603
+ 315,
604
+ 825,
605
+ 386
606
+ ],
607
+ "page_idx": 5
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "Deep-learning Baselines Recent years have seen many advances in deep learning for sequential recommendations. GRU4Rec is the first RNN-based method proposed for this problem (Hidasi et al., 2015); $G R U 4 R e c ^ { + }$ (Hidasi and Karatzoglou, 2018) later is proposed to address some shortcomings of the initial version. Caser is the corresponding CNN-based method (Tang and Wang, 2018). STAMP (Liu et al., 2018) utilizes the attention mechanism without using RNN or CNN as building blocks. Very recently, SASRec utilizes state-of-art Transformer encoder (Vaswani et al., 2017) with selfattention mechanisms. Hierarchical gating networks, also known as HGN (Ma et al., 2019) are also proposed to solve this problem. ",
612
+ "bbox": [
613
+ 173,
614
+ 404,
615
+ 826,
616
+ 515
617
+ ],
618
+ "page_idx": 5
619
+ },
620
+ {
621
+ "type": "table",
622
+ "img_path": "images/66e01fb83f231a40381edc93c3c9ad1fd838972ec9f2055e1f89a91899e58a00.jpg",
623
+ "table_caption": [
624
+ "Table 3: Comparing Different Regularizations for SSE-PT on Movielen1M Dataset. NO REG stands for no regularization. PS stands for parameter sharing across all users while PS(AGE) means PS is used within each age group. SASRec is added to last row after all SSE-PT results as a baseline. "
625
+ ],
626
+ "table_footnote": [],
627
+ "table_body": "<table><tr><td>REGULARIZATION</td><td>NDCG@5</td><td>% GAIN</td><td>RECALL@5</td><td>%GAIN</td></tr><tr><td>NO REG (BASELINE)</td><td>0.4855</td><td>1</td><td>0.6500</td><td>-</td></tr><tr><td>PS</td><td>0.5065</td><td>4.3</td><td>0.6656</td><td>2.4</td></tr><tr><td>PS (JOB)</td><td>0.4938</td><td>1.7</td><td>0.6570</td><td>1.1</td></tr><tr><td>PS (GENDER)</td><td>0.5110</td><td>5.3</td><td>0.6672</td><td>2.6</td></tr><tr><td>PS (AGE)</td><td>0.5133</td><td>5.7</td><td>0.6743</td><td>3.7</td></tr><tr><td>l2</td><td>0.5149</td><td>6.0</td><td>0.6786</td><td>4.4</td></tr><tr><td>DROPOUT</td><td>0.5165</td><td>6.4</td><td>0.6823</td><td>5.0</td></tr><tr><td>l2+DROPOUT</td><td>0.5293</td><td>9.0</td><td>0.6921</td><td>6.5</td></tr><tr><td>SSE-SE</td><td>0.5393</td><td>11.1</td><td>0.6977</td><td>7.3</td></tr><tr><td>l2 + SSE-SE + DROPOUT</td><td>0.5870</td><td>20.9</td><td>0.7442</td><td>14.5</td></tr><tr><td>SASREC (l2+DROPOUT)</td><td>0.5601</td><td></td><td>0.7164</td><td></td></tr></table>",
628
+ "bbox": [
629
+ 271,
630
+ 589,
631
+ 722,
632
+ 738
633
+ ],
634
+ "page_idx": 5
635
+ },
636
+ {
637
+ "type": "text",
638
+ "text": "Experiment Setup We use the same datasets as in (Kang and McAuley, 2018) and follow the same procedure in the paper: use last items for each user as test data, second-to-last as validation data and the rest as training data. We implemented our method in Tensorflow and solve it with Adam Optimizer (Kingma and Ba, 2014) with a learning rate of 0.001, momentum exponential decay rates $\\beta _ { 1 } = 0 . 9 , \\beta _ { 2 } = 0 . 9 8$ and a batch size of 128. In Table 1, since we use the same data, the performance of previous methods except STAMP have been reported in (Kang and McAuley, 2018). We tune the dropout rate, and SSE probabilities $p _ { u } , p _ { i } , p _ { y }$ for input user/item embeddings and output embeddings on validation sets and report the best NDCG and Recall for top- $K$ recommendations on test sets. For a fair comparison, we restrict all algorithms to use up to 50 hidden units for item embeddings. For the SSE-PT and SASRec models, we use the same number of transformer encoder blocks (i.e. $B = 2$ ) and set the maximum length $T = 2 0 0$ for Movielens 1M and 10M dataset and $T = 5 0$ for other datasets. We use top- $K$ with $K = 1 0$ and the number of negatives $C = 1 0 0$ in the evaluation procedure. In practice, using a different $K$ and $C$ does not affect our conclusions. ",
639
+ "bbox": [
640
+ 173,
641
+ 770,
642
+ 826,
643
+ 924
644
+ ],
645
+ "page_idx": 5
646
+ },
647
+ {
648
+ "type": "text",
649
+ "text": "",
650
+ "bbox": [
651
+ 173,
652
+ 103,
653
+ 823,
654
+ 132
655
+ ],
656
+ "page_idx": 6
657
+ },
658
+ {
659
+ "type": "text",
660
+ "text": "Comparisons One can easily see from Table 1 that our proposed SSE-PT has the best performance over all previous methods on all four datasets. On most datasets, our SSE-PT improves NDCG by more than $4 \\%$ when compared with SASRec (Kang and McAuley, 2018) and more than $20 \\%$ when compared to non-deep-learning methods. SSE-SE, together with dropout and weight decay, is the best choice for regularization, which is evident from Table 3. SSE-SE is a more effective way to regularize our neural networks than any existent techniques including parameter sharing, dropout, weight decay. In practice, these SSE probabilities, just like dropout rate, can be treated as tuning parameters and easily tuned. Movielens10M results are left to Table 6 in the Appendix. ",
661
+ "bbox": [
662
+ 173,
663
+ 146,
664
+ 825,
665
+ 258
666
+ ],
667
+ "page_idx": 6
668
+ },
669
+ {
670
+ "type": "image",
671
+ "img_path": "images/b2221ee0242457e902760eca3bdea35d1421ec53a04d71dab6d6fadb602280c9.jpg",
672
+ "image_caption": [],
673
+ "image_footnote": [],
674
+ "bbox": [
675
+ 173,
676
+ 271,
677
+ 825,
678
+ 597
679
+ ],
680
+ "page_idx": 6
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "Figure 2: Illustration of how SASRec (Left) and SSE-PT (Right) differs on utilizing the Engagement History of A Random User in Movielens1M Dataset. ",
685
+ "bbox": [
686
+ 174,
687
+ 630,
688
+ 823,
689
+ 659
690
+ ],
691
+ "page_idx": 6
692
+ },
693
+ {
694
+ "type": "text",
695
+ "text": "4.1 ATTENTION MECHANISM VISUALIZATION ",
696
+ "text_level": 1,
697
+ "bbox": [
698
+ 174,
699
+ 683,
700
+ 506,
701
+ 696
702
+ ],
703
+ "page_idx": 6
704
+ },
705
+ {
706
+ "type": "text",
707
+ "text": "Apart from evaluating our SSE-PT against SASRec using well-defined ranking metrics on realworld datasets, we also visualize the differences between both methods in terms of their attention mechanisms. In Figure 2, a random user’s engagement history in Movielens1M dataset is given in temporal order (column-wise). We hide the last item whose index is 26 in test set and hope that a temporal collaborative ranking model can figure out item-26 is the one this user will watch next using only previous engagement history. One can see for a typical user; they tend to look at a different style of movies at different times. Earlier on, they watched a variety of movies, including Sci-Fi, animation, thriller, romance, horror, action, comedy and adventure. But later on, in the last two columns of Figure 2, drama and thriller are the two types they like to watch most, especially the drama type. In fact, they watched 9 drama movies out of recent 10 movies. For humans, it is natural to reason that the hidden movie should probably also be drama type. So what about the machine’s reasoning? ",
708
+ "bbox": [
709
+ 174,
710
+ 708,
711
+ 825,
712
+ 861
713
+ ],
714
+ "page_idx": 6
715
+ },
716
+ {
717
+ "type": "text",
718
+ "text": "For our SSE-PT, the hidden item indexed 26 is put in the first place among its top-5 recommendations. Intelligently, the SSE-PT recommends 3 drama movies, 2 thriller movies and mixing them up in positions. Interestingly, the top recommendation is ‘Othello’, which like the recently watched ‘Richard III’, is an adaptation of a Shakespeare play, and this dependence is reflected in the attention weight. On the contrast, SASRec cannot provide top-5 recommendations that are personalized enough. It recommends a variety of action, Sci-Fi, comedy, horror, and drama movies but none of them match item-26. Although this user has watched all these types of movies in the past, they do not watch these anymore as one can easily tell from his recent history. Unfortunately, SASRec cannot capture this and does not provide personalized recommendations for this user by focusing more on drama and thriller movies. It is easy to see that in contrast, our SSE-PT model shares with human reasoning that more emphasis should be placed on recent movies. ",
719
+ "bbox": [
720
+ 174,
721
+ 867,
722
+ 825,
723
+ 924
724
+ ],
725
+ "page_idx": 6
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "",
730
+ "bbox": [
731
+ 174,
732
+ 103,
733
+ 825,
734
+ 202
735
+ ],
736
+ "page_idx": 7
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "4.2 TRAINING SPEED ",
741
+ "text_level": 1,
742
+ "bbox": [
743
+ 176,
744
+ 223,
745
+ 334,
746
+ 237
747
+ ],
748
+ "page_idx": 7
749
+ },
750
+ {
751
+ "type": "text",
752
+ "text": "In (Kang and McAuley, 2018), it has been shown that SASRec is about 11 times faster than Caser and 17 times faster than $\\mathrm { G R U 4 R e c ^ { + } }$ and achieves much better NDCG $@ 1 0$ results so we did not include Caser and GRU4Rec+ in our comparisons. In Figure 3, we only compare the training speeds and ranking performances among SASRec, SSEPT and SSE- $\\mathrm { P T } { + } { + }$ for Movielens1M dataset. Given that we added additional user embeddings into our SSE-PT model, it is expected that it will take slightly longer to train our model than un-personalized SASRec. We find empirically that training speed of the SSE-PT and SSE$\\mathrm { P T } { + } { + }$ model are comparable to that of SASRec, with SSE$\\mathrm { P T } { + } { + }$ being the fastest and the best performing model. It is clear that our SSE-PT and $\\mathrm { S S E – P T + + }$ achieve much better ranking performances than our baseline SASRec using the same training time. ",
753
+ "bbox": [
754
+ 174,
755
+ 251,
756
+ 550,
757
+ 473
758
+ ],
759
+ "page_idx": 7
760
+ },
761
+ {
762
+ "type": "image",
763
+ "img_path": "images/260c5cb5effa1da2b0db12d279620459426225bbe23a0eae5bf094562d70f44c.jpg",
764
+ "image_caption": [
765
+ "Figure 3: Illustration of the speed of SSE-PT "
766
+ ],
767
+ "image_footnote": [],
768
+ "bbox": [
769
+ 566,
770
+ 263,
771
+ 870,
772
+ 428
773
+ ],
774
+ "page_idx": 7
775
+ },
776
+ {
777
+ "type": "text",
778
+ "text": "4.3 ABLATION STUDY ",
779
+ "text_level": 1,
780
+ "bbox": [
781
+ 176,
782
+ 494,
783
+ 339,
784
+ 508
785
+ ],
786
+ "page_idx": 7
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "SSE probability Given the importance of SSE regularization for our SSE-PT model, we carefully examined the SSE probability for input user embedding in Table 7 in Appendix. We find that the appropriate hyper-parameter SSE probability is not very sensitive: anywhere between 0.4 and 1.0 gives good results, better than parameter sharing and not using SSE-SE. This is also evident based on comparison results in Table 3. ",
791
+ "bbox": [
792
+ 174,
793
+ 522,
794
+ 825,
795
+ 592
796
+ ],
797
+ "page_idx": 7
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "Sampling Probability Recall that the sampling probability is unique to our SSE- $\\mathrm { P T } { + } { + }$ model. We show in Table 8 in Appendix using an appropriate sampling probability like $0 . 2 0 . 3$ would allow it to outperform SSE-PT when the same maximum length is used. ",
802
+ "bbox": [
803
+ 174,
804
+ 613,
805
+ 825,
806
+ 655
807
+ ],
808
+ "page_idx": 7
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "Number of Attention Blocks We find for our SSE-PT model, a larger number of attention blocks is preferred. One can easily see in Table 9 in Appendix, the optimal ranking performances are achieved at $B = 4$ or 5 for Movielens1M dataset and at $B = 6$ for Movielens10M dataset. ",
813
+ "bbox": [
814
+ 174,
815
+ 675,
816
+ 825,
817
+ 717
818
+ ],
819
+ "page_idx": 7
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "Personalization and Number of Negatives Sampled Based on the results in Table 10 in Appendix, we are positive that the personalized model always outperforms the un-personalized one when we use the same regularization techniques. This holds true regardless of how many negatives sampled or what ranking metrics are used during evaluation. ",
824
+ "bbox": [
825
+ 174,
826
+ 738,
827
+ 825,
828
+ 794
829
+ ],
830
+ "page_idx": 7
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "5 CONCLUSION ",
835
+ "text_level": 1,
836
+ "bbox": [
837
+ 176,
838
+ 819,
839
+ 318,
840
+ 835
841
+ ],
842
+ "page_idx": 7
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "In this paper, we propose a novel neural network architecture called Personalized Transformer for the temporal collaborative ranking problem. It enjoys the benefits of being a personalized model, therefore achieving better ranking results for individual users than the current state-of-the-art. By examining the attention mechanisms during inference, the model is also more interpretable and tends to pay more attention to recent items in long sequences than un-personalized deep learning models. ",
847
+ "bbox": [
848
+ 174,
849
+ 853,
850
+ 825,
851
+ 924
852
+ ],
853
+ "page_idx": 7
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "REFERENCES ",
858
+ "text_level": 1,
859
+ "bbox": [
860
+ 174,
861
+ 102,
862
+ 287,
863
+ 118
864
+ ],
865
+ "page_idx": 8
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. ",
870
+ "bbox": [
871
+ 173,
872
+ 126,
873
+ 823,
874
+ 155
875
+ ],
876
+ "page_idx": 8
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "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. ",
881
+ "bbox": [
882
+ 171,
883
+ 162,
884
+ 825,
885
+ 194
886
+ ],
887
+ "page_idx": 8
888
+ },
889
+ {
890
+ "type": "text",
891
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. ",
892
+ "bbox": [
893
+ 169,
894
+ 202,
895
+ 823,
896
+ 232
897
+ ],
898
+ "page_idx": 8
899
+ },
900
+ {
901
+ "type": "text",
902
+ "text": "Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016. ",
903
+ "bbox": [
904
+ 171,
905
+ 239,
906
+ 825,
907
+ 270
908
+ ],
909
+ "page_idx": 8
910
+ },
911
+ {
912
+ "type": "text",
913
+ "text": "F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. Acm transactions on interactive intelligent systems (tiis), 5(4):19, 2016. ",
914
+ "bbox": [
915
+ 173,
916
+ 277,
917
+ 825,
918
+ 308
919
+ ],
920
+ "page_idx": 8
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "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, pages 770–778, 2016. ",
925
+ "bbox": [
926
+ 173,
927
+ 315,
928
+ 825,
929
+ 359
930
+ ],
931
+ "page_idx": 8
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "Ruining He, Wang-Cheng Kang, and Julian McAuley. Translation-based recommendation. In Proceedings of the Eleventh ACM Conference on Recommender Systems, pages 161–169. ACM, 2017. ",
936
+ "bbox": [
937
+ 173,
938
+ 367,
939
+ 826,
940
+ 411
941
+ ],
942
+ "page_idx": 8
943
+ },
944
+ {
945
+ "type": "text",
946
+ "text": "Balázs Hidasi and Alexandros Karatzoglou. Recurrent neural networks with top- $\\mathbf { \\nabla } _ { k }$ gains for sessionbased recommendations. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management, pages 843–852. ACM, 2018. ",
947
+ "bbox": [
948
+ 174,
949
+ 420,
950
+ 823,
951
+ 463
952
+ ],
953
+ "page_idx": 8
954
+ },
955
+ {
956
+ "type": "text",
957
+ "text": "Balázs Hidasi, Alexandros Karatzoglou, Linas Baltrunas, and Domonkos Tikk. Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939, 2015. ",
958
+ "bbox": [
959
+ 173,
960
+ 472,
961
+ 823,
962
+ 502
963
+ ],
964
+ "page_idx": 8
965
+ },
966
+ {
967
+ "type": "text",
968
+ "text": "Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. ",
969
+ "bbox": [
970
+ 173,
971
+ 510,
972
+ 825,
973
+ 553
974
+ ],
975
+ "page_idx": 8
976
+ },
977
+ {
978
+ "type": "text",
979
+ "text": "Arthur E Hoerl and Robert W Kennard. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67, 1970. ",
980
+ "bbox": [
981
+ 173,
982
+ 561,
983
+ 823,
984
+ 592
985
+ ],
986
+ "page_idx": 8
987
+ },
988
+ {
989
+ "type": "text",
990
+ "text": "Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. ",
991
+ "bbox": [
992
+ 174,
993
+ 599,
994
+ 823,
995
+ 630
996
+ ],
997
+ "page_idx": 8
998
+ },
999
+ {
1000
+ "type": "text",
1001
+ "text": "Wang-Cheng Kang and Julian McAuley. Self-attentive sequential recommendation. arXiv preprint arXiv:1808.09781, 2018. ",
1002
+ "bbox": [
1003
+ 173,
1004
+ 638,
1005
+ 823,
1006
+ 667
1007
+ ],
1008
+ "page_idx": 8
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
1013
+ "bbox": [
1014
+ 171,
1015
+ 676,
1016
+ 823,
1017
+ 705
1018
+ ],
1019
+ "page_idx": 8
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "Yehuda Koren. Collaborative filtering with temporal dynamics. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 447–456. ACM, 2009. ",
1024
+ "bbox": [
1025
+ 173,
1026
+ 714,
1027
+ 826,
1028
+ 757
1029
+ ],
1030
+ "page_idx": 8
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pages 950–957, 1992. ",
1035
+ "bbox": [
1036
+ 169,
1037
+ 767,
1038
+ 825,
1039
+ 796
1040
+ ],
1041
+ "page_idx": 8
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "Qiao Liu, Yifu Zeng, Refuoe Mokhosi, and Haibin Zhang. Stamp: short-term attention/memory priority model for session-based recommendation. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1831–1839. ACM, 2018. ",
1046
+ "bbox": [
1047
+ 176,
1048
+ 804,
1049
+ 825,
1050
+ 848
1051
+ ],
1052
+ "page_idx": 8
1053
+ },
1054
+ {
1055
+ "type": "text",
1056
+ "text": "Chen Ma, Peng Kang, and Xue Liu. Hierarchical gating networks for sequential recommendation. arXiv preprint arXiv:1906.09217, 2019. ",
1057
+ "bbox": [
1058
+ 173,
1059
+ 856,
1060
+ 823,
1061
+ 886
1062
+ ],
1063
+ "page_idx": 8
1064
+ },
1065
+ {
1066
+ "type": "text",
1067
+ "text": "Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013. ",
1068
+ "bbox": [
1069
+ 173,
1070
+ 895,
1071
+ 821,
1072
+ 924
1073
+ ],
1074
+ "page_idx": 8
1075
+ },
1076
+ {
1077
+ "type": "text",
1078
+ "text": "Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence, pages 452–461. AUAI Press, 2009. ",
1079
+ "bbox": [
1080
+ 176,
1081
+ 103,
1082
+ 823,
1083
+ 146
1084
+ ],
1085
+ "page_idx": 9
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme. Factorizing personalized markov chains for next-basket recommendation. In Proceedings of the 19th international conference on World wide web, pages 811–820. ACM, 2010. ",
1090
+ "bbox": [
1091
+ 178,
1092
+ 155,
1093
+ 821,
1094
+ 196
1095
+ ],
1096
+ "page_idx": 9
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "Badrul Munir Sarwar, George Karypis, Joseph A Konstan, John Riedl, et al. Item-based collaborative filtering recommendation algorithms. Www, 1:285–295, 2001. ",
1101
+ "bbox": [
1102
+ 171,
1103
+ 207,
1104
+ 823,
1105
+ 234
1106
+ ],
1107
+ "page_idx": 9
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Nathan Srebro, Jason Rennie, and Tommi S Jaakkola. Maximum-margin matrix factorization. In Advances in neural information processing systems, pages 1329–1336, 2005. ",
1112
+ "bbox": [
1113
+ 173,
1114
+ 244,
1115
+ 821,
1116
+ 273
1117
+ ],
1118
+ "page_idx": 9
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014. ",
1123
+ "bbox": [
1124
+ 178,
1125
+ 281,
1126
+ 823,
1127
+ 324
1128
+ ],
1129
+ "page_idx": 9
1130
+ },
1131
+ {
1132
+ "type": "text",
1133
+ "text": "Jiaxi Tang and Ke Wang. Personalized top-n sequential recommendation via convolutional sequence embedding. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pages 565–573. ACM, 2018. ",
1134
+ "bbox": [
1135
+ 174,
1136
+ 333,
1137
+ 826,
1138
+ 376
1139
+ ],
1140
+ "page_idx": 9
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996. ",
1145
+ "bbox": [
1146
+ 173,
1147
+ 385,
1148
+ 823,
1149
+ 414
1150
+ ],
1151
+ "page_idx": 9
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017. ",
1156
+ "bbox": [
1157
+ 174,
1158
+ 422,
1159
+ 825,
1160
+ 465
1161
+ ],
1162
+ "page_idx": 9
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Liwei Wu, Cho-Jui Hsieh, and James Sharpnack. Sql-rank: A listwise approach to collaborative ranking. In Proceedings of Machine Learning Research (35th International Conference on Machine Learning), volume 80, 2018. ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 473,
1170
+ 825,
1171
+ 517
1172
+ ],
1173
+ "page_idx": 9
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Liwei Wu, Shuqing Li, Cho-Jui Hsieh, and James Sharpnack. Stochastic shared embeddings: Datadriven regularization of embedding layers. arXiv preprint arXiv:1905.10630, 2019. ",
1178
+ "bbox": [
1179
+ 171,
1180
+ 526,
1181
+ 825,
1182
+ 555
1183
+ ],
1184
+ "page_idx": 9
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "6 APPENDIX ",
1189
+ "text_level": 1,
1190
+ "bbox": [
1191
+ 174,
1192
+ 102,
1193
+ 294,
1194
+ 117
1195
+ ],
1196
+ "page_idx": 10
1197
+ },
1198
+ {
1199
+ "type": "text",
1200
+ "text": "• $\\operatorname { N D C G @ } K$ : defined as: ",
1201
+ "bbox": [
1202
+ 217,
1203
+ 128,
1204
+ 388,
1205
+ 143
1206
+ ],
1207
+ "page_idx": 10
1208
+ },
1209
+ {
1210
+ "type": "equation",
1211
+ "img_path": "images/317c85162633d86a147e2acc1fd5365826812dfb852189392bbd00f6aadf80bd.jpg",
1212
+ "text": "$$\n\\mathrm { N D C G @ } K = \\frac { 1 } { n } \\sum _ { i = 1 } ^ { n } \\frac { \\mathrm { D C G @ } K ( i , \\Pi _ { i } ) } { \\mathrm { D C G @ } K ( i , \\Pi _ { i } ^ { * } ) } ,\n$$",
1213
+ "text_format": "latex",
1214
+ "bbox": [
1215
+ 398,
1216
+ 148,
1217
+ 655,
1218
+ 189
1219
+ ],
1220
+ "page_idx": 10
1221
+ },
1222
+ {
1223
+ "type": "text",
1224
+ "text": "where $i$ represents $i$ -th user and ",
1225
+ "bbox": [
1226
+ 232,
1227
+ 195,
1228
+ 442,
1229
+ 210
1230
+ ],
1231
+ "page_idx": 10
1232
+ },
1233
+ {
1234
+ "type": "equation",
1235
+ "img_path": "images/fb82ff8e4158155b1352d52a59f75227b4703c7765219f1a3d64bc8b001e7c67.jpg",
1236
+ "text": "$$\n\\mathrm { D C G @ } K ( i , \\Pi _ { i } ) = \\sum _ { l = 1 } ^ { K } \\frac { 2 ^ { R _ { i \\Pi _ { i l } } } - 1 } { \\log _ { 2 } ( l + 1 ) } .\n$$",
1237
+ "text_format": "latex",
1238
+ "bbox": [
1239
+ 406,
1240
+ 218,
1241
+ 648,
1242
+ 261
1243
+ ],
1244
+ "page_idx": 10
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "In the DCG definition, $\\Pi _ { i l }$ represents the index of the $l$ -th ranked item for user $i$ in test data based on the learned score matrix $X$ . $R$ is the rating matrix and $R _ { i j }$ is the rating given to item $j$ by user $i$ . $\\Pi _ { i } ^ { * }$ is the ordering provided by the ground truth rating. ",
1249
+ "bbox": [
1250
+ 228,
1251
+ 267,
1252
+ 825,
1253
+ 310
1254
+ ],
1255
+ "page_idx": 10
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "• Recall $@ K$ : defined as a fraction of positive items retrieved by the top $K$ recommendations the model makes: ",
1260
+ "bbox": [
1261
+ 215,
1262
+ 314,
1263
+ 821,
1264
+ 343
1265
+ ],
1266
+ "page_idx": 10
1267
+ },
1268
+ {
1269
+ "type": "equation",
1270
+ "img_path": "images/37adbec7342c6bf12a4621add79b59b321b4b1e36e180d41d327dbe52d27dd44.jpg",
1271
+ "text": "$$\n{ \\mathrm { R e c a l l @ } } K = { \\frac { \\sum _ { i = 1 } ^ { n } \\mathbb { 1 } \\left\\{ \\exists 1 \\leq l \\leq K : R _ { i \\Pi _ { i l } } = 1 \\right\\} } { n } } ,\n$$",
1272
+ "text_format": "latex",
1273
+ "bbox": [
1274
+ 361,
1275
+ 347,
1276
+ 694,
1277
+ 381
1278
+ ],
1279
+ "page_idx": 10
1280
+ },
1281
+ {
1282
+ "type": "text",
1283
+ "text": "here we already assume there is only a single positive item that user will engage next and the indicator function $\\mathbb { 1 } \\{ \\exists 1 \\leq l \\leq k : { R _ { i \\Pi _ { i l } } } = \\hat { 1 } \\}$ is defined to indicate whether the positive item falls into the top $K$ position in our obtained ranked list using scores predicted in (4). ",
1284
+ "bbox": [
1285
+ 230,
1286
+ 386,
1287
+ 825,
1288
+ 429
1289
+ ],
1290
+ "page_idx": 10
1291
+ },
1292
+ {
1293
+ "type": "text",
1294
+ "text": "Layer Normalization Layer normalization (Ba et al., 2016) normalizes neurons within a layer. Previous studies (Ba et al., 2016) show it is more effective than batch normalization for training recurrent neural networks (RNNs). One alternative is the batch normalization (Ioffe and Szegedy, 2015) but we find it does not work as well as the layer normalization in practice even for a reasonable large batch size of 128. Therefore, our SSE-PT model adopts layer normalization. ",
1295
+ "bbox": [
1296
+ 174,
1297
+ 444,
1298
+ 825,
1299
+ 513
1300
+ ],
1301
+ "page_idx": 10
1302
+ },
1303
+ {
1304
+ "type": "text",
1305
+ "text": "Residual Connections Residual connections are firstly proposed in ResNet for image classification problems (He et al., 2016). Recent research finds that residual connections can help training very deep neural networks even if they are not convolutional neural networks (Vaswani et al., 2017). Using residual connections allows us to train very deep neural networks here. For example, the best performing model for Movielens10M dataset in Table 9 is the SSE-PT with 6 attention blocks, in which $1 + 6 * 3 + 1 = 2 0$ layers are trained end-to-end. ",
1306
+ "bbox": [
1307
+ 174,
1308
+ 529,
1309
+ 825,
1310
+ 613
1311
+ ],
1312
+ "page_idx": 10
1313
+ },
1314
+ {
1315
+ "type": "text",
1316
+ "text": "Weight Decay Weight decay (Krogh and Hertz, 1992), also known as $l _ { 2 }$ regularization (Hoerl and Kennard, 1970), is applied to all embeddings, including both user and item embeddings. ",
1317
+ "bbox": [
1318
+ 173,
1319
+ 628,
1320
+ 823,
1321
+ 659
1322
+ ],
1323
+ "page_idx": 10
1324
+ },
1325
+ {
1326
+ "type": "text",
1327
+ "text": "Dropout Dropout (Srivastava et al., 2014) is applied to the embedding layer $E$ , self-attention layer and pointwise feed-forward layer by stochastically dropping some percentage of hidden units to prevent co-adaption of neurons. Dropout has been shown to be an effective way of regularizing deep learning models. ",
1328
+ "bbox": [
1329
+ 174,
1330
+ 672,
1331
+ 825,
1332
+ 729
1333
+ ],
1334
+ "page_idx": 10
1335
+ },
1336
+ {
1337
+ "type": "text",
1338
+ "text": "In summary, layer normalization and dropout are used in all layers except prediction layer. Residual connections are used in both self-attention layer and pointwise feed-forward layer. SSE-SE is used in embedding layer and prediction layer. ",
1339
+ "bbox": [
1340
+ 174,
1341
+ 736,
1342
+ 825,
1343
+ 779
1344
+ ],
1345
+ "page_idx": 10
1346
+ },
1347
+ {
1348
+ "type": "table",
1349
+ "img_path": "images/d3bd2f179d888ba34d2ea22cc30171b2a8d34d2b64f51e9308e75ca523817013.jpg",
1350
+ "table_caption": [
1351
+ "Table 4: Description of Datasets Used in Evaluations. "
1352
+ ],
1353
+ "table_footnote": [],
1354
+ "table_body": "<table><tr><td>DATASET</td><td>#USERS</td><td>#ITEMS</td><td>AVG SEQUENCELEN</td><td>MAX SEQUENCE LEN</td></tr><tr><td>BEAUTY</td><td>52,024</td><td>57,289</td><td>7.6</td><td>291</td></tr><tr><td>GAMES</td><td>31,013</td><td>23,715</td><td>7.3</td><td>858</td></tr><tr><td>STEAM</td><td>334,730</td><td>13,047</td><td>11.0</td><td>1,229</td></tr><tr><td>ML-1M</td><td>6,040</td><td>3,416</td><td>163.5</td><td>2,275</td></tr><tr><td>ML-10M</td><td>69,878</td><td>65,133</td><td>141.1</td><td>7,357</td></tr></table>",
1355
+ "bbox": [
1356
+ 240,
1357
+ 823,
1358
+ 753,
1359
+ 916
1360
+ ],
1361
+ "page_idx": 10
1362
+ },
1363
+ {
1364
+ "type": "table",
1365
+ "img_path": "images/fa0500a7631b415c1127f6fc9bec260569215307b568f3dce2e419c104e714c1.jpg",
1366
+ "table_caption": [
1367
+ "Table 5: Comparing our SSE-PT, SSE- $\\mathrm { P T } { + } { + }$ with SASRec on Movielen1M dataset. We use number of negatives $C = 1 0 0$ , dropout probability of 0.2 and learning rate of $1 e ^ { - 3 }$ for all experiments while varying others. $p _ { u } , p _ { i } , p _ { u }$ are SSE probabilities for user embedding, input item embedding and output item embedding respectively. "
1368
+ ],
1369
+ "table_footnote": [],
1370
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">Movielens1m</td><td colspan=\"2\">Dimensions</td><td colspan=\"2\">Number of Blocks</td><td colspan=\"3\">Sampling Probability SSE-SE Parameters</td></tr><tr><td>NDCG@10</td><td>Recall@10</td><td>du</td><td>di</td><td>b</td><td>ps</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.5961</td><td>0.8195</td><td>-</td><td>50</td><td>2</td><td></td><td>-</td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5941</td><td>0.8182</td><td>-</td><td>100</td><td>2</td><td></td><td></td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5996</td><td>0.8272</td><td>-</td><td>100</td><td>6</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>SSE-PT</td><td>0.6101</td><td>0.8343</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0</td></tr><tr><td>SSE-PT</td><td>0.6164</td><td>0.8336</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5832</td><td>0.8091</td><td>50</td><td>50</td><td>2</td><td></td><td>0</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6174</td><td>0.8351</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5949</td><td>0.8205</td><td>75</td><td>25</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6214</td><td>0.8359</td><td>25</td><td>75</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>50</td><td>100</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>50</td><td>100</td><td>2</td><td>0.3</td><td>0.92</td><td>0.1</td><td>0.1</td></tr></table>",
1371
+ "bbox": [
1372
+ 174,
1373
+ 159,
1374
+ 823,
1375
+ 330
1376
+ ],
1377
+ "page_idx": 11
1378
+ },
1379
+ {
1380
+ "type": "table",
1381
+ "img_path": "images/cc4236dfc52b8690f773e7476d16007ed359a5cad4f029112962e268f1c3d836.jpg",
1382
+ "table_caption": [
1383
+ "Table 6: Comparing our SSE-PT with SASRec on Movielens10M dataset. Unlike Table 5, we use the number of negatives $C = 5 0 0$ instead of 100 as $C = 1 0 0$ is too easy for this dataset and it gets too difficult to tell the differences between different methods: Hit Ratio $@ 1 0$ approaches 1. "
1384
+ ],
1385
+ "table_footnote": [],
1386
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td colspan=\"2\">Movielens1m</td><td colspan=\"2\">Dimensions</td><td colspan=\"2\">Number of Blocks</td><td colspan=\"3\">SSE-SE Parameters</td></tr><tr><td>Model NDCG@10</td><td>Hit Ratio@10</td><td>d</td><td>di</td><td></td><td>b</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.7268</td><td>0.9429</td><td>-</td><td>50</td><td>2</td><td></td><td>1</td><td>-</td><td>1</td></tr><tr><td>SASRec</td><td>0.7413</td><td>0.9474</td><td>1</td><td>100</td><td>2</td><td></td><td>1</td><td>1</td><td>1</td></tr><tr><td>SSE-PT</td><td>0.7199</td><td>0.9331</td><td>50</td><td>100</td><td>2</td><td></td><td>PS</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7169</td><td>0.9296</td><td>50</td><td>100</td><td>2</td><td></td><td>0.0</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7398</td><td>0.9418</td><td>50</td><td>100</td><td>2</td><td></td><td>0.2</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7500</td><td>0.9500</td><td>50</td><td>100</td><td>2</td><td></td><td>0.4</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7484</td><td>0.9480</td><td>50</td><td>100</td><td></td><td>2</td><td>0.6</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7529</td><td>0.9485</td><td>50</td><td>100</td><td></td><td>2</td><td>0.8</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7503</td><td>0.9505</td><td>50</td><td>100</td><td></td><td>2</td><td>1.0</td><td>0.01</td><td>0.01</td></tr></table>",
1387
+ "bbox": [
1388
+ 207,
1389
+ 398,
1390
+ 787,
1391
+ 554
1392
+ ],
1393
+ "page_idx": 11
1394
+ },
1395
+ {
1396
+ "type": "text",
1397
+ "text": "• PopRec: ranking items according to their popularity. ",
1398
+ "bbox": [
1399
+ 217,
1400
+ 569,
1401
+ 576,
1402
+ 584
1403
+ ],
1404
+ "page_idx": 11
1405
+ },
1406
+ {
1407
+ "type": "text",
1408
+ "text": "• BPR: Bayesian personalized ranking for implicit feedback setting (Rendle et al., 2009). It is a low-rank matrix factorization model with a pairwise loss function. But it does not utilize the temporal information. Therefore, it serves as a strong baseline for non-temporal methods. ",
1409
+ "bbox": [
1410
+ 215,
1411
+ 589,
1412
+ 825,
1413
+ 643
1414
+ ],
1415
+ "page_idx": 11
1416
+ },
1417
+ {
1418
+ "type": "text",
1419
+ "text": "• FMC: Factorized Markov Chains: a first-order Markov Chain method, in which predictions are made only based on previously engaged item. ",
1420
+ "bbox": [
1421
+ 215,
1422
+ 650,
1423
+ 823,
1424
+ 679
1425
+ ],
1426
+ "page_idx": 11
1427
+ },
1428
+ {
1429
+ "type": "text",
1430
+ "text": "• PFMC: a personalized Markov chain model (Rendle et al., 2010) that combines matrix factorization and first-order Markov Chain to take advantage of both users’ latent long-term preferences as well as short-term item transitions. ",
1431
+ "bbox": [
1432
+ 215,
1433
+ 684,
1434
+ 821,
1435
+ 727
1436
+ ],
1437
+ "page_idx": 11
1438
+ },
1439
+ {
1440
+ "type": "text",
1441
+ "text": "• TransRec: a first-order sequential recommendation method (He et al., 2017) in which items are embedded into a transition space and users are modelled as translation vectors operating on item sequences. ",
1442
+ "bbox": [
1443
+ 214,
1444
+ 731,
1445
+ 823,
1446
+ 773
1447
+ ],
1448
+ "page_idx": 11
1449
+ },
1450
+ {
1451
+ "type": "text",
1452
+ "text": "SQL-Rank (Wu et al., 2018) and item-based recommendations (Sarwar et al., 2001) are omitted because the former is similar to BPR (Rendle et al., 2009) except using the listwise loss function instead of the pairwise loss function and the latter has been shown inferior to TransRec (He et al., 2017). ",
1453
+ "bbox": [
1454
+ 176,
1455
+ 787,
1456
+ 826,
1457
+ 843
1458
+ ],
1459
+ "page_idx": 11
1460
+ },
1461
+ {
1462
+ "type": "text",
1463
+ "text": "6.0.1 DEEP-LEARNING BASELINES ",
1464
+ "text_level": 1,
1465
+ "bbox": [
1466
+ 176,
1467
+ 861,
1468
+ 428,
1469
+ 875
1470
+ ],
1471
+ "page_idx": 11
1472
+ },
1473
+ {
1474
+ "type": "text",
1475
+ "text": "• GRU4Rec: the first RNN-based method proposed for the session-based recommendation problem (Hidasi et al., 2015). It utilizes the GRU structures (Chung et al., 2014) initially proposed for speech modelling. ",
1476
+ "bbox": [
1477
+ 217,
1478
+ 882,
1479
+ 823,
1480
+ 924
1481
+ ],
1482
+ "page_idx": 11
1483
+ },
1484
+ {
1485
+ "type": "text",
1486
+ "text": "• GRU4Rec+: follow-up work of GRU4Rec by the same authors: the model has a very similar architecture to GRU4Rec but has a more complicated loss function (Hidasi and Karatzoglou, 2018). ",
1487
+ "bbox": [
1488
+ 217,
1489
+ 103,
1490
+ 825,
1491
+ 145
1492
+ ],
1493
+ "page_idx": 12
1494
+ },
1495
+ {
1496
+ "type": "text",
1497
+ "text": "• Caser: a CNN-based method (Tang and Wang, 2018) which embeds a sequence of recent items in both time and latent spaces forming an ‘image’ before learning local features through horizontal and vertical convolutional filters. In (Tang and Wang, 2018), user embeddings are included in the prediction layer only. On the contrast, in our Personalized Transformer, user embeddings are also introduced in the lowest embedding layer so they can play an important role in self-attention mechanisms as well as in prediction stages. ",
1498
+ "bbox": [
1499
+ 217,
1500
+ 150,
1501
+ 823,
1502
+ 233
1503
+ ],
1504
+ "page_idx": 12
1505
+ },
1506
+ {
1507
+ "type": "text",
1508
+ "text": "• STAMP: a session-based recommendation algorithm (Liu et al., 2018) using attention mechanism. (Liu et al., 2018) only uses fully connected layers with one attention block that is not self-attentive. ",
1509
+ "bbox": [
1510
+ 217,
1511
+ 238,
1512
+ 823,
1513
+ 280
1514
+ ],
1515
+ "page_idx": 12
1516
+ },
1517
+ {
1518
+ "type": "text",
1519
+ "text": "• SASRec: a self-attentive sequential recommendation method (Kang and McAuley, 2018) motivated by Transformer in NLP (Vaswani et al., 2017). Unlike our method SSE-PT, SASRec does not incorporate user embedding and therefore is not a personalized method. SASRec paper (Kang and McAuley, 2018) also does not utilize SSE (Wu et al., 2019) for further regularization: only dropout and weight decay are used. ",
1520
+ "bbox": [
1521
+ 217,
1522
+ 285,
1523
+ 821,
1524
+ 354
1525
+ ],
1526
+ "page_idx": 12
1527
+ },
1528
+ {
1529
+ "type": "text",
1530
+ "text": "• HGN: hierarchical gating networks method to solve the sequential recommendation problem (Ma et al., 2019), which incorporates the user embeddings and gating networks for better personalization than the SASRec model. ",
1531
+ "bbox": [
1532
+ 218,
1533
+ 359,
1534
+ 821,
1535
+ 401
1536
+ ],
1537
+ "page_idx": 12
1538
+ },
1539
+ {
1540
+ "type": "table",
1541
+ "img_path": "images/43b5399df936642f0c0b62b6fd4b9dd03dd36dd13d49ee2d065dbb06de235503.jpg",
1542
+ "table_caption": [
1543
+ "Table 7: Comparing Different SSE probability for user embeddings for SSE-PT on Movielens1M Dataset. Embedding hidden units of 50 for users and 100 for items, attention blocks of 2, SSE probability of 0.01 for item embeddings, dropout probability of 0.2 and max length of 200 are used. "
1544
+ ],
1545
+ "table_footnote": [],
1546
+ "table_body": "<table><tr><td>USER-SIDE SSE-SE PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>PARAMETER SHARING</td><td>0.6188</td><td>0.8294</td></tr><tr><td>1.0</td><td>0.6258</td><td>0.8346</td></tr><tr><td>0.9</td><td>0.6275</td><td>0.8321</td></tr><tr><td>0.8</td><td>0.6244</td><td>0.8359</td></tr><tr><td>0.6</td><td>0.6256</td><td>0.8341</td></tr><tr><td>0.4</td><td>0.6237</td><td>0.8369</td></tr><tr><td>0.2</td><td>0.6163</td><td>0.8281</td></tr><tr><td>0.0</td><td>0.5908</td><td>0.8048</td></tr></table>",
1547
+ "bbox": [
1548
+ 240,
1549
+ 479,
1550
+ 753,
1551
+ 640
1552
+ ],
1553
+ "page_idx": 12
1554
+ },
1555
+ {
1556
+ "type": "table",
1557
+ "img_path": "images/e6c6dc2c28957b7464b44bf7ffe1f9df97035bd6daa76b591cfa2dc6e0ff0951.jpg",
1558
+ "table_caption": [
1559
+ "Table 8: Comparing Different Sampling Probability, $p _ { s }$ , of SSE- $\\mathrm { P T } { + } { + }$ on Movielens1M Dataset. Hyper-parameters the same as Table 7, except that the max length $T$ allowed is set 100 instead of 200 to show effects of sampling sequences. "
1560
+ ],
1561
+ "table_footnote": [],
1562
+ "table_body": "<table><tr><td>SAMPLING PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>SASREC (T: =100)</td><td>0.5769</td><td>0.8045</td></tr><tr><td>SSE-PT(T: = 100)</td><td>0.6142</td><td>0.8212</td></tr><tr><td>1.0</td><td>0.5697</td><td>0.7977</td></tr><tr><td>0.8</td><td>0.5735</td><td>0.7801</td></tr><tr><td>0.6</td><td>0.6062</td><td>0.8242</td></tr><tr><td>0.4</td><td>0.6113</td><td>0.8273</td></tr><tr><td>0.3</td><td>0.6186</td><td>0.8318</td></tr><tr><td>0.2</td><td>0.6193</td><td>0.8233</td></tr><tr><td>0.0</td><td>0.6142</td><td>0.8212</td></tr></table>",
1563
+ "bbox": [
1564
+ 303,
1565
+ 726,
1566
+ 687,
1567
+ 878
1568
+ ],
1569
+ "page_idx": 12
1570
+ },
1571
+ {
1572
+ "type": "table",
1573
+ "img_path": "images/fd118e8b9ec4a957230a03aa25acc5def9d98c881752676eabd392f0d0eb3e42.jpg",
1574
+ "table_caption": [
1575
+ "Table 9: Comparing Different Number of Blocks for SSE-PT while Keeping The Rest Fixed on Movielens1M and Movielens10M Datasets. "
1576
+ ],
1577
+ "table_footnote": [],
1578
+ "table_body": "<table><tr><td>DATASETS</td><td># OF BLOCKS</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td rowspan=\"7\">MOVIELENS1M</td><td>SASREC (6 BLOCKS)</td><td>0.5984</td><td>0.8207</td></tr><tr><td>1</td><td>0.6162</td><td>0.8301</td></tr><tr><td>2</td><td>0.6280</td><td>0.8365</td></tr><tr><td>3</td><td>0.6293</td><td>0.8376</td></tr><tr><td>4</td><td>0.6270</td><td>0.8401</td></tr><tr><td>5</td><td>0.6308</td><td>0.8361</td></tr><tr><td>6</td><td>0.6270</td><td>0.8397</td></tr><tr><td rowspan=\"6\">MOVIELENS10M</td><td>SASREC(6 BLOCKS)</td><td>0.7531</td><td>0.9490</td></tr><tr><td>1</td><td>0.7454</td><td>0.9478</td></tr><tr><td>2</td><td>0.7512</td><td>0.9522</td></tr><tr><td>3</td><td>0.7543</td><td>0.9491</td></tr><tr><td>4</td><td>0.7608</td><td>0.9485</td></tr><tr><td>5</td><td>0.7619</td><td>0.9524</td></tr><tr><td></td><td>6</td><td>0.7683</td><td>0.9537</td></tr></table>",
1579
+ "bbox": [
1580
+ 303,
1581
+ 247,
1582
+ 687,
1583
+ 428
1584
+ ],
1585
+ "page_idx": 13
1586
+ },
1587
+ {
1588
+ "type": "table",
1589
+ "img_path": "images/5ccecf4fa2a3356fb87de4ad7ce3b3b6f160d7ceda850f35273ae723df305e4b.jpg",
1590
+ "table_caption": [
1591
+ "Table 10: Varying number of negatives $C$ in evaluation on Movielens1M dataset. Other hyperparameters are fixed for a fair comparison. "
1592
+ ],
1593
+ "table_footnote": [],
1594
+ "table_body": "<table><tr><td>METRIC</td><td>NDCG@10</td><td>RECALL @10</td><td>C</td></tr><tr><td>UN-PERSONALIZED</td><td>0.3787</td><td>0.6119</td><td>500</td></tr><tr><td>PERSONALIZED</td><td>0.3846</td><td>0.6171</td><td>500</td></tr><tr><td>UN-PERSONALIZED</td><td>0.2791</td><td>0.4781</td><td>1000</td></tr><tr><td>PERSONALIZED</td><td>0.2860</td><td>0.4929</td><td>1000</td></tr><tr><td>UN-PERSONALIZED</td><td>0.1939</td><td>0.3515</td><td>2000</td></tr><tr><td>PERSONALIZED</td><td>0.1993</td><td>0.3667</td><td>2000</td></tr></table>",
1595
+ "bbox": [
1596
+ 303,
1597
+ 695,
1598
+ 689,
1599
+ 810
1600
+ ],
1601
+ "page_idx": 13
1602
+ }
1603
+ ]
parse/train/HkeuD34KPH/HkeuD34KPH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkeuD34KPH/HkeuD34KPH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkxjYoCqKX/HkxjYoCqKX.md ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RELAXED QUANTIZATION FOR DISCRETIZED NEURAL NETWORKS
2
+
3
+ Christos Louizos∗ University of Amsterdam TNO Intelligent Imaging c.louizos@uva.nl
4
+
5
+ Matthias Reisser QUVA Lab University of Amsterdam m.reisser@uva.nl
6
+
7
+ Tijmen Blankevoort Qualcomm AI Research tijmen@qti.qualcomm.com
8
+
9
+ Efstratios Gavves QUVA Lab University of Amsterdam egavves@uva.nl
10
+
11
+ Max Welling
12
+ University of Amsterdam Qualcomm
13
+ m.welling@uva.nl
14
+
15
+ # ABSTRACT
16
+
17
+ Neural network quantization has become an important research area due to its great impact on deployment of large models on resource constrained devices. In order to train networks that can be effectively discretized without loss of performance, we introduce a differentiable quantization procedure. Differentiability can be achieved by transforming continuous distributions over the weights and activations of the network to categorical distributions over the quantization grid. These are subsequently relaxed to continuous surrogates that can allow for efficient gradient-based optimization. We further show that stochastic rounding can be seen as a special case of the proposed approach and that under this formulation the quantization grid itself can also be optimized with gradient descent. We experimentally validate the performance of our method on MNIST, CIFAR 10 and Imagenet classification.
18
+
19
+ # 1 INTRODUCTION
20
+
21
+ Neural networks excel in a variety of large scale problems due to their highly flexible parametric nature. However, deploying big models on resource constrained devices, such as mobile phones, drones or IoT devices is still challenging because they require a large amount of power, memory and computation. Neural network compression is a means to tackle this issue and has therefore become an important research topic.
22
+
23
+ Neural network compression can be, roughly, divided into two not mutually exclusive categories: pruning and quantization. While pruning (LeCun et al., 1990; Han et al., 2015) aims to make the model “smaller” by altering the architecture, quantization aims to reduce the precision of the arithmetic operations in the network. In this paper we focus on the latter. Most network quantization methods either simulate or enforce discretization of the network during training, e.g. via rounding of the weights and activations. Although seemingly straighforward, the discontinuity of the discretization makes the gradient-based optimization infeasible. The reason is that there is no gradient of the loss with respect to the parameters. A workaround to the discontinuity are the “pseudo-gradients” according to the straight-through estimator (Bengio et al., 2013), which have been successfully used for training low-bit width architectures at e.g. Hubara et al. (2016); Zhu et al. (2016).
24
+
25
+ The purpose of this work is to introduce a novel quantization procedure, Relaxed Quantization (RQ). RQ can bypass the non-differentiability of the quantization operation during training by smoothing it appropriately. The contributions of this paper are four-fold: First, we show how to make the set of quantization targets part of the training process such that we can optimize them with gradient descent. Second, we introduce a way to discretize the network by converting distributions over the weights and activations to categorical distributions over the quantization grid. Third, we show that we can obtain a “smooth” quantization procedure by replacing the categorical distributions with concrete (Maddison et al., 2016; Jang et al., 2016) equivalents. Finally we show that stochastic rounding (Gupta et al., 2015), one of the most popular quantization techniques, can be seen as a special case of the proposed framework. We present the details of our approach in Section 2, discuss related work in Section 3 and experimentally validate it in Section 4. Finally we conclude and provide fruitful directions for future research in Section 5.
26
+
27
+ ![](images/7bf04f3575778fc04522f823ee1e5f467c4d201da2b0e38916ddf1badaa8d384.jpg)
28
+ Figure 1: The proposed discretization process. (a) Given a distribution $p ( \tilde { x } )$ over the real line we partition it into $K$ intervals of width $\alpha$ where the center of each of the intervals is a grid point $g _ { i }$ . The shaded area corresponds to the probability of $\tilde { x }$ falling inside the interval containing that specific $g _ { i }$ . (b) Categorical distribution over the grid obtained after discretization. The probability of each of the grid points $g _ { i }$ is equal to the probability of $\tilde { x }$ falling inside their respective intervals.
29
+
30
+ # 2 RELAXED QUANTIZATION FOR DISCRETIZING NEURAL NETWORKS
31
+
32
+ The central element for the discretization of weights and activations of a neural network is a quantizer $q ( \cdot )$ . The quantizer receives a (usually) continous signal as input and discretizes it to a countable set of values. This process is inherently lossy and non-invertible: given the output of the quantizer, it is impossible to determine the exact value of the input. One of the simplest quantizers is the rounding function:
33
+
34
+ $$
35
+ q ( x ) = \alpha \left\lfloor { \frac { x } { \alpha } } + { \frac { 1 } { 2 } } \right\rfloor ,
36
+ $$
37
+
38
+ where $\alpha$ corresponds to the step size of the quantizer. With $\alpha = 1$ , the quantizer rounds $x$ to its nearest integer number.
39
+
40
+ Unfortunately, we cannot simply apply the rounding quantizer to discretize the weights and activations of a neural network. Because of the quantizers’ lossy and non-invertible nature, important information might be destroyed and lead to a decrease in accuracy. To this end, it is preferable to train the neural network while simulating the effects of quantization during the training procedure. This encourages the weights and activations to be robust to quantization and therefore decreases the performance gap between a full-precision neural network and its discretized version.
41
+
42
+ However, the aforementioned rounding process is non-differentiable. As a result, we cannot directly optimize the discretized network with stochastic gradient descent, the workhorse of neural network optimization. In this work, we posit a “smooth” quantizer as a possible way for enabling gradient based optimization.
43
+
44
+ # 2.1 LEARNING (FIXED POINT) QUANTIZERS VIA GRADIENT DESCENT
45
+
46
+ The proposed quantizer comprises four elements: a vocabulary, its noise model and the resulting discretization procedure, as well as a final relaxation step to enable gradient based optimization.
47
+
48
+ The first element of the quantizer is the vocabulary: it is the set of (countable) output values that the quantizer can produce. In our case, this vocabulary has an inherent structure, as it is a grid of ordered
49
+
50
+ scalars. For fixed point quantization the grid $\mathcal { G }$ is defined as
51
+
52
+ $$
53
+ \mathcal { G } = \left[ - 2 ^ { b - 1 } , \ldots , 0 , \ldots , 2 ^ { b - 1 } - 1 \right] ,
54
+ $$
55
+
56
+ where $b$ is the number of available bits that allow for $K = 2 ^ { b }$ possible integer values. By construction this grid of values is agnostic to the input signal $x$ and hence suboptimal; to allow for the grid to adapt to $x$ we introduce two free parameters, a scale $\alpha$ and an offset $\beta$ . This leads to a learnable grid via $\hat { \mathcal { G } } = \alpha \mathcal { G } + \beta$ that can adapt to the range and location of the input signal.
57
+
58
+ The second element of the quantizer is the assumption about the input noise $\epsilon$ ; it determines how probable it is for a specific value of the input signal to move to each grid point. Adding noise to $x$ will result in a quantizer that is, on average, a smooth function of its input. In essense, this is an application of variational optimization (Staines & Barber, 2012) to the non-differentiable rounding function, which enables us to do gradient based optimization.
59
+
60
+ We model this form of noise as acting additively to the input signal $x$ and being governed by a distribution $p ( \epsilon )$ . This process induces a distribution $p ( \tilde { x } )$ where $\tilde { x } = x + \epsilon$ . In the next step of the quantization procedure, we discretize $p ( \tilde { x } )$ according to the quantization grid $\hat { \mathcal G }$ ; this neccesitates the evaluation of the cumulative distribution function (CDF). For this reason, we will assume that the noise is distributed according to a zero mean logistic distribution with a standard deviation $\sigma$ , i.e. $L ( 0 , \sigma )$ , hence leading to $p ( \bar { \tilde { x } } ) = L ( x , \sigma )$ . The CDF of the logistic distribution is the sigmoid function which is easy to evaluate and backpropagate through. Using Gaussian distributions proved to be less effective in preliminary experiments. Other distributions are conceivable and we will briefly discuss the choice of a uniform distribution in Section 2.3.
61
+
62
+ The third element is, given the aforementioned assumptions, how the quantizer determines an appropriate assignment for each realization of the input signal $x$ . Due to the stochastic nature of $\tilde { x }$ , a deterministic round-to-nearest operation will result in a stochastic quantizer for $x$ . Quantizing $x$ in this manner corresponds to discretizing $p ( \tilde { x } )$ onto $\hat { \mathcal G }$ and then sampling grid points $g _ { i }$ from it. More specifically, we construct a categorical distribution over the grid by adopting intervals of width equal to $\alpha$ centered at each of the grid points. The probability of selecting that particular grid point will now be equal to the probability of $\tilde { x }$ falling inside those intervals:
63
+
64
+ $$
65
+ \begin{array} { r l } & { p ( \hat { x } = g _ { i } | x , \sigma ) = P ( \tilde { x } \leq ( g _ { i } + \alpha / 2 ) ) - P ( \tilde { x } < ( g _ { i } - \alpha / 2 ) ) ) } \\ & { \qquad = \mathrm { S i g m o i d } ( ( g _ { i } + \alpha / 2 - x ) / \sigma ) - \mathrm { S i g m o i d } ( ( g _ { i } - \alpha / 2 - x ) / \sigma ) , } \end{array}
66
+ $$
67
+
68
+ where $\hat { x }$ corresponds to the quantized variable, $P ( \cdot )$ corresponds to the CDF and the step from Equation 2 to Equation 3 is due to the logistic noise assumption. A visualization of the aforementioned process can be seen in Figure 1. For the first and last grid point we will assume that they reside within $( g _ { 0 } - \alpha / 2 , g _ { 0 } + \alpha / 2 ]$ and $\left( g _ { K } - \alpha / 2 , g _ { K } + \alpha / 2 \right]$ respectively. Under this assumption we will have to truncate $p ( \tilde { x } )$ such that it only has support within $\left( g _ { 0 } - \alpha / 2 , g _ { K } + \alpha / 2 \right]$ . Fortunately this is easy to do, as it corresponds to just a simple modification of the CDF:
69
+
70
+ $$
71
+ P ( \tilde { x } \le c | \tilde { x } \in ( g _ { 0 } - \alpha / 2 , g _ { K } + \alpha / 2 ] ) = \frac { P ( \tilde { x } \le c ) - P ( \tilde { x } < ( g _ { 0 } - \alpha / 2 ) ) } { P ( \tilde { x } \le ( g _ { K } + \alpha / 2 ) ) - P ( \tilde { x } < ( g _ { 0 } - \alpha / 2 ) ) } .
72
+ $$
73
+
74
+ Armed with this categorical distribution over the grid, the quantizer proceeds to assign a specific grid value to $\hat { x }$ by drawing a random sample. This procedure emulates quantization noise, which prevents the model from fitting the data. This noise can be reduced in two ways: by clustering the weights and activations around the points of the grid and by reducing the logistic noise $\sigma$ . As $\sigma 0$ , the CDF converges towards the step function, prohibiting gradient flow. On the other hand, if $\epsilon$ is too high, the optimization procedure is very noisy, prohibiting convergence. For this reason, during optimization we initialize $\sigma$ in a sensible range, such that $L ( x , \sigma )$ covers a significant portion of the grid. Please confer Appendix A for details. We then let $\sigma$ be freely optimized via gradient descent such that the loss is minimized. Both effects reduce the gap between the function that the neural network computes during training time vs. test time. We illustrate this in Figure 2.
75
+
76
+ The fourth element of the procedure is the relaxation of the non-differentiable categorical distribution sampling. While we can use an unbiased gradient estimator via REINFORCE (Williams, 1992), we opt for a continuous relaxation due to high variances with REINFORCE. This is achieved by replacing the categorical distribution with a concrete distribution (Maddison et al., 2016; Jang et al., 2016). This relaxation procedure corresponds to adopting a “smooth” categorical distribution that can be seen as a “noisy” softmax. Let $\pi _ { i }$ be the categorical probability of sampling grid point $i$ , i.e. $\pi _ { i } = p ( { \hat { x } } = g _ { i } )$ ; the “smoothed” quantized value $\hat { x }$ can be obtained via:
77
+
78
+ ![](images/c6c6c00b30e56119f87c59acbac42f6924682523cf9f8b29eba7ebd39fbd06e5.jpg)
79
+ Figure 2: Best viewed in color. Illustration of the inductive bias obtained via training with the proposed quantizer; means of the logistic distribution over the weights for each layer of the LeNet-5 when trained with 2 bits per weight and activation. Each color corresponds to an assignment to a particular grid point and the vertical dashed lines correspond to the grid points $\beta = 0$ ). We can clearly see that the real valued weights are naturally encouraged through training to cluster into multiple modes, one for each grid point. It should also be mentioned, that for the right and leftmost grid points the probability of selecting them is maximized by moving the corresponding weight furthest right or left respectively. Interestingly, we observe that the network converged to ternary weights for the input and (almost) binary weights for the output layer.
80
+
81
+ $$
82
+ u _ { i } \sim \mathrm { G u m b e l } ( 0 , 1 ) , \qquad z _ { i } = \frac { \exp ( ( \log \pi _ { i } + u _ { i } ) / \lambda ) } { \sum _ { j } \exp ( ( \log \pi _ { j } + u _ { j } ) / \lambda ) } , \qquad \hat { x } = \sum _ { i = 1 } ^ { K } z _ { i } g _ { i } ,
83
+ $$
84
+
85
+ where $z _ { i }$ is the random sample from the concrete distribution and $\lambda$ is a temperature parameter that controls the degree of approximation, since as $\lambda 0$ the concrete distribution becomes a categorical.
86
+
87
+ We have thus defined a fully differentiable “soft” quantization procedure that allows for stochastic gradients for both the quantizer parameters $\alpha , \beta , \sigma$ as well as the input signal $x$ (e.g. the weights or the activations of a neural network). We refer to this algorithm as Relaxed Quantization (RQ). We summarize its forward pass as performed during training in Algorithm 1. It is also worthwhile to notice that if there were no noise at the input $x$ then the categorical distribution would have non-zero mass only at a single value, thus prohibiting gradient based optimization for $x$ and $\sigma$ .
88
+
89
+ One drawback of this approach is that the smoothed quantized values defined in Equation 5 do not have to coincide with grid points, as $z$ is not a one-hot vector. Instead, these values can lie anywhere between the smallest and largest grid point, something which is impossible with e.g. stochastic rounding (Gupta et al., 2015). In order to make sure that only grid-points are sampled, we propose an alternative algorithm RQ ST in which we use the variant of the straight-through (ST) estimator proposed in Jang et al. (2016). Here we sample the actual categorical distribution during the forward pass but assume a sample from the concrete distribution for the backward pass. While this gradient estimator is obviously biased, in practice it works as the “gradients” seem to point towards a valid direction. This effect was also recently studied at Yin et al. (2019). We perform experiments with both variants.
90
+
91
+ After convergence, we can obtain a “hard” quantization procedure, i.e. select points from the grid, at test time by either reverting to a categorical distribution (instead of the continuous surrogate) or by rounding to the nearest grid point. In this paper we chose the latter as it is more aligned with the low-resource environments in which quantized models will be deployed. Furthermore, with this goal in mind, we employ two quantization grids with their own learnable scalar $\alpha , \sigma$ (and potentially $\beta$ ) parameters for each layer; one for the weights and one for the activations.
92
+
93
+ # 2.2 SCALABLE QUANTIZATION VIA A LOCAL GRID
94
+
95
+ Sampling $\hat { x }$ based on drawing $K$ random numbers for the concrete distribution as described in Equation 5 can be very expensive for larger values of $K$ . Firstly, drawing $K$ random numbers for every individual weight and activation in a neural network drastically increases the number of operations required in the forward pass. Secondly, it also requires keeping many more numbers in memory for gradient computations during the backward pass. Compared to a standard neural network or stochastic rounding approaches, the proposed procedure can thus be infeasible for larger models and datasets.
96
+
97
+ <table><tr><td>Algorithm 1 Quantization during training.</td><td>Algorithm 2 Quantization during testing.</td></tr><tr><td>Require: Input x, grid G, scale of the grid α, scale of noise o, temperature 入, fuzz param. e r =[- α/2,gk +α/2] #interval points c = Sigmoid((r - x)/σ)# evaluate CDF Ti= cK+1]-c[1]+Ke c[i+1]-c[i]+∈ # categorical distr. z ~ Concrete(π,λ) return ∑i zigi</td><td>Require: Input x, scale and offset of the grid α, β, minimum and maximum values go, gK y = α·round((x - β)/α) + β return min(gk,max(go,y)</td></tr></table>
98
+
99
+ Fortunately, we can make sampling $\hat { x }$ independent of the grid size by assuming zero probability for grid-points that lie far away from the signal $x$ . Specifically, by only considering grid points that are within $\delta$ standard deviations away from $x$ , we truncate $p ( \tilde { x } )$ such that it lies within a “localized” grid around $x$ .
100
+
101
+ To simplify the computation required for determining the local grid elements, we choose the grid point closest to $x$ , $\lfloor x \rceil$ , as the center of the local grid (Figure 3). Since $\sigma$ is shared between all elements of the weight matrix or activation, the local grid has the same width for every element.
102
+
103
+ The computation of the probabilities over the localized grid is similar to the truncation happening in Equation 4 and the smoothed quantized value is obtained via a manner similar to Equation 5:
104
+
105
+ ![](images/14ddf2a6c3275218a9dea74b1be93bdb706cc251b547e3fe2b18fa3e26a08a20.jpg)
106
+ Figure 3: Local grid construction
107
+
108
+ $$
109
+ \begin{array} { c } { P ( \tilde { x } \leq c | \tilde { x } \in ( \lfloor x \rceil - \delta \sigma , \lfloor x \rceil + \delta \sigma ] ) = \displaystyle \frac { P ( \tilde { x } \leq c ) - P ( \tilde { x } < \lfloor x \rceil - \delta \sigma ) } { P ( \tilde { x } \leq \lfloor x \rceil + \delta \sigma ) - P ( \tilde { x } < \lfloor x \rceil - \delta \sigma ) } } \\ { \displaystyle \hat { x } = \displaystyle \sum _ { g _ { i } \in ( \lfloor x \rceil - \delta \sigma , \lfloor x \rceil + \delta \sigma ] } z _ { i } g _ { i } } \end{array}
110
+ $$
111
+
112
+ # 2.3 RELATION TO STOCHASTIC ROUNDING
113
+
114
+ One of the pioneering works in neural network quantization has been the work of Gupta et al. (2015); it introduced stochastic rounding, a technique that is one of the most popular approaches for training neural networks with reduced numerical precision. Instead of rounding to the nearest representable value, the stochastic rounding procedure selects one of the two closest grid points with probability depending on the distance of the high precision input from these grid points. In fact, we can view stochastic rounding as a special case of RQ where $\begin{array} { r } { p ( \tilde { x } ) = U ( x - \frac { \alpha } { 2 } , \tilde { x } + \frac { \bar { \alpha } } { 2 } ) } \end{array}$ . This uniform distribution centered at $x$ of width equal to the grid width $\alpha$ generally has support only for the closest grid point. Discretizing this distribution to a categorical over the quantization grid however assigns probabilities to the two closest grid points as in stochastic rounding, following Equation 2:
115
+
116
+ $$
117
+ p ( \hat { x } = \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha \left. x \right. = P ( \tilde { x } \leq ( \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha + \alpha / 2 ) ) - P ( \tilde { x } < ( \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha - \alpha / 2 ) ) = \left\lceil \frac { x } { \alpha } \right\rceil - \frac { x } { \alpha } .
118
+ $$
119
+
120
+ Stochastic rounding has proven to be a very powerful quantization scheme, even though it relies on biased gradient estimates for the rounding procedure. On the one hand, RQ provides a way to circumvent this estimator at the cost of optimizing a surrogate objective. On the other hand, RQ ST makes use of the unreasonably effective straight-through estimator as used in Jang et al. (2016)
121
+
122
+ to avoid optimizing a surrogate objective, at the cost of biased gradients. Compared to stochastic rounding, RQ ST further allows sampling of not only the two closest grid points, but also has support for more distant ones depending on the estimated input noise $\sigma$ . Intuitively, this allows for larger steps in the input space without first having to decrease variance at the traversion between grid sections.
123
+
124
+ # 3 RELATED WORK
125
+
126
+ In this work we focus on hardware oriented quantization approaches. As opposed to methods that focus only on weight quantization and network compression for a reduced memory footprint, quantizing all operations within the network aims to additionally provide reduced execution times. Within the body of work that considers quantizing weights and activations fall papers using stochastic rounding (Gupta et al., 2015; Hubara et al., 2016; Gysel et al., 2018; Wu et al., 2018). (Wu et al., 2018) also consider quantized backpropagation, which is out-of-scope for this work.
127
+
128
+ Furthermore, another line of work considers binarizing (Courbariaux et al., 2015; Zhou et al., 2018) or ternarizing (Li et al., 2016; Zhou et al., 2018) weights and activations (Hubara et al., 2016; Rastegari et al., 2016; Zhou et al., 2016) via the straight-through gradient estimator (Bengio et al., 2013); these allow for fast implementations of convolutions using only bit-shift operations. In a similar vein, the straight through estimator has also been used in Cai et al. (2017); Faraone et al. (2018); Jacob et al. (2017); Zhou et al. (2017); Mishra & Marr (2017) for quantizing neural networks to arbitrary bit-precision. In these approaches, the full precision weights that are updated during training correspond to the means of the logistic distributions that are used in RQ. Furthermore, Jacob et al. (2017) maintains moving averages for the minimum and maximum observed values for activations while parameterises the network’s weights’ grids via their minimum and maximum values directly. This fixed-point grid is therefore learned during training, however without gradient descent; unlike the proposed RQ. Alternatively, instead of discretizing real valued weights, Shayer et al. (2018) directly optimize discrete distributions over them. While providing promising results, this approach does not generalize straightforwardly to activation quantization. A bayesian approach to binarized models was taken in Soudry et al. (2014), which provided encouraging results on small scale experiments with an ensemble of quantized models sampled from the approximate posterior distribution. For small vocabulary sizes (e.g. ternary weights / activations) Yin et al. (2016) proposed explicit formulas to compute the closest (according to the Euclidean distance) quantized value.
129
+
130
+ Another line of work quantizes networks through regularization. (Louizos et al., 2017a) formulate a variational approach that allows for heuristically determining the required bit-width precision for each weight of the model. Improving upon this work, (Achterhold et al., 2018) proposed a quantizing prior that encourages ternary weights during training. Similarly to RQ, this method also allows for optimizing the scale of the ternary grid. In contrast to RQ, this is only done implicitly via the regularization term. One drawback of these approaches is that the strength of the regularization decays with the amount of training data, thus potentially reducing their effectiveness on large datasets. Alternatively, one could directly regularize towards a set of specific values via the approach described at Yin et al. (2018).
131
+
132
+ Weights in a neural network are usually not distributed uniformly within a layer. As a result, performing non-uniform quantization is usually more effective. (Baskin et al., 2018) employ a stochastic quantizer by first uniformizing the weight or activation distribution through a non-linear transformation and then injecting uniform noise into this transformed space. (Polino et al., 2018) propose a version of their method in which the quantizer’s code book is learned by gradient descent, resulting in a non-uniformly spaced grid. Another line of works quantizes by clustering and therefore falls into this category; (Han et al., 2015; Ullrich et al., 2017) represent each of the weights by the centroid of its closest cluster. While such non-uniform techniques can be indeed effective, they do not allow for efficient implementations on todays hardware. Nevertheless, there is encouraging recent work (Zhang et al., 2018) on non-uniform grids that can be implemented with bit operations.
133
+
134
+ Within the liteterature on quantizing neural networks there are many approaches that are orthogonal to our work and could potentially be combined for additional improvements. (Mishra & Marr, 2017; Polino et al., 2018) use knowledge distrillation techniques to good effect, whereas works such as (Mishra et al., 2017) modify the architecture to compensate for lower precision computations. (Zhou et al., 2017; 2018; Baskin et al., 2018) perform quantization in an step-by-step manner going from input layer to output, thus allowing the later layers to more easily adapt to the rounding errors introduced. Polino et al. (2018); Faraone et al. (2018) further employ “bucketing”, where small groups of weights share a grid, instead of one grid per layer. As an example from Polino et al. (2018), a bucket size of 256 weights per grid on Resnet-18 translates to $\sim 9 1 . 4 k$ separate scaling factors / offsets as opposed to 22 in RQ.
135
+
136
+ # 4 EXPERIMENTS
137
+
138
+ For the subsequent experiments RQ will correspond to the proposed procedure that has concrete sampling and RQ ST will correspond to the proposed procedure that uses the Gumbel-softmax straight-through estimator (Jang et al., 2016) for the gradient. We did not optimize an offset for the grids in order to be able to represent the number zero exactly, which allows for sparsity and is required for zero-padding. Furthermore we assumed a grid that starts from zero when quantizing the outputs of ReLU. We provide further details on the experimental settings at Appendix A. We will also provide results of our own implementation of stochastic rounding (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018) $\mathrm { S R + D R } )$ . Here we used the same hyperparameters as for RQ. All experiments were implemented with TensorFlow (Abadi et al., 2015), using the Keras library (Chollet et al., 2015).
139
+
140
+ # 4.1 LENET-5 ON MNIST AND VGG7 ON CIFAR 10
141
+
142
+ For the first task we considered the toy LeNet-5 network trained on MNIST with the 32C5 - MP2 - 64C5 - MP2 - 512FC - Softmax architecture and the VGG $2 \mathrm { x } ( 1 2 8 \mathrm { C } 3 ) - \mathrm { M P } 2 - 2 \mathrm { x } ( 2 5 6 \mathrm { C } 3 ) - \mathrm { M P } 2$ - 2x(512C3) - MP2 - 1024FC - Softmax architecture on the CIFAR 10 dataset. Details about the hyperparameter settings can be found in Appendix A.
143
+
144
+ By observing the results in Table 1, we see that our method can achieve competitive results that improve upon several recent works on neural network quantization. Considering that we achieve lower test error for 8 bit quantization than the high-precision models, we can see how RQ has a regularizing effect. Generally speaking we found that the gradient variance for low bit-widths (i.e. 2-4 bits) in RQ needs to be kept in check through appropriate learning rates.
145
+
146
+ # 4.2 RESNET-18 AND MOBILENET ON IMAGENET
147
+
148
+ In order to demonstrate the effectiveness of our proposed approach on large scale tasks we considered the task of quantizing a Resnet-18 (He et al., 2016) as well as a Mobilenet (Howard et al., 2017) trained on the Imagenet (ILSVRC2012) dataset. For the Resnet-18 experiment, we started from a pre-trained full precision model that was trained for 90 epochs. We provide further details about the training procedure in Appendix C. The Mobilenet was initialized with the pretrained model available on the tensorflow github repository1. We quantized the weights of all layers, post ReLU activations and average pooling layer for various bit-widths via fine-tuning for ten epochs. Further details can be found in Appendix C.
149
+
150
+ Some of the existing quantization works do not quantize the first (and sometimes) last layer. Doing so simplifies the problem but it can, depending on the model and input dimensions, significantly increase the amount of computation required. We therefore make use of the bit operations (BOPs) metric (Baskin et al., 2018), which can be seen as a proxy for the execution speed on appropriate hardware. In BOPs, the impact of not quantizing the first layer in, for example, the Resnet-18 model on Imagenet, becomes apparent: keeping the first layer in full precision requires roughly 1.3 times as many BOPs for one forward pass through the whole network compared to quantizing all weights and activations to 5 bits.
151
+
152
+ Figure 4 compares a wide range of methods in terms of accuracy and BOPs. We choose to compare only against methods that employ fixed-point quantization on Resnet-18 and Mobilenet, hence do not compare with non-uniform quantization techniques, such as the one described at Baskin et al. (2018). In addition to our own implementation of (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018), we also report results of “rounding”. This corresponds to simply rounding the pre-trained high-precision model followed by re-estimation of the batchnorm statistics. The grid in this case is defined as the initial grid used for fine-tuning with RQ. For batchnorm re-estimation and grid initialization, please confer Appendix A.
153
+
154
+ Table 1: Test error $( \% )$ on MNIST and CIFAR 10 using LeNet5-Caffe and VGG-7 respectively. Two and four bit for VGG with $\mathrm { S R + D R }$ resulted in a big gap between training and validation accuracy, so we omit those results.
155
+
156
+ <table><tr><td>Method</td><td># Bits weights/act.</td><td>MNIST</td><td>CIFAR 10</td></tr><tr><td>Original</td><td>32/32</td><td>0.64</td><td>6.95</td></tr><tr><td rowspan="3">SR+DR (Gupta et al.,2015; Gysel et al., 2018)</td><td>8/8</td><td>0.58</td><td>7.06</td></tr><tr><td>4/4</td><td>0.66</td><td>1</td></tr><tr><td>2/2</td><td>1.03</td><td>1</td></tr><tr><td>Deep Comp. (Han et al., 2015)</td><td>(5-8)/32</td><td>0.74</td><td>-</td></tr><tr><td>TWN (Li et al., 2016)</td><td>2/32</td><td>0.65a</td><td>7.44</td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>-</td><td>9.88</td></tr><tr><td>XNOR-net (Rastegari et al., 2016) SWS (Ullrich et al., 2017)</td><td>1/1</td><td>1</td><td>10.17</td></tr><tr><td>Bayesian Comp. (Louizos et al., 2017a)</td><td>3/32</td><td>0.97</td><td>-</td></tr><tr><td>VNQ(Achterhold et al.,2018)</td><td>(7-18)/32</td><td>1.00</td><td>-</td></tr><tr><td>WAGE (Wu et al., 2018)</td><td>2/32</td><td>0.73</td><td>1</td></tr><tr><td>LR Net (Shayer et al., 2018)b</td><td>2/8</td><td>0.40</td><td>6.78</td></tr><tr><td rowspan="2"></td><td>1/32 2/32</td><td>0.53a 0.50a</td><td>6.82 6.74</td></tr><tr><td></td><td></td><td></td></tr><tr><td rowspan="3">RQ (ours)</td><td>8/8</td><td>0.55</td><td>6.70</td></tr><tr><td>4/4 2/2</td><td>0.58</td><td>8.43</td></tr><tr><td></td><td>0.76</td><td>11.75</td></tr><tr><td rowspan="3">RQ ST (ours)</td><td>8/8</td><td>0.56</td><td>6.72</td></tr><tr><td>4/4</td><td>0.61</td><td>7.96</td></tr><tr><td>2/2</td><td>0.63</td><td>9.08</td></tr></table>
157
+
158
+ aWith batch normalization after convolution bLast layer in full precision
159
+
160
+ In Figure 4a we observe that on ResNet-18 the RQ variants form the “Pareto frontier” in the trade-off between accuracy and efficiency, along with SYQ, Apprentice and Jacob et al. (2017). SYQ, however, employs “bucketing” and Apprentice uses distillation, both of which can be combined with RQ and improve performance. Jacob et al. (2017) does better than RQ with 8 bits, however RQ improved w.r.t. to its pretrained model, whereas Jacob et al. (2017) decreased slightly. For experimental details with Jacob et al. (2017), please confer Appendix C.1. $\mathrm { S R + D R }$ underperforms in this setting and is worse than simple rounding for 5 to 8 bits.
161
+
162
+ For Mobilenet, 4b shows that RQ is competitive to existing approaches. Simple rounding resulted in almost random chance for all of the bit configurations. $\mathrm { S R + D R }$ shows its strength for the 8 bit scenario, while in the lower bit regime, RQ outperforms competitive approaches.
163
+
164
+ # 5 DISCUSSION
165
+
166
+ We have introduced Relaxed Quantization (RQ), a powerful and versatile algorithm for learning low-bit neural networks using a uniform quantization scheme. As such, the models trained by this method can be easily transferred and executed on low-bit fixed point chipsets. We have extensively evaluated RQ on various image classification benchmarks and have shown that it allows for the better trade-offs between accuracy and bit operations per second.
167
+
168
+ Future hardware might enable us to cheaply do non-uniform quantization, for which this method can be easily extended. (Lai et al., 2017; Ortiz et al., 2018) for example, show the benefits of low-bit floating point weights that can be efficiently implemented in hardware. The floating point quantization grid can be easily learned with RQ by redefining $\hat { \mathcal G }$ . General non-uniform quantization, as described for example in (Baskin et al., 2018), is a natural extension to RQ, whose exploration we leave to future work. For example, we could experiment with a base grid that is defined as in Zhang et al. (2018). Currently, the bit-width of every quantizer is determined beforehand, but in future work we will explore learning the required bit precision within this framework. In our experiments, batch normalization was implemented as a sequence of convolution, batch normalization and quantization. On a low-precision chip, however, batch normalization would be ”folded” (Jacob et al., 2017) into the kernel and bias of the convolution, the result of which is then rounded to low precision. In order to accurately reflect this folding at test time, future work on the proposed algorithm will emulate folded batchnorm at training time and learn the corresponding quantization grid of the modified kernel and bias. For fast model evaluation on low-precision hardware, quantization goes hand-in-hand with network pruning. The proposed method is orthogonal to pruning methods such as, for example, $L _ { 0 }$ regularization (Louizos et al., 2017b), which allows for group sparsity and pruning of hidden units.
169
+
170
+ ![](images/ebf2c94dff571b8712b4006b142ae2dbf0f39c837d80ca7b9cba7b00cc25f434.jpg)
171
+ Figure 4: Best viewed in color. Comparison of various methods on Resnet-18 and Mobilenet according to top-1 error (on the y-axis) and bit operations (on the $\mathbf { X }$ -axis) computed according to the formula described in Baskin et al. (2018). Each dashed line corresponds to employing a specific bit configuration for every layer’s weights and activations. Values for top-1 and top-5 errors are given in Table 2 in the Appendix. We compare against multiple works that employ fixed-point quantization: $\mathrm { S R + D R }$ (Gupta et al., 2015; Gysel et al., 2018), LR Net (Shayer et al., 2018), Jacob et al. (2017), TWN (Li et al., 2016), INQ (Zhou et al., 2017), BWN (Rastegari et al., 2016), XNORnet (Rastegari et al., 2016), DoReFa (Zhou et al., 2016), HWGQ (Cai et al., 2017), ELQ Zhou et al. (2018), SYQ (Faraone et al., 2018), Apprentice (Mishra & Marr, 2017), QSM (Sheng et al., 2018) and rounding.
172
+
173
+ # REFERENCES
174
+
175
+ Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, ´ Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
176
+
177
+ Jan Achterhold, Jan Mathias Koehler, Anke Schmeink, and Tim Genewein. Variational network quantization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ry-TW-WAb.
178
+
179
+ Chaim Baskin, Eli Schwartz, Evgenii Zheltonozhskii, Natan Liss, Raja Giryes, Alex M Bronstein, and Avi Mendelson. Uniq: Uniform noise injection for the quantization of neural networks. arXiv
180
+
181
+ preprint arXiv:1804.10969, 2018.
182
+
183
+ Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
184
+
185
+ Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. arXiv preprint arXiv:1702.00953, 2017.
186
+
187
+ Franc¸ois Chollet et al. Keras. https://keras.io, 2015.
188
+
189
+ Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pp. 3123–3131, 2015.
190
+
191
+ Julian Faraone, Nicholas Fraser, Michaela Blott, and Philip HW Leong. Syq: Learning symmetric quantization for efficient deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4300–4309, 2018.
192
+
193
+ Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pp. 1737–1746, 2015.
194
+
195
+ Philipp Gysel, Jon Pimentel, Mohammad Motamedi, and Soheil Ghiasi. Ristretto: A framework for empirical study of resource-efficient inference in convolutional neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2018. doi: 10.1109/TNNLS.2018.2808319.
196
+
197
+ 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.
198
+
199
+ 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.
200
+
201
+ 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.
202
+
203
+ Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016.
204
+
205
+ Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv preprint arXiv:1712.05877, 2017.
206
+
207
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
208
+
209
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
210
+
211
+ Liangzhen Lai, Naveen Suda, and Vikas Chandra. Deep convolutional neural network inference with floating-point weights and fixed-point activations. arXiv preprint arXiv:1703.03073, 2017.
212
+
213
+ Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems 2, NIPS 1989, volume 2, pp. 598–605. Morgan-Kaufmann Publishers, 1990.
214
+
215
+ Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
216
+
217
+ Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. arXiv preprint arXiv:1705.08665, 2017a.
218
+
219
+ Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l _ { 0 }$ regularization. arXiv preprint arXiv:1712.01312, 2017b.
220
+
221
+ Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
222
+
223
+ Asit Mishra and Debbie Marr. Apprentice: Using knowledge distillation techniques to improve low-precision network accuracy. arXiv preprint arXiv:1711.05852, 2017.
224
+
225
+ Asit Mishra, Eriko Nurvitadhi, Jeffrey J Cook, and Debbie Marr. Wrpn: wide reduced-precision networks. arXiv preprint arXiv:1709.01134, 2017.
226
+
227
+ Marc Ortiz, Adrian Cristal, Eduard Ayguad ´ e, and Marc Casas. Low-precision floating-point schemes ´ for neural network training. arXiv preprint arXiv:1804.05267, 2018.
228
+
229
+ Jorn WT Peters and Max Welling. Probabilistic binary neural networks. arXiv preprint arXiv:1809.03368, 2018.
230
+
231
+ Antonio Polino, Razvan Pascanu, and Dan Alistarh. Model compression via distillation and quantization. arXiv preprint arXiv:1802.05668, 2018.
232
+
233
+ Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
234
+
235
+ Oran Shayer, Dan Levi, and Ethan Fetaya. Learning discrete weights using the local reparameterization trick. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BySRH6CpW.
236
+
237
+ Tao Sheng, Chen Feng, Shaojie Zhuo, Xiaopeng Zhang, Liang Shen, and Mickey Aleksic. A quantization-friendly separable convolution for mobilenets. 2018.
238
+
239
+ Daniel Soudry, Itay Hubara, and Ron Meir. Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. In Advances in Neural Information Processing Systems, pp. 963–971, 2014.
240
+
241
+ Joe Staines and David Barber. Variational optimization. arXiv preprint arXiv:1212.4507, 2012.
242
+
243
+ Karen Ullrich, Edward Meeds, and Max Welling. Soft weight-sharing for neural network compression. ICLR, 2017.
244
+
245
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
246
+
247
+ Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJGXzmspb.
248
+
249
+ Penghang Yin, Shuai Zhang, Yingyong Qi, and Jack Xin. Quantization and training of low bit-width convolutional neural networks for object detection. arXiv preprint arXiv:1612.06052, 2016.
250
+
251
+ Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Binaryrelax: A relaxation approach for training deep neural networks with quantized weights. SIAM Journal on Imaging Sciences, 11(4):2205–2223, 2018.
252
+
253
+ Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Blended coarse gradient descent for full quantization of deep neural networks. Research in the Mathematical Sciences, 6(1):14, 2019.
254
+
255
+ Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In European Conference on Computer Vision (ECCV), 2018.
256
+
257
+ Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017.
258
+
259
+ Aojun Zhou, Anbang Yao, Kuan Wang, and Yurong Chen. Explicit loss-error-aware quantization for low-bit deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9426–9435, 2018.
260
+
261
+ Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
262
+
263
+ Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
264
+
265
+ # A EXPERIMENTAL DETAILS
266
+
267
+ The grid width $\alpha$ of each grid was initialized according to the bit-width $b$ and the maximum and minimum values of the input $x$ to the quantizer2. Since the inputs $\tilde { x }$ in both cases for our approach are stochastic it makes sense to assume a width for the grid that is slightly larger than the standard width $t = ( \operatorname* { m a x } ( x ) - \operatorname* { m i n } ( x ) ) / 2 ^ { b }$ ; for the activations, whenever $b > 4$ , we initialize $\alpha = t + 3 t / 2 ^ { b }$ , for $4 \geq b > 2$ we used $\alpha = { { t + 3 t } \ o { / { 2 ^ { b + 1 } } } }$ and finally for $b = 2$ we used $\alpha = t$ . Since with ReLU activations the magnitude can become quite large (thus leading to increased quantization noise for smaller bit widths), this scheme keeps the noise injected to the network in check. For the weights we always used an initial $\alpha = t + 3 t / \dot { 2 } ^ { b }$ . The standard deviation of the logistic noise $\sigma$ was initialized to be three times smaller than the width $\alpha$ , i.e. $\sigma = \alpha / 3$ . Under this specification, most of the probability mass of the logistic distribution is initially (roughly) in the bins containing the closest grid point and its’ two neighbors.
268
+
269
+ The moving averages of layer statistics that are aggregated during the training phase for the batch normalization do not necessarily reflect the statistics of the quantized model accurately. Even though RQ aims to minimize the gap between training and testing phase, we found that the aggregated statistics in combination with the learned scale and shift parameters of batch normalization lead to decreased test performance. In order to avoid this drop in accuracy, we apply the insights from (Peters & Welling, 2018) and recompute the statistics of the quantized model before reporting the final test error rate. The final models were determined through early stopping using the validation loss computed with minibatch statistics, in case the model uses batch normalization.
270
+
271
+ For the MNIST experiment we rescaled the input to the [-1, 1] range, employed no regularization and the network was trained with Adam (Kingma & Ba, 2014) and a batch size of 128. We used a local grid whenever the bit width was larger than 2 for both, weights and biases (shared grid parameters), as well as for the ouputs of the ReLU, with $\delta = 3$ . For the 8 and 4 bit networks we used a temperature $\lambda$ of 2 whereas for the 2 bit models we used a temperature of 1 for RQ. We trained the 8 and 4 bit networks for 100 epochs using a learning rate of 1e-3 and the 2 bit networks for 200 epochs with a learning rate of 5e-4. In all of the cases the learning rate was annealed to zero during the last 50 epochs.
272
+
273
+ For the CIFAR 10 experiment, the hyperparameters were chosen identically to the LeNet-5 experiments except a few differences. We chose a learning rate ot 1e-4 instead of 1e-3 for 8 and 4 bit networks and trained for 300 epochs with a batch size of 100. We also included a weight decay term of 1e-4 for the 8 bit networks. For the 2 bit model we started with a learning rate of 1e-3. The VGG model contains a batch normalization layer after every convolutional layer, but preceeded by max pooling, if present.
274
+
275
+ # B CONVERGENCE SPEED OF VGG ON CIFAR 10
276
+
277
+ Training a neural network with RQ imposes an additional sampling burden for every weight and activation in the network. Here, we investigate whether the extra “noise” that is introduced hampers the convergence speed of the network when we train from a random initialization. We recorded the learning curves for a $2 / 2$ bit RQ-VGG network on CIFAR 10 (as this quantization level exhibits the largest amount of noise) and compare it to the full precision baseline. The results can be seen in
278
+
279
+ Figure 5. As we can observe, the 2/2 bit network has qualitatively similar trends to the full precision baseline. Therefore we can conclude that the noise is not detrimental for the task at hand, at least for this particular model. In terms of wall-clock time, training the RQ model with a full (4 elements) grid took approximately 15 times as long as the high-precision baseline with an implementation in Tensorflow v1.11.0 and running on a single Titan-X Nvidia GPU.
280
+
281
+ ![](images/13bf7464f37b06660fb16b368a648b94601b945f6a890c59faa69f6427f4793a.jpg)
282
+ Figure 5: Learning curves for the VGG on CIFAR 10.
283
+
284
+ # C IMAGENET DETAILS
285
+
286
+ Each channel of the input images was preprocessed by subtracting the mean and dividing by the standard deviation of that channel across the training set. We then resized the images such that the shorter side is set to 256 and then applied random $2 2 4 \mathrm { x } 2 2 4$ crops and random horizontal flips for data augmentation. For evaluation we consider the center $2 2 4 \mathbf { x } 2 2 4$ crop of the images.
287
+
288
+ We trained the base Resnet-18 model with stochastic gradient descent, a batch size of 128, nesterov momentum of 0.9 and a learning rate of 0.1 which was multiplied by 0.1 at the 30th and 60th epoch. We also applied weight decay with a strength of 1e-4. For the quantized model fine-tuning phase, we used Adam with a learning rate of $5 e ^ { - \tilde { 6 } }$ , a batch size of 24 and a momentum of 0.99. We used a temperature of 2 for both RQ variants. Following the strategy in (Jacob et al., 2017), we did not quantize the biases.
289
+
290
+ Table 2 contains the error rates for Resnet-18 and Mobilenet on which Figure 1 is based on. Algorithm and architecture specific changes are mentioned explicitly through footnotes.
291
+
292
+ # C.1 JACOB ET AL. (2017) FOR RESNET18
293
+
294
+ We used the code provided at https://github.com/tensorflow/models/tree/ master/official/resnet and modified the construction of the training and evaluation graph by inserting quantization operations provided by the tensorflow.contrib.quantize package. In a first step, the unmodified code was used to train a high-precision Resnet18 model using the hyper-parameter settings for the learning rate scheduling that are provided in the github repository. More specifically, the model was trained for 90 epochs with a batch size of 128. The learning rate scheduling involved a ”warm up” period in which the learning rate was annealed from zero to 0.64 over the first $5 0 k$ steps, after which it was divided by 10 after epochs 30, 60 and 80 respectively. Gradients were modified using a momentum of 0.9. Final test performance under this procedure is $2 9 . 5 3 \%$ top-1 error and $1 0 . 4 4 \%$ top-5 error. From the high-precision model checkpoint, the final quantized model was then fine-tuned for 10 epochs using a constant learning rate of $1 e ^ { - 4 }$ and momentum of 0.9. We did not freeze the moving averages of the batch normalization layers. Finally, we found that re-estimating the batchnorm statistics was harmful for this algorithm. We hypothesise that this is due to the usage of folded batch normalization, which incorporates the statistics into the construction of the grid at training time.
295
+
296
+ Table 2: Top-1 and top-5 error $( \% )$ with Resnet18 and Mobilenet (full resolution and multiplier of one) on Imagenet
297
+
298
+ <table><tr><td colspan="2"></td><td colspan="2">Resnet18</td><td colspan="2">Mobilenet</td></tr><tr><td>Method</td><td># Bits weights/act.</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td>Original</td><td>32/32</td><td>30.46</td><td>10.81</td><td>29.39</td><td>10.53</td></tr><tr><td rowspan="2">SR+DR (Gupta et al., 2015; Gysel et al., 2018)</td><td>8/8</td><td>31.83</td><td>11.48</td><td>28.70</td><td>10.04</td></tr><tr><td>6/6</td><td>40.75 45.48</td><td>16.90 20.16</td><td>33.34 40.61</td><td>12.83</td></tr><tr><td rowspan="2">Rounding</td><td>5/5</td><td></td><td></td><td></td><td>17.65</td></tr><tr><td>8/8</td><td>30.22</td><td>10.60</td><td>1</td><td>1</td></tr><tr><td rowspan="3">(Jacob et al., 2017)a</td><td>6/6</td><td>31.61 36.97</td><td>11.32 14.95</td><td></td><td></td></tr><tr><td>5/5</td><td>78.79</td><td>57.10</td><td>= 1</td><td></td></tr><tr><td>4/4</td><td>29.62</td><td>10.45</td><td></td><td>1</td></tr><tr><td rowspan="3"></td><td>8/8</td><td>32.69</td><td>12.46</td><td>30.30</td><td>10.50</td></tr><tr><td>6/6 5/5</td><td>35.36</td><td>13.33</td><td>1 =</td><td>1</td></tr><tr><td>1/32b</td><td>40.10</td><td>17.70</td><td></td><td></td></tr><tr><td rowspan="2">LR Net (Shayer et al., 2018)</td><td>2/32℃</td><td>36.50</td><td>15.20</td><td></td><td></td></tr><tr><td>8/8</td><td>1</td><td>1</td><td>31.97</td><td></td></tr><tr><td>QSM (Sheng et al., 2018)a d</td><td></td><td>38.20</td><td>15.80</td><td></td><td></td></tr><tr><td>TWN (Li et al., 2016) INQ (Zhou et al., 2017)</td><td>2/32 5/32</td><td>31.02</td><td>10.90</td><td></td><td></td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>39.20</td><td>17.00</td><td></td><td></td></tr><tr><td>XNOR-net (Rastegari et al., 2016)</td><td>1/1</td><td>48.80</td><td>26.80</td><td></td><td></td></tr><tr><td>HWGQ (Cai et al., 2017)b</td><td>1/2</td><td>40.4</td><td>17.8</td><td></td><td></td></tr><tr><td>DoReFa (Zhou et al., 2016)be</td><td>1/4</td><td>40.8</td><td>18.5</td><td></td><td></td></tr><tr><td>ELQ (Zhou et al., 2018)</td><td>1/32</td><td>35.28</td><td>13.96</td><td></td><td></td></tr><tr><td></td><td>2/32</td><td>32.48</td><td>11.95</td><td></td><td></td></tr><tr><td rowspan="2">SYQ (Faraone et al., 2018)f</td><td>1/8</td><td>37.1</td><td>15.4</td><td></td><td></td></tr><tr><td>2/8</td><td>32.3</td><td>12.2</td><td></td><td></td></tr><tr><td rowspan="2">Apprentice (Mishra &amp; Marr,2017)b</td><td></td><td>32</td><td></td><td></td><td></td></tr><tr><td>2/8 4/8</td><td>29.6</td><td>一</td><td></td><td></td></tr><tr><td rowspan="3">RQ (ours)</td><td>8/8</td><td></td><td></td><td></td><td></td></tr><tr><td>6/6</td><td>30.03 31.35</td><td>10.56 11.22</td><td>29.57 31.98</td><td>10.58 12.00</td></tr><tr><td>5/5</td><td>34.90</td><td>13.43</td><td>38.62</td><td>16.27</td></tr><tr><td rowspan="4">RQ ST (ours)</td><td>4/4</td><td>38.48</td><td>16.01</td><td>1</td><td>1</td></tr><tr><td>8/8</td><td>30.37</td><td>10.67</td><td>29.94</td><td>10.48</td></tr><tr><td>6/6</td><td>31.85</td><td>11.62</td><td>32.38</td><td>12.22</td></tr><tr><td>5/5</td><td>36.65</td><td>14.54</td><td>43.15</td><td>19.65</td></tr><tr><td></td><td>4/4</td><td>37.54</td><td>15.22</td><td>1</td><td>1</td></tr></table>
299
+
300
+ aIncludes folded batch normalization bFirst and last layer not quantized cFirst layer not quantized dModified architecture eResults taken from https://github.com/tensorpack/tensorpack/blob/master/ examples/DoReFa-Net/resnet-dorefa.py fWeights of first and last layer not quantized
301
+
302
+ # C.2 JACOB ET AL. (2017) FOR MOBILENET
303
+
304
+ The $8 / 8$ bit results for quantizing Mobilenet provided in table 2 are read off from Figure 4.1 in Jacob et al. (2017). The pre-trained models published at https://github.com/tensorflow/ models/blob/master/research/slim/nets/mobilenet_v1.md originally reflected that number up until commit 4415c2613b0c74032a7c631769ef9fa7f5477d88, but have since been updated to improved error rates of 29.9 and 11.1 respectively. Unfortunately, there are several conflicting sources for quantized Mobilenet results and pretrainedmodels within the tensorflow github repository. https://github.com/tensorflow/ tensorflow/blob/master/tensorflow/contrib/lite/g3doc/models.md# image-classification-quantized-models, for example, reports error rates of 30.0 and 11.0, whereas at https://github.com/tensorflow/tensorflow/tree/master/ tensorflow/contrib/quantize the reported top-1 error rate is 30.3.
305
+
306
+ We attempted to use the provided training scripts in the https://github.com/tensorflow/ models/blob/master/research/slim repository to train lower-bit mobilenet variants, but did not succeed in doing so. We experimented with learning rates in the range of $[ 5 e ^ { - 6 } , 5 e ^ { - 5 } , 1 e ^ { - 4 } ]$ for $5 / 5 , \ 6 / 6$ and $8 / 8$ bit-width variants, but could not achieve significant accuracy improvements within the first 10 epochs of fine-tuning of the high-precision model published at https://github.com/tensorflow/models/blob/master/research/ slim/nets/mobilenet_v1.md. After 10 epochs, the $8 / 8$ version achieved 31.39 top-1 error with a learning rate of $1 e ^ { - 4 }$ and as such is worse than the published results. We therefore chose to only include the published numbers for the $8 / 8$ bit model and leave addition hyperparameter tuning to future work.
parse/train/HkxjYoCqKX/HkxjYoCqKX_content_list.json ADDED
@@ -0,0 +1,1688 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "RELAXED QUANTIZATION FOR DISCRETIZED NEURAL NETWORKS ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 99,
9
+ 596,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Christos Louizos∗ University of Amsterdam TNO Intelligent Imaging c.louizos@uva.nl ",
17
+ "bbox": [
18
+ 282,
19
+ 170,
20
+ 450,
21
+ 226
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Matthias Reisser QUVA Lab University of Amsterdam m.reisser@uva.nl ",
28
+ "bbox": [
29
+ 545,
30
+ 171,
31
+ 715,
32
+ 226
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Tijmen Blankevoort Qualcomm AI Research tijmen@qti.qualcomm.com ",
39
+ "bbox": [
40
+ 183,
41
+ 247,
42
+ 411,
43
+ 290
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Efstratios Gavves QUVA Lab University of Amsterdam egavves@uva.nl ",
50
+ "bbox": [
51
+ 437,
52
+ 247,
53
+ 607,
54
+ 304
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Max Welling \nUniversity of Amsterdam Qualcomm \nm.welling@uva.nl ",
61
+ "bbox": [
62
+ 633,
63
+ 247,
64
+ 803,
65
+ 304
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "ABSTRACT ",
72
+ "text_level": 1,
73
+ "bbox": [
74
+ 454,
75
+ 340,
76
+ 544,
77
+ 354
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Neural network quantization has become an important research area due to its great impact on deployment of large models on resource constrained devices. In order to train networks that can be effectively discretized without loss of performance, we introduce a differentiable quantization procedure. Differentiability can be achieved by transforming continuous distributions over the weights and activations of the network to categorical distributions over the quantization grid. These are subsequently relaxed to continuous surrogates that can allow for efficient gradient-based optimization. We further show that stochastic rounding can be seen as a special case of the proposed approach and that under this formulation the quantization grid itself can also be optimized with gradient descent. We experimentally validate the performance of our method on MNIST, CIFAR 10 and Imagenet classification. ",
84
+ "bbox": [
85
+ 233,
86
+ 371,
87
+ 766,
88
+ 523
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "1 INTRODUCTION ",
95
+ "text_level": 1,
96
+ "bbox": [
97
+ 176,
98
+ 550,
99
+ 336,
100
+ 565
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Neural networks excel in a variety of large scale problems due to their highly flexible parametric nature. However, deploying big models on resource constrained devices, such as mobile phones, drones or IoT devices is still challenging because they require a large amount of power, memory and computation. Neural network compression is a means to tackle this issue and has therefore become an important research topic. ",
107
+ "bbox": [
108
+ 174,
109
+ 582,
110
+ 825,
111
+ 651
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Neural network compression can be, roughly, divided into two not mutually exclusive categories: pruning and quantization. While pruning (LeCun et al., 1990; Han et al., 2015) aims to make the model “smaller” by altering the architecture, quantization aims to reduce the precision of the arithmetic operations in the network. In this paper we focus on the latter. Most network quantization methods either simulate or enforce discretization of the network during training, e.g. via rounding of the weights and activations. Although seemingly straighforward, the discontinuity of the discretization makes the gradient-based optimization infeasible. The reason is that there is no gradient of the loss with respect to the parameters. A workaround to the discontinuity are the “pseudo-gradients” according to the straight-through estimator (Bengio et al., 2013), which have been successfully used for training low-bit width architectures at e.g. Hubara et al. (2016); Zhu et al. (2016). ",
118
+ "bbox": [
119
+ 173,
120
+ 659,
121
+ 825,
122
+ 797
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "The purpose of this work is to introduce a novel quantization procedure, Relaxed Quantization (RQ). RQ can bypass the non-differentiability of the quantization operation during training by smoothing it appropriately. The contributions of this paper are four-fold: First, we show how to make the set of quantization targets part of the training process such that we can optimize them with gradient descent. Second, we introduce a way to discretize the network by converting distributions over the weights and activations to categorical distributions over the quantization grid. Third, we show that we can obtain a “smooth” quantization procedure by replacing the categorical distributions with concrete (Maddison et al., 2016; Jang et al., 2016) equivalents. Finally we show that stochastic rounding (Gupta et al., 2015), one of the most popular quantization techniques, can be seen as a special case of the proposed framework. We present the details of our approach in Section 2, discuss related work in Section 3 and experimentally validate it in Section 4. Finally we conclude and provide fruitful directions for future research in Section 5. ",
129
+ "bbox": [
130
+ 174,
131
+ 804,
132
+ 825,
133
+ 901
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "image",
139
+ "img_path": "images/7bf04f3575778fc04522f823ee1e5f467c4d201da2b0e38916ddf1badaa8d384.jpg",
140
+ "image_caption": [
141
+ "Figure 1: The proposed discretization process. (a) Given a distribution $p ( \\tilde { x } )$ over the real line we partition it into $K$ intervals of width $\\alpha$ where the center of each of the intervals is a grid point $g _ { i }$ . The shaded area corresponds to the probability of $\\tilde { x }$ falling inside the interval containing that specific $g _ { i }$ . (b) Categorical distribution over the grid obtained after discretization. The probability of each of the grid points $g _ { i }$ is equal to the probability of $\\tilde { x }$ falling inside their respective intervals. "
142
+ ],
143
+ "image_footnote": [],
144
+ "bbox": [
145
+ 191,
146
+ 102,
147
+ 790,
148
+ 279
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "",
155
+ "bbox": [
156
+ 174,
157
+ 388,
158
+ 825,
159
+ 459
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "2 RELAXED QUANTIZATION FOR DISCRETIZING NEURAL NETWORKS ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 173,
169
+ 483,
170
+ 754,
171
+ 497
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "The central element for the discretization of weights and activations of a neural network is a quantizer $q ( \\cdot )$ . The quantizer receives a (usually) continous signal as input and discretizes it to a countable set of values. This process is inherently lossy and non-invertible: given the output of the quantizer, it is impossible to determine the exact value of the input. One of the simplest quantizers is the rounding function: ",
178
+ "bbox": [
179
+ 173,
180
+ 513,
181
+ 825,
182
+ 583
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "equation",
188
+ "img_path": "images/02163608bf1940467ca563e836c2797683ebb09074f5a67ff0cd4a51687967d2.jpg",
189
+ "text": "$$\nq ( x ) = \\alpha \\left\\lfloor { \\frac { x } { \\alpha } } + { \\frac { 1 } { 2 } } \\right\\rfloor ,\n$$",
190
+ "text_format": "latex",
191
+ "bbox": [
192
+ 431,
193
+ 590,
194
+ 565,
195
+ 625
196
+ ],
197
+ "page_idx": 1
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "where $\\alpha$ corresponds to the step size of the quantizer. With $\\alpha = 1$ , the quantizer rounds $x$ to its nearest integer number. ",
202
+ "bbox": [
203
+ 174,
204
+ 632,
205
+ 823,
206
+ 661
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "Unfortunately, we cannot simply apply the rounding quantizer to discretize the weights and activations of a neural network. Because of the quantizers’ lossy and non-invertible nature, important information might be destroyed and lead to a decrease in accuracy. To this end, it is preferable to train the neural network while simulating the effects of quantization during the training procedure. This encourages the weights and activations to be robust to quantization and therefore decreases the performance gap between a full-precision neural network and its discretized version. ",
213
+ "bbox": [
214
+ 174,
215
+ 667,
216
+ 825,
217
+ 751
218
+ ],
219
+ "page_idx": 1
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "However, the aforementioned rounding process is non-differentiable. As a result, we cannot directly optimize the discretized network with stochastic gradient descent, the workhorse of neural network optimization. In this work, we posit a “smooth” quantizer as a possible way for enabling gradient based optimization. ",
224
+ "bbox": [
225
+ 174,
226
+ 757,
227
+ 825,
228
+ 814
229
+ ],
230
+ "page_idx": 1
231
+ },
232
+ {
233
+ "type": "text",
234
+ "text": "2.1 LEARNING (FIXED POINT) QUANTIZERS VIA GRADIENT DESCENT ",
235
+ "text_level": 1,
236
+ "bbox": [
237
+ 176,
238
+ 834,
239
+ 663,
240
+ 848
241
+ ],
242
+ "page_idx": 1
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "The proposed quantizer comprises four elements: a vocabulary, its noise model and the resulting discretization procedure, as well as a final relaxation step to enable gradient based optimization. ",
247
+ "bbox": [
248
+ 176,
249
+ 859,
250
+ 823,
251
+ 888
252
+ ],
253
+ "page_idx": 1
254
+ },
255
+ {
256
+ "type": "text",
257
+ "text": "The first element of the quantizer is the vocabulary: it is the set of (countable) output values that the quantizer can produce. In our case, this vocabulary has an inherent structure, as it is a grid of ordered ",
258
+ "bbox": [
259
+ 174,
260
+ 895,
261
+ 821,
262
+ 924
263
+ ],
264
+ "page_idx": 1
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "scalars. For fixed point quantization the grid $\\mathcal { G }$ is defined as ",
269
+ "bbox": [
270
+ 174,
271
+ 103,
272
+ 565,
273
+ 118
274
+ ],
275
+ "page_idx": 2
276
+ },
277
+ {
278
+ "type": "equation",
279
+ "img_path": "images/da2e6e34075229d062962d7729b238f05c7b7cf430a061f7ea120b36109f518f.jpg",
280
+ "text": "$$\n\\mathcal { G } = \\left[ - 2 ^ { b - 1 } , \\ldots , 0 , \\ldots , 2 ^ { b - 1 } - 1 \\right] ,\n$$",
281
+ "text_format": "latex",
282
+ "bbox": [
283
+ 379,
284
+ 125,
285
+ 619,
286
+ 145
287
+ ],
288
+ "page_idx": 2
289
+ },
290
+ {
291
+ "type": "text",
292
+ "text": "where $b$ is the number of available bits that allow for $K = 2 ^ { b }$ possible integer values. By construction this grid of values is agnostic to the input signal $x$ and hence suboptimal; to allow for the grid to adapt to $x$ we introduce two free parameters, a scale $\\alpha$ and an offset $\\beta$ . This leads to a learnable grid via $\\hat { \\mathcal { G } } = \\alpha \\mathcal { G } + \\beta$ that can adapt to the range and location of the input signal. ",
293
+ "bbox": [
294
+ 174,
295
+ 152,
296
+ 823,
297
+ 212
298
+ ],
299
+ "page_idx": 2
300
+ },
301
+ {
302
+ "type": "text",
303
+ "text": "The second element of the quantizer is the assumption about the input noise $\\epsilon$ ; it determines how probable it is for a specific value of the input signal to move to each grid point. Adding noise to $x$ will result in a quantizer that is, on average, a smooth function of its input. In essense, this is an application of variational optimization (Staines & Barber, 2012) to the non-differentiable rounding function, which enables us to do gradient based optimization. ",
304
+ "bbox": [
305
+ 173,
306
+ 218,
307
+ 825,
308
+ 287
309
+ ],
310
+ "page_idx": 2
311
+ },
312
+ {
313
+ "type": "text",
314
+ "text": "We model this form of noise as acting additively to the input signal $x$ and being governed by a distribution $p ( \\epsilon )$ . This process induces a distribution $p ( \\tilde { x } )$ where $\\tilde { x } = x + \\epsilon$ . In the next step of the quantization procedure, we discretize $p ( \\tilde { x } )$ according to the quantization grid $\\hat { \\mathcal G }$ ; this neccesitates the evaluation of the cumulative distribution function (CDF). For this reason, we will assume that the noise is distributed according to a zero mean logistic distribution with a standard deviation $\\sigma$ , i.e. $L ( 0 , \\sigma )$ , hence leading to $p ( \\bar { \\tilde { x } } ) = L ( x , \\sigma )$ . The CDF of the logistic distribution is the sigmoid function which is easy to evaluate and backpropagate through. Using Gaussian distributions proved to be less effective in preliminary experiments. Other distributions are conceivable and we will briefly discuss the choice of a uniform distribution in Section 2.3. ",
315
+ "bbox": [
316
+ 173,
317
+ 294,
318
+ 825,
319
+ 422
320
+ ],
321
+ "page_idx": 2
322
+ },
323
+ {
324
+ "type": "text",
325
+ "text": "The third element is, given the aforementioned assumptions, how the quantizer determines an appropriate assignment for each realization of the input signal $x$ . Due to the stochastic nature of $\\tilde { x }$ , a deterministic round-to-nearest operation will result in a stochastic quantizer for $x$ . Quantizing $x$ in this manner corresponds to discretizing $p ( \\tilde { x } )$ onto $\\hat { \\mathcal G }$ and then sampling grid points $g _ { i }$ from it. More specifically, we construct a categorical distribution over the grid by adopting intervals of width equal to $\\alpha$ centered at each of the grid points. The probability of selecting that particular grid point will now be equal to the probability of $\\tilde { x }$ falling inside those intervals: ",
326
+ "bbox": [
327
+ 173,
328
+ 429,
329
+ 825,
330
+ 530
331
+ ],
332
+ "page_idx": 2
333
+ },
334
+ {
335
+ "type": "equation",
336
+ "img_path": "images/e2086fec6caedb9f315f8d31fe3db169c3a17299e4f2d7d58ed7e17d09ba0593.jpg",
337
+ "text": "$$\n\\begin{array} { r l } & { p ( \\hat { x } = g _ { i } | x , \\sigma ) = P ( \\tilde { x } \\leq ( g _ { i } + \\alpha / 2 ) ) - P ( \\tilde { x } < ( g _ { i } - \\alpha / 2 ) ) ) } \\\\ & { \\qquad = \\mathrm { S i g m o i d } ( ( g _ { i } + \\alpha / 2 - x ) / \\sigma ) - \\mathrm { S i g m o i d } ( ( g _ { i } - \\alpha / 2 - x ) / \\sigma ) , } \\end{array}\n$$",
338
+ "text_format": "latex",
339
+ "bbox": [
340
+ 236,
341
+ 535,
342
+ 758,
343
+ 573
344
+ ],
345
+ "page_idx": 2
346
+ },
347
+ {
348
+ "type": "text",
349
+ "text": "where $\\hat { x }$ corresponds to the quantized variable, $P ( \\cdot )$ corresponds to the CDF and the step from Equation 2 to Equation 3 is due to the logistic noise assumption. A visualization of the aforementioned process can be seen in Figure 1. For the first and last grid point we will assume that they reside within $( g _ { 0 } - \\alpha / 2 , g _ { 0 } + \\alpha / 2 ]$ and $\\left( g _ { K } - \\alpha / 2 , g _ { K } + \\alpha / 2 \\right]$ respectively. Under this assumption we will have to truncate $p ( \\tilde { x } )$ such that it only has support within $\\left( g _ { 0 } - \\alpha / 2 , g _ { K } + \\alpha / 2 \\right]$ . Fortunately this is easy to do, as it corresponds to just a simple modification of the CDF: ",
350
+ "bbox": [
351
+ 173,
352
+ 577,
353
+ 825,
354
+ 661
355
+ ],
356
+ "page_idx": 2
357
+ },
358
+ {
359
+ "type": "equation",
360
+ "img_path": "images/e1caa9652c95894f3979db45656e20068469bcc0bc0ca5a2c166c00d3bf9203f.jpg",
361
+ "text": "$$\nP ( \\tilde { x } \\le c | \\tilde { x } \\in ( g _ { 0 } - \\alpha / 2 , g _ { K } + \\alpha / 2 ] ) = \\frac { P ( \\tilde { x } \\le c ) - P ( \\tilde { x } < ( g _ { 0 } - \\alpha / 2 ) ) } { P ( \\tilde { x } \\le ( g _ { K } + \\alpha / 2 ) ) - P ( \\tilde { x } < ( g _ { 0 } - \\alpha / 2 ) ) } .\n$$",
362
+ "text_format": "latex",
363
+ "bbox": [
364
+ 215,
365
+ 667,
366
+ 781,
367
+ 702
368
+ ],
369
+ "page_idx": 2
370
+ },
371
+ {
372
+ "type": "text",
373
+ "text": "Armed with this categorical distribution over the grid, the quantizer proceeds to assign a specific grid value to $\\hat { x }$ by drawing a random sample. This procedure emulates quantization noise, which prevents the model from fitting the data. This noise can be reduced in two ways: by clustering the weights and activations around the points of the grid and by reducing the logistic noise $\\sigma$ . As $\\sigma 0$ , the CDF converges towards the step function, prohibiting gradient flow. On the other hand, if $\\epsilon$ is too high, the optimization procedure is very noisy, prohibiting convergence. For this reason, during optimization we initialize $\\sigma$ in a sensible range, such that $L ( x , \\sigma )$ covers a significant portion of the grid. Please confer Appendix A for details. We then let $\\sigma$ be freely optimized via gradient descent such that the loss is minimized. Both effects reduce the gap between the function that the neural network computes during training time vs. test time. We illustrate this in Figure 2. ",
374
+ "bbox": [
375
+ 173,
376
+ 707,
377
+ 825,
378
+ 848
379
+ ],
380
+ "page_idx": 2
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "The fourth element of the procedure is the relaxation of the non-differentiable categorical distribution sampling. While we can use an unbiased gradient estimator via REINFORCE (Williams, 1992), we opt for a continuous relaxation due to high variances with REINFORCE. This is achieved by replacing the categorical distribution with a concrete distribution (Maddison et al., 2016; Jang et al., 2016). This relaxation procedure corresponds to adopting a “smooth” categorical distribution that can be seen as a “noisy” softmax. Let $\\pi _ { i }$ be the categorical probability of sampling grid point $i$ , i.e. $\\pi _ { i } = p ( { \\hat { x } } = g _ { i } )$ ; the “smoothed” quantized value $\\hat { x }$ can be obtained via: ",
385
+ "bbox": [
386
+ 174,
387
+ 853,
388
+ 825,
389
+ 924
390
+ ],
391
+ "page_idx": 2
392
+ },
393
+ {
394
+ "type": "image",
395
+ "img_path": "images/c6c6c00b30e56119f87c59acbac42f6924682523cf9f8b29eba7ebd39fbd06e5.jpg",
396
+ "image_caption": [
397
+ "Figure 2: Best viewed in color. Illustration of the inductive bias obtained via training with the proposed quantizer; means of the logistic distribution over the weights for each layer of the LeNet-5 when trained with 2 bits per weight and activation. Each color corresponds to an assignment to a particular grid point and the vertical dashed lines correspond to the grid points $\\beta = 0$ ). We can clearly see that the real valued weights are naturally encouraged through training to cluster into multiple modes, one for each grid point. It should also be mentioned, that for the right and leftmost grid points the probability of selecting them is maximized by moving the corresponding weight furthest right or left respectively. Interestingly, we observe that the network converged to ternary weights for the input and (almost) binary weights for the output layer. "
398
+ ],
399
+ "image_footnote": [],
400
+ "bbox": [
401
+ 176,
402
+ 99,
403
+ 823,
404
+ 244
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "",
411
+ "bbox": [
412
+ 173,
413
+ 409,
414
+ 823,
415
+ 438
416
+ ],
417
+ "page_idx": 3
418
+ },
419
+ {
420
+ "type": "equation",
421
+ "img_path": "images/d03629577da398257729f6363e3d206762862e991febbbbb27c3375f5478376c.jpg",
422
+ "text": "$$\nu _ { i } \\sim \\mathrm { G u m b e l } ( 0 , 1 ) , \\qquad z _ { i } = \\frac { \\exp ( ( \\log \\pi _ { i } + u _ { i } ) / \\lambda ) } { \\sum _ { j } \\exp ( ( \\log \\pi _ { j } + u _ { j } ) / \\lambda ) } , \\qquad \\hat { x } = \\sum _ { i = 1 } ^ { K } z _ { i } g _ { i } ,\n$$",
423
+ "text_format": "latex",
424
+ "bbox": [
425
+ 245,
426
+ 445,
427
+ 751,
428
+ 488
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "where $z _ { i }$ is the random sample from the concrete distribution and $\\lambda$ is a temperature parameter that controls the degree of approximation, since as $\\lambda 0$ the concrete distribution becomes a categorical. ",
435
+ "bbox": [
436
+ 176,
437
+ 496,
438
+ 823,
439
+ 523
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "We have thus defined a fully differentiable “soft” quantization procedure that allows for stochastic gradients for both the quantizer parameters $\\alpha , \\beta , \\sigma$ as well as the input signal $x$ (e.g. the weights or the activations of a neural network). We refer to this algorithm as Relaxed Quantization (RQ). We summarize its forward pass as performed during training in Algorithm 1. It is also worthwhile to notice that if there were no noise at the input $x$ then the categorical distribution would have non-zero mass only at a single value, thus prohibiting gradient based optimization for $x$ and $\\sigma$ . ",
446
+ "bbox": [
447
+ 174,
448
+ 530,
449
+ 825,
450
+ 614
451
+ ],
452
+ "page_idx": 3
453
+ },
454
+ {
455
+ "type": "text",
456
+ "text": "One drawback of this approach is that the smoothed quantized values defined in Equation 5 do not have to coincide with grid points, as $z$ is not a one-hot vector. Instead, these values can lie anywhere between the smallest and largest grid point, something which is impossible with e.g. stochastic rounding (Gupta et al., 2015). In order to make sure that only grid-points are sampled, we propose an alternative algorithm RQ ST in which we use the variant of the straight-through (ST) estimator proposed in Jang et al. (2016). Here we sample the actual categorical distribution during the forward pass but assume a sample from the concrete distribution for the backward pass. While this gradient estimator is obviously biased, in practice it works as the “gradients” seem to point towards a valid direction. This effect was also recently studied at Yin et al. (2019). We perform experiments with both variants. ",
457
+ "bbox": [
458
+ 174,
459
+ 621,
460
+ 825,
461
+ 761
462
+ ],
463
+ "page_idx": 3
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "After convergence, we can obtain a “hard” quantization procedure, i.e. select points from the grid, at test time by either reverting to a categorical distribution (instead of the continuous surrogate) or by rounding to the nearest grid point. In this paper we chose the latter as it is more aligned with the low-resource environments in which quantized models will be deployed. Furthermore, with this goal in mind, we employ two quantization grids with their own learnable scalar $\\alpha , \\sigma$ (and potentially $\\beta$ ) parameters for each layer; one for the weights and one for the activations. ",
468
+ "bbox": [
469
+ 174,
470
+ 767,
471
+ 825,
472
+ 852
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "2.2 SCALABLE QUANTIZATION VIA A LOCAL GRID ",
479
+ "text_level": 1,
480
+ "bbox": [
481
+ 174,
482
+ 869,
483
+ 535,
484
+ 882
485
+ ],
486
+ "page_idx": 3
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "Sampling $\\hat { x }$ based on drawing $K$ random numbers for the concrete distribution as described in Equation 5 can be very expensive for larger values of $K$ . Firstly, drawing $K$ random numbers for every individual weight and activation in a neural network drastically increases the number of operations required in the forward pass. Secondly, it also requires keeping many more numbers in memory for gradient computations during the backward pass. Compared to a standard neural network or stochastic rounding approaches, the proposed procedure can thus be infeasible for larger models and datasets. ",
491
+ "bbox": [
492
+ 176,
493
+ 895,
494
+ 823,
495
+ 924
496
+ ],
497
+ "page_idx": 3
498
+ },
499
+ {
500
+ "type": "table",
501
+ "img_path": "images/20df8cb41921eb1c9d7ddf2c35731901f56c6550026077ecc81f975ac5fd6b25.jpg",
502
+ "table_caption": [],
503
+ "table_footnote": [],
504
+ "table_body": "<table><tr><td>Algorithm 1 Quantization during training.</td><td>Algorithm 2 Quantization during testing.</td></tr><tr><td>Require: Input x, grid G, scale of the grid α, scale of noise o, temperature 入, fuzz param. e r =[- α/2,gk +α/2] #interval points c = Sigmoid((r - x)/σ)# evaluate CDF Ti= cK+1]-c[1]+Ke c[i+1]-c[i]+∈ # categorical distr. z ~ Concrete(π,λ) return ∑i zigi</td><td>Require: Input x, scale and offset of the grid α, β, minimum and maximum values go, gK y = α·round((x - β)/α) + β return min(gk,max(go,y)</td></tr></table>",
505
+ "bbox": [
506
+ 173,
507
+ 131,
508
+ 826,
509
+ 270
510
+ ],
511
+ "page_idx": 4
512
+ },
513
+ {
514
+ "type": "text",
515
+ "text": "",
516
+ "bbox": [
517
+ 173,
518
+ 295,
519
+ 825,
520
+ 364
521
+ ],
522
+ "page_idx": 4
523
+ },
524
+ {
525
+ "type": "text",
526
+ "text": "Fortunately, we can make sampling $\\hat { x }$ independent of the grid size by assuming zero probability for grid-points that lie far away from the signal $x$ . Specifically, by only considering grid points that are within $\\delta$ standard deviations away from $x$ , we truncate $p ( \\tilde { x } )$ such that it lies within a “localized” grid around $x$ . ",
527
+ "bbox": [
528
+ 173,
529
+ 371,
530
+ 821,
531
+ 428
532
+ ],
533
+ "page_idx": 4
534
+ },
535
+ {
536
+ "type": "text",
537
+ "text": "To simplify the computation required for determining the local grid elements, we choose the grid point closest to $x$ , $\\lfloor x \\rceil$ , as the center of the local grid (Figure 3). Since $\\sigma$ is shared between all elements of the weight matrix or activation, the local grid has the same width for every element. ",
538
+ "bbox": [
539
+ 174,
540
+ 434,
541
+ 588,
542
+ 505
543
+ ],
544
+ "page_idx": 4
545
+ },
546
+ {
547
+ "type": "text",
548
+ "text": "The computation of the probabilities over the localized grid is similar to the truncation happening in Equation 4 and the smoothed quantized value is obtained via a manner similar to Equation 5: ",
549
+ "bbox": [
550
+ 173,
551
+ 511,
552
+ 588,
553
+ 568
554
+ ],
555
+ "page_idx": 4
556
+ },
557
+ {
558
+ "type": "image",
559
+ "img_path": "images/14ddf2a6c3275218a9dea74b1be93bdb706cc251b547e3fe2b18fa3e26a08a20.jpg",
560
+ "image_caption": [
561
+ "Figure 3: Local grid construction "
562
+ ],
563
+ "image_footnote": [],
564
+ "bbox": [
565
+ 606,
566
+ 454,
567
+ 818,
568
+ 544
569
+ ],
570
+ "page_idx": 4
571
+ },
572
+ {
573
+ "type": "equation",
574
+ "img_path": "images/030ac8a7a0af3cd35579b17a62e9e3d4024c0b33ff9093d62916cdef9b46d4e9.jpg",
575
+ "text": "$$\n\\begin{array} { c } { P ( \\tilde { x } \\leq c | \\tilde { x } \\in ( \\lfloor x \\rceil - \\delta \\sigma , \\lfloor x \\rceil + \\delta \\sigma ] ) = \\displaystyle \\frac { P ( \\tilde { x } \\leq c ) - P ( \\tilde { x } < \\lfloor x \\rceil - \\delta \\sigma ) } { P ( \\tilde { x } \\leq \\lfloor x \\rceil + \\delta \\sigma ) - P ( \\tilde { x } < \\lfloor x \\rceil - \\delta \\sigma ) } } \\\\ { \\displaystyle \\hat { x } = \\displaystyle \\sum _ { g _ { i } \\in ( \\lfloor x \\rceil - \\delta \\sigma , \\lfloor x \\rceil + \\delta \\sigma ] } z _ { i } g _ { i } } \\end{array}\n$$",
576
+ "text_format": "latex",
577
+ "bbox": [
578
+ 236,
579
+ 573,
580
+ 761,
581
+ 646
582
+ ],
583
+ "page_idx": 4
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "2.3 RELATION TO STOCHASTIC ROUNDING",
588
+ "text_level": 1,
589
+ "bbox": [
590
+ 176,
591
+ 669,
592
+ 485,
593
+ 683
594
+ ],
595
+ "page_idx": 4
596
+ },
597
+ {
598
+ "type": "text",
599
+ "text": "One of the pioneering works in neural network quantization has been the work of Gupta et al. (2015); it introduced stochastic rounding, a technique that is one of the most popular approaches for training neural networks with reduced numerical precision. Instead of rounding to the nearest representable value, the stochastic rounding procedure selects one of the two closest grid points with probability depending on the distance of the high precision input from these grid points. In fact, we can view stochastic rounding as a special case of RQ where $\\begin{array} { r } { p ( \\tilde { x } ) = U ( x - \\frac { \\alpha } { 2 } , \\tilde { x } + \\frac { \\bar { \\alpha } } { 2 } ) } \\end{array}$ . This uniform distribution centered at $x$ of width equal to the grid width $\\alpha$ generally has support only for the closest grid point. Discretizing this distribution to a categorical over the quantization grid however assigns probabilities to the two closest grid points as in stochastic rounding, following Equation 2: ",
600
+ "bbox": [
601
+ 173,
602
+ 694,
603
+ 826,
604
+ 820
605
+ ],
606
+ "page_idx": 4
607
+ },
608
+ {
609
+ "type": "equation",
610
+ "img_path": "images/161b3a2f09181fde1cc261b471f7223eec7d1818de54f18b6d6bb65866a82f37.jpg",
611
+ "text": "$$\np ( \\hat { x } = \\left\\lfloor \\frac { x } { \\alpha } \\right\\rfloor \\alpha \\left. x \\right. = P ( \\tilde { x } \\leq ( \\left\\lfloor \\frac { x } { \\alpha } \\right\\rfloor \\alpha + \\alpha / 2 ) ) - P ( \\tilde { x } < ( \\left\\lfloor \\frac { x } { \\alpha } \\right\\rfloor \\alpha - \\alpha / 2 ) ) = \\left\\lceil \\frac { x } { \\alpha } \\right\\rceil - \\frac { x } { \\alpha } .\n$$",
612
+ "text_format": "latex",
613
+ "bbox": [
614
+ 212,
615
+ 827,
616
+ 784,
617
+ 854
618
+ ],
619
+ "page_idx": 4
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "Stochastic rounding has proven to be a very powerful quantization scheme, even though it relies on biased gradient estimates for the rounding procedure. On the one hand, RQ provides a way to circumvent this estimator at the cost of optimizing a surrogate objective. On the other hand, RQ ST makes use of the unreasonably effective straight-through estimator as used in Jang et al. (2016) ",
624
+ "bbox": [
625
+ 174,
626
+ 867,
627
+ 825,
628
+ 924
629
+ ],
630
+ "page_idx": 4
631
+ },
632
+ {
633
+ "type": "text",
634
+ "text": "to avoid optimizing a surrogate objective, at the cost of biased gradients. Compared to stochastic rounding, RQ ST further allows sampling of not only the two closest grid points, but also has support for more distant ones depending on the estimated input noise $\\sigma$ . Intuitively, this allows for larger steps in the input space without first having to decrease variance at the traversion between grid sections. ",
635
+ "bbox": [
636
+ 174,
637
+ 103,
638
+ 823,
639
+ 159
640
+ ],
641
+ "page_idx": 5
642
+ },
643
+ {
644
+ "type": "text",
645
+ "text": "3 RELATED WORK ",
646
+ "text_level": 1,
647
+ "bbox": [
648
+ 176,
649
+ 181,
650
+ 344,
651
+ 198
652
+ ],
653
+ "page_idx": 5
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "In this work we focus on hardware oriented quantization approaches. As opposed to methods that focus only on weight quantization and network compression for a reduced memory footprint, quantizing all operations within the network aims to additionally provide reduced execution times. Within the body of work that considers quantizing weights and activations fall papers using stochastic rounding (Gupta et al., 2015; Hubara et al., 2016; Gysel et al., 2018; Wu et al., 2018). (Wu et al., 2018) also consider quantized backpropagation, which is out-of-scope for this work. ",
658
+ "bbox": [
659
+ 174,
660
+ 215,
661
+ 825,
662
+ 299
663
+ ],
664
+ "page_idx": 5
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "Furthermore, another line of work considers binarizing (Courbariaux et al., 2015; Zhou et al., 2018) or ternarizing (Li et al., 2016; Zhou et al., 2018) weights and activations (Hubara et al., 2016; Rastegari et al., 2016; Zhou et al., 2016) via the straight-through gradient estimator (Bengio et al., 2013); these allow for fast implementations of convolutions using only bit-shift operations. In a similar vein, the straight through estimator has also been used in Cai et al. (2017); Faraone et al. (2018); Jacob et al. (2017); Zhou et al. (2017); Mishra & Marr (2017) for quantizing neural networks to arbitrary bit-precision. In these approaches, the full precision weights that are updated during training correspond to the means of the logistic distributions that are used in RQ. Furthermore, Jacob et al. (2017) maintains moving averages for the minimum and maximum observed values for activations while parameterises the network’s weights’ grids via their minimum and maximum values directly. This fixed-point grid is therefore learned during training, however without gradient descent; unlike the proposed RQ. Alternatively, instead of discretizing real valued weights, Shayer et al. (2018) directly optimize discrete distributions over them. While providing promising results, this approach does not generalize straightforwardly to activation quantization. A bayesian approach to binarized models was taken in Soudry et al. (2014), which provided encouraging results on small scale experiments with an ensemble of quantized models sampled from the approximate posterior distribution. For small vocabulary sizes (e.g. ternary weights / activations) Yin et al. (2016) proposed explicit formulas to compute the closest (according to the Euclidean distance) quantized value. ",
669
+ "bbox": [
670
+ 174,
671
+ 306,
672
+ 825,
673
+ 555
674
+ ],
675
+ "page_idx": 5
676
+ },
677
+ {
678
+ "type": "text",
679
+ "text": "Another line of work quantizes networks through regularization. (Louizos et al., 2017a) formulate a variational approach that allows for heuristically determining the required bit-width precision for each weight of the model. Improving upon this work, (Achterhold et al., 2018) proposed a quantizing prior that encourages ternary weights during training. Similarly to RQ, this method also allows for optimizing the scale of the ternary grid. In contrast to RQ, this is only done implicitly via the regularization term. One drawback of these approaches is that the strength of the regularization decays with the amount of training data, thus potentially reducing their effectiveness on large datasets. Alternatively, one could directly regularize towards a set of specific values via the approach described at Yin et al. (2018). ",
680
+ "bbox": [
681
+ 174,
682
+ 563,
683
+ 825,
684
+ 688
685
+ ],
686
+ "page_idx": 5
687
+ },
688
+ {
689
+ "type": "text",
690
+ "text": "Weights in a neural network are usually not distributed uniformly within a layer. As a result, performing non-uniform quantization is usually more effective. (Baskin et al., 2018) employ a stochastic quantizer by first uniformizing the weight or activation distribution through a non-linear transformation and then injecting uniform noise into this transformed space. (Polino et al., 2018) propose a version of their method in which the quantizer’s code book is learned by gradient descent, resulting in a non-uniformly spaced grid. Another line of works quantizes by clustering and therefore falls into this category; (Han et al., 2015; Ullrich et al., 2017) represent each of the weights by the centroid of its closest cluster. While such non-uniform techniques can be indeed effective, they do not allow for efficient implementations on todays hardware. Nevertheless, there is encouraging recent work (Zhang et al., 2018) on non-uniform grids that can be implemented with bit operations. ",
691
+ "bbox": [
692
+ 174,
693
+ 694,
694
+ 825,
695
+ 833
696
+ ],
697
+ "page_idx": 5
698
+ },
699
+ {
700
+ "type": "text",
701
+ "text": "Within the liteterature on quantizing neural networks there are many approaches that are orthogonal to our work and could potentially be combined for additional improvements. (Mishra & Marr, 2017; Polino et al., 2018) use knowledge distrillation techniques to good effect, whereas works such as (Mishra et al., 2017) modify the architecture to compensate for lower precision computations. (Zhou et al., 2017; 2018; Baskin et al., 2018) perform quantization in an step-by-step manner going from input layer to output, thus allowing the later layers to more easily adapt to the rounding errors introduced. Polino et al. (2018); Faraone et al. (2018) further employ “bucketing”, where small groups of weights share a grid, instead of one grid per layer. As an example from Polino et al. (2018), a bucket size of 256 weights per grid on Resnet-18 translates to $\\sim 9 1 . 4 k$ separate scaling factors / offsets as opposed to 22 in RQ. ",
702
+ "bbox": [
703
+ 174,
704
+ 840,
705
+ 825,
706
+ 924
707
+ ],
708
+ "page_idx": 5
709
+ },
710
+ {
711
+ "type": "text",
712
+ "text": "",
713
+ "bbox": [
714
+ 174,
715
+ 103,
716
+ 825,
717
+ 159
718
+ ],
719
+ "page_idx": 6
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "4 EXPERIMENTS ",
724
+ "text_level": 1,
725
+ "bbox": [
726
+ 176,
727
+ 180,
728
+ 326,
729
+ 195
730
+ ],
731
+ "page_idx": 6
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "For the subsequent experiments RQ will correspond to the proposed procedure that has concrete sampling and RQ ST will correspond to the proposed procedure that uses the Gumbel-softmax straight-through estimator (Jang et al., 2016) for the gradient. We did not optimize an offset for the grids in order to be able to represent the number zero exactly, which allows for sparsity and is required for zero-padding. Furthermore we assumed a grid that starts from zero when quantizing the outputs of ReLU. We provide further details on the experimental settings at Appendix A. We will also provide results of our own implementation of stochastic rounding (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018) $\\mathrm { S R + D R } )$ . Here we used the same hyperparameters as for RQ. All experiments were implemented with TensorFlow (Abadi et al., 2015), using the Keras library (Chollet et al., 2015). ",
736
+ "bbox": [
737
+ 174,
738
+ 210,
739
+ 825,
740
+ 349
741
+ ],
742
+ "page_idx": 6
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "4.1 LENET-5 ON MNIST AND VGG7 ON CIFAR 10 ",
747
+ "text_level": 1,
748
+ "bbox": [
749
+ 173,
750
+ 366,
751
+ 549,
752
+ 381
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "For the first task we considered the toy LeNet-5 network trained on MNIST with the 32C5 - MP2 - 64C5 - MP2 - 512FC - Softmax architecture and the VGG $2 \\mathrm { x } ( 1 2 8 \\mathrm { C } 3 ) - \\mathrm { M P } 2 - 2 \\mathrm { x } ( 2 5 6 \\mathrm { C } 3 ) - \\mathrm { M P } 2$ - 2x(512C3) - MP2 - 1024FC - Softmax architecture on the CIFAR 10 dataset. Details about the hyperparameter settings can be found in Appendix A. ",
759
+ "bbox": [
760
+ 173,
761
+ 392,
762
+ 825,
763
+ 449
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "By observing the results in Table 1, we see that our method can achieve competitive results that improve upon several recent works on neural network quantization. Considering that we achieve lower test error for 8 bit quantization than the high-precision models, we can see how RQ has a regularizing effect. Generally speaking we found that the gradient variance for low bit-widths (i.e. 2-4 bits) in RQ needs to be kept in check through appropriate learning rates. ",
770
+ "bbox": [
771
+ 174,
772
+ 455,
773
+ 825,
774
+ 525
775
+ ],
776
+ "page_idx": 6
777
+ },
778
+ {
779
+ "type": "text",
780
+ "text": "4.2 RESNET-18 AND MOBILENET ON IMAGENET ",
781
+ "text_level": 1,
782
+ "bbox": [
783
+ 178,
784
+ 541,
785
+ 519,
786
+ 555
787
+ ],
788
+ "page_idx": 6
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "In order to demonstrate the effectiveness of our proposed approach on large scale tasks we considered the task of quantizing a Resnet-18 (He et al., 2016) as well as a Mobilenet (Howard et al., 2017) trained on the Imagenet (ILSVRC2012) dataset. For the Resnet-18 experiment, we started from a pre-trained full precision model that was trained for 90 epochs. We provide further details about the training procedure in Appendix C. The Mobilenet was initialized with the pretrained model available on the tensorflow github repository1. We quantized the weights of all layers, post ReLU activations and average pooling layer for various bit-widths via fine-tuning for ten epochs. Further details can be found in Appendix C. ",
793
+ "bbox": [
794
+ 174,
795
+ 568,
796
+ 825,
797
+ 679
798
+ ],
799
+ "page_idx": 6
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "Some of the existing quantization works do not quantize the first (and sometimes) last layer. Doing so simplifies the problem but it can, depending on the model and input dimensions, significantly increase the amount of computation required. We therefore make use of the bit operations (BOPs) metric (Baskin et al., 2018), which can be seen as a proxy for the execution speed on appropriate hardware. In BOPs, the impact of not quantizing the first layer in, for example, the Resnet-18 model on Imagenet, becomes apparent: keeping the first layer in full precision requires roughly 1.3 times as many BOPs for one forward pass through the whole network compared to quantizing all weights and activations to 5 bits. ",
804
+ "bbox": [
805
+ 174,
806
+ 685,
807
+ 825,
808
+ 796
809
+ ],
810
+ "page_idx": 6
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "Figure 4 compares a wide range of methods in terms of accuracy and BOPs. We choose to compare only against methods that employ fixed-point quantization on Resnet-18 and Mobilenet, hence do not compare with non-uniform quantization techniques, such as the one described at Baskin et al. (2018). In addition to our own implementation of (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018), we also report results of “rounding”. This corresponds to simply rounding the pre-trained high-precision model followed by re-estimation of the batchnorm statistics. The grid in this case is defined as the initial grid used for fine-tuning with RQ. For batchnorm re-estimation and grid initialization, please confer Appendix A. ",
815
+ "bbox": [
816
+ 173,
817
+ 804,
818
+ 825,
819
+ 888
820
+ ],
821
+ "page_idx": 6
822
+ },
823
+ {
824
+ "type": "table",
825
+ "img_path": "images/77f512880099c1b82129be6fefaaf9636a47e3c8ae3a5cdebd5b4ee547d0cd3a.jpg",
826
+ "table_caption": [
827
+ "Table 1: Test error $( \\% )$ on MNIST and CIFAR 10 using LeNet5-Caffe and VGG-7 respectively. Two and four bit for VGG with $\\mathrm { S R + D R }$ resulted in a big gap between training and validation accuracy, so we omit those results. "
828
+ ],
829
+ "table_footnote": [
830
+ "aWith batch normalization after convolution bLast layer in full precision "
831
+ ],
832
+ "table_body": "<table><tr><td>Method</td><td># Bits weights/act.</td><td>MNIST</td><td>CIFAR 10</td></tr><tr><td>Original</td><td>32/32</td><td>0.64</td><td>6.95</td></tr><tr><td rowspan=\"3\">SR+DR (Gupta et al.,2015; Gysel et al., 2018)</td><td>8/8</td><td>0.58</td><td>7.06</td></tr><tr><td>4/4</td><td>0.66</td><td>1</td></tr><tr><td>2/2</td><td>1.03</td><td>1</td></tr><tr><td>Deep Comp. (Han et al., 2015)</td><td>(5-8)/32</td><td>0.74</td><td>-</td></tr><tr><td>TWN (Li et al., 2016)</td><td>2/32</td><td>0.65a</td><td>7.44</td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>-</td><td>9.88</td></tr><tr><td>XNOR-net (Rastegari et al., 2016) SWS (Ullrich et al., 2017)</td><td>1/1</td><td>1</td><td>10.17</td></tr><tr><td>Bayesian Comp. (Louizos et al., 2017a)</td><td>3/32</td><td>0.97</td><td>-</td></tr><tr><td>VNQ(Achterhold et al.,2018)</td><td>(7-18)/32</td><td>1.00</td><td>-</td></tr><tr><td>WAGE (Wu et al., 2018)</td><td>2/32</td><td>0.73</td><td>1</td></tr><tr><td>LR Net (Shayer et al., 2018)b</td><td>2/8</td><td>0.40</td><td>6.78</td></tr><tr><td rowspan=\"2\"></td><td>1/32 2/32</td><td>0.53a 0.50a</td><td>6.82 6.74</td></tr><tr><td></td><td></td><td></td></tr><tr><td rowspan=\"3\">RQ (ours)</td><td>8/8</td><td>0.55</td><td>6.70</td></tr><tr><td>4/4 2/2</td><td>0.58</td><td>8.43</td></tr><tr><td></td><td>0.76</td><td>11.75</td></tr><tr><td rowspan=\"3\">RQ ST (ours)</td><td>8/8</td><td>0.56</td><td>6.72</td></tr><tr><td>4/4</td><td>0.61</td><td>7.96</td></tr><tr><td>2/2</td><td>0.63</td><td>9.08</td></tr></table>",
833
+ "bbox": [
834
+ 207,
835
+ 154,
836
+ 790,
837
+ 494
838
+ ],
839
+ "page_idx": 7
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "",
844
+ "bbox": [
845
+ 173,
846
+ 555,
847
+ 823,
848
+ 584
849
+ ],
850
+ "page_idx": 7
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "In Figure 4a we observe that on ResNet-18 the RQ variants form the “Pareto frontier” in the trade-off between accuracy and efficiency, along with SYQ, Apprentice and Jacob et al. (2017). SYQ, however, employs “bucketing” and Apprentice uses distillation, both of which can be combined with RQ and improve performance. Jacob et al. (2017) does better than RQ with 8 bits, however RQ improved w.r.t. to its pretrained model, whereas Jacob et al. (2017) decreased slightly. For experimental details with Jacob et al. (2017), please confer Appendix C.1. $\\mathrm { S R + D R }$ underperforms in this setting and is worse than simple rounding for 5 to 8 bits. ",
855
+ "bbox": [
856
+ 174,
857
+ 590,
858
+ 825,
859
+ 689
860
+ ],
861
+ "page_idx": 7
862
+ },
863
+ {
864
+ "type": "text",
865
+ "text": "For Mobilenet, 4b shows that RQ is competitive to existing approaches. Simple rounding resulted in almost random chance for all of the bit configurations. $\\mathrm { S R + D R }$ shows its strength for the 8 bit scenario, while in the lower bit regime, RQ outperforms competitive approaches. ",
866
+ "bbox": [
867
+ 176,
868
+ 695,
869
+ 825,
870
+ 738
871
+ ],
872
+ "page_idx": 7
873
+ },
874
+ {
875
+ "type": "text",
876
+ "text": "5 DISCUSSION ",
877
+ "text_level": 1,
878
+ "bbox": [
879
+ 174,
880
+ 757,
881
+ 310,
882
+ 773
883
+ ],
884
+ "page_idx": 7
885
+ },
886
+ {
887
+ "type": "text",
888
+ "text": "We have introduced Relaxed Quantization (RQ), a powerful and versatile algorithm for learning low-bit neural networks using a uniform quantization scheme. As such, the models trained by this method can be easily transferred and executed on low-bit fixed point chipsets. We have extensively evaluated RQ on various image classification benchmarks and have shown that it allows for the better trade-offs between accuracy and bit operations per second. ",
889
+ "bbox": [
890
+ 174,
891
+ 789,
892
+ 823,
893
+ 858
894
+ ],
895
+ "page_idx": 7
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "Future hardware might enable us to cheaply do non-uniform quantization, for which this method can be easily extended. (Lai et al., 2017; Ortiz et al., 2018) for example, show the benefits of low-bit floating point weights that can be efficiently implemented in hardware. The floating point quantization grid can be easily learned with RQ by redefining $\\hat { \\mathcal G }$ . General non-uniform quantization, as described for example in (Baskin et al., 2018), is a natural extension to RQ, whose exploration we leave to future work. For example, we could experiment with a base grid that is defined as in Zhang et al. (2018). Currently, the bit-width of every quantizer is determined beforehand, but in future work we will explore learning the required bit precision within this framework. In our experiments, batch normalization was implemented as a sequence of convolution, batch normalization and quantization. On a low-precision chip, however, batch normalization would be ”folded” (Jacob et al., 2017) into the kernel and bias of the convolution, the result of which is then rounded to low precision. In order to accurately reflect this folding at test time, future work on the proposed algorithm will emulate folded batchnorm at training time and learn the corresponding quantization grid of the modified kernel and bias. For fast model evaluation on low-precision hardware, quantization goes hand-in-hand with network pruning. The proposed method is orthogonal to pruning methods such as, for example, $L _ { 0 }$ regularization (Louizos et al., 2017b), which allows for group sparsity and pruning of hidden units. ",
900
+ "bbox": [
901
+ 174,
902
+ 866,
903
+ 823,
904
+ 924
905
+ ],
906
+ "page_idx": 7
907
+ },
908
+ {
909
+ "type": "image",
910
+ "img_path": "images/ebf2c94dff571b8712b4006b142ae2dbf0f39c837d80ca7b9cba7b00cc25f434.jpg",
911
+ "image_caption": [
912
+ "Figure 4: Best viewed in color. Comparison of various methods on Resnet-18 and Mobilenet according to top-1 error (on the y-axis) and bit operations (on the $\\mathbf { X }$ -axis) computed according to the formula described in Baskin et al. (2018). Each dashed line corresponds to employing a specific bit configuration for every layer’s weights and activations. Values for top-1 and top-5 errors are given in Table 2 in the Appendix. We compare against multiple works that employ fixed-point quantization: $\\mathrm { S R + D R }$ (Gupta et al., 2015; Gysel et al., 2018), LR Net (Shayer et al., 2018), Jacob et al. (2017), TWN (Li et al., 2016), INQ (Zhou et al., 2017), BWN (Rastegari et al., 2016), XNORnet (Rastegari et al., 2016), DoReFa (Zhou et al., 2016), HWGQ (Cai et al., 2017), ELQ Zhou et al. (2018), SYQ (Faraone et al., 2018), Apprentice (Mishra & Marr, 2017), QSM (Sheng et al., 2018) and rounding. "
913
+ ],
914
+ "image_footnote": [],
915
+ "bbox": [
916
+ 171,
917
+ 88,
918
+ 825,
919
+ 315
920
+ ],
921
+ "page_idx": 8
922
+ },
923
+ {
924
+ "type": "text",
925
+ "text": "",
926
+ "bbox": [
927
+ 173,
928
+ 493,
929
+ 826,
930
+ 660
931
+ ],
932
+ "page_idx": 8
933
+ },
934
+ {
935
+ "type": "text",
936
+ "text": "REFERENCES ",
937
+ "text_level": 1,
938
+ "bbox": [
939
+ 174,
940
+ 683,
941
+ 285,
942
+ 696
943
+ ],
944
+ "page_idx": 8
945
+ },
946
+ {
947
+ "type": "text",
948
+ "text": "Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, ´ Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org. ",
949
+ "bbox": [
950
+ 176,
951
+ 705,
952
+ 826,
953
+ 832
954
+ ],
955
+ "page_idx": 8
956
+ },
957
+ {
958
+ "type": "text",
959
+ "text": "Jan Achterhold, Jan Mathias Koehler, Anke Schmeink, and Tim Genewein. Variational network quantization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ ry-TW-WAb. ",
960
+ "bbox": [
961
+ 173,
962
+ 842,
963
+ 825,
964
+ 885
965
+ ],
966
+ "page_idx": 8
967
+ },
968
+ {
969
+ "type": "text",
970
+ "text": "Chaim Baskin, Eli Schwartz, Evgenii Zheltonozhskii, Natan Liss, Raja Giryes, Alex M Bronstein, and Avi Mendelson. Uniq: Uniform noise injection for the quantization of neural networks. arXiv ",
971
+ "bbox": [
972
+ 174,
973
+ 895,
974
+ 823,
975
+ 924
976
+ ],
977
+ "page_idx": 8
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "preprint arXiv:1804.10969, 2018. ",
982
+ "bbox": [
983
+ 189,
984
+ 103,
985
+ 413,
986
+ 118
987
+ ],
988
+ "page_idx": 9
989
+ },
990
+ {
991
+ "type": "text",
992
+ "text": "Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. ",
993
+ "bbox": [
994
+ 173,
995
+ 128,
996
+ 823,
997
+ 157
998
+ ],
999
+ "page_idx": 9
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "text": "Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. arXiv preprint arXiv:1702.00953, 2017. ",
1004
+ "bbox": [
1005
+ 171,
1006
+ 166,
1007
+ 823,
1008
+ 195
1009
+ ],
1010
+ "page_idx": 9
1011
+ },
1012
+ {
1013
+ "type": "text",
1014
+ "text": "Franc¸ois Chollet et al. Keras. https://keras.io, 2015. ",
1015
+ "bbox": [
1016
+ 173,
1017
+ 205,
1018
+ 575,
1019
+ 220
1020
+ ],
1021
+ "page_idx": 9
1022
+ },
1023
+ {
1024
+ "type": "text",
1025
+ "text": "Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pp. 3123–3131, 2015. ",
1026
+ "bbox": [
1027
+ 176,
1028
+ 229,
1029
+ 823,
1030
+ 272
1031
+ ],
1032
+ "page_idx": 9
1033
+ },
1034
+ {
1035
+ "type": "text",
1036
+ "text": "Julian Faraone, Nicholas Fraser, Michaela Blott, and Philip HW Leong. Syq: Learning symmetric quantization for efficient deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4300–4309, 2018. ",
1037
+ "bbox": [
1038
+ 173,
1039
+ 281,
1040
+ 826,
1041
+ 325
1042
+ ],
1043
+ "page_idx": 9
1044
+ },
1045
+ {
1046
+ "type": "text",
1047
+ "text": "Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pp. 1737–1746, 2015. ",
1048
+ "bbox": [
1049
+ 174,
1050
+ 334,
1051
+ 826,
1052
+ 377
1053
+ ],
1054
+ "page_idx": 9
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "text": "Philipp Gysel, Jon Pimentel, Mohammad Motamedi, and Soheil Ghiasi. Ristretto: A framework for empirical study of resource-efficient inference in convolutional neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2018. doi: 10.1109/TNNLS.2018.2808319. ",
1059
+ "bbox": [
1060
+ 173,
1061
+ 387,
1062
+ 826,
1063
+ 430
1064
+ ],
1065
+ "page_idx": 9
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015. ",
1070
+ "bbox": [
1071
+ 171,
1072
+ 439,
1073
+ 823,
1074
+ 469
1075
+ ],
1076
+ "page_idx": 9
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "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. ",
1081
+ "bbox": [
1082
+ 174,
1083
+ 478,
1084
+ 825,
1085
+ 521
1086
+ ],
1087
+ "page_idx": 9
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. ",
1092
+ "bbox": [
1093
+ 174,
1094
+ 530,
1095
+ 826,
1096
+ 574
1097
+ ],
1098
+ "page_idx": 9
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016. ",
1103
+ "bbox": [
1104
+ 174,
1105
+ 583,
1106
+ 825,
1107
+ 626
1108
+ ],
1109
+ "page_idx": 9
1110
+ },
1111
+ {
1112
+ "type": "text",
1113
+ "text": "Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv preprint arXiv:1712.05877, 2017. ",
1114
+ "bbox": [
1115
+ 174,
1116
+ 635,
1117
+ 825,
1118
+ 679
1119
+ ],
1120
+ "page_idx": 9
1121
+ },
1122
+ {
1123
+ "type": "text",
1124
+ "text": "Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. ",
1125
+ "bbox": [
1126
+ 173,
1127
+ 688,
1128
+ 825,
1129
+ 717
1130
+ ],
1131
+ "page_idx": 9
1132
+ },
1133
+ {
1134
+ "type": "text",
1135
+ "text": "Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
1136
+ "bbox": [
1137
+ 173,
1138
+ 727,
1139
+ 823,
1140
+ 756
1141
+ ],
1142
+ "page_idx": 9
1143
+ },
1144
+ {
1145
+ "type": "text",
1146
+ "text": "Liangzhen Lai, Naveen Suda, and Vikas Chandra. Deep convolutional neural network inference with floating-point weights and fixed-point activations. arXiv preprint arXiv:1703.03073, 2017. ",
1147
+ "bbox": [
1148
+ 171,
1149
+ 765,
1150
+ 823,
1151
+ 795
1152
+ ],
1153
+ "page_idx": 9
1154
+ },
1155
+ {
1156
+ "type": "text",
1157
+ "text": "Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems 2, NIPS 1989, volume 2, pp. 598–605. Morgan-Kaufmann Publishers, 1990. ",
1158
+ "bbox": [
1159
+ 174,
1160
+ 804,
1161
+ 825,
1162
+ 847
1163
+ ],
1164
+ "page_idx": 9
1165
+ },
1166
+ {
1167
+ "type": "text",
1168
+ "text": "Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016. ",
1169
+ "bbox": [
1170
+ 173,
1171
+ 856,
1172
+ 823,
1173
+ 886
1174
+ ],
1175
+ "page_idx": 9
1176
+ },
1177
+ {
1178
+ "type": "text",
1179
+ "text": "Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. arXiv preprint arXiv:1705.08665, 2017a. ",
1180
+ "bbox": [
1181
+ 176,
1182
+ 895,
1183
+ 821,
1184
+ 924
1185
+ ],
1186
+ "page_idx": 9
1187
+ },
1188
+ {
1189
+ "type": "text",
1190
+ "text": "Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l _ { 0 }$ regularization. arXiv preprint arXiv:1712.01312, 2017b. ",
1191
+ "bbox": [
1192
+ 171,
1193
+ 103,
1194
+ 825,
1195
+ 132
1196
+ ],
1197
+ "page_idx": 10
1198
+ },
1199
+ {
1200
+ "type": "text",
1201
+ "text": "Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016. ",
1202
+ "bbox": [
1203
+ 173,
1204
+ 140,
1205
+ 823,
1206
+ 170
1207
+ ],
1208
+ "page_idx": 10
1209
+ },
1210
+ {
1211
+ "type": "text",
1212
+ "text": "Asit Mishra and Debbie Marr. Apprentice: Using knowledge distillation techniques to improve low-precision network accuracy. arXiv preprint arXiv:1711.05852, 2017. ",
1213
+ "bbox": [
1214
+ 171,
1215
+ 178,
1216
+ 823,
1217
+ 208
1218
+ ],
1219
+ "page_idx": 10
1220
+ },
1221
+ {
1222
+ "type": "text",
1223
+ "text": "Asit Mishra, Eriko Nurvitadhi, Jeffrey J Cook, and Debbie Marr. Wrpn: wide reduced-precision networks. arXiv preprint arXiv:1709.01134, 2017. ",
1224
+ "bbox": [
1225
+ 173,
1226
+ 214,
1227
+ 823,
1228
+ 244
1229
+ ],
1230
+ "page_idx": 10
1231
+ },
1232
+ {
1233
+ "type": "text",
1234
+ "text": "Marc Ortiz, Adrian Cristal, Eduard Ayguad ´ e, and Marc Casas. Low-precision floating-point schemes ´ for neural network training. arXiv preprint arXiv:1804.05267, 2018. ",
1235
+ "bbox": [
1236
+ 171,
1237
+ 252,
1238
+ 825,
1239
+ 282
1240
+ ],
1241
+ "page_idx": 10
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "Jorn WT Peters and Max Welling. Probabilistic binary neural networks. arXiv preprint arXiv:1809.03368, 2018. ",
1246
+ "bbox": [
1247
+ 171,
1248
+ 289,
1249
+ 825,
1250
+ 319
1251
+ ],
1252
+ "page_idx": 10
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "Antonio Polino, Razvan Pascanu, and Dan Alistarh. Model compression via distillation and quantization. arXiv preprint arXiv:1802.05668, 2018. ",
1257
+ "bbox": [
1258
+ 169,
1259
+ 327,
1260
+ 826,
1261
+ 357
1262
+ ],
1263
+ "page_idx": 10
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016. ",
1268
+ "bbox": [
1269
+ 174,
1270
+ 364,
1271
+ 823,
1272
+ 407
1273
+ ],
1274
+ "page_idx": 10
1275
+ },
1276
+ {
1277
+ "type": "text",
1278
+ "text": "Oran Shayer, Dan Levi, and Ethan Fetaya. Learning discrete weights using the local reparameterization trick. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ BySRH6CpW. ",
1279
+ "bbox": [
1280
+ 176,
1281
+ 415,
1282
+ 823,
1283
+ 459
1284
+ ],
1285
+ "page_idx": 10
1286
+ },
1287
+ {
1288
+ "type": "text",
1289
+ "text": "Tao Sheng, Chen Feng, Shaojie Zhuo, Xiaopeng Zhang, Liang Shen, and Mickey Aleksic. A quantization-friendly separable convolution for mobilenets. 2018. ",
1290
+ "bbox": [
1291
+ 171,
1292
+ 467,
1293
+ 825,
1294
+ 496
1295
+ ],
1296
+ "page_idx": 10
1297
+ },
1298
+ {
1299
+ "type": "text",
1300
+ "text": "Daniel Soudry, Itay Hubara, and Ron Meir. Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. In Advances in Neural Information Processing Systems, pp. 963–971, 2014. ",
1301
+ "bbox": [
1302
+ 174,
1303
+ 503,
1304
+ 821,
1305
+ 546
1306
+ ],
1307
+ "page_idx": 10
1308
+ },
1309
+ {
1310
+ "type": "text",
1311
+ "text": "Joe Staines and David Barber. Variational optimization. arXiv preprint arXiv:1212.4507, 2012. ",
1312
+ "bbox": [
1313
+ 171,
1314
+ 554,
1315
+ 799,
1316
+ 570
1317
+ ],
1318
+ "page_idx": 10
1319
+ },
1320
+ {
1321
+ "type": "text",
1322
+ "text": "Karen Ullrich, Edward Meeds, and Max Welling. Soft weight-sharing for neural network compression. ICLR, 2017. ",
1323
+ "bbox": [
1324
+ 171,
1325
+ 578,
1326
+ 825,
1327
+ 608
1328
+ ],
1329
+ "page_idx": 10
1330
+ },
1331
+ {
1332
+ "type": "text",
1333
+ "text": "Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. ",
1334
+ "bbox": [
1335
+ 173,
1336
+ 616,
1337
+ 825,
1338
+ 645
1339
+ ],
1340
+ "page_idx": 10
1341
+ },
1342
+ {
1343
+ "type": "text",
1344
+ "text": "Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ HJGXzmspb. ",
1345
+ "bbox": [
1346
+ 176,
1347
+ 652,
1348
+ 823,
1349
+ 696
1350
+ ],
1351
+ "page_idx": 10
1352
+ },
1353
+ {
1354
+ "type": "text",
1355
+ "text": "Penghang Yin, Shuai Zhang, Yingyong Qi, and Jack Xin. Quantization and training of low bit-width convolutional neural networks for object detection. arXiv preprint arXiv:1612.06052, 2016. ",
1356
+ "bbox": [
1357
+ 171,
1358
+ 704,
1359
+ 823,
1360
+ 734
1361
+ ],
1362
+ "page_idx": 10
1363
+ },
1364
+ {
1365
+ "type": "text",
1366
+ "text": "Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Binaryrelax: A relaxation approach for training deep neural networks with quantized weights. SIAM Journal on Imaging Sciences, 11(4):2205–2223, 2018. ",
1367
+ "bbox": [
1368
+ 176,
1369
+ 741,
1370
+ 825,
1371
+ 785
1372
+ ],
1373
+ "page_idx": 10
1374
+ },
1375
+ {
1376
+ "type": "text",
1377
+ "text": "Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Blended coarse gradient descent for full quantization of deep neural networks. Research in the Mathematical Sciences, 6(1):14, 2019. ",
1378
+ "bbox": [
1379
+ 173,
1380
+ 792,
1381
+ 825,
1382
+ 835
1383
+ ],
1384
+ "page_idx": 10
1385
+ },
1386
+ {
1387
+ "type": "text",
1388
+ "text": "Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In European Conference on Computer Vision (ECCV), 2018. ",
1389
+ "bbox": [
1390
+ 171,
1391
+ 843,
1392
+ 823,
1393
+ 887
1394
+ ],
1395
+ "page_idx": 10
1396
+ },
1397
+ {
1398
+ "type": "text",
1399
+ "text": "Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017. ",
1400
+ "bbox": [
1401
+ 173,
1402
+ 895,
1403
+ 823,
1404
+ 924
1405
+ ],
1406
+ "page_idx": 10
1407
+ },
1408
+ {
1409
+ "type": "text",
1410
+ "text": "Aojun Zhou, Anbang Yao, Kuan Wang, and Yurong Chen. Explicit loss-error-aware quantization for low-bit deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9426–9435, 2018. ",
1411
+ "bbox": [
1412
+ 176,
1413
+ 103,
1414
+ 823,
1415
+ 146
1416
+ ],
1417
+ "page_idx": 11
1418
+ },
1419
+ {
1420
+ "type": "text",
1421
+ "text": "Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. ",
1422
+ "bbox": [
1423
+ 174,
1424
+ 156,
1425
+ 823,
1426
+ 198
1427
+ ],
1428
+ "page_idx": 11
1429
+ },
1430
+ {
1431
+ "type": "text",
1432
+ "text": "Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016. ",
1433
+ "bbox": [
1434
+ 174,
1435
+ 208,
1436
+ 821,
1437
+ 237
1438
+ ],
1439
+ "page_idx": 11
1440
+ },
1441
+ {
1442
+ "type": "text",
1443
+ "text": "A EXPERIMENTAL DETAILS ",
1444
+ "text_level": 1,
1445
+ "bbox": [
1446
+ 178,
1447
+ 265,
1448
+ 416,
1449
+ 280
1450
+ ],
1451
+ "page_idx": 11
1452
+ },
1453
+ {
1454
+ "type": "text",
1455
+ "text": "The grid width $\\alpha$ of each grid was initialized according to the bit-width $b$ and the maximum and minimum values of the input $x$ to the quantizer2. Since the inputs $\\tilde { x }$ in both cases for our approach are stochastic it makes sense to assume a width for the grid that is slightly larger than the standard width $t = ( \\operatorname* { m a x } ( x ) - \\operatorname* { m i n } ( x ) ) / 2 ^ { b }$ ; for the activations, whenever $b > 4$ , we initialize $\\alpha = t + 3 t / 2 ^ { b }$ , for $4 \\geq b > 2$ we used $\\alpha = { { t + 3 t } \\ o { / { 2 ^ { b + 1 } } } }$ and finally for $b = 2$ we used $\\alpha = t$ . Since with ReLU activations the magnitude can become quite large (thus leading to increased quantization noise for smaller bit widths), this scheme keeps the noise injected to the network in check. For the weights we always used an initial $\\alpha = t + 3 t / \\dot { 2 } ^ { b }$ . The standard deviation of the logistic noise $\\sigma$ was initialized to be three times smaller than the width $\\alpha$ , i.e. $\\sigma = \\alpha / 3$ . Under this specification, most of the probability mass of the logistic distribution is initially (roughly) in the bins containing the closest grid point and its’ two neighbors. ",
1456
+ "bbox": [
1457
+ 174,
1458
+ 296,
1459
+ 825,
1460
+ 449
1461
+ ],
1462
+ "page_idx": 11
1463
+ },
1464
+ {
1465
+ "type": "text",
1466
+ "text": "The moving averages of layer statistics that are aggregated during the training phase for the batch normalization do not necessarily reflect the statistics of the quantized model accurately. Even though RQ aims to minimize the gap between training and testing phase, we found that the aggregated statistics in combination with the learned scale and shift parameters of batch normalization lead to decreased test performance. In order to avoid this drop in accuracy, we apply the insights from (Peters & Welling, 2018) and recompute the statistics of the quantized model before reporting the final test error rate. The final models were determined through early stopping using the validation loss computed with minibatch statistics, in case the model uses batch normalization. ",
1467
+ "bbox": [
1468
+ 174,
1469
+ 455,
1470
+ 825,
1471
+ 568
1472
+ ],
1473
+ "page_idx": 11
1474
+ },
1475
+ {
1476
+ "type": "text",
1477
+ "text": "For the MNIST experiment we rescaled the input to the [-1, 1] range, employed no regularization and the network was trained with Adam (Kingma & Ba, 2014) and a batch size of 128. We used a local grid whenever the bit width was larger than 2 for both, weights and biases (shared grid parameters), as well as for the ouputs of the ReLU, with $\\delta = 3$ . For the 8 and 4 bit networks we used a temperature $\\lambda$ of 2 whereas for the 2 bit models we used a temperature of 1 for RQ. We trained the 8 and 4 bit networks for 100 epochs using a learning rate of 1e-3 and the 2 bit networks for 200 epochs with a learning rate of 5e-4. In all of the cases the learning rate was annealed to zero during the last 50 epochs. ",
1478
+ "bbox": [
1479
+ 174,
1480
+ 574,
1481
+ 825,
1482
+ 685
1483
+ ],
1484
+ "page_idx": 11
1485
+ },
1486
+ {
1487
+ "type": "text",
1488
+ "text": "For the CIFAR 10 experiment, the hyperparameters were chosen identically to the LeNet-5 experiments except a few differences. We chose a learning rate ot 1e-4 instead of 1e-3 for 8 and 4 bit networks and trained for 300 epochs with a batch size of 100. We also included a weight decay term of 1e-4 for the 8 bit networks. For the 2 bit model we started with a learning rate of 1e-3. The VGG model contains a batch normalization layer after every convolutional layer, but preceeded by max pooling, if present. ",
1489
+ "bbox": [
1490
+ 174,
1491
+ 693,
1492
+ 825,
1493
+ 776
1494
+ ],
1495
+ "page_idx": 11
1496
+ },
1497
+ {
1498
+ "type": "text",
1499
+ "text": "B CONVERGENCE SPEED OF VGG ON CIFAR 10 ",
1500
+ "text_level": 1,
1501
+ "bbox": [
1502
+ 176,
1503
+ 796,
1504
+ 596,
1505
+ 813
1506
+ ],
1507
+ "page_idx": 11
1508
+ },
1509
+ {
1510
+ "type": "text",
1511
+ "text": "Training a neural network with RQ imposes an additional sampling burden for every weight and activation in the network. Here, we investigate whether the extra “noise” that is introduced hampers the convergence speed of the network when we train from a random initialization. We recorded the learning curves for a $2 / 2$ bit RQ-VGG network on CIFAR 10 (as this quantization level exhibits the largest amount of noise) and compare it to the full precision baseline. The results can be seen in ",
1512
+ "bbox": [
1513
+ 174,
1514
+ 829,
1515
+ 823,
1516
+ 898
1517
+ ],
1518
+ "page_idx": 11
1519
+ },
1520
+ {
1521
+ "type": "text",
1522
+ "text": "Figure 5. As we can observe, the 2/2 bit network has qualitatively similar trends to the full precision baseline. Therefore we can conclude that the noise is not detrimental for the task at hand, at least for this particular model. In terms of wall-clock time, training the RQ model with a full (4 elements) grid took approximately 15 times as long as the high-precision baseline with an implementation in Tensorflow v1.11.0 and running on a single Titan-X Nvidia GPU. ",
1523
+ "bbox": [
1524
+ 173,
1525
+ 103,
1526
+ 825,
1527
+ 174
1528
+ ],
1529
+ "page_idx": 12
1530
+ },
1531
+ {
1532
+ "type": "image",
1533
+ "img_path": "images/13bf7464f37b06660fb16b368a648b94601b945f6a890c59faa69f6427f4793a.jpg",
1534
+ "image_caption": [
1535
+ "Figure 5: Learning curves for the VGG on CIFAR 10. "
1536
+ ],
1537
+ "image_footnote": [],
1538
+ "bbox": [
1539
+ 192,
1540
+ 190,
1541
+ 789,
1542
+ 511
1543
+ ],
1544
+ "page_idx": 12
1545
+ },
1546
+ {
1547
+ "type": "text",
1548
+ "text": "C IMAGENET DETAILS ",
1549
+ "text_level": 1,
1550
+ "bbox": [
1551
+ 174,
1552
+ 569,
1553
+ 375,
1554
+ 585
1555
+ ],
1556
+ "page_idx": 12
1557
+ },
1558
+ {
1559
+ "type": "text",
1560
+ "text": "Each channel of the input images was preprocessed by subtracting the mean and dividing by the standard deviation of that channel across the training set. We then resized the images such that the shorter side is set to 256 and then applied random $2 2 4 \\mathrm { x } 2 2 4$ crops and random horizontal flips for data augmentation. For evaluation we consider the center $2 2 4 \\mathbf { x } 2 2 4$ crop of the images. ",
1561
+ "bbox": [
1562
+ 174,
1563
+ 601,
1564
+ 825,
1565
+ 656
1566
+ ],
1567
+ "page_idx": 12
1568
+ },
1569
+ {
1570
+ "type": "text",
1571
+ "text": "We trained the base Resnet-18 model with stochastic gradient descent, a batch size of 128, nesterov momentum of 0.9 and a learning rate of 0.1 which was multiplied by 0.1 at the 30th and 60th epoch. We also applied weight decay with a strength of 1e-4. For the quantized model fine-tuning phase, we used Adam with a learning rate of $5 e ^ { - \\tilde { 6 } }$ , a batch size of 24 and a momentum of 0.99. We used a temperature of 2 for both RQ variants. Following the strategy in (Jacob et al., 2017), we did not quantize the biases. ",
1572
+ "bbox": [
1573
+ 174,
1574
+ 664,
1575
+ 825,
1576
+ 747
1577
+ ],
1578
+ "page_idx": 12
1579
+ },
1580
+ {
1581
+ "type": "text",
1582
+ "text": "Table 2 contains the error rates for Resnet-18 and Mobilenet on which Figure 1 is based on. Algorithm and architecture specific changes are mentioned explicitly through footnotes. ",
1583
+ "bbox": [
1584
+ 173,
1585
+ 755,
1586
+ 823,
1587
+ 784
1588
+ ],
1589
+ "page_idx": 12
1590
+ },
1591
+ {
1592
+ "type": "text",
1593
+ "text": "C.1 JACOB ET AL. (2017) FOR RESNET18 ",
1594
+ "text_level": 1,
1595
+ "bbox": [
1596
+ 176,
1597
+ 800,
1598
+ 475,
1599
+ 814
1600
+ ],
1601
+ "page_idx": 12
1602
+ },
1603
+ {
1604
+ "type": "text",
1605
+ "text": "We used the code provided at https://github.com/tensorflow/models/tree/ master/official/resnet and modified the construction of the training and evaluation graph by inserting quantization operations provided by the tensorflow.contrib.quantize package. In a first step, the unmodified code was used to train a high-precision Resnet18 model using the hyper-parameter settings for the learning rate scheduling that are provided in the github repository. More specifically, the model was trained for 90 epochs with a batch size of 128. The learning rate scheduling involved a ”warm up” period in which the learning rate was annealed from zero to 0.64 over the first $5 0 k$ steps, after which it was divided by 10 after epochs 30, 60 and 80 respectively. Gradients were modified using a momentum of 0.9. Final test performance under this procedure is $2 9 . 5 3 \\%$ top-1 error and $1 0 . 4 4 \\%$ top-5 error. From the high-precision model checkpoint, the final quantized model was then fine-tuned for 10 epochs using a constant learning rate of $1 e ^ { - 4 }$ and momentum of 0.9. We did not freeze the moving averages of the batch normalization layers. Finally, we found that re-estimating the batchnorm statistics was harmful for this algorithm. We hypothesise that this is due to the usage of folded batch normalization, which incorporates the statistics into the construction of the grid at training time. ",
1606
+ "bbox": [
1607
+ 174,
1608
+ 827,
1609
+ 825,
1610
+ 924
1611
+ ],
1612
+ "page_idx": 12
1613
+ },
1614
+ {
1615
+ "type": "table",
1616
+ "img_path": "images/076d9939bd7745a5c7f581a839fb1322cb83b68f04626cf3095656f6ead9beea.jpg",
1617
+ "table_caption": [
1618
+ "Table 2: Top-1 and top-5 error $( \\% )$ with Resnet18 and Mobilenet (full resolution and multiplier of one) on Imagenet "
1619
+ ],
1620
+ "table_footnote": [
1621
+ "aIncludes folded batch normalization bFirst and last layer not quantized cFirst layer not quantized dModified architecture eResults taken from https://github.com/tensorpack/tensorpack/blob/master/ examples/DoReFa-Net/resnet-dorefa.py fWeights of first and last layer not quantized "
1622
+ ],
1623
+ "table_body": "<table><tr><td colspan=\"2\"></td><td colspan=\"2\">Resnet18</td><td colspan=\"2\">Mobilenet</td></tr><tr><td>Method</td><td># Bits weights/act.</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td>Original</td><td>32/32</td><td>30.46</td><td>10.81</td><td>29.39</td><td>10.53</td></tr><tr><td rowspan=\"2\">SR+DR (Gupta et al., 2015; Gysel et al., 2018)</td><td>8/8</td><td>31.83</td><td>11.48</td><td>28.70</td><td>10.04</td></tr><tr><td>6/6</td><td>40.75 45.48</td><td>16.90 20.16</td><td>33.34 40.61</td><td>12.83</td></tr><tr><td rowspan=\"2\">Rounding</td><td>5/5</td><td></td><td></td><td></td><td>17.65</td></tr><tr><td>8/8</td><td>30.22</td><td>10.60</td><td>1</td><td>1</td></tr><tr><td rowspan=\"3\">(Jacob et al., 2017)a</td><td>6/6</td><td>31.61 36.97</td><td>11.32 14.95</td><td></td><td></td></tr><tr><td>5/5</td><td>78.79</td><td>57.10</td><td>= 1</td><td></td></tr><tr><td>4/4</td><td>29.62</td><td>10.45</td><td></td><td>1</td></tr><tr><td rowspan=\"3\"></td><td>8/8</td><td>32.69</td><td>12.46</td><td>30.30</td><td>10.50</td></tr><tr><td>6/6 5/5</td><td>35.36</td><td>13.33</td><td>1 =</td><td>1</td></tr><tr><td>1/32b</td><td>40.10</td><td>17.70</td><td></td><td></td></tr><tr><td rowspan=\"2\">LR Net (Shayer et al., 2018)</td><td>2/32℃</td><td>36.50</td><td>15.20</td><td></td><td></td></tr><tr><td>8/8</td><td>1</td><td>1</td><td>31.97</td><td></td></tr><tr><td>QSM (Sheng et al., 2018)a d</td><td></td><td>38.20</td><td>15.80</td><td></td><td></td></tr><tr><td>TWN (Li et al., 2016) INQ (Zhou et al., 2017)</td><td>2/32 5/32</td><td>31.02</td><td>10.90</td><td></td><td></td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>39.20</td><td>17.00</td><td></td><td></td></tr><tr><td>XNOR-net (Rastegari et al., 2016)</td><td>1/1</td><td>48.80</td><td>26.80</td><td></td><td></td></tr><tr><td>HWGQ (Cai et al., 2017)b</td><td>1/2</td><td>40.4</td><td>17.8</td><td></td><td></td></tr><tr><td>DoReFa (Zhou et al., 2016)be</td><td>1/4</td><td>40.8</td><td>18.5</td><td></td><td></td></tr><tr><td>ELQ (Zhou et al., 2018)</td><td>1/32</td><td>35.28</td><td>13.96</td><td></td><td></td></tr><tr><td></td><td>2/32</td><td>32.48</td><td>11.95</td><td></td><td></td></tr><tr><td rowspan=\"2\">SYQ (Faraone et al., 2018)f</td><td>1/8</td><td>37.1</td><td>15.4</td><td></td><td></td></tr><tr><td>2/8</td><td>32.3</td><td>12.2</td><td></td><td></td></tr><tr><td rowspan=\"2\">Apprentice (Mishra &amp; Marr,2017)b</td><td></td><td>32</td><td></td><td></td><td></td></tr><tr><td>2/8 4/8</td><td>29.6</td><td>一</td><td></td><td></td></tr><tr><td rowspan=\"3\">RQ (ours)</td><td>8/8</td><td></td><td></td><td></td><td></td></tr><tr><td>6/6</td><td>30.03 31.35</td><td>10.56 11.22</td><td>29.57 31.98</td><td>10.58 12.00</td></tr><tr><td>5/5</td><td>34.90</td><td>13.43</td><td>38.62</td><td>16.27</td></tr><tr><td rowspan=\"4\">RQ ST (ours)</td><td>4/4</td><td>38.48</td><td>16.01</td><td>1</td><td>1</td></tr><tr><td>8/8</td><td>30.37</td><td>10.67</td><td>29.94</td><td>10.48</td></tr><tr><td>6/6</td><td>31.85</td><td>11.62</td><td>32.38</td><td>12.22</td></tr><tr><td>5/5</td><td>36.65</td><td>14.54</td><td>43.15</td><td>19.65</td></tr><tr><td></td><td>4/4</td><td>37.54</td><td>15.22</td><td>1</td><td>1</td></tr></table>",
1624
+ "bbox": [
1625
+ 174,
1626
+ 132,
1627
+ 821,
1628
+ 738
1629
+ ],
1630
+ "page_idx": 13
1631
+ },
1632
+ {
1633
+ "type": "text",
1634
+ "text": "",
1635
+ "bbox": [
1636
+ 173,
1637
+ 867,
1638
+ 826,
1639
+ 924
1640
+ ],
1641
+ "page_idx": 13
1642
+ },
1643
+ {
1644
+ "type": "text",
1645
+ "text": "",
1646
+ "bbox": [
1647
+ 174,
1648
+ 103,
1649
+ 825,
1650
+ 160
1651
+ ],
1652
+ "page_idx": 14
1653
+ },
1654
+ {
1655
+ "type": "text",
1656
+ "text": "C.2 JACOB ET AL. (2017) FOR MOBILENET ",
1657
+ "text_level": 1,
1658
+ "bbox": [
1659
+ 176,
1660
+ 176,
1661
+ 485,
1662
+ 190
1663
+ ],
1664
+ "page_idx": 14
1665
+ },
1666
+ {
1667
+ "type": "text",
1668
+ "text": "The $8 / 8$ bit results for quantizing Mobilenet provided in table 2 are read off from Figure 4.1 in Jacob et al. (2017). The pre-trained models published at https://github.com/tensorflow/ models/blob/master/research/slim/nets/mobilenet_v1.md originally reflected that number up until commit 4415c2613b0c74032a7c631769ef9fa7f5477d88, but have since been updated to improved error rates of 29.9 and 11.1 respectively. Unfortunately, there are several conflicting sources for quantized Mobilenet results and pretrainedmodels within the tensorflow github repository. https://github.com/tensorflow/ tensorflow/blob/master/tensorflow/contrib/lite/g3doc/models.md# image-classification-quantized-models, for example, reports error rates of 30.0 and 11.0, whereas at https://github.com/tensorflow/tensorflow/tree/master/ tensorflow/contrib/quantize the reported top-1 error rate is 30.3. ",
1669
+ "bbox": [
1670
+ 173,
1671
+ 203,
1672
+ 826,
1673
+ 356
1674
+ ],
1675
+ "page_idx": 14
1676
+ },
1677
+ {
1678
+ "type": "text",
1679
+ "text": "We attempted to use the provided training scripts in the https://github.com/tensorflow/ models/blob/master/research/slim repository to train lower-bit mobilenet variants, but did not succeed in doing so. We experimented with learning rates in the range of $[ 5 e ^ { - 6 } , 5 e ^ { - 5 } , 1 e ^ { - 4 } ]$ for $5 / 5 , \\ 6 / 6$ and $8 / 8$ bit-width variants, but could not achieve significant accuracy improvements within the first 10 epochs of fine-tuning of the high-precision model published at https://github.com/tensorflow/models/blob/master/research/ slim/nets/mobilenet_v1.md. After 10 epochs, the $8 / 8$ version achieved 31.39 top-1 error with a learning rate of $1 e ^ { - 4 }$ and as such is worse than the published results. We therefore chose to only include the published numbers for the $8 / 8$ bit model and leave addition hyperparameter tuning to future work. ",
1680
+ "bbox": [
1681
+ 173,
1682
+ 362,
1683
+ 826,
1684
+ 501
1685
+ ],
1686
+ "page_idx": 14
1687
+ }
1688
+ ]
parse/train/HkxjYoCqKX/HkxjYoCqKX_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkxjYoCqKX/HkxjYoCqKX_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/LKUfuWxajHc/LKUfuWxajHc.md ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TransMIL: Transformer based Correlated Multiple Instance Learning for Whole Slide Image Classification
2
+
3
+ Zhuchen Shao∗,1, Hao Bian∗,1, Yang Chen∗,1, Yifeng Wang2, Jian Zhang3, Xiangyang Ji4 Yongbing Zhang†,2
4
+
5
+ 1Tsinghua Shenzhen International Graduate School, Tsinghua University 2Harbin Institute of Technology (Shenzhen) 3School of Electronic and Computer Engineering, Peking University 4Department of Automation, Tsinghua University
6
+
7
+ # Abstract
8
+
9
+ Multiple instance learning (MIL) is a powerful tool to solve the weakly supervised classification in whole slide image (WSI) based pathology diagnosis. However, the current MIL methods are usually based on independent and identical distribution hypothesis, thus neglect the correlation among different instances. To address this problem, we proposed a new framework, called correlated MIL, and provided a proof for convergence. Based on this framework, we devised a Transformer based MIL (TransMIL), which explored both morphological and spatial information. The proposed TransMIL can effectively deal with unbalanced/balanced and binary/multiple classification with great visualization and interpretability. We conducted various experiments for three different computational pathology problems and achieved better performance and faster convergence compared with state-of-the-art methods. The test AUC for the binary tumor classification can be up to $9 3 . 0 9 \%$ over CAMELYON16 dataset. And the AUC over the cancer subtypes classification can be up to $9 6 . 0 3 \%$ and $9 8 . 8 2 \%$ over TCGANSCLC dataset and TCGA-RCC dataset, respectively. Implementation is available at: https://github.com/szc19990412/TransMIL.
10
+
11
+ # 1 Introduction
12
+
13
+ The advent of whole slide image (WSI) scanners, which convert the tissue on the biopsy slide into a gigapixel image fully preserving the original tissue structure [1], provides a good opportunity for the application of deep learning in the field of digital pathology [2, 3, 4]. However, the deep learning based biopsy diagnosis in WSI has to face a great challenges due to the huge size and the lack of pixel-level annotations[5]. To address this problem, multiple instance learning (MIL) is usually adopted to take diagnosis analysis as a weakly supervised learning problem.
14
+
15
+ In deep learning based MIL, one straightforward idea is to perform pooling operation [6, 7] on instance feature embeddings extracted by CNN. Ilse et al. [8] proposed an attention based aggregation operator, giving each instance additional contribution information through trainable attention weights. In addition, Li et al. [9] introduced non-local attention into the MIL problem. By calculating the similarity between the highest-score instance and the others, each instance is given different attention weight and the interpretable attention map can be obtained accordingly. There were also other pioneering works [10, 11, 12, 13, 14] in weakly supervised WSI diagnosis.
16
+
17
+ ![](images/b0e76c2b2189d208366e72eb4261ec15ac404dc2d5e663237686354e465654eb.jpg)
18
+ Figure 1: Decision-making process. MIL Attention Mechanism: follow the i.i.d. assumption. Selfattention Mechanism: under the correlated MIL framework.
19
+
20
+ However, all these methods are based on the assumption that all the instances in each bag are independent and identically distributed (i.i.d.). While achieving some improvements in many tasks, this i.i.d. assumption was not entirely valid [15] in many cases. Actually, pathologists often consider both the contextual information around a single area and the correlation information between different areas when making a diagnostic decision. Therefore, it would be much desirable to consider the correlation between different instances in MIL diagnosis.
21
+
22
+ At present, Transformer is widely used in many vision tasks [16, 17, 18, 19, 20, 21] due to the strong ability of describing correlation between different segments in a sequence (tokens) as well as modelling long distance information. As shown in Figure 1, different from bypass attention network in the existing MIL, the Transformer adopts self-attention mechanism, which can pay attention to the pairwise correlation between each token within a sequence. However, traditional Transformer sequences are limited by their computational complexity and can only tackle shorter sequences (e.g., less than 1000) [22]. Therefore, it is not suitable for large size images such as WSIs.
23
+
24
+ To address these challenges mentioned above, we proposed a correlated MIL framework, including the convergence proof and a generic three-step algorithm. In addition, a Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information between different instances. Great performance over various datasets demonstrate the validity of the proposed method.
25
+
26
+ # 2 Related Work
27
+
28
+ # 2.1 Application of MIL in WSI classification
29
+
30
+ The application of MIL in WSIs can be divided into two categories. The first one is instance-level algorithms [7, 23, 24, 25, 26], where a CNN is first trained by assigning each instance a pseudo-label based on the bag-level label, and then the top-k instances are selected for aggregation. However, this method requires a large number of WSIs, since only a small number of instances within each slide can actually participate in the training. The second category is embedding-level algorithms, where each patch in the entire slide is mapped to a fixed-length embedding, and then all feature embeddings are aggregated by an operator (e.g., max-pooling). To improve the performance, the MIL attention based method [8, 10, 11, 12, 13] assigns the contribution of each instance by introducing trainable parameters. In addition, the feature clustering methods [14, 27, 28] calculated the cluster centroids of all the feature embeddings and then the representative feature embeddings was employed to make the final prediction. Recently, non-local attention [9] was also adopted in MIL to pay more attention to the correlation between the highest-score instance and all the remaining instances.
31
+
32
+ # 2.2 Attention and Self-attention in Deep Learning
33
+
34
+ Attention was initially used to extract important information about sentences in machine translation [29]. Then the attention mechanism was gradually applied to computer vision tasks, including giving different weights to feature channels [30] or spatial distribution [31], or giving different weights to time series in video analysis [32]. Recently, attention was also applied in MIL analysis [10, 11, 12, 13]. However, all these methods did not consider the correlation between different instances.
35
+
36
+ The most typical self-attention application was the Transformer based NLP framework proposed by Google [33]. Recently, Transformer was also applied in many computer vision tasks, including object detection [16, 17], segmentation [18, 19], image enhancement [20, 21] and video processing [34]. In this paper, for the first time, we proposed a Transformer based WSI classification, where the correlations among different instances within the same bag are comprehensively considered.
37
+
38
+ # 3 Method
39
+
40
+ # 3.1 Correlated Multiple Instance Learning
41
+
42
+ Problem formulation Take binary MIL classification as an example, we want to predict a target value $Y _ { i } \in \{ 0 , 1 \}$ , given a bag of instances $\{ \pmb { x } _ { i , 1 } , \pmb { x } _ { i , 2 } , \ldots , \pmb { x } _ { i , n } \}$ with $\mathbf { X } _ { i }$ , for $i = 1 , \ldots , b$ , that exhibit both dependency and ordering among each other. The instance-level labels $\{ y _ { i , 1 } , y _ { i , 2 } , . . . , y _ { i , n } \}$ are unknown, and the bag-level label is $Y _ { i }$ , for $i = 1 , \dots , b$ . A binary MIL classification can be defined as:
43
+
44
+ $$
45
+ Y _ { i } = \left\{ { 0 , \mathrm { i f f } \sum _ { } y _ { i , j } = 0 y _ { i , j } \in \{ 0 , 1 \} , j = 1 \dots n } _ { } \right.
46
+ $$
47
+
48
+ $$
49
+ \hat { Y } _ { i } = { S } ( { \bf X } _ { i } ) ,
50
+ $$
51
+
52
+ where $S$ is a scoring function, $\hat { Y _ { i } }$ represents the prediction. $b$ is the total number of bags, $n$ is the number of instances in ith bag, and the number of $n$ can vary for different bags.
53
+
54
+ Compared to the MIL framework proposed by Ilse et al. [8], we further introduce the correlation between different instances. Theorem 1 and Inference give an arbitrary approximation form of the scoring function $S ( \mathbf { X } )$ , and Theorem 2 provides the advantage of correlated MIL.
55
+
56
+ Theorem 1. Suppose $S : \mathcal { X } \mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \cdot , \cdot )$ $\forall \varepsilon > 0$ , for any invertible map $P : \mathcal X \to \mathbb R ^ { n }$ , ∃ function $\sigma$ and $g$ , such that for any $\mathbf { X } \in { \mathcal { X } }$ :
57
+
58
+ $$
59
+ | S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
60
+ $$
61
+
62
+ That is: a Hausdorff continuous function $S ( \mathbf { X } )$ can be arbitrarily approximated by a function in the form $g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ,$ ).
63
+
64
+ Proof. By the continuity of $S$ , we take $\forall \varepsilon > 0 , \exists \delta _ { \varepsilon }$ , so that $| S ( \mathbf { X } ) - S ( \mathbf { X } ^ { \prime } ) | < \varepsilon$ for any $\mathbf { X } , \mathbf { X } ^ { \prime } \in \mathcal { X }$ , if ${ d _ { H } } \left( { { \bf { X } } , { \bf { X } } ^ { \prime } } \right) < \delta _ { \varepsilon }$ .
65
+
66
+ Define $\begin{array} { r } { K = \lceil \frac { 1 } { \delta _ { \varepsilon } } \rceil } \end{array}$ and define an auxiliary function: $\begin{array} { r } { \sigma ( { \pmb x } ) = \frac { \lfloor K { \pmb x } \rfloor } { K } } \end{array}$ . Let $\tilde { \mathbf { X } } = \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \}$ , then:
67
+
68
+ $$
69
+ | S ( \mathbf { X } ) - S ( \tilde { \mathbf { X } } ) | < \varepsilon ,
70
+ $$
71
+
72
+ because $\begin{array} { r } { d _ { H } ( \mathbf { X } , \tilde { \mathbf { X } } ) < \frac { 1 } { K } \le \delta _ { \varepsilon } } \end{array}$ .
73
+
74
+ Let $P : \mathcal X \to \mathbb R ^ { n }$ be any invertible map, its inverse mapping is expressed as $P ^ { - 1 }$ : $\mathbb { R } ^ { n } \to \mathcal { X }$ . Let $g = S \left( P ^ { - 1 } \right)$ , then:
75
+
76
+ $$
77
+ S \left( P ^ { - 1 } ( \underset { \mathbf { X } \in \mathcal { X } } { P } ( \{ \sigma ( \mathbf { x } ) : \mathbf { x } \in \mathbf { X } \} ) ) \right) = S \left( P ^ { - 1 } ( \underset { \mathbf { \tilde { X } } \in \mathcal { X } } { P } ( \tilde { \mathbf { X } } ) ) \right) = S ( \tilde { \mathbf { X } } ) .
78
+ $$
79
+
80
+ Because $| S ( \mathbf { X } ) - S ( \tilde { \mathbf { X } } ) | < \varepsilon$ and $S ( \tilde { \mathbf { X } } ) = S \left( P ^ { - 1 } ( P ( \tilde { \mathbf { X } } ) ) \right) = g ( P ( \tilde { \mathbf { X } } ) )$ , we have:
81
+
82
+ $$
83
+ | S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
84
+ $$
85
+
86
+ This completes the proof.
87
+
88
+ ![](images/679e2bd5120805ecf45628c54c6e3e15ad557272862ce9e8c6b43cf63a36e9a2.jpg)
89
+ Figure 2: The difference between different Pooling Matrix P. Suppose there are 5 instances sampled from WSI in (a), $\mathbf { P } \in \mathbb { R } ^ { 5 \times 5 }$ is the corresponding Pooling Matrix, where the values in the diagonal line indicate the attention weight for itself and the rest indicate correlation between different instances. (b,c,d) all neglect the correlation information, hence the $\mathbf { P }$ is diagonal matrix. In (b), the first instance was chosen by Max-pooling operator, so there is only one non-zero value in the first diagonal position. In (c), all the values within diagonal line are the same due to the Mean-pooling operator. In (d), the values within diagonal line can be varied due to the introduction of bypass attention. (e) obeys the correlation assumption, so there are non-zero values in off-diagonal position indicating correlation between different instances.
90
+
91
+ Inference Suppose $S : \mathcal { X } \mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \cdot , \cdot )$ $\forall \varepsilon > 0$ , for any function $f$ and any invertible map $P : \mathcal X \to \mathbb R ^ { n }$ , ∃ function $h$ and $g$ , such that for any $\mathbf { X } \in { \mathcal { X } }$ :
92
+
93
+ $$
94
+ | S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ f ( \pmb { x } ) + h ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
95
+ $$
96
+
97
+ That is: a Hausdorff continuous function $S ( \mathbf { X } )$ can be arbitrarily approximated by a function in the form $g { \big ( } { \underset { \mathbf { X } \in { \mathcal { X } } } { P } } { \big \{ } f ( { \pmb { x } } ) + h ( { \pmb { x } } ) : { \pmb { x } } \in \mathbf { X } { \} } .$ ).
98
+
99
+ Proof. The proof is in the Appendix A.
100
+
101
+ Theorem 2. The Instances in the bag are represented by random variables $\Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n }$ , the information entropy of the bag under the correlation assumption can be expressed as $H \left( \Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n } \right)$ , and the information entropy of the bag under the i.i.d. (independent and identical distribution) assumption can be expressed as $\textstyle \sum _ { t = 1 } ^ { n } { \bar { H } } \left( \Theta _ { t } \right)$ , then we have:
102
+
103
+ $$
104
+ H \left( \Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n } \right) = \sum _ { t = 2 } ^ { n } H \left( \Theta _ { t } \mid \Theta _ { 1 } , \ldots , \Theta _ { t - 1 } \right) + H \left( \Theta _ { 1 } \right) \leq \sum _ { t = 1 } ^ { n } H \left( \Theta _ { t } \right) .
105
+ $$
106
+
107
+ Proof. The proof is in the Appendix A.
108
+
109
+ Theorem 2 proved the correlation assumption has smaller information entropy, which may reduce the uncertainty and bring more useful information for the MIL problem. Motivated by the Inference and Theorem 2, a generic three-step method like Algorithm1 was developed. The main difference between the proposed algorithm and existing methods is shown in Figure 2.
110
+
111
+ Algorithm 1: A generic three-step approach under the correlated MIL
112
+
113
+ <table><tr><td>Input: The bag of instances Xi = {xi,1, xi,2 ..., xi,n} Output: Bag-level predicted label Yi</td></tr><tr><td>1) Extracting morphological and spatial information of all the instances by f and h,</td></tr><tr><td>respectively;</td></tr><tr><td>Xf ← f(Xi),Xh ← h(Xi),Xfh ← Xf +Xh,where Xf,Xh,Xfh ∈ Rnxd;</td></tr><tr><td>2) Aggregating the extracted information for all instances by Pooling Matrix P;</td></tr><tr><td>Xp ←PXfh, whereP ∈ Rnxn;</td></tr><tr><td>3) Transforming Xp to obtain the predicted bag-level label by g;</td></tr><tr><td>Y← g(Xp).</td></tr></table>
114
+
115
+ ![](images/d6aeeb4d6938525f28a0f40446e31d24e0684299499c4e2af52c8a057db262e8.jpg)
116
+ Figure 3: Overview of our TransMIL. Each WSI is cropped into patches (background is discarded), and embedded in feature vectors by ResNet50. Then the sequence is processed with the TPT module: 1) Squaring of sequence; 2) Correlation modelling of the sequence; 3) Conditional position encoding and local information fusion; 4) Deep feature aggregation; 5) Mapping of $\mathbb { T } \to \mathcal { y }$ .
117
+
118
+ # 3.2 How to apply Transformer to correlated MIL
119
+
120
+ The Transformer uses a self-attention mechanism to model the interactions between all tokens in a sequence, and the adding of positional information further increases the use of sequential order information. Therefore it’s a good idea to introduce the Transformer into the correlated MIL problem where the function $h$ encodes the spatial information among instances, and the Pooling Matrix $\mathbf { P }$ uses self-attention for information aggregation. To make this clear, we further give a formal denition.
121
+
122
+ Transformer based MIL. Given a set of bags $\{ \mathbf { X } _ { 1 } , \mathbf { X } _ { 2 } , \ldots , \mathbf { X } _ { b } \}$ , and each bag $\mathbf { X } _ { i }$ contains multiple instances $\{ \pmb { x } _ { i , 1 } , \pmb { x } _ { i , 2 } , \ldots , \pmb { x } _ { i , n } \}$ and a corresponding label $Y _ { i }$ . The goal is to learn the mappings: $\mathbb { X } \mathbb { T } \mathcal { Y }$ , where $\mathbb { X }$ is the bag space, $\mathbb { T }$ is the Transformer space and $\mathcal { V }$ is the label space. The specific mapping form of $\mathbb { X } \to \mathbb { T }$ and $\mathbb { T } \to \mathbb { Y }$ are available in the Appendix B.
123
+
124
+ # 3.3 TransMIL for Weakly Supervised WSI Classication
125
+
126
+ To better describe the mapping of $\mathbb { X } \to \mathbb { T }$ , we design a TPT module with two Transformer layers and a position encoding layer, where Transformer layers are designed for aggregating morphological information and Pyramid Position Encoding Generator (PPEG) is designed for encoding spatial information. The overview of proposed Transformer based MIL (TransMIL) is shown in Figure 3.
127
+
128
+ Long Instances Sequence Modelling with TPT. The sequences are from the feature embeddings in each WSI. The processing steps of the TPT module are shown in Algorithm 2, where MSA denotes Multi-head Self-attention, MLP denotes Multilayer Perceptron, and LN denotes Layer Norm.
129
+
130
+ Algorithm 2: TPT module processing flow
131
+ Input: A bag of feature embeddings $\mathbf { H } _ { i } = \{ h _ { i , 1 } , \dots , h _ { i , n } \}$ , where $h _ { i , j } \in \mathbb { R } ^ { 1 \times d }$ is the embedding of the $j$ th instance, $\mathbf { H } _ { i } \in \mathbb { R } ^ { n \times d }$
132
+ Output: Bag-level predicted label $\hat { Y _ { i } }$ 1) Squaring of sequence; $\sqrt { N } \lceil \sqrt { n } \rceil$ , $M \gets N - n$ , $\mathbf { H } _ { S } \gets$ Concat $( h _ { i , c l a s s }$ , $\mathbf { H } _ { i }$ , $( h _ { i , 1 } , \ldots , h _ { i , M } ) )$ , where
133
+ $h _ { i , c l a s s } \in \mathbb { R } ^ { 1 \times d }$ represents class token, $\mathbf { H } _ { S } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 2) Correlation modelling of the sequence; $\mathbf { H } _ { S } ^ { \ell } \gets \mathrm { M S A } \left( \mathbf { H } _ { S } \right)$ , where $\ell$ denotes the layer index of the Transformer, $\mathbf { H } _ { S } ^ { \ell } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 3) Conditional position encoding and local information fusion; $\mathbf { H } _ { S } ^ { P } \mathrm { P P E G } ( \mathbf { H } _ { S } ^ { \ell } )$ , where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 4) Deep feature aggregation; $\mathbf { H } _ { S } ^ { \ell + 1 } \mathrm { M S A } ( \mathbf { H } _ { S } ^ { P } )$ , where $\mathbf { H } _ { S } ^ { \ell + 1 } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 5) Mapping of $\mathbb { T } \to \mathcal { y }$ ; $\hat { Y } _ { i } \gets \mathrm { M L P } \left( \mathrm { L N } \left( \left( \mathbf { H } _ { S } ^ { \ell + 1 } \right) ^ { ( 0 ) } \right) \right)$ , where $\big ( \mathbf { H } _ { S } ^ { \ell + 1 } \big ) ^ { ( 0 ) } \in \mathbb { R } ^ { 1 \times d }$ represents class token.
134
+
135
+ For most cases, the softmax used in Transformer for vision tasks such as [17, 18, 35] is a row-byrow softmax normalization function. The standard self-attention mechanism requires the calculation of similarity scores between each pair of tokens, resulting in both memory and time complexity of $O ( n ^ { 2 } )$ . To deal with the long instances sequence problem in WSIs, the softmax in TPT adopts the Nystrom Method proposed in [22]. The approximated self-attention form $\hat { \bf S }$ can be defined as:
136
+
137
+ $$
138
+ \hat { \bf S } = \mathrm { s o f t m a x } \left( \frac { { \bf Q } \tilde { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) \left( \mathrm { s o f t m a x } \left( \frac { \tilde { \bf Q } \tilde { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) \right) ^ { + } \mathrm { s o f t m a x } \left( \frac { \tilde { \bf Q } { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) ,
139
+ $$
140
+
141
+ where $\tilde { \mathbf { Q } }$ and $\tilde { \bf K }$ are the $m$ selected landmarks from the original $n$ dimensional sequence of $\mathbf { Q }$ and $\mathbf { K }$ , and $\mathbf { A } ^ { + }$ is a Moore-Penrose pseudoinverse of A. The final computational complexity is reduced from $O ( n ^ { 2 } )$ to $O ( n )$ . By doing this, the TPT module with approximation processing can satisfy the case where a bag contains thousands of tokens as input.
142
+
143
+ Position encoding with PPEG. In WSIs, the number of tokens in the corresponding sequence often varies due to the inherently variable size of the slide and tissue area. In [36] it is shown that the adding of zero padding can provide an absolute position information to convolution. Inspired by this, we designed the PPEG module accordingly. The overview is shown in Figure 4, and the pseudo-code for the processing is shown in Algorithm 3.
144
+
145
+ Figure 4: Pyramid Position Encoding Generator. 1) The sequence is divided into patch tokens and class token; 2) Patch tokens are reshaped into 2-D image space; 3) Different sized convolution kernels are used to encode spatial information; 4) Different spatial information are fused together; 5) Patch tokens are flattened into sequence; 6) Connect class token and patch tokens.
146
+
147
+ Our PPEG module has more advantages over the method proposed in [37]: (1) PPEG module uses different sized convolution kernels in the same layer, which can encode the positional information with different granularity, enabling high adaptability of PPEG. (2) Taking advantage of CNN’s ability to aggregate context information, the tokens in the sequence is able to obtain both global information and context information, which enriches the features carried by each token.
148
+
149
+ # Algorithm 3: PPEG processing flow
150
+
151
+ Input: A bag of feature embeddings $\mathbf { H } _ { S } ^ { \ell }$ after correlation modelling, where $\mathbf { H } _ { S } ^ { \ell } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ .
152
+ Output: The feature embeddings $\mathbf { H } _ { S } ^ { P }$ after conditional position encoding and local information fusion, where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ . 1) Split: $\mathbf { H } _ { S } ^ { \ell }$ is divided into patch tokens $\mathbf { H } _ { f }$ and class token $\mathbf { H } _ { c }$ ; $\mathbf { H } _ { f } , \mathbf { H } _ { c } \gets \mathrm { S p l i t } \left( \mathbf { H } _ { S } ^ { \ell } \right)$ , where $\mathbf { H } _ { f } \in \mathbb { R } ^ { N \times d } , \mathbf { H } _ { c } \in \mathbb { R } ^ { 1 \times d }$ ; 2) Spatial Restore: patch tokens $\mathbf { H } _ { f }$ are reshaped to $\mathbf { H } _ { S } ^ { f }$ in the 2-D image space; $\mathbf { H } _ { S } ^ { f } \mathrm { R e s t o r e } ( \mathbf { H } _ { f } )$ , where $\mathbf { H } _ { S } ^ { f } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d }$ ; 3) Group Convolution: using a set of group convolutions with kernel $k$ and $\frac { k - 1 } { 2 }$ zero
153
+ paddings $( k = 3 , 5 , 7 )$ to obtain $\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ ; $\mathbf { H } _ { t } ^ { f } \gets \mathrm { C o n v } \left( \mathbf { H } _ { S } ^ { f } \right)$ , where $\mathbf { H } _ { t } ^ { f } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d } , t = 1 , 2 , 3 \mathrm { { : } }$ 4) Fusion: $\mathbf { H } _ { S } ^ { f }$ and the $\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ obtained from the convolution block processing are
154
+ added together to obtain $\mathbf { H } _ { S } ^ { F }$ ; $\mathbf { H } _ { S } ^ { F } \mathbf { H } _ { S } ^ { f } + \mathbf { H } _ { 1 } ^ { f } + \mathbf { H } _ { 2 } ^ { f } + \mathbf { H } _ { 3 } ^ { f }$ , where $\mathbf { H } _ { S } ^ { F } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d }$ ; 5) Flatten: $\mathbf { H } _ { S } ^ { F }$ are flattened into sequence $\mathbf { H } _ { s e }$ ; $\mathbf { H } _ { s e } \gets$ Flatten $\left( \mathbf { H } _ { S } ^ { F } \right)$ , where $\mathbf { H } _ { s e } \in \mathbb { R } ^ { N \times d }$ ; 6) Concat: connect $\mathbf { H } _ { s e }$ and class token $\mathbf { H } _ { c }$ to obtain $\mathbf { H } _ { S } ^ { P }$ ; $\mathbf { H } _ { S } ^ { P } \mathrm { C o n c a t } ( \mathbf { H } _ { s e } , \mathbf { H } _ { c } )$ , where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ .
155
+
156
+ # 4 Experiments and Results
157
+
158
+ To demonstrate the superior performance of the proposed TransMIL, various experiments were conducted over three public datasets: CAMELYON16, The Caner Genome Atlas (TCGA) non-small cell lung cancer (NSCLC), as well as the TCGA renal cell carcinoma (RCC).
159
+
160
+ Dataset. CAMELYON16 is a public dataset for metastasis detection in breast cancer, including 270 training sets and 130 test sets. After pre-processing, a total of about 3.5 million patches at $\times 2 0$ magnification, in average about 8,800 patches per bag were obtained.
161
+
162
+ TCGA-NSCLC includes two subtype projects, i.e., Lung Squamous Cell Carcinoma (TGCA-LUSC) and Lung Adenocarcinoma (TCGA-LUAD), for a total of 993 diagnostic WSIs, including 507 LUAD slides from 444 cases and 486 LUSC slides from 452 cases. After pre-processing, the mean number of patches extracted per slide at $\times 2 0$ magnification is 15371.
163
+
164
+ TCGA-RCC includes three subtype projects, i.e., Kidney Chromophobe Renal Cell Carcinoma (TGCA-KICH), Kidney Renal Clear Cell Carcinoma (TCGA-KIRC) and Kidney Renal Papillary Cell Carcinoma (TCGA-KIRP), for a total of 884 diagnostic WSIs, including 111 KICH slides from 99 cases, 489 KIRC slides from 483 cases, and 284 KIRP slides from 264 cases. After preprocessing, the mean number of patches extracted per slide at $\times 2 0$ magnification is 14627.
165
+
166
+ Experiment Setup and Evaluation Metrics. Each WSI is cropped into a series of $2 5 6 \times 2 5 6$ nonoverlapping patches, where the background region (saturation ${ < } 1 5$ ) is discarded. In CAMELYON16 we trained on the official training set after splitting the 270 WSIs into approximately $9 0 \%$ training and $1 0 \%$ validation, and tested on the official test set. For TCGA datasets, we first ensured that different slides from one patient do not exist in both the training and test sets, and then randomly split the data in the ratio of training:validation:test $= 6 0 { : } 1 5 { : } 2 5$ . For the evaluation metrics, we used accuracy and area under the curve (AUC) scores to evaluate the classification performance, where the accuracy was calculated with a threshold of 0.5 in all experiments. For the AUC, the official test set AUC was used on the CAMELYON16 dataset, the average AUC was used on the TCGANSCLC dataset, and the average one-versus-rest AUC (macro-averaged) was used on the TCGARCC dataset. All the results over TCGA datasets are obtained by 4-fold cross-validation.
167
+
168
+ Implementation Details. In the training step, cross-entropy loss was adopted, and the Lookahead optimizer [38] was employed with a learning rate of 2e-4 and weight decay of 1e-5. The size of mini-batch $B$ is 1. As in [13], the feature of each patch is embedded in a 1024-dimensional vector by a ResNet50 [39] model pre-trained on ImageNet. During training, the dimension of each feature embedding is reduced from 1024 to 512 by a fully connected layer. Finally, the feature embedding of each bag can be represented as $\mathbf { H } _ { i } \in \mathbb { R } ^ { n \times 5 1 2 }$ . In the inference step, the softmax is used to normalize the predicted scores for each class. All experiments are done with a RTX 3090.
169
+
170
+ Baseline. The baselines we chose include deep models with traditional pooling operators such as mean-pooling, max-pooling and the current state-of-the-art deep MIL models [8, 9, 13, 23, 40], the attention based pooling operator ABMIL [8] and PT-MTA [40], non-local attention based pooling operator DSMIL [9], single-attention-branch CLAM-SB[13], multi-attention-branch CLAM-MB[13], and recurrent neural network(RNN) based aggregation MIL-RNN [23].
171
+
172
+ # 4.1 Results on WSI classification
173
+
174
+ We will present the results of both binary and multiple classification. The binary classification tasks contain positive/negative classification over CAMELYON16 and LUSC/LUAD subtypes classification over TCGA-NSCLC. The multiple classification refers to TGCA-KICH/TCGA-KIRC/TCGAKIRP subtypes classification over TCGA-RCC. All the results are provided in Table 1.
175
+
176
+ In CAMELYON16, only a small portion of each positive slide contains tumours (averagely total cancer area per slide $< 1 0 \%$ ), resulting in the presence of a large number of negative regions disturbing the prediction of positive slide. The bypass attention-based methods and proposed TransMIL all outperform the traditional pooling operators. However in AUC score, TransMIL was at least $5 \%$ higher than ABMIL, PT-MTA and CLAM which neglect the correlation between instances, and do not consider the spatial information between patches. DSMIL only considers the relationship between the highest scoring instance and others, leading to limited performance.
177
+
178
+ Table 1: Results on CAMELYON16, TCGA-NSCLC and TCGA-RCC.
179
+
180
+ <table><tr><td rowspan="2"></td><td colspan="2">CAMELYON16</td><td colspan="2">TCGA-NSCLC</td><td colspan="2">TCGA-RCC</td></tr><tr><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td></tr><tr><td>Mean-pooling</td><td>0.6389</td><td>0.4647</td><td>0.7282</td><td>0.8401</td><td>0.9054</td><td>0.9786</td></tr><tr><td>Max-pooling</td><td>0.8062</td><td>0.8569</td><td>0.8593</td><td>0.9463</td><td>0.9378</td><td>0.9879</td></tr><tr><td>ABMIL[8]</td><td>0.8682</td><td>0.8760</td><td>0.7719</td><td>0.8656</td><td>0.8934</td><td>0.9702</td></tr><tr><td>PT-MTA [40]</td><td>0.8217</td><td>0.8454</td><td>0.7379</td><td>0.8299</td><td>0.9059</td><td>0.9700</td></tr><tr><td>MIL-RNN [23]</td><td>0.8450</td><td>0.8880</td><td>0.8619</td><td>0.9107</td><td>一</td><td>一</td></tr><tr><td>DSMIL [9]</td><td>0.7985</td><td>0.8179</td><td>0.8058</td><td>0.8925</td><td>0.9294</td><td>0.9841</td></tr><tr><td>CLAM-SB[13]</td><td>0.8760</td><td>0.8809</td><td>0.8180</td><td>0.8818</td><td>0.8816</td><td>0.9723</td></tr><tr><td>CLAM-MB[13]</td><td>0.8372</td><td>0.8679</td><td>0.8422</td><td>0.9377</td><td>0.8966</td><td>0.9799</td></tr><tr><td>TransMIL</td><td>0.8837</td><td>0.9309</td><td>0.8835</td><td>0.9603</td><td>0.9466</td><td>0.9882</td></tr></table>
181
+
182
+ In TCGA-NSCLC, positive slides contain relatively large areas of tumour region (averagely total cancer area per slide ${ > } 8 0 \%$ ), consequently the pooling operator can achieve better performance than in CAMELYON16. Again, TransMIL performed better than all the other competing methods, achieving $1 . 4 0 \%$ higher in AUC and $2 . 1 6 \%$ in accuracy, compared with the second best method.
183
+
184
+ In TCGA-RCC, as MIL-RNN did not consider the multi-classification problem, it was not included in this comparison result. The TCGA-RCC is unbalanced distributed in cancer subtypes and has large areas of tumour region in the positive slides (averagely total cancer area per slide ${ > } 8 0 \%$ ). However, TransMIL is equally applicable to multi-class problems with unbalanced data. It can be observed that TransMIL achieves best results in both accuracy and AUC score.
185
+
186
+ # 4.2 Ablation Study
187
+
188
+ To further determine the contribution of the PPEG module and the conditional position encoding for the performance, we have conducted a series of ablation studies. Since the high classification accuracy of most methods over TCGA-RCC is not obvious, all ablation study experiments are based on the CAMELYON16 and the TCGA-NSCLC dataset. All experiments were evaluated by AUC.
189
+
190
+ # 4.2.1 Effects of PPEG
191
+
192
+ The position encoding of the Transformer typically explores absolute position encoding (e.g., sinusoidal encoding, learnable absolute encoding) as well as conditional position encoding. However, learnable absolute encoding is commonly used in problems with fixed length sequences, and does not meet the requirement for variable length of input sequences in WSI analysis, so it is not taken into account in this paper. Here, we compared the effect of sinusoidal encoding and PPEG module which represents multi-level conditional position encoding. The same experiments are performed over CAMELYON16 and TCGA-NSCLC dataset, and the results are shown in Table 2. It should be noted that sinusoidal encoding is added to the original sequence with a multiplication of 0.001 as described in [33].
193
+
194
+ Table 2: Effects of PPEG.
195
+
196
+ <table><tr><td>Model</td><td>Params</td><td>Camelyon16</td><td>NSCLC</td></tr><tr><td>w/o</td><td>2.625M</td><td>0.8416</td><td>0.9287</td></tr><tr><td>sin-cos</td><td>2.625M</td><td>0.8941</td><td>0.9374</td></tr><tr><td>3×3</td><td>2.630M</td><td>0.8913</td><td>0.9355</td></tr><tr><td>7×7</td><td>2.651M</td><td>0.9015</td><td>0.9336</td></tr><tr><td>both</td><td>2.669M</td><td>0.9059</td><td>0.9402</td></tr><tr><td>PPEG</td><td>2.669M</td><td>0.9309</td><td>0.9603</td></tr></table>
197
+
198
+ ![](images/e707257be5bb10312bbf3088dfc58ec0f6447b7b728f53504a19ec48a2081e47.jpg)
199
+ Figure 5: Effects of Positional Encoding.
200
+
201
+ Compared with the model without position encoding, it can be seen that both sinusoidal encoding and conditional position encoding can improve the classification performance, and conditional position information encoded by PPEG can be more effective in diagnosis analysis. In contrast to the $3 \times 3$ and $7 \times 7$ convolutional block, adding different sized convolution kernels in the same layer allows for multi-level positional encoding and adds more context information to each token.
202
+
203
+ # 4.2.2 Effects of Conditional Position Encoding
204
+
205
+ Here, by disrupting the order of the input sequences, we explore actual improvements for conditional position encoding. The performance of the model under different configurations is shown in Figure 5, where order represents sequential data input and $w / o$ represents random and disordered data input. It can be seen that conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \%$ over CAMELYON16 and $0 . 6 1 \%$ over TCGA-NSCLC in AUC.
206
+
207
+ Compared with the model without position encoding or with sinusoidal encoding, conditional position information encoded by PPEG can be more effective in diagnosis analysis. Compared with the results trained over the sequential and disordered training sets, conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \%$ over CAMELYON16 and $0 . 6 1 \%$ over TCGA-NSCLC in AUC.
208
+
209
+ # 4.3 Interpretability and Attention Visualization
210
+
211
+ Here, we will further show the interpretability of TransMIL. As shown in Figure 6(a), the area within the blue curve annotation is the cancer region, which was provided by Gao et al. [41] over the TCGA-RCC dataset. In Figure 6(b), attention scores from TransMIL were visualised as a heatmap to determine the ROI and interpret the important morphology used for diagnosis, and Figure 6(c) is a zoomed-in view of the black square in Figure 6(b). Obviously, there is a high consistency between fine annotation area and heatmap, illustrating great interpretability and attention visualization of the proposed TransMIL.
212
+
213
+ ![](images/be9b1dab98277f1e1385b8022a1a0ce049a3009f496e314ad9d0e3bfe6c78186.jpg)
214
+ Figure 6: Interpretability and visualization.
215
+
216
+ # 4.4 Fast Convergence
217
+
218
+ Traditional MIL methods as well as the latest MIL methods such as ABMIL, DSMIL and CLAM usually require a large number of epochs to converge. Different from these methods, TransMIL makes use of the morphological and spatial information among instances, leading to approximately two to three times fewer training epochs. As shown in Figure 7, TransMIL has better performance in terms of convergence and validation AUC than other MIL methods.
219
+
220
+ # 5 Conclusion
221
+
222
+ In this paper, we have developed a novel correlated MIL framework that is consistent with the behavior of pathologists considering both the contextual information around a single area and the correlation between different areas when making a diagnostic decision. Based on this framework, a
223
+
224
+ ![](images/3fa1392172d1bf81f2dc21cbbf594d8eb34347b3a0e441d5a571eee38a47b9cf.jpg)
225
+ Figure 7: The convergence comparison of TransMIL and the competing methods.
226
+
227
+ Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information in weakly supervised WSI classification. We also design a PPEG for position encoding as well as a TPT module with two Transformer layers and a position encoding layer. The TransMIL network is easy to train, and can be applied to unbalanced/balanced and binary/multiple classification with great visualization and interpretability. Most importantly, TransMIL outperforms the state-of-the-art MIL algorithms in terms of both AUC and accuracy over three public datasets. Currently, all the experiments were conducted over the dataset with $\times 2 0$ magnification, however the WSIs with higher magnification will result in longer sequence and inevitably pose great challenges in terms of both computational and memory requirements, and we will explore this issue in the follow-up work.
228
+
229
+ Broader Impact Our proposed approach shows greater potential for MIL application to real-world diagnosis analysis, particularly in problems that require more correlated information such as survival analysis and cancer cell spread detection. In the short term, the benefit of this work is to provide a model with better performance, faster convergence and clinical interpretability. In the long term, the proposed TransMIL network is more applicable to real situations, and it is hoped that it will provide more novel and effective ideas about further applications of deep MIL to diagnosis analysis.
230
+
231
+ Acknowledgment This work was supported in part by the National Natural Science Foundation of China (61922048&62031023), in part by the Shenzhen Science and Technology Project (JCYJ20200109142808034), and in part by Guangdong Special Support (2019TX05X187).
232
+
233
+ # References
234
+
235
+ [1] Lei He, L Rodney Long, Sameer Antani, and George R Thoma. Histology image analysis for carcinoma detection and grading. Computer methods and programs in biomedicine, pages 538–556, 2012.
236
+ [2] Anant Madabhushi. Digital pathology image analysis: opportunities and challenges. Imaging in medicine, pages 7–10, 2009.
237
+ [3] Chen Li, Xintong Li, Md Rahaman, Xiaoyan Li, Hongzan Sun, Hong Zhang, Yong Zhang, Xiaoqi Li, Jian Wu, Yudong Yao, et al. A comprehensive review of computer-aided whole-slide image analysis: from datasets to feature extraction, segmentation, classification, and detection approaches. arXiv preprint arXiv:2102.10553, 2021.
238
+ [4] Xiaomin Zhou, Chen Li, Md Mamunur Rahaman, Yudong Yao, Shiliang Ai, Changhao Sun, Qian Wang, Yong Zhang, Mo Li, Xiaoyan Li, et al. A comprehensive review for breast histopathology image analysis using classical and deep neural networks. IEEE Access, pages 90931–90956, 2020.
239
+ [5] Chetan L Srinidhi, Ozan Ciga, and Anne L Martel. Deep neural network models for computational histopathology: A survey. Medical Image Analysis, 2020.
240
+ [6] Xinggang Wang, Yongluan Yan, Peng Tang, Xiang Bai, and Wenyu Liu. Revisiting multiple instance neural networks. Pattern Recognition, pages 15–24, 2018.
241
+ [7] Fahdi Kanavati, Gouji Toyokawa, Seiya Momosaki, Michael Rambeau, Yuka Kozuma, Fumihiro Shoji, Koji Yamazaki, Sadanori Takeo, Osamu Iizuka, and Masayuki Tsuneki. Weaklysupervised learning for lung carcinoma classification using deep learning. Scientific reports, pages 1–11, 2020. [8] Maximilian Ilse, Jakub M. Tomczak, and M. Welling. Attention-based deep multiple instance learning. In International Conference on Machine Learning, pages 2127–2136, 2018.
242
+ [9] Bin Li, Yin Li, and Kevin W Eliceiri. Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
243
+ [10] Naofumi Tomita, Behnaz Abdollahi, Jason Wei, Bing Ren, A. Suriawinata, and S. Hassanpour. Attention-based deep neural networks for detection of cancerous and precancerous esophagus tissue on histopathological slides. JAMA Network Open, 2019.
244
+ [11] Noriaki Hashimoto, Daisuke Fukushima, Ryoichi Koga, Yusuke Takagi, Kaho Ko, Kei Kohno, Masato Nakaguro, Shigeo Nakamura, Hidekata Hontani, and Ichiro Takeuchi. Multi-scale domain-adversarial multiple-instance cnn for cancer subtype classification with unannotated histopathological images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3852–3861, 2020.
245
+ [12] Nikhil Naik, Ali Madani, Andre Esteva, Nitish Shirish Keskar, Michael F Press, Daniel Ruderman, David B Agus, and Richard Socher. Deep learning-enabled breast cancer hormonal receptor status determination from base-level h&e stains. Nature communications, pages 1–8, 2020.
246
+ [13] Ming Y Lu, Drew FK Williamson, Tiffany Y Chen, Richard J Chen, Matteo Barbieri, and Faisal Mahmood. Data-efficient and weakly supervised computational pathology on wholeslide images. Nature Biomedical Engineering, pages 1–16, 2021.
247
+ [14] Yash Sharma, Aman Shrivastava, Lubaina Ehsan, Christopher A. Moskaluk, Sana Syed, and Donald E. Brown. Cluster-to-conquer: A framework for end-to-end multi-instance learning for whole slide image classification. arXiv preprint arXiv:2103.10626, 2021.
248
+ [15] Ming Tu, Jing Huang, Xiaodong He, and Bowen Zhou. Multiple instance learning with graph neural networks. In International Conference on Machine Learning, 2019.
249
+ [16] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Proceedings of the European Conference on Computer Vision, pages 213–229, 2020.
250
+ [17] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021.
251
+ [18] Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, Le Lu, Alan L Yuille, and Yuyin Zhou. Transunet: Transformers make strong encoders for medical image segmentation. arXiv preprint arXiv:2102.04306, 2021.
252
+ [19] Yundong Zhang, Huiye Liu, and Qiang Hu. Transfuse: Fusing transformers and cnns for medical image segmentation. arXiv preprint arXiv:2102.08005, 2021.
253
+ [20] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020.
254
+ [21] Fuzhi Yang, Huan Yang, J. Fu, Hongtao Lu, and B. Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5790–5799, 2020.
255
+ [22] Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn Fung, Yin Li, and Vikas Singh. Nyströmformer: A nyström-based algorithm for approximating self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
256
+ [23] Gabriele Campanella, Matthew G Hanna, Luke Geneslaw, Allen Miraflor, Vitor Werneck Krauss Silva, Klaus J Busam, Edi Brogi, Victor E Reuter, David S Klimstra, and Thomas J Fuchs. Clinical-grade computational pathology using weakly supervised deep learning on whole slide images. Nature medicine, pages 1301–1309, 2019.
257
+ [24] G. Xu, Zhigang Song, Zhuo Sun, Calvin Ku, Z. Yang, C. Liu, S. Wang, Jianpeng Ma, and W. Xu. Camel: A weakly supervised learning framework for histopathology image segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10681–10690, 2019.
258
+ [25] Marvin Lerousseau, Maria Vakalopoulou, Marion Classe, Julien Adam, Enzo Battistella, Alexandre Carré, Théo Estienne, Théophraste Henry, Eric Deutsch, and Nikos Paragios. Weakly supervised multiple instance learning histopathological tumor segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 470–479, 2020.
259
+ [26] P. Chikontwe, Meejeong Kim, S. Nam, H. Go, and S. Park. Multiple instance learning with center embeddings for histopathology classification. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 519–528, 2020.
260
+ [27] Xi Wang, Hao Chen, Caixia Gan, Huangjing Lin, Qi Dou, Efstratios Tsougenis, Qitao Huang, Muyan Cai, and Pheng-Ann Heng. Weakly supervised deep learning for whole slide lung cancer image analysis. IEEE Transactions on cybernetics, pages 3950–3962, 2019.
261
+ [28] Chensu Xie, Hassan Muhammad, Chad M Vanderbilt, Raul Caso, Dig Vijay Kumar Yarlagadda, Gabriele Campanella, and Thomas J Fuchs. Beyond classification: Whole slide tissue histopathology analysis by end-to-end part learning. In Medical Imaging with Deep Learning, pages 843–856, 2020.
262
+ [29] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
263
+ [30] Jie Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7132–7141, 2018.
264
+ [31] S. Woo, Jongchan Park, Joon-Young Lee, and In-So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision, pages 3–19, 2018.
265
+ [32] Yongming Rao, Jiwen Lu, and J. Zhou. Attention-aware deep reinforcement learning for video face recognition. In IEEE International Conference on Computer Vision, pages 3931–3940, 2017.
266
+ [33] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, undefinedukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017.
267
+ [34] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In Proceedings of the European Conference on Computer Vision, pages 528–543, 2020.
268
+ [35] A. Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, M. Dehghani, Matthias Minderer, G. Heigold, S. Gelly, Jakob Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
269
+ [36] Md Amirul Islam, Sen Jia, and Neil D. B. Bruce. How much position information do convolutional neural networks encode? In International Conference on Learning Representations, 2020.
270
+ [37] Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021.
271
+ [38] Michael Ruogu Zhang, James Lucas, Geoffrey E. Hinton, and Jimmy Ba. Lookahead optimizer: k steps forward, 1 step back. In Advances in Neural Information Processing Systems, pages 9597–9608, 2019.
272
+ [39] 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, pages 770–778, 2016.
273
+ [40] Weijian Li, Viet-Duy Nguyen, Haofu Liao, Matt Wilder, Ke Cheng, and Jiebo Luo. Patch transformer for multi-tagging whole slide histopathology images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 532–540, 2019.
274
+ [41] Zeyu Gao, Pargorn Puttapirat, Jiangbo Shi, and Chen Li. Renal cell carcinoma detection and subtyping with minimal point-based annotation in whole-slide images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 439– 448, 2020.
parse/train/LKUfuWxajHc/LKUfuWxajHc_content_list.json ADDED
@@ -0,0 +1,1223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "TransMIL: Transformer based Correlated Multiple Instance Learning for Whole Slide Image Classification ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 187,
8
+ 122,
9
+ 810,
10
+ 198
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Zhuchen Shao∗,1, Hao Bian∗,1, Yang Chen∗,1, Yifeng Wang2, Jian Zhang3, Xiangyang Ji4 Yongbing Zhang†,2 ",
17
+ "bbox": [
18
+ 191,
19
+ 247,
20
+ 805,
21
+ 277
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "1Tsinghua Shenzhen International Graduate School, Tsinghua University 2Harbin Institute of Technology (Shenzhen) 3School of Electronic and Computer Engineering, Peking University 4Department of Automation, Tsinghua University ",
28
+ "bbox": [
29
+ 285,
30
+ 289,
31
+ 710,
32
+ 340
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Abstract ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 462,
42
+ 381,
43
+ 535,
44
+ 397
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Multiple instance learning (MIL) is a powerful tool to solve the weakly supervised classification in whole slide image (WSI) based pathology diagnosis. However, the current MIL methods are usually based on independent and identical distribution hypothesis, thus neglect the correlation among different instances. To address this problem, we proposed a new framework, called correlated MIL, and provided a proof for convergence. Based on this framework, we devised a Transformer based MIL (TransMIL), which explored both morphological and spatial information. The proposed TransMIL can effectively deal with unbalanced/balanced and binary/multiple classification with great visualization and interpretability. We conducted various experiments for three different computational pathology problems and achieved better performance and faster convergence compared with state-of-the-art methods. The test AUC for the binary tumor classification can be up to $9 3 . 0 9 \\%$ over CAMELYON16 dataset. And the AUC over the cancer subtypes classification can be up to $9 6 . 0 3 \\%$ and $9 8 . 8 2 \\%$ over TCGANSCLC dataset and TCGA-RCC dataset, respectively. Implementation is available at: https://github.com/szc19990412/TransMIL. ",
51
+ "bbox": [
52
+ 233,
53
+ 414,
54
+ 766,
55
+ 633
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 Introduction ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 664,
66
+ 310,
67
+ 681
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "The advent of whole slide image (WSI) scanners, which convert the tissue on the biopsy slide into a gigapixel image fully preserving the original tissue structure [1], provides a good opportunity for the application of deep learning in the field of digital pathology [2, 3, 4]. However, the deep learning based biopsy diagnosis in WSI has to face a great challenges due to the huge size and the lack of pixel-level annotations[5]. To address this problem, multiple instance learning (MIL) is usually adopted to take diagnosis analysis as a weakly supervised learning problem. ",
74
+ "bbox": [
75
+ 174,
76
+ 698,
77
+ 825,
78
+ 780
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In deep learning based MIL, one straightforward idea is to perform pooling operation [6, 7] on instance feature embeddings extracted by CNN. Ilse et al. [8] proposed an attention based aggregation operator, giving each instance additional contribution information through trainable attention weights. In addition, Li et al. [9] introduced non-local attention into the MIL problem. By calculating the similarity between the highest-score instance and the others, each instance is given different attention weight and the interpretable attention map can be obtained accordingly. There were also other pioneering works [10, 11, 12, 13, 14] in weakly supervised WSI diagnosis. ",
85
+ "bbox": [
86
+ 176,
87
+ 787,
88
+ 825,
89
+ 856
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/b0e76c2b2189d208366e72eb4261ec15ac404dc2d5e663237686354e465654eb.jpg",
96
+ "image_caption": [
97
+ "Figure 1: Decision-making process. MIL Attention Mechanism: follow the i.i.d. assumption. Selfattention Mechanism: under the correlated MIL framework. "
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 217,
102
+ 87,
103
+ 781,
104
+ 257
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "",
111
+ "bbox": [
112
+ 173,
113
+ 340,
114
+ 823,
115
+ 369
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "However, all these methods are based on the assumption that all the instances in each bag are independent and identically distributed (i.i.d.). While achieving some improvements in many tasks, this i.i.d. assumption was not entirely valid [15] in many cases. Actually, pathologists often consider both the contextual information around a single area and the correlation information between different areas when making a diagnostic decision. Therefore, it would be much desirable to consider the correlation between different instances in MIL diagnosis. ",
122
+ "bbox": [
123
+ 174,
124
+ 376,
125
+ 825,
126
+ 459
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "At present, Transformer is widely used in many vision tasks [16, 17, 18, 19, 20, 21] due to the strong ability of describing correlation between different segments in a sequence (tokens) as well as modelling long distance information. As shown in Figure 1, different from bypass attention network in the existing MIL, the Transformer adopts self-attention mechanism, which can pay attention to the pairwise correlation between each token within a sequence. However, traditional Transformer sequences are limited by their computational complexity and can only tackle shorter sequences (e.g., less than 1000) [22]. Therefore, it is not suitable for large size images such as WSIs. ",
133
+ "bbox": [
134
+ 174,
135
+ 465,
136
+ 825,
137
+ 563
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "To address these challenges mentioned above, we proposed a correlated MIL framework, including the convergence proof and a generic three-step algorithm. In addition, a Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information between different instances. Great performance over various datasets demonstrate the validity of the proposed method. ",
144
+ "bbox": [
145
+ 174,
146
+ 569,
147
+ 825,
148
+ 625
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "2 Related Work ",
155
+ "text_level": 1,
156
+ "bbox": [
157
+ 174,
158
+ 665,
159
+ 321,
160
+ 683
161
+ ],
162
+ "page_idx": 1
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "2.1 Application of MIL in WSI classification ",
167
+ "text_level": 1,
168
+ "bbox": [
169
+ 174,
170
+ 710,
171
+ 493,
172
+ 726
173
+ ],
174
+ "page_idx": 1
175
+ },
176
+ {
177
+ "type": "text",
178
+ "text": "The application of MIL in WSIs can be divided into two categories. The first one is instance-level algorithms [7, 23, 24, 25, 26], where a CNN is first trained by assigning each instance a pseudo-label based on the bag-level label, and then the top-k instances are selected for aggregation. However, this method requires a large number of WSIs, since only a small number of instances within each slide can actually participate in the training. The second category is embedding-level algorithms, where each patch in the entire slide is mapped to a fixed-length embedding, and then all feature embeddings are aggregated by an operator (e.g., max-pooling). To improve the performance, the MIL attention based method [8, 10, 11, 12, 13] assigns the contribution of each instance by introducing trainable parameters. In addition, the feature clustering methods [14, 27, 28] calculated the cluster centroids of all the feature embeddings and then the representative feature embeddings was employed to make the final prediction. Recently, non-local attention [9] was also adopted in MIL to pay more attention to the correlation between the highest-score instance and all the remaining instances. ",
179
+ "bbox": [
180
+ 174,
181
+ 744,
182
+ 825,
183
+ 911
184
+ ],
185
+ "page_idx": 1
186
+ },
187
+ {
188
+ "type": "text",
189
+ "text": "2.2 Attention and Self-attention in Deep Learning ",
190
+ "text_level": 1,
191
+ "bbox": [
192
+ 176,
193
+ 90,
194
+ 531,
195
+ 106
196
+ ],
197
+ "page_idx": 2
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "Attention was initially used to extract important information about sentences in machine translation [29]. Then the attention mechanism was gradually applied to computer vision tasks, including giving different weights to feature channels [30] or spatial distribution [31], or giving different weights to time series in video analysis [32]. Recently, attention was also applied in MIL analysis [10, 11, 12, 13]. However, all these methods did not consider the correlation between different instances. ",
202
+ "bbox": [
203
+ 174,
204
+ 116,
205
+ 825,
206
+ 185
207
+ ],
208
+ "page_idx": 2
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "The most typical self-attention application was the Transformer based NLP framework proposed by Google [33]. Recently, Transformer was also applied in many computer vision tasks, including object detection [16, 17], segmentation [18, 19], image enhancement [20, 21] and video processing [34]. In this paper, for the first time, we proposed a Transformer based WSI classification, where the correlations among different instances within the same bag are comprehensively considered. ",
213
+ "bbox": [
214
+ 174,
215
+ 191,
216
+ 825,
217
+ 262
218
+ ],
219
+ "page_idx": 2
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "3 Method ",
224
+ "text_level": 1,
225
+ "bbox": [
226
+ 173,
227
+ 280,
228
+ 271,
229
+ 296
230
+ ],
231
+ "page_idx": 2
232
+ },
233
+ {
234
+ "type": "text",
235
+ "text": "3.1 Correlated Multiple Instance Learning ",
236
+ "text_level": 1,
237
+ "bbox": [
238
+ 174,
239
+ 310,
240
+ 483,
241
+ 325
242
+ ],
243
+ "page_idx": 2
244
+ },
245
+ {
246
+ "type": "text",
247
+ "text": "Problem formulation Take binary MIL classification as an example, we want to predict a target value $Y _ { i } \\in \\{ 0 , 1 \\}$ , given a bag of instances $\\{ \\pmb { x } _ { i , 1 } , \\pmb { x } _ { i , 2 } , \\ldots , \\pmb { x } _ { i , n } \\}$ with $\\mathbf { X } _ { i }$ , for $i = 1 , \\ldots , b$ , that exhibit both dependency and ordering among each other. The instance-level labels $\\{ y _ { i , 1 } , y _ { i , 2 } , . . . , y _ { i , n } \\}$ are unknown, and the bag-level label is $Y _ { i }$ , for $i = 1 , \\dots , b$ . A binary MIL classification can be defined as: ",
248
+ "bbox": [
249
+ 173,
250
+ 335,
251
+ 826,
252
+ 404
253
+ ],
254
+ "page_idx": 2
255
+ },
256
+ {
257
+ "type": "equation",
258
+ "img_path": "images/caf4257f48a9145b6f2a4dd40370b096cfa1fc00ad6ee8b1442e09858c9868b9.jpg",
259
+ "text": "$$\nY _ { i } = \\left\\{ { 0 , \\mathrm { i f f } \\sum _ { } y _ { i , j } = 0 y _ { i , j } \\in \\{ 0 , 1 \\} , j = 1 \\dots n } _ { } \\right.\n$$",
260
+ "text_format": "latex",
261
+ "bbox": [
262
+ 321,
263
+ 400,
264
+ 673,
265
+ 444
266
+ ],
267
+ "page_idx": 2
268
+ },
269
+ {
270
+ "type": "equation",
271
+ "img_path": "images/00f49e8783d02ae9133e6f5e1263409623747b4dc39bb4f8abc841f8c701502a.jpg",
272
+ "text": "$$\n\\hat { Y } _ { i } = { S } ( { \\bf X } _ { i } ) ,\n$$",
273
+ "text_format": "latex",
274
+ "bbox": [
275
+ 454,
276
+ 445,
277
+ 542,
278
+ 465
279
+ ],
280
+ "page_idx": 2
281
+ },
282
+ {
283
+ "type": "text",
284
+ "text": "where $S$ is a scoring function, $\\hat { Y _ { i } }$ represents the prediction. $b$ is the total number of bags, $n$ is the number of instances in ith bag, and the number of $n$ can vary for different bags. ",
285
+ "bbox": [
286
+ 171,
287
+ 468,
288
+ 825,
289
+ 497
290
+ ],
291
+ "page_idx": 2
292
+ },
293
+ {
294
+ "type": "text",
295
+ "text": "Compared to the MIL framework proposed by Ilse et al. [8], we further introduce the correlation between different instances. Theorem 1 and Inference give an arbitrary approximation form of the scoring function $S ( \\mathbf { X } )$ , and Theorem 2 provides the advantage of correlated MIL. ",
296
+ "bbox": [
297
+ 174,
298
+ 502,
299
+ 823,
300
+ 545
301
+ ],
302
+ "page_idx": 2
303
+ },
304
+ {
305
+ "type": "text",
306
+ "text": "Theorem 1. Suppose $S : \\mathcal { X } \\mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \\cdot , \\cdot )$ $\\forall \\varepsilon > 0$ , for any invertible map $P : \\mathcal X \\to \\mathbb R ^ { n }$ , ∃ function $\\sigma$ and $g$ , such that for any $\\mathbf { X } \\in { \\mathcal { X } }$ : ",
307
+ "bbox": [
308
+ 173,
309
+ 558,
310
+ 820,
311
+ 587
312
+ ],
313
+ "page_idx": 2
314
+ },
315
+ {
316
+ "type": "equation",
317
+ "img_path": "images/817658baef638af3e1e1064e33720ec6683a684da3e61a666e566604ce529d64.jpg",
318
+ "text": "$$\n| S ( \\mathbf { X } ) - g ( \\underset { \\mathbf { X } \\in \\mathcal { X } } { P } \\{ \\sigma ( \\pmb { x } ) : \\pmb { x } \\in \\mathbf { X } \\} ) | < \\varepsilon .\n$$",
319
+ "text_format": "latex",
320
+ "bbox": [
321
+ 364,
322
+ 589,
323
+ 630,
324
+ 613
325
+ ],
326
+ "page_idx": 2
327
+ },
328
+ {
329
+ "type": "text",
330
+ "text": "That is: a Hausdorff continuous function $S ( \\mathbf { X } )$ can be arbitrarily approximated by a function in the form $g ( \\underset { \\mathbf { X } \\in \\mathcal { X } } { P } \\{ \\sigma ( \\pmb { x } ) : \\pmb { x } \\in \\mathbf { X } \\} ,$ ). ",
331
+ "bbox": [
332
+ 169,
333
+ 616,
334
+ 825,
335
+ 648
336
+ ],
337
+ "page_idx": 2
338
+ },
339
+ {
340
+ "type": "text",
341
+ "text": "Proof. By the continuity of $S$ , we take $\\forall \\varepsilon > 0 , \\exists \\delta _ { \\varepsilon }$ , so that $| S ( \\mathbf { X } ) - S ( \\mathbf { X } ^ { \\prime } ) | < \\varepsilon$ for any $\\mathbf { X } , \\mathbf { X } ^ { \\prime } \\in \\mathcal { X }$ , if ${ d _ { H } } \\left( { { \\bf { X } } , { \\bf { X } } ^ { \\prime } } \\right) < \\delta _ { \\varepsilon }$ . ",
342
+ "bbox": [
343
+ 173,
344
+ 665,
345
+ 826,
346
+ 695
347
+ ],
348
+ "page_idx": 2
349
+ },
350
+ {
351
+ "type": "text",
352
+ "text": "Define $\\begin{array} { r } { K = \\lceil \\frac { 1 } { \\delta _ { \\varepsilon } } \\rceil } \\end{array}$ and define an auxiliary function: $\\begin{array} { r } { \\sigma ( { \\pmb x } ) = \\frac { \\lfloor K { \\pmb x } \\rfloor } { K } } \\end{array}$ . Let $\\tilde { \\mathbf { X } } = \\{ \\sigma ( \\pmb { x } ) : \\pmb { x } \\in \\mathbf { X } \\}$ , then: ",
353
+ "bbox": [
354
+ 173,
355
+ 700,
356
+ 823,
357
+ 722
358
+ ],
359
+ "page_idx": 2
360
+ },
361
+ {
362
+ "type": "equation",
363
+ "img_path": "images/2c1b1a862d1cf231e7a462c4468e1f35892f8d40c0f87cf69c838a5f49494856.jpg",
364
+ "text": "$$\n| S ( \\mathbf { X } ) - S ( \\tilde { \\mathbf { X } } ) | < \\varepsilon ,\n$$",
365
+ "text_format": "latex",
366
+ "bbox": [
367
+ 426,
368
+ 728,
369
+ 568,
370
+ 748
371
+ ],
372
+ "page_idx": 2
373
+ },
374
+ {
375
+ "type": "text",
376
+ "text": "because $\\begin{array} { r } { d _ { H } ( \\mathbf { X } , \\tilde { \\mathbf { X } } ) < \\frac { 1 } { K } \\le \\delta _ { \\varepsilon } } \\end{array}$ . ",
377
+ "bbox": [
378
+ 173,
379
+ 748,
380
+ 379,
381
+ 767
382
+ ],
383
+ "page_idx": 2
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "Let $P : \\mathcal X \\to \\mathbb R ^ { n }$ be any invertible map, its inverse mapping is expressed as $P ^ { - 1 }$ : $\\mathbb { R } ^ { n } \\to \\mathcal { X }$ . Let $g = S \\left( P ^ { - 1 } \\right)$ , then: ",
388
+ "bbox": [
389
+ 173,
390
+ 772,
391
+ 826,
392
+ 803
393
+ ],
394
+ "page_idx": 2
395
+ },
396
+ {
397
+ "type": "equation",
398
+ "img_path": "images/9dac71152f04177d568a5cd8b4c6eaeb059ec85b68f7ded56ac94e8f3ef63adb.jpg",
399
+ "text": "$$\nS \\left( P ^ { - 1 } ( \\underset { \\mathbf { X } \\in \\mathcal { X } } { P } ( \\{ \\sigma ( \\mathbf { x } ) : \\mathbf { x } \\in \\mathbf { X } \\} ) ) \\right) = S \\left( P ^ { - 1 } ( \\underset { \\mathbf { \\tilde { X } } \\in \\mathcal { X } } { P } ( \\tilde { \\mathbf { X } } ) ) \\right) = S ( \\tilde { \\mathbf { X } } ) .\n$$",
400
+ "text_format": "latex",
401
+ "bbox": [
402
+ 267,
403
+ 805,
404
+ 728,
405
+ 840
406
+ ],
407
+ "page_idx": 2
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "Because $| S ( \\mathbf { X } ) - S ( \\tilde { \\mathbf { X } } ) | < \\varepsilon$ and $S ( \\tilde { \\mathbf { X } } ) = S \\left( P ^ { - 1 } ( P ( \\tilde { \\mathbf { X } } ) ) \\right) = g ( P ( \\tilde { \\mathbf { X } } ) )$ , we have: ",
412
+ "bbox": [
413
+ 178,
414
+ 843,
415
+ 728,
416
+ 867
417
+ ],
418
+ "page_idx": 2
419
+ },
420
+ {
421
+ "type": "equation",
422
+ "img_path": "images/aca260ace2853c320a59a69b5b3a52537c1a59fee52a975c36348378bf297bdb.jpg",
423
+ "text": "$$\n| S ( \\mathbf { X } ) - g ( \\underset { \\mathbf { X } \\in \\mathcal { X } } { P } \\{ \\sigma ( \\pmb { x } ) : \\pmb { x } \\in \\mathbf { X } \\} ) | < \\varepsilon .\n$$",
424
+ "text_format": "latex",
425
+ "bbox": [
426
+ 366,
427
+ 871,
428
+ 630,
429
+ 893
430
+ ],
431
+ "page_idx": 2
432
+ },
433
+ {
434
+ "type": "text",
435
+ "text": "This completes the proof. ",
436
+ "bbox": [
437
+ 174,
438
+ 897,
439
+ 341,
440
+ 911
441
+ ],
442
+ "page_idx": 2
443
+ },
444
+ {
445
+ "type": "image",
446
+ "img_path": "images/679e2bd5120805ecf45628c54c6e3e15ad557272862ce9e8c6b43cf63a36e9a2.jpg",
447
+ "image_caption": [
448
+ "Figure 2: The difference between different Pooling Matrix P. Suppose there are 5 instances sampled from WSI in (a), $\\mathbf { P } \\in \\mathbb { R } ^ { 5 \\times 5 }$ is the corresponding Pooling Matrix, where the values in the diagonal line indicate the attention weight for itself and the rest indicate correlation between different instances. (b,c,d) all neglect the correlation information, hence the $\\mathbf { P }$ is diagonal matrix. In (b), the first instance was chosen by Max-pooling operator, so there is only one non-zero value in the first diagonal position. In (c), all the values within diagonal line are the same due to the Mean-pooling operator. In (d), the values within diagonal line can be varied due to the introduction of bypass attention. (e) obeys the correlation assumption, so there are non-zero values in off-diagonal position indicating correlation between different instances. "
449
+ ],
450
+ "image_footnote": [],
451
+ "bbox": [
452
+ 181,
453
+ 94,
454
+ 825,
455
+ 189
456
+ ],
457
+ "page_idx": 3
458
+ },
459
+ {
460
+ "type": "text",
461
+ "text": "Inference Suppose $S : \\mathcal { X } \\mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \\cdot , \\cdot )$ $\\forall \\varepsilon > 0$ , for any function $f$ and any invertible map $P : \\mathcal X \\to \\mathbb R ^ { n }$ , ∃ function $h$ and $g$ , such that for any $\\mathbf { X } \\in { \\mathcal { X } }$ : ",
462
+ "bbox": [
463
+ 174,
464
+ 354,
465
+ 823,
466
+ 396
467
+ ],
468
+ "page_idx": 3
469
+ },
470
+ {
471
+ "type": "equation",
472
+ "img_path": "images/fad9d88cf7633530ce028bc821bbd1f878b47ec7d1154c0dbf77037f24bbf0c5.jpg",
473
+ "text": "$$\n| S ( \\mathbf { X } ) - g ( \\underset { \\mathbf { X } \\in \\mathcal { X } } { P } \\{ f ( \\pmb { x } ) + h ( \\pmb { x } ) : \\pmb { x } \\in \\mathbf { X } \\} ) | < \\varepsilon .\n$$",
474
+ "text_format": "latex",
475
+ "bbox": [
476
+ 339,
477
+ 395,
478
+ 656,
479
+ 419
480
+ ],
481
+ "page_idx": 3
482
+ },
483
+ {
484
+ "type": "text",
485
+ "text": "That is: a Hausdorff continuous function $S ( \\mathbf { X } )$ can be arbitrarily approximated by a function in the form $g { \\big ( } { \\underset { \\mathbf { X } \\in { \\mathcal { X } } } { P } } { \\big \\{ } f ( { \\pmb { x } } ) + h ( { \\pmb { x } } ) : { \\pmb { x } } \\in \\mathbf { X } { \\} } .$ ). ",
486
+ "bbox": [
487
+ 173,
488
+ 422,
489
+ 825,
490
+ 457
491
+ ],
492
+ "page_idx": 3
493
+ },
494
+ {
495
+ "type": "text",
496
+ "text": "Proof. The proof is in the Appendix A. ",
497
+ "bbox": [
498
+ 174,
499
+ 473,
500
+ 433,
501
+ 489
502
+ ],
503
+ "page_idx": 3
504
+ },
505
+ {
506
+ "type": "text",
507
+ "text": "Theorem 2. The Instances in the bag are represented by random variables $\\Theta _ { 1 } , \\Theta _ { 2 } , \\ldots , \\Theta _ { n }$ , the information entropy of the bag under the correlation assumption can be expressed as $H \\left( \\Theta _ { 1 } , \\Theta _ { 2 } , \\ldots , \\Theta _ { n } \\right)$ , and the information entropy of the bag under the i.i.d. (independent and identical distribution) assumption can be expressed as $\\textstyle \\sum _ { t = 1 } ^ { n } { \\bar { H } } \\left( \\Theta _ { t } \\right)$ , then we have: ",
508
+ "bbox": [
509
+ 173,
510
+ 512,
511
+ 825,
512
+ 570
513
+ ],
514
+ "page_idx": 3
515
+ },
516
+ {
517
+ "type": "equation",
518
+ "img_path": "images/859c08907bc10fc7de358e919d73e34759f818c1b7e428d7914ad97293c225a5.jpg",
519
+ "text": "$$\nH \\left( \\Theta _ { 1 } , \\Theta _ { 2 } , \\ldots , \\Theta _ { n } \\right) = \\sum _ { t = 2 } ^ { n } H \\left( \\Theta _ { t } \\mid \\Theta _ { 1 } , \\ldots , \\Theta _ { t - 1 } \\right) + H \\left( \\Theta _ { 1 } \\right) \\leq \\sum _ { t = 1 } ^ { n } H \\left( \\Theta _ { t } \\right) .\n$$",
520
+ "text_format": "latex",
521
+ "bbox": [
522
+ 241,
523
+ 577,
524
+ 756,
525
+ 619
526
+ ],
527
+ "page_idx": 3
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "Proof. The proof is in the Appendix A. ",
532
+ "bbox": [
533
+ 174,
534
+ 632,
535
+ 433,
536
+ 647
537
+ ],
538
+ "page_idx": 3
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "Theorem 2 proved the correlation assumption has smaller information entropy, which may reduce the uncertainty and bring more useful information for the MIL problem. Motivated by the Inference and Theorem 2, a generic three-step method like Algorithm1 was developed. The main difference between the proposed algorithm and existing methods is shown in Figure 2. ",
543
+ "bbox": [
544
+ 173,
545
+ 662,
546
+ 825,
547
+ 719
548
+ ],
549
+ "page_idx": 3
550
+ },
551
+ {
552
+ "type": "table",
553
+ "img_path": "images/af2ed5f54d8e9a7cd8482b16d40e4f33dd7d7932cce07d9e40b48f8954c6b2e8.jpg",
554
+ "table_caption": [
555
+ "Algorithm 1: A generic three-step approach under the correlated MIL "
556
+ ],
557
+ "table_footnote": [],
558
+ "table_body": "<table><tr><td>Input: The bag of instances Xi = {xi,1, xi,2 ..., xi,n} Output: Bag-level predicted label Yi</td></tr><tr><td>1) Extracting morphological and spatial information of all the instances by f and h,</td></tr><tr><td>respectively;</td></tr><tr><td>Xf ← f(Xi),Xh ← h(Xi),Xfh ← Xf +Xh,where Xf,Xh,Xfh ∈ Rnxd;</td></tr><tr><td>2) Aggregating the extracted information for all instances by Pooling Matrix P;</td></tr><tr><td>Xp ←PXfh, whereP ∈ Rnxn;</td></tr><tr><td>3) Transforming Xp to obtain the predicted bag-level label by g;</td></tr><tr><td>Y← g(Xp).</td></tr></table>",
559
+ "bbox": [
560
+ 173,
561
+ 744,
562
+ 767,
563
+ 895
564
+ ],
565
+ "page_idx": 3
566
+ },
567
+ {
568
+ "type": "image",
569
+ "img_path": "images/d6aeeb4d6938525f28a0f40446e31d24e0684299499c4e2af52c8a057db262e8.jpg",
570
+ "image_caption": [
571
+ "Figure 3: Overview of our TransMIL. Each WSI is cropped into patches (background is discarded), and embedded in feature vectors by ResNet50. Then the sequence is processed with the TPT module: 1) Squaring of sequence; 2) Correlation modelling of the sequence; 3) Conditional position encoding and local information fusion; 4) Deep feature aggregation; 5) Mapping of $\\mathbb { T } \\to \\mathcal { y }$ . "
572
+ ],
573
+ "image_footnote": [],
574
+ "bbox": [
575
+ 174,
576
+ 87,
577
+ 825,
578
+ 220
579
+ ],
580
+ "page_idx": 4
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "3.2 How to apply Transformer to correlated MIL ",
585
+ "text_level": 1,
586
+ "bbox": [
587
+ 174,
588
+ 313,
589
+ 527,
590
+ 327
591
+ ],
592
+ "page_idx": 4
593
+ },
594
+ {
595
+ "type": "text",
596
+ "text": "The Transformer uses a self-attention mechanism to model the interactions between all tokens in a sequence, and the adding of positional information further increases the use of sequential order information. Therefore it’s a good idea to introduce the Transformer into the correlated MIL problem where the function $h$ encodes the spatial information among instances, and the Pooling Matrix $\\mathbf { P }$ uses self-attention for information aggregation. To make this clear, we further give a formal denition. ",
597
+ "bbox": [
598
+ 173,
599
+ 338,
600
+ 825,
601
+ 409
602
+ ],
603
+ "page_idx": 4
604
+ },
605
+ {
606
+ "type": "text",
607
+ "text": "Transformer based MIL. Given a set of bags $\\{ \\mathbf { X } _ { 1 } , \\mathbf { X } _ { 2 } , \\ldots , \\mathbf { X } _ { b } \\}$ , and each bag $\\mathbf { X } _ { i }$ contains multiple instances $\\{ \\pmb { x } _ { i , 1 } , \\pmb { x } _ { i , 2 } , \\ldots , \\pmb { x } _ { i , n } \\}$ and a corresponding label $Y _ { i }$ . The goal is to learn the mappings: $\\mathbb { X } \\mathbb { T } \\mathcal { Y }$ , where $\\mathbb { X }$ is the bag space, $\\mathbb { T }$ is the Transformer space and $\\mathcal { V }$ is the label space. The specific mapping form of $\\mathbb { X } \\to \\mathbb { T }$ and $\\mathbb { T } \\to \\mathbb { Y }$ are available in the Appendix B. ",
608
+ "bbox": [
609
+ 174,
610
+ 422,
611
+ 825,
612
+ 479
613
+ ],
614
+ "page_idx": 4
615
+ },
616
+ {
617
+ "type": "text",
618
+ "text": "3.3 TransMIL for Weakly Supervised WSI Classication ",
619
+ "text_level": 1,
620
+ "bbox": [
621
+ 173,
622
+ 496,
623
+ 571,
624
+ 511
625
+ ],
626
+ "page_idx": 4
627
+ },
628
+ {
629
+ "type": "text",
630
+ "text": "To better describe the mapping of $\\mathbb { X } \\to \\mathbb { T }$ , we design a TPT module with two Transformer layers and a position encoding layer, where Transformer layers are designed for aggregating morphological information and Pyramid Position Encoding Generator (PPEG) is designed for encoding spatial information. The overview of proposed Transformer based MIL (TransMIL) is shown in Figure 3. ",
631
+ "bbox": [
632
+ 174,
633
+ 521,
634
+ 825,
635
+ 578
636
+ ],
637
+ "page_idx": 4
638
+ },
639
+ {
640
+ "type": "text",
641
+ "text": "Long Instances Sequence Modelling with TPT. The sequences are from the feature embeddings in each WSI. The processing steps of the TPT module are shown in Algorithm 2, where MSA denotes Multi-head Self-attention, MLP denotes Multilayer Perceptron, and LN denotes Layer Norm. ",
642
+ "bbox": [
643
+ 173,
644
+ 593,
645
+ 826,
646
+ 635
647
+ ],
648
+ "page_idx": 4
649
+ },
650
+ {
651
+ "type": "text",
652
+ "text": "Algorithm 2: TPT module processing flow \nInput: A bag of feature embeddings $\\mathbf { H } _ { i } = \\{ h _ { i , 1 } , \\dots , h _ { i , n } \\}$ , where $h _ { i , j } \\in \\mathbb { R } ^ { 1 \\times d }$ is the embedding of the $j$ th instance, $\\mathbf { H } _ { i } \\in \\mathbb { R } ^ { n \\times d }$ \nOutput: Bag-level predicted label $\\hat { Y _ { i } }$ 1) Squaring of sequence; $\\sqrt { N } \\lceil \\sqrt { n } \\rceil$ , $M \\gets N - n$ , $\\mathbf { H } _ { S } \\gets$ Concat $( h _ { i , c l a s s }$ , $\\mathbf { H } _ { i }$ , $( h _ { i , 1 } , \\ldots , h _ { i , M } ) )$ , where \n$h _ { i , c l a s s } \\in \\mathbb { R } ^ { 1 \\times d }$ represents class token, $\\mathbf { H } _ { S } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ ; 2) Correlation modelling of the sequence; $\\mathbf { H } _ { S } ^ { \\ell } \\gets \\mathrm { M S A } \\left( \\mathbf { H } _ { S } \\right)$ , where $\\ell$ denotes the layer index of the Transformer, $\\mathbf { H } _ { S } ^ { \\ell } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ ; 3) Conditional position encoding and local information fusion; $\\mathbf { H } _ { S } ^ { P } \\mathrm { P P E G } ( \\mathbf { H } _ { S } ^ { \\ell } )$ , where $\\mathbf { H } _ { S } ^ { P } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ ; 4) Deep feature aggregation; $\\mathbf { H } _ { S } ^ { \\ell + 1 } \\mathrm { M S A } ( \\mathbf { H } _ { S } ^ { P } )$ , where $\\mathbf { H } _ { S } ^ { \\ell + 1 } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ ; 5) Mapping of $\\mathbb { T } \\to \\mathcal { y }$ ; $\\hat { Y } _ { i } \\gets \\mathrm { M L P } \\left( \\mathrm { L N } \\left( \\left( \\mathbf { H } _ { S } ^ { \\ell + 1 } \\right) ^ { ( 0 ) } \\right) \\right)$ , where $\\big ( \\mathbf { H } _ { S } ^ { \\ell + 1 } \\big ) ^ { ( 0 ) } \\in \\mathbb { R } ^ { 1 \\times d }$ represents class token. ",
653
+ "bbox": [
654
+ 173,
655
+ 661,
656
+ 808,
657
+ 904
658
+ ],
659
+ "page_idx": 4
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "For most cases, the softmax used in Transformer for vision tasks such as [17, 18, 35] is a row-byrow softmax normalization function. The standard self-attention mechanism requires the calculation of similarity scores between each pair of tokens, resulting in both memory and time complexity of $O ( n ^ { 2 } )$ . To deal with the long instances sequence problem in WSIs, the softmax in TPT adopts the Nystrom Method proposed in [22]. The approximated self-attention form $\\hat { \\bf S }$ can be defined as: ",
664
+ "bbox": [
665
+ 174,
666
+ 90,
667
+ 826,
668
+ 164
669
+ ],
670
+ "page_idx": 5
671
+ },
672
+ {
673
+ "type": "equation",
674
+ "img_path": "images/4643daa0d35fe12db87b201202088842245b8831bd7b780ab99edd2d2799fdb9.jpg",
675
+ "text": "$$\n\\hat { \\bf S } = \\mathrm { s o f t m a x } \\left( \\frac { { \\bf Q } \\tilde { \\bf K } ^ { T } } { \\sqrt { d _ { q } } } \\right) \\left( \\mathrm { s o f t m a x } \\left( \\frac { \\tilde { \\bf Q } \\tilde { \\bf K } ^ { T } } { \\sqrt { d _ { q } } } \\right) \\right) ^ { + } \\mathrm { s o f t m a x } \\left( \\frac { \\tilde { \\bf Q } { \\bf K } ^ { T } } { \\sqrt { d _ { q } } } \\right) ,\n$$",
676
+ "text_format": "latex",
677
+ "bbox": [
678
+ 263,
679
+ 174,
680
+ 733,
681
+ 220
682
+ ],
683
+ "page_idx": 5
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "where $\\tilde { \\mathbf { Q } }$ and $\\tilde { \\bf K }$ are the $m$ selected landmarks from the original $n$ dimensional sequence of $\\mathbf { Q }$ and $\\mathbf { K }$ , and $\\mathbf { A } ^ { + }$ is a Moore-Penrose pseudoinverse of A. The final computational complexity is reduced from $O ( n ^ { 2 } )$ to $O ( n )$ . By doing this, the TPT module with approximation processing can satisfy the case where a bag contains thousands of tokens as input. ",
688
+ "bbox": [
689
+ 174,
690
+ 232,
691
+ 825,
692
+ 290
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "Position encoding with PPEG. In WSIs, the number of tokens in the corresponding sequence often varies due to the inherently variable size of the slide and tissue area. In [36] it is shown that the adding of zero padding can provide an absolute position information to convolution. Inspired by this, we designed the PPEG module accordingly. The overview is shown in Figure 4, and the pseudo-code for the processing is shown in Algorithm 3. ",
699
+ "bbox": [
700
+ 173,
701
+ 309,
702
+ 825,
703
+ 380
704
+ ],
705
+ "page_idx": 5
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "Figure 4: Pyramid Position Encoding Generator. 1) The sequence is divided into patch tokens and class token; 2) Patch tokens are reshaped into 2-D image space; 3) Different sized convolution kernels are used to encode spatial information; 4) Different spatial information are fused together; 5) Patch tokens are flattened into sequence; 6) Connect class token and patch tokens. ",
710
+ "bbox": [
711
+ 173,
712
+ 410,
713
+ 825,
714
+ 467
715
+ ],
716
+ "page_idx": 5
717
+ },
718
+ {
719
+ "type": "text",
720
+ "text": "Our PPEG module has more advantages over the method proposed in [37]: (1) PPEG module uses different sized convolution kernels in the same layer, which can encode the positional information with different granularity, enabling high adaptability of PPEG. (2) Taking advantage of CNN’s ability to aggregate context information, the tokens in the sequence is able to obtain both global information and context information, which enriches the features carried by each token. ",
721
+ "bbox": [
722
+ 173,
723
+ 486,
724
+ 825,
725
+ 556
726
+ ],
727
+ "page_idx": 5
728
+ },
729
+ {
730
+ "type": "text",
731
+ "text": "Algorithm 3: PPEG processing flow ",
732
+ "text_level": 1,
733
+ "bbox": [
734
+ 174,
735
+ 579,
736
+ 416,
737
+ 594
738
+ ],
739
+ "page_idx": 5
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "Input: A bag of feature embeddings $\\mathbf { H } _ { S } ^ { \\ell }$ after correlation modelling, where $\\mathbf { H } _ { S } ^ { \\ell } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ . \nOutput: The feature embeddings $\\mathbf { H } _ { S } ^ { P }$ after conditional position encoding and local information fusion, where $\\mathbf { H } _ { S } ^ { P } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ . 1) Split: $\\mathbf { H } _ { S } ^ { \\ell }$ is divided into patch tokens $\\mathbf { H } _ { f }$ and class token $\\mathbf { H } _ { c }$ ; $\\mathbf { H } _ { f } , \\mathbf { H } _ { c } \\gets \\mathrm { S p l i t } \\left( \\mathbf { H } _ { S } ^ { \\ell } \\right)$ , where $\\mathbf { H } _ { f } \\in \\mathbb { R } ^ { N \\times d } , \\mathbf { H } _ { c } \\in \\mathbb { R } ^ { 1 \\times d }$ ; 2) Spatial Restore: patch tokens $\\mathbf { H } _ { f }$ are reshaped to $\\mathbf { H } _ { S } ^ { f }$ in the 2-D image space; $\\mathbf { H } _ { S } ^ { f } \\mathrm { R e s t o r e } ( \\mathbf { H } _ { f } )$ , where $\\mathbf { H } _ { S } ^ { f } \\in \\mathbb { R } ^ { \\sqrt { N } \\times \\sqrt { N } \\times d }$ ; 3) Group Convolution: using a set of group convolutions with kernel $k$ and $\\frac { k - 1 } { 2 }$ zero \npaddings $( k = 3 , 5 , 7 )$ to obtain $\\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ ; $\\mathbf { H } _ { t } ^ { f } \\gets \\mathrm { C o n v } \\left( \\mathbf { H } _ { S } ^ { f } \\right)$ , where $\\mathbf { H } _ { t } ^ { f } \\in \\mathbb { R } ^ { \\sqrt { N } \\times \\sqrt { N } \\times d } , t = 1 , 2 , 3 \\mathrm { { : } }$ 4) Fusion: $\\mathbf { H } _ { S } ^ { f }$ and the $\\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ obtained from the convolution block processing are \nadded together to obtain $\\mathbf { H } _ { S } ^ { F }$ ; $\\mathbf { H } _ { S } ^ { F } \\mathbf { H } _ { S } ^ { f } + \\mathbf { H } _ { 1 } ^ { f } + \\mathbf { H } _ { 2 } ^ { f } + \\mathbf { H } _ { 3 } ^ { f }$ , where $\\mathbf { H } _ { S } ^ { F } \\in \\mathbb { R } ^ { \\sqrt { N } \\times \\sqrt { N } \\times d }$ ; 5) Flatten: $\\mathbf { H } _ { S } ^ { F }$ are flattened into sequence $\\mathbf { H } _ { s e }$ ; $\\mathbf { H } _ { s e } \\gets$ Flatten $\\left( \\mathbf { H } _ { S } ^ { F } \\right)$ , where $\\mathbf { H } _ { s e } \\in \\mathbb { R } ^ { N \\times d }$ ; 6) Concat: connect $\\mathbf { H } _ { s e }$ and class token $\\mathbf { H } _ { c }$ to obtain $\\mathbf { H } _ { S } ^ { P }$ ; $\\mathbf { H } _ { S } ^ { P } \\mathrm { C o n c a t } ( \\mathbf { H } _ { s e } , \\mathbf { H } _ { c } )$ , where $\\mathbf { H } _ { S } ^ { P } \\in \\mathbb { R } ^ { ( N + 1 ) \\times d }$ . ",
744
+ "bbox": [
745
+ 176,
746
+ 598,
747
+ 805,
748
+ 890
749
+ ],
750
+ "page_idx": 5
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "4 Experiments and Results ",
755
+ "text_level": 1,
756
+ "bbox": [
757
+ 174,
758
+ 89,
759
+ 413,
760
+ 106
761
+ ],
762
+ "page_idx": 6
763
+ },
764
+ {
765
+ "type": "text",
766
+ "text": "To demonstrate the superior performance of the proposed TransMIL, various experiments were conducted over three public datasets: CAMELYON16, The Caner Genome Atlas (TCGA) non-small cell lung cancer (NSCLC), as well as the TCGA renal cell carcinoma (RCC). ",
767
+ "bbox": [
768
+ 174,
769
+ 122,
770
+ 825,
771
+ 164
772
+ ],
773
+ "page_idx": 6
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "Dataset. CAMELYON16 is a public dataset for metastasis detection in breast cancer, including 270 training sets and 130 test sets. After pre-processing, a total of about 3.5 million patches at $\\times 2 0$ magnification, in average about 8,800 patches per bag were obtained. ",
778
+ "bbox": [
779
+ 174,
780
+ 181,
781
+ 825,
782
+ 224
783
+ ],
784
+ "page_idx": 6
785
+ },
786
+ {
787
+ "type": "text",
788
+ "text": "TCGA-NSCLC includes two subtype projects, i.e., Lung Squamous Cell Carcinoma (TGCA-LUSC) and Lung Adenocarcinoma (TCGA-LUAD), for a total of 993 diagnostic WSIs, including 507 LUAD slides from 444 cases and 486 LUSC slides from 452 cases. After pre-processing, the mean number of patches extracted per slide at $\\times 2 0$ magnification is 15371. ",
789
+ "bbox": [
790
+ 174,
791
+ 229,
792
+ 825,
793
+ 285
794
+ ],
795
+ "page_idx": 6
796
+ },
797
+ {
798
+ "type": "text",
799
+ "text": "TCGA-RCC includes three subtype projects, i.e., Kidney Chromophobe Renal Cell Carcinoma (TGCA-KICH), Kidney Renal Clear Cell Carcinoma (TCGA-KIRC) and Kidney Renal Papillary Cell Carcinoma (TCGA-KIRP), for a total of 884 diagnostic WSIs, including 111 KICH slides from 99 cases, 489 KIRC slides from 483 cases, and 284 KIRP slides from 264 cases. After preprocessing, the mean number of patches extracted per slide at $\\times 2 0$ magnification is 14627. ",
800
+ "bbox": [
801
+ 174,
802
+ 292,
803
+ 825,
804
+ 362
805
+ ],
806
+ "page_idx": 6
807
+ },
808
+ {
809
+ "type": "text",
810
+ "text": "Experiment Setup and Evaluation Metrics. Each WSI is cropped into a series of $2 5 6 \\times 2 5 6$ nonoverlapping patches, where the background region (saturation ${ < } 1 5$ ) is discarded. In CAMELYON16 we trained on the official training set after splitting the 270 WSIs into approximately $9 0 \\%$ training and $1 0 \\%$ validation, and tested on the official test set. For TCGA datasets, we first ensured that different slides from one patient do not exist in both the training and test sets, and then randomly split the data in the ratio of training:validation:test $= 6 0 { : } 1 5 { : } 2 5$ . For the evaluation metrics, we used accuracy and area under the curve (AUC) scores to evaluate the classification performance, where the accuracy was calculated with a threshold of 0.5 in all experiments. For the AUC, the official test set AUC was used on the CAMELYON16 dataset, the average AUC was used on the TCGANSCLC dataset, and the average one-versus-rest AUC (macro-averaged) was used on the TCGARCC dataset. All the results over TCGA datasets are obtained by 4-fold cross-validation. ",
811
+ "bbox": [
812
+ 174,
813
+ 380,
814
+ 825,
815
+ 531
816
+ ],
817
+ "page_idx": 6
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "Implementation Details. In the training step, cross-entropy loss was adopted, and the Lookahead optimizer [38] was employed with a learning rate of 2e-4 and weight decay of 1e-5. The size of mini-batch $B$ is 1. As in [13], the feature of each patch is embedded in a 1024-dimensional vector by a ResNet50 [39] model pre-trained on ImageNet. During training, the dimension of each feature embedding is reduced from 1024 to 512 by a fully connected layer. Finally, the feature embedding of each bag can be represented as $\\mathbf { H } _ { i } \\in \\mathbb { R } ^ { n \\times 5 1 2 }$ . In the inference step, the softmax is used to normalize the predicted scores for each class. All experiments are done with a RTX 3090. ",
822
+ "bbox": [
823
+ 174,
824
+ 549,
825
+ 825,
826
+ 646
827
+ ],
828
+ "page_idx": 6
829
+ },
830
+ {
831
+ "type": "text",
832
+ "text": "Baseline. The baselines we chose include deep models with traditional pooling operators such as mean-pooling, max-pooling and the current state-of-the-art deep MIL models [8, 9, 13, 23, 40], the attention based pooling operator ABMIL [8] and PT-MTA [40], non-local attention based pooling operator DSMIL [9], single-attention-branch CLAM-SB[13], multi-attention-branch CLAM-MB[13], and recurrent neural network(RNN) based aggregation MIL-RNN [23]. ",
833
+ "bbox": [
834
+ 174,
835
+ 664,
836
+ 825,
837
+ 734
838
+ ],
839
+ "page_idx": 6
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "4.1 Results on WSI classification ",
844
+ "text_level": 1,
845
+ "bbox": [
846
+ 176,
847
+ 752,
848
+ 413,
849
+ 767
850
+ ],
851
+ "page_idx": 6
852
+ },
853
+ {
854
+ "type": "text",
855
+ "text": "We will present the results of both binary and multiple classification. The binary classification tasks contain positive/negative classification over CAMELYON16 and LUSC/LUAD subtypes classification over TCGA-NSCLC. The multiple classification refers to TGCA-KICH/TCGA-KIRC/TCGAKIRP subtypes classification over TCGA-RCC. All the results are provided in Table 1. ",
856
+ "bbox": [
857
+ 174,
858
+ 779,
859
+ 825,
860
+ 835
861
+ ],
862
+ "page_idx": 6
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "In CAMELYON16, only a small portion of each positive slide contains tumours (averagely total cancer area per slide $< 1 0 \\%$ ), resulting in the presence of a large number of negative regions disturbing the prediction of positive slide. The bypass attention-based methods and proposed TransMIL all outperform the traditional pooling operators. However in AUC score, TransMIL was at least $5 \\%$ higher than ABMIL, PT-MTA and CLAM which neglect the correlation between instances, and do not consider the spatial information between patches. DSMIL only considers the relationship between the highest scoring instance and others, leading to limited performance. ",
867
+ "bbox": [
868
+ 174,
869
+ 842,
870
+ 825,
871
+ 911
872
+ ],
873
+ "page_idx": 6
874
+ },
875
+ {
876
+ "type": "table",
877
+ "img_path": "images/331b1c429a73ba6ddab3fba4397ce4e0bbcc6f98b5fdfa9f37c8e37bc862745d.jpg",
878
+ "table_caption": [
879
+ "Table 1: Results on CAMELYON16, TCGA-NSCLC and TCGA-RCC. "
880
+ ],
881
+ "table_footnote": [],
882
+ "table_body": "<table><tr><td rowspan=\"2\"></td><td colspan=\"2\">CAMELYON16</td><td colspan=\"2\">TCGA-NSCLC</td><td colspan=\"2\">TCGA-RCC</td></tr><tr><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td></tr><tr><td>Mean-pooling</td><td>0.6389</td><td>0.4647</td><td>0.7282</td><td>0.8401</td><td>0.9054</td><td>0.9786</td></tr><tr><td>Max-pooling</td><td>0.8062</td><td>0.8569</td><td>0.8593</td><td>0.9463</td><td>0.9378</td><td>0.9879</td></tr><tr><td>ABMIL[8]</td><td>0.8682</td><td>0.8760</td><td>0.7719</td><td>0.8656</td><td>0.8934</td><td>0.9702</td></tr><tr><td>PT-MTA [40]</td><td>0.8217</td><td>0.8454</td><td>0.7379</td><td>0.8299</td><td>0.9059</td><td>0.9700</td></tr><tr><td>MIL-RNN [23]</td><td>0.8450</td><td>0.8880</td><td>0.8619</td><td>0.9107</td><td>一</td><td>一</td></tr><tr><td>DSMIL [9]</td><td>0.7985</td><td>0.8179</td><td>0.8058</td><td>0.8925</td><td>0.9294</td><td>0.9841</td></tr><tr><td>CLAM-SB[13]</td><td>0.8760</td><td>0.8809</td><td>0.8180</td><td>0.8818</td><td>0.8816</td><td>0.9723</td></tr><tr><td>CLAM-MB[13]</td><td>0.8372</td><td>0.8679</td><td>0.8422</td><td>0.9377</td><td>0.8966</td><td>0.9799</td></tr><tr><td>TransMIL</td><td>0.8837</td><td>0.9309</td><td>0.8835</td><td>0.9603</td><td>0.9466</td><td>0.9882</td></tr></table>",
883
+ "bbox": [
884
+ 223,
885
+ 108,
886
+ 776,
887
+ 284
888
+ ],
889
+ "page_idx": 7
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "",
894
+ "bbox": [
895
+ 176,
896
+ 310,
897
+ 820,
898
+ 338
899
+ ],
900
+ "page_idx": 7
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "In TCGA-NSCLC, positive slides contain relatively large areas of tumour region (averagely total cancer area per slide ${ > } 8 0 \\%$ ), consequently the pooling operator can achieve better performance than in CAMELYON16. Again, TransMIL performed better than all the other competing methods, achieving $1 . 4 0 \\%$ higher in AUC and $2 . 1 6 \\%$ in accuracy, compared with the second best method. ",
905
+ "bbox": [
906
+ 174,
907
+ 344,
908
+ 825,
909
+ 401
910
+ ],
911
+ "page_idx": 7
912
+ },
913
+ {
914
+ "type": "text",
915
+ "text": "In TCGA-RCC, as MIL-RNN did not consider the multi-classification problem, it was not included in this comparison result. The TCGA-RCC is unbalanced distributed in cancer subtypes and has large areas of tumour region in the positive slides (averagely total cancer area per slide ${ > } 8 0 \\%$ ). However, TransMIL is equally applicable to multi-class problems with unbalanced data. It can be observed that TransMIL achieves best results in both accuracy and AUC score. ",
916
+ "bbox": [
917
+ 174,
918
+ 406,
919
+ 825,
920
+ 477
921
+ ],
922
+ "page_idx": 7
923
+ },
924
+ {
925
+ "type": "text",
926
+ "text": "4.2 Ablation Study ",
927
+ "text_level": 1,
928
+ "bbox": [
929
+ 174,
930
+ 493,
931
+ 316,
932
+ 508
933
+ ],
934
+ "page_idx": 7
935
+ },
936
+ {
937
+ "type": "text",
938
+ "text": "To further determine the contribution of the PPEG module and the conditional position encoding for the performance, we have conducted a series of ablation studies. Since the high classification accuracy of most methods over TCGA-RCC is not obvious, all ablation study experiments are based on the CAMELYON16 and the TCGA-NSCLC dataset. All experiments were evaluated by AUC. ",
939
+ "bbox": [
940
+ 174,
941
+ 520,
942
+ 825,
943
+ 575
944
+ ],
945
+ "page_idx": 7
946
+ },
947
+ {
948
+ "type": "text",
949
+ "text": "4.2.1 Effects of PPEG ",
950
+ "text_level": 1,
951
+ "bbox": [
952
+ 174,
953
+ 590,
954
+ 338,
955
+ 606
956
+ ],
957
+ "page_idx": 7
958
+ },
959
+ {
960
+ "type": "text",
961
+ "text": "The position encoding of the Transformer typically explores absolute position encoding (e.g., sinusoidal encoding, learnable absolute encoding) as well as conditional position encoding. However, learnable absolute encoding is commonly used in problems with fixed length sequences, and does not meet the requirement for variable length of input sequences in WSI analysis, so it is not taken into account in this paper. Here, we compared the effect of sinusoidal encoding and PPEG module which represents multi-level conditional position encoding. The same experiments are performed over CAMELYON16 and TCGA-NSCLC dataset, and the results are shown in Table 2. It should be noted that sinusoidal encoding is added to the original sequence with a multiplication of 0.001 as described in [33]. ",
962
+ "bbox": [
963
+ 173,
964
+ 616,
965
+ 826,
966
+ 741
967
+ ],
968
+ "page_idx": 7
969
+ },
970
+ {
971
+ "type": "table",
972
+ "img_path": "images/201c985fcaa44286b457682c1089fe6f8f9a059d63f77b42f075c518cbef90c3.jpg",
973
+ "table_caption": [
974
+ "Table 2: Effects of PPEG. "
975
+ ],
976
+ "table_footnote": [],
977
+ "table_body": "<table><tr><td>Model</td><td>Params</td><td>Camelyon16</td><td>NSCLC</td></tr><tr><td>w/o</td><td>2.625M</td><td>0.8416</td><td>0.9287</td></tr><tr><td>sin-cos</td><td>2.625M</td><td>0.8941</td><td>0.9374</td></tr><tr><td>3×3</td><td>2.630M</td><td>0.8913</td><td>0.9355</td></tr><tr><td>7×7</td><td>2.651M</td><td>0.9015</td><td>0.9336</td></tr><tr><td>both</td><td>2.669M</td><td>0.9059</td><td>0.9402</td></tr><tr><td>PPEG</td><td>2.669M</td><td>0.9309</td><td>0.9603</td></tr></table>",
978
+ "bbox": [
979
+ 189,
980
+ 787,
981
+ 485,
982
+ 902
983
+ ],
984
+ "page_idx": 7
985
+ },
986
+ {
987
+ "type": "image",
988
+ "img_path": "images/e707257be5bb10312bbf3088dfc58ec0f6447b7b728f53504a19ec48a2081e47.jpg",
989
+ "image_caption": [
990
+ "Figure 5: Effects of Positional Encoding. "
991
+ ],
992
+ "image_footnote": [],
993
+ "bbox": [
994
+ 496,
995
+ 746,
996
+ 820,
997
+ 891
998
+ ],
999
+ "page_idx": 7
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "text": "Compared with the model without position encoding, it can be seen that both sinusoidal encoding and conditional position encoding can improve the classification performance, and conditional position information encoded by PPEG can be more effective in diagnosis analysis. In contrast to the $3 \\times 3$ and $7 \\times 7$ convolutional block, adding different sized convolution kernels in the same layer allows for multi-level positional encoding and adds more context information to each token. ",
1004
+ "bbox": [
1005
+ 174,
1006
+ 92,
1007
+ 825,
1008
+ 161
1009
+ ],
1010
+ "page_idx": 8
1011
+ },
1012
+ {
1013
+ "type": "text",
1014
+ "text": "4.2.2 Effects of Conditional Position Encoding ",
1015
+ "text_level": 1,
1016
+ "bbox": [
1017
+ 173,
1018
+ 176,
1019
+ 508,
1020
+ 191
1021
+ ],
1022
+ "page_idx": 8
1023
+ },
1024
+ {
1025
+ "type": "text",
1026
+ "text": "Here, by disrupting the order of the input sequences, we explore actual improvements for conditional position encoding. The performance of the model under different configurations is shown in Figure 5, where order represents sequential data input and $w / o$ represents random and disordered data input. It can be seen that conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \\%$ over CAMELYON16 and $0 . 6 1 \\%$ over TCGA-NSCLC in AUC. ",
1027
+ "bbox": [
1028
+ 174,
1029
+ 200,
1030
+ 825,
1031
+ 270
1032
+ ],
1033
+ "page_idx": 8
1034
+ },
1035
+ {
1036
+ "type": "text",
1037
+ "text": "Compared with the model without position encoding or with sinusoidal encoding, conditional position information encoded by PPEG can be more effective in diagnosis analysis. Compared with the results trained over the sequential and disordered training sets, conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \\%$ over CAMELYON16 and $0 . 6 1 \\%$ over TCGA-NSCLC in AUC. ",
1038
+ "bbox": [
1039
+ 174,
1040
+ 276,
1041
+ 825,
1042
+ 345
1043
+ ],
1044
+ "page_idx": 8
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "4.3 Interpretability and Attention Visualization ",
1049
+ "text_level": 1,
1050
+ "bbox": [
1051
+ 174,
1052
+ 363,
1053
+ 516,
1054
+ 378
1055
+ ],
1056
+ "page_idx": 8
1057
+ },
1058
+ {
1059
+ "type": "text",
1060
+ "text": "Here, we will further show the interpretability of TransMIL. As shown in Figure 6(a), the area within the blue curve annotation is the cancer region, which was provided by Gao et al. [41] over the TCGA-RCC dataset. In Figure 6(b), attention scores from TransMIL were visualised as a heatmap to determine the ROI and interpret the important morphology used for diagnosis, and Figure 6(c) is a zoomed-in view of the black square in Figure 6(b). Obviously, there is a high consistency between fine annotation area and heatmap, illustrating great interpretability and attention visualization of the proposed TransMIL. ",
1061
+ "bbox": [
1062
+ 173,
1063
+ 388,
1064
+ 825,
1065
+ 486
1066
+ ],
1067
+ "page_idx": 8
1068
+ },
1069
+ {
1070
+ "type": "image",
1071
+ "img_path": "images/be9b1dab98277f1e1385b8022a1a0ce049a3009f496e314ad9d0e3bfe6c78186.jpg",
1072
+ "image_caption": [
1073
+ "Figure 6: Interpretability and visualization. "
1074
+ ],
1075
+ "image_footnote": [],
1076
+ "bbox": [
1077
+ 176,
1078
+ 503,
1079
+ 821,
1080
+ 661
1081
+ ],
1082
+ "page_idx": 8
1083
+ },
1084
+ {
1085
+ "type": "text",
1086
+ "text": "4.4 Fast Convergence ",
1087
+ "text_level": 1,
1088
+ "bbox": [
1089
+ 174,
1090
+ 720,
1091
+ 336,
1092
+ 736
1093
+ ],
1094
+ "page_idx": 8
1095
+ },
1096
+ {
1097
+ "type": "text",
1098
+ "text": "Traditional MIL methods as well as the latest MIL methods such as ABMIL, DSMIL and CLAM usually require a large number of epochs to converge. Different from these methods, TransMIL makes use of the morphological and spatial information among instances, leading to approximately two to three times fewer training epochs. As shown in Figure 7, TransMIL has better performance in terms of convergence and validation AUC than other MIL methods. ",
1099
+ "bbox": [
1100
+ 174,
1101
+ 747,
1102
+ 825,
1103
+ 816
1104
+ ],
1105
+ "page_idx": 8
1106
+ },
1107
+ {
1108
+ "type": "text",
1109
+ "text": "5 Conclusion ",
1110
+ "text_level": 1,
1111
+ "bbox": [
1112
+ 174,
1113
+ 837,
1114
+ 299,
1115
+ 854
1116
+ ],
1117
+ "page_idx": 8
1118
+ },
1119
+ {
1120
+ "type": "text",
1121
+ "text": "In this paper, we have developed a novel correlated MIL framework that is consistent with the behavior of pathologists considering both the contextual information around a single area and the correlation between different areas when making a diagnostic decision. Based on this framework, a ",
1122
+ "bbox": [
1123
+ 174,
1124
+ 869,
1125
+ 825,
1126
+ 911
1127
+ ],
1128
+ "page_idx": 8
1129
+ },
1130
+ {
1131
+ "type": "image",
1132
+ "img_path": "images/3fa1392172d1bf81f2dc21cbbf594d8eb34347b3a0e441d5a571eee38a47b9cf.jpg",
1133
+ "image_caption": [
1134
+ "Figure 7: The convergence comparison of TransMIL and the competing methods. "
1135
+ ],
1136
+ "image_footnote": [],
1137
+ "bbox": [
1138
+ 205,
1139
+ 87,
1140
+ 790,
1141
+ 222
1142
+ ],
1143
+ "page_idx": 9
1144
+ },
1145
+ {
1146
+ "type": "text",
1147
+ "text": "Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information in weakly supervised WSI classification. We also design a PPEG for position encoding as well as a TPT module with two Transformer layers and a position encoding layer. The TransMIL network is easy to train, and can be applied to unbalanced/balanced and binary/multiple classification with great visualization and interpretability. Most importantly, TransMIL outperforms the state-of-the-art MIL algorithms in terms of both AUC and accuracy over three public datasets. Currently, all the experiments were conducted over the dataset with $\\times 2 0$ magnification, however the WSIs with higher magnification will result in longer sequence and inevitably pose great challenges in terms of both computational and memory requirements, and we will explore this issue in the follow-up work. ",
1148
+ "bbox": [
1149
+ 173,
1150
+ 273,
1151
+ 825,
1152
+ 398
1153
+ ],
1154
+ "page_idx": 9
1155
+ },
1156
+ {
1157
+ "type": "text",
1158
+ "text": "Broader Impact Our proposed approach shows greater potential for MIL application to real-world diagnosis analysis, particularly in problems that require more correlated information such as survival analysis and cancer cell spread detection. In the short term, the benefit of this work is to provide a model with better performance, faster convergence and clinical interpretability. In the long term, the proposed TransMIL network is more applicable to real situations, and it is hoped that it will provide more novel and effective ideas about further applications of deep MIL to diagnosis analysis. ",
1159
+ "bbox": [
1160
+ 174,
1161
+ 412,
1162
+ 825,
1163
+ 496
1164
+ ],
1165
+ "page_idx": 9
1166
+ },
1167
+ {
1168
+ "type": "text",
1169
+ "text": "Acknowledgment This work was supported in part by the National Natural Science Foundation of China (61922048&62031023), in part by the Shenzhen Science and Technology Project (JCYJ20200109142808034), and in part by Guangdong Special Support (2019TX05X187). ",
1170
+ "bbox": [
1171
+ 176,
1172
+ 511,
1173
+ 825,
1174
+ 553
1175
+ ],
1176
+ "page_idx": 9
1177
+ },
1178
+ {
1179
+ "type": "text",
1180
+ "text": "References ",
1181
+ "text_level": 1,
1182
+ "bbox": [
1183
+ 174,
1184
+ 571,
1185
+ 266,
1186
+ 588
1187
+ ],
1188
+ "page_idx": 9
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "[1] Lei He, L Rodney Long, Sameer Antani, and George R Thoma. Histology image analysis for carcinoma detection and grading. Computer methods and programs in biomedicine, pages 538–556, 2012. \n[2] Anant Madabhushi. Digital pathology image analysis: opportunities and challenges. Imaging in medicine, pages 7–10, 2009. \n[3] Chen Li, Xintong Li, Md Rahaman, Xiaoyan Li, Hongzan Sun, Hong Zhang, Yong Zhang, Xiaoqi Li, Jian Wu, Yudong Yao, et al. A comprehensive review of computer-aided whole-slide image analysis: from datasets to feature extraction, segmentation, classification, and detection approaches. arXiv preprint arXiv:2102.10553, 2021. \n[4] Xiaomin Zhou, Chen Li, Md Mamunur Rahaman, Yudong Yao, Shiliang Ai, Changhao Sun, Qian Wang, Yong Zhang, Mo Li, Xiaoyan Li, et al. A comprehensive review for breast histopathology image analysis using classical and deep neural networks. IEEE Access, pages 90931–90956, 2020. \n[5] Chetan L Srinidhi, Ozan Ciga, and Anne L Martel. Deep neural network models for computational histopathology: A survey. Medical Image Analysis, 2020. \n[6] Xinggang Wang, Yongluan Yan, Peng Tang, Xiang Bai, and Wenyu Liu. Revisiting multiple instance neural networks. Pattern Recognition, pages 15–24, 2018. \n[7] Fahdi Kanavati, Gouji Toyokawa, Seiya Momosaki, Michael Rambeau, Yuka Kozuma, Fumihiro Shoji, Koji Yamazaki, Sadanori Takeo, Osamu Iizuka, and Masayuki Tsuneki. Weaklysupervised learning for lung carcinoma classification using deep learning. Scientific reports, pages 1–11, 2020. [8] Maximilian Ilse, Jakub M. Tomczak, and M. Welling. Attention-based deep multiple instance learning. In International Conference on Machine Learning, pages 2127–2136, 2018. \n[9] Bin Li, Yin Li, and Kevin W Eliceiri. Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021. \n[10] Naofumi Tomita, Behnaz Abdollahi, Jason Wei, Bing Ren, A. Suriawinata, and S. Hassanpour. Attention-based deep neural networks for detection of cancerous and precancerous esophagus tissue on histopathological slides. JAMA Network Open, 2019. \n[11] Noriaki Hashimoto, Daisuke Fukushima, Ryoichi Koga, Yusuke Takagi, Kaho Ko, Kei Kohno, Masato Nakaguro, Shigeo Nakamura, Hidekata Hontani, and Ichiro Takeuchi. Multi-scale domain-adversarial multiple-instance cnn for cancer subtype classification with unannotated histopathological images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3852–3861, 2020. \n[12] Nikhil Naik, Ali Madani, Andre Esteva, Nitish Shirish Keskar, Michael F Press, Daniel Ruderman, David B Agus, and Richard Socher. Deep learning-enabled breast cancer hormonal receptor status determination from base-level h&e stains. Nature communications, pages 1–8, 2020. \n[13] Ming Y Lu, Drew FK Williamson, Tiffany Y Chen, Richard J Chen, Matteo Barbieri, and Faisal Mahmood. Data-efficient and weakly supervised computational pathology on wholeslide images. Nature Biomedical Engineering, pages 1–16, 2021. \n[14] Yash Sharma, Aman Shrivastava, Lubaina Ehsan, Christopher A. Moskaluk, Sana Syed, and Donald E. Brown. Cluster-to-conquer: A framework for end-to-end multi-instance learning for whole slide image classification. arXiv preprint arXiv:2103.10626, 2021. \n[15] Ming Tu, Jing Huang, Xiaodong He, and Bowen Zhou. Multiple instance learning with graph neural networks. In International Conference on Machine Learning, 2019. \n[16] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Proceedings of the European Conference on Computer Vision, pages 213–229, 2020. \n[17] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021. \n[18] Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, Le Lu, Alan L Yuille, and Yuyin Zhou. Transunet: Transformers make strong encoders for medical image segmentation. arXiv preprint arXiv:2102.04306, 2021. \n[19] Yundong Zhang, Huiye Liu, and Qiang Hu. Transfuse: Fusing transformers and cnns for medical image segmentation. arXiv preprint arXiv:2102.08005, 2021. \n[20] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020. \n[21] Fuzhi Yang, Huan Yang, J. Fu, Hongtao Lu, and B. Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5790–5799, 2020. \n[22] Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn Fung, Yin Li, and Vikas Singh. Nyströmformer: A nyström-based algorithm for approximating self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021. \n[23] Gabriele Campanella, Matthew G Hanna, Luke Geneslaw, Allen Miraflor, Vitor Werneck Krauss Silva, Klaus J Busam, Edi Brogi, Victor E Reuter, David S Klimstra, and Thomas J Fuchs. Clinical-grade computational pathology using weakly supervised deep learning on whole slide images. Nature medicine, pages 1301–1309, 2019. \n[24] G. Xu, Zhigang Song, Zhuo Sun, Calvin Ku, Z. Yang, C. Liu, S. Wang, Jianpeng Ma, and W. Xu. Camel: A weakly supervised learning framework for histopathology image segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10681–10690, 2019. \n[25] Marvin Lerousseau, Maria Vakalopoulou, Marion Classe, Julien Adam, Enzo Battistella, Alexandre Carré, Théo Estienne, Théophraste Henry, Eric Deutsch, and Nikos Paragios. Weakly supervised multiple instance learning histopathological tumor segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 470–479, 2020. \n[26] P. Chikontwe, Meejeong Kim, S. Nam, H. Go, and S. Park. Multiple instance learning with center embeddings for histopathology classification. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 519–528, 2020. \n[27] Xi Wang, Hao Chen, Caixia Gan, Huangjing Lin, Qi Dou, Efstratios Tsougenis, Qitao Huang, Muyan Cai, and Pheng-Ann Heng. Weakly supervised deep learning for whole slide lung cancer image analysis. IEEE Transactions on cybernetics, pages 3950–3962, 2019. \n[28] Chensu Xie, Hassan Muhammad, Chad M Vanderbilt, Raul Caso, Dig Vijay Kumar Yarlagadda, Gabriele Campanella, and Thomas J Fuchs. Beyond classification: Whole slide tissue histopathology analysis by end-to-end part learning. In Medical Imaging with Deep Learning, pages 843–856, 2020. \n[29] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015. \n[30] Jie Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7132–7141, 2018. \n[31] S. Woo, Jongchan Park, Joon-Young Lee, and In-So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision, pages 3–19, 2018. \n[32] Yongming Rao, Jiwen Lu, and J. Zhou. Attention-aware deep reinforcement learning for video face recognition. In IEEE International Conference on Computer Vision, pages 3931–3940, 2017. \n[33] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, undefinedukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017. \n[34] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In Proceedings of the European Conference on Computer Vision, pages 528–543, 2020. \n[35] A. Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, M. Dehghani, Matthias Minderer, G. Heigold, S. Gelly, Jakob Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. \n[36] Md Amirul Islam, Sen Jia, and Neil D. B. Bruce. How much position information do convolutional neural networks encode? In International Conference on Learning Representations, 2020. \n[37] Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021. \n[38] Michael Ruogu Zhang, James Lucas, Geoffrey E. Hinton, and Jimmy Ba. Lookahead optimizer: k steps forward, 1 step back. In Advances in Neural Information Processing Systems, pages 9597–9608, 2019. \n[39] 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, pages 770–778, 2016. \n[40] Weijian Li, Viet-Duy Nguyen, Haofu Liao, Matt Wilder, Ke Cheng, and Jiebo Luo. Patch transformer for multi-tagging whole slide histopathology images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 532–540, 2019. \n[41] Zeyu Gao, Pargorn Puttapirat, Jiangbo Shi, and Chen Li. Renal cell carcinoma detection and subtyping with minimal point-based annotation in whole-slide images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 439– 448, 2020. ",
1193
+ "bbox": [
1194
+ 179,
1195
+ 594,
1196
+ 826,
1197
+ 911
1198
+ ],
1199
+ "page_idx": 9
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "",
1204
+ "bbox": [
1205
+ 171,
1206
+ 68,
1207
+ 828,
1208
+ 921
1209
+ ],
1210
+ "page_idx": 10
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "",
1215
+ "bbox": [
1216
+ 173,
1217
+ 42,
1218
+ 828,
1219
+ 917
1220
+ ],
1221
+ "page_idx": 11
1222
+ }
1223
+ ]
parse/train/LKUfuWxajHc/LKUfuWxajHc_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/LKUfuWxajHc/LKUfuWxajHc_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/hw2VfWAr6t6/hw2VfWAr6t6.md ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Enabling Fast Differentially Private SGD via Just-in-Time Compilation and Vectorization
2
+
3
+ Pranav Subramani∗
4
+ Cheriton School of Computer Science University of Waterloo
5
+ pranav.subramani@uwaterloo.ca
6
+
7
+ Nicholas Vadivelu∗ Cheriton School of Computer Science University of Waterloo nbvadive@uwaterloo.ca
8
+
9
+ Gautam Kamath Cheriton School of Computer Science University of Waterloo g@csail.mit.edu
10
+
11
+ # Abstract
12
+
13
+ A common pain point in differentially private machine learning is the significant runtime overhead incurred when executing Differentially Private Stochastic Gradient Descent (DPSGD), which may be as large as two orders of magnitude. We thoroughly demonstrate that by exploiting powerful language primitives, including vectorization, just-in-time compilation, and static graph optimization, one can dramatically reduce these overheads, in many cases nearly matching the best nonprivate running times. These gains are realized in two frameworks: one is JAX, which provides rich support for these primitives through the XLA compiler. We also rebuild core parts of TensorFlow Privacy, integrating more effective vectorization as well as XLA compilation, granting significant memory and runtime improvements over previous release versions. Our proposed approaches allow us to achieve up to $5 0 \mathrm { x }$ speedups compared to the best alternatives. Our code is available at https://github.com/TheSalon/fast-dpsgd.
14
+
15
+ # 1 Introduction
16
+
17
+ Machine learning has recently experienced tremedous growth, being used to solve problems with unprecedented accuracy in a myriad of domains. However, not all domains are alike—while many datasets are freely available, we often would like to train ML models on sensitive data. Troublingly, it has been demonstrated that disregarding these concerns, or even using heuristic and best-effort privacy approaches, can result in significant leakage of private information [9, 12]. Differential privacy (DP) [16] has emerged as a strong and rigorous notion of data privacy, capable of protecting against privacy violations in a variety of settings.
18
+
19
+ One of the workhorse algorithms in machine learning is stochastic gradient descent (SGD) which has a differentially private analogue, DPSGD [43, 8, 2] which was introduced as a drop-in replacement for SGD. The primary differences include a per-example gradient clipping step and a batch-level addition of Gaussian noise. While these modifications seem relatively innocuous, they have so far led to non-trivial costs in terms of running time and final accuracy. In this paper, we address and mitigate the running time overhead of DPSGD.
20
+
21
+ Most modern machine learning frameworks allow efficient access to average minibatch gradients, and not at a per-example level. Access to these objects is critical in DPSGD, as well as other applications beyond privacy [52]. Lack of support for fast computation of per-example gradients has been noted and lamented numerous times for both TensorFlow [35, 42, 3] and PyTorch [32, 6].
22
+
23
+ Numerous attempts to avoid these computational roadblocks have been proposed. Goodfellow [20] proposed an algorithmic solution for computing per-example $\ell _ { 2 }$ -norms of the gradients for fullyconnected networks. Other proposed solutions work by exploiting Jacobians [14] or parallelizing over the batch dimension [4]. Several of these approaches are are restricted to specific types of architectures—for example, [20] is restricted to fully-connected layers, though [41] extends this to convolutional layers, and a very recent work [33] further considers layers including recurrent networks, attention, and more. BackPACK [14] currently supports only fully connected and convolutional layers, and while the paper states that it can be extended to recurrent and residual layers, GitHub issues related to implementation of these features have been open since November 2019 [13]. Facebook’s Opacus [51] emphasizes speed and scalability as the main selling points. We briefly mention microbatching, in which comparatively small subsets of the minibatch called “microbatches” of points are averaged before clipping, reducing the number of clipping operations (and thus the running time), at the cost of requiring additional noise to achieve the same privacy guarantee. Since this generally results in significantly worse accuracy, we do not investigate it further in our work. A more thorough description of approaches is provided in Section 2.1.
24
+
25
+ As mentioned in the literature (and thoroughly explored later in this paper), all existing approaches seem to incur moderate to severe running time overhead versus non-private SGD, with slowdowns as large as two orders of magnitude. For instance, Carlini et al. [12] comment “Training a differentially private algorithm is known to be slower than standard training; our implementation of this algorithm is 10-100x slower than standard training,” where their implementation is based on TensorFlow Privacy. Additionally, Thomas et al. [45] document a slowdown from 12 minutes to 14 hours due to the introduction of differential privacy, a 70x slowdown. The effect of these slowdowns can range from an inconvenience when it comes to rapid prototyping of smaller models, to prohibitively expensive for a single training run of a larger model. Overcoming this obstacle is an important step in helping differentially private machine learning transition from its present nascent state to widespread adoption.
26
+
27
+ # 1.1 Results
28
+
29
+ We demonstrate that one can mostly eliminate the significant running time overhead of differentially private SGD by exploiting language primitives such as vectorization, just-in-time (JIT) compilation, and static graph optimization. These features are core primitives within JAX [19, 10] and TensorFlow 2 (TF2) [1], both tensor-processing libraries from Google. These frameworks combine JIT compilation backed by the Accelerated Linear Algebra (XLA) [22] just-in-time compiler (JIT) with auto differentiation for high-performance machine learning. As we will see, JAX is consistently the fastest method for running DPSGD, with running times comparable to the non-private case. Our custom TensorFlow Privacy (TFP) implementation (referred to as Custom TFP), which leverages vectorization and XLA compilation in TensorFlow 2, demonstrates similar performance to JAX and significantly outperforms the existing TFP library. These changes have since been merged into TensorFlow Privacy.
30
+
31
+ Our primary contributions are as follows:
32
+
33
+ 1. We thoroughly benchmark several frameworks and libraries for DPSGD.
34
+ 2. We extend TensorFlow Privacy to support TF2, more efficient vectorization, and XLA compilation, significantly improving its running time in most cases (referred to as Custom TFP in this paper). We also contribute a variant of our implementation to TensorFlow Privacy, which is now the fastest DPSGD algorithm the library provides.
35
+ 3. We demonstrate that methods which use vectorization, JIT compilation, and static graph optimization are consistently the fastest and most memory-efficient: specifically, JAX and Custom TFP.
36
+ 4. We find that, despite similarities in the compilation pipeline, JAX is generally faster than Custom TFP. We examine and discuss compiled XLA assembly to explain the discrepancy.
37
+ 5. Finally, our supplement contains code to reproduce these experiments, as well as guide researchers and engineers in developing fast code for private ML.
38
+
39
+ Table 1: Median running time (s) per epoch of training various models at batch size 128. FCNN stands for Fully-Connected Neural Network; CNN stands for Convolutinal Neural Network.
40
+
41
+ <table><tr><td></td><td colspan="2">Private Training</td><td>Non-Private Training</td></tr><tr><td>Architecture</td><td>JAX/Custom TFP</td><td>Best Alternative</td><td>Best Time</td></tr><tr><td>FCNN</td><td>0.21</td><td>0.77</td><td>0.55</td></tr><tr><td>CNN</td><td>7.3</td><td>12</td><td>1.7</td></tr><tr><td>LSTM</td><td>8.2</td><td>407</td><td>4.8</td></tr></table>
42
+
43
+ Table 1 summarizes some of our experimental results, with median running time per epoch for a variety of settings. JAX and Custom TFP are consistently the fastest.
44
+
45
+ We observe dramatic improvements for LSTMs [28], potentially significant enough to bring LSTMs from impractical into the realm of feasibility. JAX is able to privately train these models $1 7 \mathbf { x }$ and $5 0 \mathrm { x }$ faster than the best alternative.2 Examining the overhead due to privacy: JAX’s running time increases by roughly 2x, compared to factors closer to $1 0 \mathrm { x }$ for alternatives.
46
+
47
+ For fully-connected and convolutional networks, JAX or Custom TFP almost entirely remove the overhead due to privacy. In fact, the running times are significantly better than some alternatives without privacy. Recall that these are per-epoch times: while an improvement of 0.5 seconds might seem insignificant, this can add up when training for many epochs. We perform an ablation study (Table 2) for all models to pinpoint the source of all improvements.
48
+
49
+ While our investigations show the consistent and substantial superiority of JAX for fast private machine learning, these benefits remain relatively unknown. Though a small number of experts are aware [44], and the official JAX repo contains a toy demonstration [25], before the initial posting of our paper a Google Scholar search revealed only two papers which use JAX for differential privacy [49, 38], and neither emphasizes or even comments on the computational advantages of JAX. Similarly, while efficient per-example gradients have been studied in TensorFlow [5], efficient application of these techniques is not readily available to privacy researchers. We hope that our investigation will document this phenomenon and encourage others to adopt it for their private machine learning needs.
50
+
51
+ # 1.2 Simultaneous and Subsequent Work
52
+
53
+ Simultaneous to our work, [11] employ Johnson-Lindenstrauss projections to quickly approximate per-example gradient norms. This is an algorithmic modification, and will not be functionally equivalent to DPSGD – similar to microbatching, there is a time-accuracy tradeoff (though not as severe in this case).
54
+
55
+ Subsequent to the initial posting of this paper, we worked with Google engineers to implement our improvements into TensorFlow Privacy. Vadivelu contributed an JAX implementation of DPSGD to the Optax library [27]. [7] employed our findings to efficiently privately train BERT-Large. In a recent Opacus whitepaper [51], the authors repeat some of our experiments on more recent versions of these frameworks; we defer to their work for discussion of these results.
56
+
57
+ # 2 Description of Approaches
58
+
59
+ # 2.1 Libraries Enabling DPSGD
60
+
61
+ JAX [19, 10]. JAX is a recently introduced framework for machine learning, defined by its automatic differentiation capabilities and JIT compilation via the XLA compiler [22]. Programs written in pure Python and JAX’s NumPy [26] API can be translated to an intermediate language (XLA-HLO) to be JIT compiled, i.e., to generate custom assembly instructions for the hardware. This enables optimizations such as kernel-fusions, buffer reuse, improved memory layout, and more. Additionally, one of the core functions present in JAX is VMAP, a vectorized map, which enables easy-to-write and efficient batch level parallelism that is fundamental to DPSGD. As we will demonstrate, these enable the fastest approach for DPSGD that we are aware of.
62
+
63
+ Custom TFP. Vectorization and XLA-driven JIT compilation is also available in TensorFlow 2 [1], which we leverage in our implementation, Custom TFP. With these primitives, we achieve performance comparable to JAX and surpassing existing DPSGD implementations in TensorFlow. We augment TensorFlow Privacy to better utilize tf.vectorized_map and follow TensorFlow 2 best practices while retaining the existing functionality.
64
+
65
+ Chain-Rule-Based Per-Example Gradients [20, 41]. This suite of techniques is implemented on top of PyTorch [39]. They support efficient GPU-accelerated per-example gradients for fullyconnected layers via [20], as well as convolutional layers via [41], which we describe in the detail in the following paragraphs.
66
+
67
+ Let $C , D , T$ , and $B$ refer to the number of input channels, output channels, the spatial dimension, and the batch size. The shape of the input $x$ is $( B , C , T )$ . The conventional formula for the discrete convolution can be written as:
68
+
69
+ $$
70
+ \sum _ { c = 0 } ^ { C - 1 } \sum _ { k = 0 } ^ { K - 1 } x [ b , c , t + K ] h [ d , c , k ] .
71
+ $$
72
+
73
+ The gradient of this expression can be efficiently computed via automatic differentiation [40]. PyTorch’s automatic differentiation cannot be parallelized across the batch dimension $b$ [41], which is required to backpropagate through the above expression. Instead, they rewrite the convolution as follows:
74
+
75
+ $$
76
+ \sum _ { c = 0 } ^ { C / G - 1 } \sum _ { k = 0 } ^ { K - 1 } x \left[ b , c , g \frac { C } { G } , t + K \right] h [ d , g , c , k ] ,
77
+ $$
78
+
79
+ where $G$ is the number of groups and the shape of $x$ is $( 1 , B , C , { \cal T } )$ . The initial convolution is 1-dimensional, while the above expression includes an added dimension. Similarly, to allow backpropagation through a $k$ -dimensional convolutional layer, a $( k + 1 )$ -dimensional convolutional layer is required. This can be achieved by utilizing the group attribute in the convolution function in PyTorch, since splitting it into groups implies that the same convolution is applied to each individual group.
80
+
81
+ BackPACK [14]. The chain rule gives the following expression for the gradient of a loss function:
82
+
83
+ $$
84
+ \nabla _ { \theta ^ { ( i ) } } \ell ( \theta ) = ( J _ { \theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } \left( \prod _ { j = i } ^ { L - 1 } ( J _ { z _ { n } ^ { ( j ) } } z _ { n } ^ { ( j + 1 ) } ) ^ { T } \right) ( \nabla _ { z _ { n } ^ { ( L ) } } \ell _ { n } ( \theta ) ) .
85
+ $$
86
+
87
+ In order to compute this quantity, one requires the ability to multiply the Jacobian by a vector and by a matrix, which is not currently supported in PyTorch’s automatic differentiation framework. In BackPACK, Dangel et al. [14] extend several layers within PyTorch to support fast Jacobian-vector and Jacobian-matrix products in order to extract quantities like individual gradients, variance, $\ell _ { 2 }$ - norm of the gradients, and second-order quantities. In particular, to extract first-order gradients, their method multiplies the transposed Jacobian with the outputs of the layer:
88
+
89
+ $$
90
+ \frac { 1 } { N } \nabla _ { \theta ^ { ( i ) } } \ell ( \theta ) = \frac { 1 } { N } ( J _ { \theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } ( \nabla _ { z _ { n } ^ { ( i ) } } \ell ( \theta ) ) ,
91
+ $$
92
+
93
+ where $i = 1 , \ldots , N$ and each $\theta ^ { ( i ) }$ has a gradient which is of shape $( N , d ^ { ( i ) } )$ . BackPACK provides efficient computation for the transpose of the Jacobian as well as the Jacobian.
94
+
95
+ Opacus [51]. Opacus is a library for training PyTorch models with differential privacy, recently released by Facebook. It supports per-example gradients, using PyTorch’s forward and backward hooks to propagate gradients. They provide support for several PyTorch layers including LSTM layers, which are not supported in either of the previous two frameworks. Note that Opacus does not support PyTorch’s nn.LSTM but instead implements a separate opacus.layers.DPLSTM, with adjustments that allow individual gradients to propagate through it.
96
+
97
+ PyVacy [48]. Before the release of Opacus (and its predecessor PyTorch-DP), PyVacy was the most popular library for DP machine learning in PyTorch. PyVacy has no custom support for parallelization across the batch dimension for any layer since it processes each sample individually (by way of a for-loop). This generally leads to a large increase in runtime for models trained using PyVacy.
98
+
99
+ TensorFlow Privacy [37] TensorFlow Privacy is a library for differentially private machine learning, built on top of TensorFlow. TensorFlow Privacy has general support for a vectorized implementation of DPSGD via vectorized_map which allows it to parallelize across the batch dimension, used to extract per-example gradients. The library recently introduced a TensorFlow 2 compatible API that leverages GradientTape.jacobian to compute per-example gradients, which we compare seperately to the TensorFlow 1 API in our experiments.
100
+
101
+ # 2.2 Notable Framework Features
102
+
103
+ Static versus Dynamic Graph. TensorFlow and JAX use a static graph to track computation in order to optimize execution and compute gradients. This means the sequence of operations is traced and a large proportion of shapes are determined during the first invocation of the function, allowing for kernel fusion, buffer reuse, and other optimizations on subsequent calls. PyTorch uses a dynamic graph to track computation flow in order to compute gradients, but does not optimize execution. This enables increased dynamism in the shapes and types of computations, at the cost of losing all the aforementioned optimizations.
104
+
105
+ Grappler versus XLA. TensorFlow has two optimization engines: Grappler [21] and XLA. Grappler, TensorFlow’s original graph optimizer, takes as input the computation graph and is able to prune dead nodes, remove redundant computation, improve memory layouts, and more. XLA, TensorFlow’s new optimizing compiler, can perform the same optimizations as Grappler, in addition to generating code for fused kernels. For this reason, XLA has the potential to extract more performance out of TensorFlow graphs than Grappler, but does not always accomplish this due to Grappler’s maturity.
106
+
107
+ JAX and XLA. JAX was built from the ground up to leverage XLA, and so many of its operations map directly to XLA primitives. We often observe that JAX is able to extract better performance out of XLA than TensorFlow.
108
+
109
+ Pytorch and Static Graphs. Recently, PyTorch has released the capability to JIT compile its code through torch.jit or PyTorch XLA [18]. Due to the early nature of these two efforts, they were not successful in JIT compiling the methods we tried, thus we do not consider them further.
110
+
111
+ Just-In-Time Compilation JIT compilation is a method of compilation that happens at runtime, as opposed to before program execution. JAX and TensorFlow perform JIT compilation by recording operations that are executed on tensors/arrays (i.e. “tracing”), generating the low-level instructions to perform these operations, optimizing these instructions, then producing fast low-level kernels. The XLA compiler requires all array shapes to be known at trace-time so it can statically determine how much memory should be allocated for each operation. While compilation can be relatively slow compared to execution $\mathord { \sim } 1 0 \mathrm { x }$ the time), you only pay this price once at the first training iteration, provided the input shapes do not change.
112
+
113
+ # 3 Empirical Findings
114
+
115
+ We evaluate the aforementioned implementations of DPSGD in runtime and memory consumption on three datasets: CIFAR10 [31], a dataset of small colour images with 60,000 training examples of size $3 2 \times 3 2 \times 3$ each, IMDb [36], a movie review sentiment classification dataset with 25,000 training examples padded to a sequence length of 256 each, and Adult [15], containing 45,220 examples with 104 features, which was preprocessed via methods from [29]. These datasets are available for open use and do not contain personally identifiable information or offensive content.
116
+
117
+ We perform our evaluations on three different architectures. We start with the smallest dataset, Adult, training a 5,532-parameter fully-connected neural network (FCNN). Then, we train a CIFAR10 convolutional neural network classifier architecture with 605,226 parameters used by Papernot et al. [38]. For IMDb, we use an LSTM network with 1,081,002 parameters, demonstrating the method on a relatively large model. This selection covers the common data and architecture types at realistic sizes for differentially private learning. In particular, we did not consider the exceptionally large models which are not prevalent in non-private machine learning. Additional experiments can be found in the supplement that are omitted due to space constraints. These experiments cover a wider range of parameters and architectures to elucidate the benefits of using XLA JIT for DPSGD.
118
+
119
+ ![](images/9a3f8cf843b83e05d46d37bb1dab0d71dd07186f22e67c295be8ec268dbd6807.jpg)
120
+
121
+ ![](images/e3cbf49e714ad7c8fc70099904ccc592e020e2bd158108cc7dfb3beeb3af456f.jpg)
122
+ Figure 1: Runtimes for the fully connected network on the Adult dataset. We observe that JAX and Custom TFP are the fastest by a large margin in both settings, with DPSGD having low overhead over the non-private setting. The y-axis is truncated for clarity.
123
+ Figure 2: Runtimes for the CNN on the CIFAR10 dataset. We observe that JAX has the fastest runtime in the private case while TensorFlow 2 with XLA and JAX are the fastest in the non-private case at most batch sizes. Similar to the MNIST case, TFP struggles at the largest batch size due to an inability to properly parallelize per-gradient computation with this level of memory consumption. The y-axis is truncated for clarity.
124
+
125
+ We compare a number of different methods for fast DPSGD, including JAX [19, 10], BackPACK [14], the chain-rule based method (CRB) [20, 41], Opacus [51], PyVacy [48], TensorFlow Privacy (TFP) [37] and our modification of TFP, dubbed Custom TFP. For TensorFlow based frameworks, we evaluate performance both with and without XLA JIT compilation in both TF 1 and TF 2. We refer to TensorFlow 2 and JAX as modern XLA-compiled libraries.
126
+
127
+ These architectures and datasets are evaluated in terms of runtime at batch sizes 16, 32, 64, 128, and 256. This showcases a comparison of runtimes across a variety of batch sizes to present a holistic picture of the running times, as well as demonstrating the impact of memory utilization on runtime. Each experiment was run for 20 epochs and the median epoch run-time is reported. The variance of these experiments was low enough that the errors bars are negligible (full results provided in the supplement). Outside of the initial compilation time required for the static graph frameworks, the runtime showed little variance between epochs, resulting in narrow confidence intervals for the epoch runtime (data available upon request). We preprocess all the data in advance and use an identical generator-based dataloader for all frameworks, to ensure consistency.
128
+
129
+ All experiments were run on Ubuntu 18.04 with an Intel Core i7-7800X CPU $3 . 5 0 \mathrm { G H z }$ , 6 cores), NVIDIA GTX Titan V GPU (12GB VRAM), and 32GB of RAM. The code is provided in the supplement and is publicly released.
130
+
131
+ ![](images/45a88e3275af77554f562c1bcdd642452bdab37b718759590bc3c59fe3bbbcb5.jpg)
132
+ Figure 3: Runtimes for the LSTM network on the IMDb dataset. JAX is by far the fastest option, resulting in a roughly $5 0 \mathrm { x }$ speedup for batch size 256. The quadratic memory cost of Opacus prevents us from evaluating this implementation at these batch sizes, however, we observe a median runtime of 1024.16s at batch size 10. Excessive memory consumption prevent us from evaluating Custom TFP and TFP at larger batch sizes. An open TensorFlow 2 bug prevents us from evaluating Custom TFP (XLA) in this setting [46]. BackPACK and CRB do not support embedding layers. The y-axis is truncated for clarity.
133
+
134
+ First, we evaluate the FCNN model (Figure 1), where we observe that JAX and Custom TFP are significantly faster than the other options in both the private and non-private setting. With such a simple architecture, the compiler can perform significant optimizations. Notably, JAX and Custom TFP show little overhead over their non-private counterparts. The non-statically compiled frameworks (apart from PyVacy) remain competitive in this setting due to the shallow network size and low parameter count. TFP 2 without XLA performs unexpectedly poorly, due to the Jacobian computation which does not account for per-example independence of gradients.
135
+
136
+ We then evaluate the CIFAR10 CNN model (Figure 2), where JAX is by far the most performant implementation in the private case, and the modern XLA-compiled frameworks are the fastest non-private methods. Custom TFP is noticeably slower than JAX—we conjecture that this is due to different utilization of the JIT compiler, see Section 4. Also, at the largest batch size, TFP’s performance deteriorates due to the memory consumption preventing it from effectively parallelizing the per-example gradient computation.
137
+
138
+ For the final runtime experiment we evaluate the LSTM network (Figure 3). A TensorFlow 2 bug [46] and lack of support from BackPACK and CRB prevent us from evaluating this setting on those implementations. We see a similar phenomenon to the CIFAR10 CNN case for TFP: at larger batch sizes, the library fails to parallelize effectively pessimizing the runtime. TensorFlow and PyTorch benefit from a fast cuDNN LSTM implementation in the non-private case which they fail to leverage in the private case, explaining the significant difference in performance. JAX, on the other hand, uses an LSTM implementation based on primitive operations, which allows it to retain similar performance in both the private and non-private settings.
139
+
140
+ To understand the importance of vectorization (via VMAP) and JIT compilation (JIT), we ablate JAX’s performance on these tasks with and without these two components (Table 2). We observe that JIT alone provides up to a $4 3 5 \mathrm { x }$ improvement, and VMAP alone provides up to a $6 4 \mathrm { x }$ improvement. When used in tandem, both complement each other, providing up to a 5160x improvement.
141
+
142
+ Similarly, we ablate the components in Custom TFP (Table 2). In TensorFlow, vectorized_map automatically compiles the code, preventing us from ablating it alone. We observe that XLA in TensorFlow 2 is able to reclaim performance lost by not vectorizing, seeing that the non-VMAP XLA performance comes close to VMAP Graph performance in many settings. We further see the non-compiled runtimes are not as extreme as seen in JAX: TensorFlow is better optimized to run reasonably fast in all settings.
143
+
144
+ Finally, we explore the memory consumption behaviour of these implementations (Table 3), observing that running time has a strong negative correlation to memory consumption. The modern XLAcompiled libraries provide impressive batch size capability. Also, all the frameworks except JAX and PyVacy struggle with batch sizes on the LSTM. Since PyVacy processes examples sequentially, it has a constant memory consumption with respect to batch size, effectively trading off running time for optimal memory use. The other frameworks are crippled without access to their fused cuDNN LSTM implementation, while JAX has no issues as its LSTM is composed of primitives. Finally, due to the specialized per-example gradient computation afforded by CRB for convolutions, it shows the best memory utilization among the PyTorch frameworks, even beating Custom TFP (without XLA) in the CIFAR10 CNN case.
145
+
146
+ Table 2: Ablation of JIT compilation and vectorization in Custom TFP (left) and JAX (right). Median runtime per epoch for a run of 20 epochs at batch size 128 for DPSGD. In TensorFlow, one can not use vectorization without graph compilation, which is why there is no standalone vectorization. Empty entries are due to confirmed active bugs in TensorFlow [47, 46]. We exclude LSTMs, as JAX runs out of memory without JIT compilation for this model.
147
+
148
+ <table><tr><td>Graph</td><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td><td>LSTM</td></tr><tr><td></td><td></td><td></td><td>147</td><td>561</td><td>717</td></tr><tr><td>√</td><td></td><td></td><td>12.7</td><td>85.5</td><td>361</td></tr><tr><td></td><td>√</td><td></td><td>1.83</td><td>71.5</td><td></td></tr><tr><td>√</td><td></td><td>:</td><td>0.770</td><td>33.8</td><td>68.6</td></tr><tr><td></td><td>√</td><td></td><td>0.209</td><td>23.3</td><td></td></tr></table>
149
+
150
+ <table><tr><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td></tr><tr><td rowspan="5">·</td><td rowspan="5">√</td><td>1240</td><td>3840</td></tr><tr><td>19.2</td><td>64.8</td></tr><tr><td>2.85</td><td>84.0</td></tr><tr><td>0.239</td><td>7.28</td></tr><tr><td></td><td></td></tr></table>
151
+
152
+ Table 3: Maximum batch size supported by each library before encountering out of memory errors. Missing entries represent missing functionality or bugs in the frameworks. PyVacy handles examples sequentially, giving constant memory consumption with respect to batch size.
153
+
154
+ <table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td>JAX TensorFlow 2 (XLA)</td><td>10,448 15,040</td><td>11,984</td></tr><tr><td>TensorFlow 2</td><td>11,328</td><td>9,221</td></tr><tr><td>TensorFlow 1 (XLA)</td><td>10,880</td><td>5,070</td></tr><tr><td>TensorFlow 1</td><td>11,480</td><td>5,264</td></tr><tr><td>PyTorch</td><td>10,752</td><td>9,943</td></tr></table>
155
+
156
+ <table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td> JAX (DP)</td><td>4,264</td><td>2,487</td></tr><tr><td>Custom TFP (XLA) TFP 2 (XLA)</td><td>3,144 168</td><td></td></tr><tr><td>Custom TFP</td><td>1,944</td><td>137</td></tr><tr><td>TFP 2</td><td>104</td><td>105</td></tr><tr><td>TFP (XLA)</td><td>168</td><td>88</td></tr><tr><td>TFP</td><td>104</td><td>105</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Opacus</td><td>1,920</td><td>10</td></tr><tr><td>BackPACK</td><td>1,216</td><td></td></tr><tr><td>CRB</td><td>2,184</td><td></td></tr><tr><td>PyVacy</td><td>8</td><td>8</td></tr></table>
157
+
158
+ # 4 Discussion
159
+
160
+ JAX and Custom TFP’s runtime advancements can be primarily attributed to the advancement of the compiler present in both of these languages. The XLA compiler performs a variety of operations ranging from memory scheduling to kernel fusion. The memory optimizations are vital for larger models where DPSGD becomes a memory-bound algorithm. One of the core features of XLA is buffer reutilization which has a significant impact on the maximum memory used [22]. Furthermore, the memory scheduler can mitigate peak memory usage to prevent a runtime exception for overusing available memory.
161
+
162
+ The effectiveness of XLA is demonstrated through the peak batch size experiment (which serves as a proxy for memory efficiency): in both the private and non-private settings, XLA far exceeds alternatives in the peak batch size it supports. Through this experiment, we also see the benefits of using small operation primitives as opposed to large fused kernels: TensorFlow and PyTorch both leverage the optimized cuDNN kernel in the non-private setting for performance [23, 17], but cannot in the private setting, leading to significantly worse performance. Modifying all existing cuDNN kernels to enable use in the private case would require a non-trivial engineering investment. JAX instead focuses on optimizing operation primitives, so even in foreign computational circumstances, its performance is comparatively strong. Succinctly, JAX sacrifices the ability to use highly optimized fused kernels for generalizability.
163
+
164
+ Our implementation of Custom TFP leverages the vectorized map for both the forward and backward pass, unlike existing implementations which only use vectorized map for the backward pass (identical to the JAX version). This gives the compiler explicit information about the independence of batches in the computation, enabling significant optimizations, explaining the improvement in Custom TFP compared to the existing TensorFlow implementations. Details about the implementation are provided in the supplementary code.
165
+
166
+ We notice that the runtimes and memory consumption are different between Custom TFP and JAX despite having the same backend compiler. We investigate differences in the XLA-assembly for simple code segments in both frameworks in the supplemental material. TensorFlow 1.0 does not have the same capability to integrate with XLA as TF 2.0 does. The primary optimization available is autoclustering, which we observe does not optimize operations nearly as much as the full JIT.
167
+
168
+ Through the ablation study of VMAP and JIT in JAX shown in Table 2, we observe that both components complement each other. In general, we observe that JIT provides the larger performance gain, as shown with the FCNN. For the CNN, the large matrix operations coupled with JAX’s asynchronous execution [34] allow reasonable utilization of the GPU even without VMAP, which is why we observe less of an improvement from JIT alone in this experiment. The runtimes without these two primitives is significantly slower than the other frameworks–this is because JAX was built ground-up to leverage these primitives [10].
169
+
170
+ In the ablation for Custom TFP in Table 2, we see some key differences with JAX. First, the mechanism for VMAP in TensorFlow 2 is different from that in JAX: JAX performs op-by-op batching without compilation, while TensorFlow always compiles the vectorized map [24]. We observe that the non-compiled code still runs in a reasonable amount of time since TensorFlow is optimized to have a competitive eager execution, while JAX is not. Also, in TensorFlow, XLA’s JIT compilation without vectorization is often able to bring the runtime performance close to that of the graph mode with vectorization, implying that XLA is able to recognize opportunities for parallelization even when the user does not explicitly request it. Finally, we observe the benefit of having a fast, fused implementation for LSTMs: while JAX ran out of memory outside of a compiled and vectorized context, Custom TFP is able to achieve reasonable runtimes by leveraging the fused kernel.
171
+
172
+ # 4.1 Drawbacks
173
+
174
+ While integrating XLA into DPSGD presents a massive runtime and memory advantage, there is a cost. XLA is a subset of all permissable operations in JAX and TensorFlow, requiring users to be cognizant of functionality they use. For example, jax.numpy.unique $\left( \mathbf { x } \right)$ produces a result whose shape is not known at compile time, preventing it from being used with JIT compilation. More subtle errors involving unintended recompilation of code are also possible which can lead to enormous slowdowns.
175
+
176
+ Another potential downside is that these benefits are not observed if the batch size is large enough and the bottleneck becomes the actual network evaluation. In a situation like this, all of the frameworks would perform at approximately the same speeds. However, in practice, this is rarely true and moreso in differentially private machine learning where models are not particularly large.
177
+
178
+ # 5 Conclusion and Future Work
179
+
180
+ We have demonstrated that language primitives like vectorization, JIT compilation, and static graph optimization can dramatically improve the running time of DPSGD, realized by JAX and our Custom TFP. In particular, we find that using JAX can almost entirely remove the computational overhead introduced by DPSGD, thus alleviating a major pain point of private machine learning practitioners.
181
+
182
+ In our work, we focus on conventional set-ups for academic researchers; for future work, it would be insightful to explore the performance of distributed DPSGD, as distributed set-ups are becoming increasingly commonplace. Furthermore, implementing a PyTorch JIT compatible version of DPSGD could provide an alternative to TensorFlow and JAX, particularly if said implementation is compatible with PyTorch XLA. Though these two compilation systems are immature compared to TensorFlow and JAX, they are rapidly improving and should not be ignored. Outside of Python, there are powerful autodifferentiation methods in other more perfomant languages such as Julia [30] and Swift [50] which are worthy of study.
183
+
184
+ # Acknowledgements
185
+
186
+ We would like to thank Roy Frostig for helpful discussions on JAX, Steve Chien and Shuang Song for their work in implementing our improvements in TensorFlow Privacy, Xi He and Om Thakkar for valuable feedback on drafts of this work, and several JAX, TensorFlow, and Opacus developers who helped answer our issues, including James Bradbury, Peter Buchlovsky, Peter Hawkins, Matthew Johnson, Karthik Prasad, Github handle ravikyram, and Qianli Scott Zhu.
187
+
188
+ # Funding Transparency Statement
189
+
190
+ Funding in direct support of this work: an NSERC Discovery Grant, a Compute Canada RRG grant, and a University of Waterloo startup grant.
191
+
192
+ # References
193
+
194
+ [1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems. https://www.tensorflow.org/, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
195
+ [2] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM Conference on Computer and Communications Security, CCS ’16, pages 308–318, New York, NY, USA, 2016. ACM.
196
+ [3] act65. Custom gradient aggregation methods. https://github.com/tensorflow/ tensorflow/issues/15760, December 2017. URL https://github.com/tensorflow/ tensorflow/issues/15760.
197
+ [4] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond. arXiv preprint arXiv:1903.04243, 2019.
198
+ [5] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond, 2019.
199
+ [6] alexdepremia. [feature request] expanding gradient function with variances. https://github. com/pytorch/pytorch/issues/8897, June 2018. URL https://github.com/pytorch/ pytorch/issues/8897.
200
+ [7] Rohan Anil, Badih Ghazi, Vineet Gupta, Ravi Kumar, and Pasin Manurangsi. Large-scale differentially private BERT. arXiv preprint arXiv:2108.01624, 2021.
201
+ [8] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’14, pages 464–473, Washington, DC, USA, 2014. IEEE Computer Society.
202
+ [9] Abhishek Bhowmick, John Duchi, Julien Freudiger, Gaurav Kapoor, and Ryan Rogers. Protection against reconstruction and its applications in private federated learning. arXiv preprint arXiv:1812.00984, 2018.
203
+
204
+ [10] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
205
+
206
+ [11] Zhiqi Bu, Sivakanth Gopi, Janardhan Kulkarni, Yin Tat Lee, Judy Hanwen Shen, and Uthaipon Tantipongpipat. Fast and memory efficient differentially private-sgd via JL projections. In Advances in Neural Information Processing Systems 34, NeurIPS ’21. Curran Associates, Inc., 2021.
207
+
208
+ [12] Nicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: Evaluating and testing unintended memorization in neural networks. In 28th USENIX Security Symposium, USENIX Security ’19, pages 267–284. USENIX Association, 2019.
209
+
210
+ [13] Felix Dangel. Support for recurrent units. https://github.com/f-dangel/backpack/ issues/16, 2019. URL https://github.com/f-dangel/backpack/issues/16.
211
+
212
+ [14] Felix Dangel, Frederik Kunstner, and Philipp Hennig. BackPACK: Packing more into backprop. In Proceedings of the 8th International Conference on Learning Representations, ICLR ’20, 2020.
213
+
214
+ [15] Dheeru Dua and Casey Graff. UCI machine learning repository. http://archive.ics.uci. edu/ml, 2017. URL http://archive.ics.uci.edu/ml. License: Open Data Commons.
215
+
216
+ [16] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the 3rd Conference on Theory of Cryptography, TCC ’06, pages 265–284, Berlin, Heidelberg, 2006. Springer.
217
+
218
+ [17] Facebook. Lstm. https://pytorch.org/docs/stable/_modules/torch/nn/modules/ rnn.html#LSTM. URL https://pytorch.org/docs/stable/_modules/torch/nn/ modules/rnn.html#LSTM.
219
+
220
+ [18] FaceBook. Pytorch xla, 2020. URL https://github.com/pytorch/xla.
221
+
222
+ [19] Roy Frostig, Matthew James Johnson, and Chris Leary. Compiling machine learning programs via high-level tracing. In The 1st Conference on Systems and Machine Learning, SysML ’18, 2018.
223
+
224
+ [20] Ian Goodfellow. Efficient per-example gradient computations. arXiv preprint arXiv:1510.01799, 2015.
225
+
226
+ [21] Google. Tensorflow graph optimization with grappler. https://www.tensorflow.org/ guide/graph_optimization, . URL https://www.tensorflow.org/guide/graph_ optimization. License: Apache 2.0 License.
227
+
228
+ [22] Google. XLA: Optimizing compiler for machine learning. https://www.tensorflow.org/ xla, . URL https://www.tensorflow.org/xla. License: Apache 2.0 License.
229
+
230
+ [23] Google. tf.keras.layers.lstm. https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM, . URL https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM.
231
+
232
+ [24] Google. tf.vectorized_map. https://www.tensorflow.org/api_docs/python/tf/ vectorized_map, . URL https://www.tensorflow.org/api_docs/python/tf/ vectorized_map.
233
+
234
+ [25] Google. differentially_private_sgd.py. https://github.com/google/jax/blob/master/ examples/differentially_private_sgd.py, April 2019. URL https://github.com/ google/jax/blob/master/examples/differentially_private_sgd.py. License: Apache License 2.0.
235
+
236
+ [26] Charles R Harris, K Jarrod Millman, Stéfan J van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J Smith, et al. Array programming with numpy. Nature, 585(7825):357–362, 2020.
237
+
238
+ [27] Matteo Hessel, David Budden, Fabio Viola, Mihaela Rosca, Eren Sezener, and Tom Hennigan. Optax: composable gradient transformation and optimisation, in JAX!, 2020. URL http: //github.com/deepmind/optax.
239
+
240
+ [28] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
241
+
242
+ [29] Roger Iyengar, Joseph P Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In Proceedings of the 40th IEEE Symposium on Security and Privacy, SP ’19, pages 299–316, Washington, DC, USA, 2019. IEEE Computer Society.
243
+
244
+ [30] Julia. Juliadiff. https://www.juliadiff.org/. URL https://www.juliadiff.org/.
245
+
246
+ [31] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
247
+
248
+ [32] Frederik Kunstner. [feature request] simple and efficient way to get gradients of each element of a sum. https://github.com/pytorch/pytorch/issues/7786, May 2018. URL https: //github.com/pytorch/pytorch/issues/7786.
249
+
250
+ [33] Jaewoo Lee and Daniel Kifer. Scaling up differentially private deep learning with fast perexample gradient clipping. arXiv preprint arXiv:2009.03106, 2020.
251
+
252
+ [34] Anselm Levskaya and Matthew James Johnson. Asynchronous dispatch. https:// jax.readthedocs.io/en/latest/async_dispatch.html, 2019. URL https://jax. readthedocs.io/en/latest/async_dispatch.html.
253
+
254
+ [35] Zachary C. Lipton. Gradients of non-scalars (higher rank jacobians). https://github. com/tensorflow/tensorflow/issues/675, January 2016. URL https://github.com/ tensorflow/tensorflow/issues/675.
255
+
256
+ [36] Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. License: No explicit license, but explicitly is made available for research.
257
+
258
+ [37] Nicolas Papernot, Andrew Galen, and Steven Chien. Tensorflow privacy. https://github. com/tensorflow/privacy, December 2018. URL https://github.com/tensorflow/ privacy. License: Apache 2.0 License.
259
+
260
+ [38] Nicolas Papernot, Abhradeep Thakurta, Shuang Song, Steve Chien, and Úlfar Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. arXiv preprint arXiv:2007.14191, 2020.
261
+
262
+ [39] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf. License: BSD.
263
+
264
+ [40] Louis B Rall. Automatic Differentiation: Techniques and Applications, volume 120 of Lecture Notes in Computer Science. Springer, 1981.
265
+
266
+ [41] Gaspar Rochette, Andre Manoel, and Eric W Tramel. Efficient per-example gradient computations in convolutional neural networks. arXiv preprint arXiv:1912.06015, 2019.
267
+
268
+ [42] seerdecker. Provide unaggregated gradients tensors. https://github.com/tensorflow/ tensorflow/issues/4897, October 2016. URL https://github.com/tensorflow/ tensorflow/issues/4897.
269
+
270
+ [43] Shuang Song, Kamalika Chaudhuri, and Anand D Sarwate. Stochastic gradient descent with differentially private updates. In Proceedings of the 2013 IEEE Global Conference on Signal and Information Processing, GlobalSIP ’13, pages 245–248, Washington, DC, USA, 2013. IEEE Computer Society.
271
+
272
+ [44] Kunal Talwar. Personal communication, July 2020.
273
+
274
+ [45] Aleena Thomas, David Adelani, Ali Davody, Aditya Mogadala, and Dietrich Klakow. Investigating the impact of pre-trained word embeddings on memorization in neural networks. In Proceedings of the 23rd International Conference on Text, Speech and Dialogue, TSD $^ { , } 2 0$ , 2020.
275
+
276
+ [46] Nicholas Vadivelu. Xla compilation does not work with embeddings layer. https: //github.com/tensorflow/tensorflow/issues/43687, October 2020. URL https: //github.com/tensorflow/tensorflow/issues/43687.
277
+
278
+ [47] Nicholas Vadivelu. Xla compilation bug. https://github.com/tensorflow/tensorflow/ issues/43723, October 2020. URL https://github.com/tensorflow/tensorflow/ issues/43723.
279
+
280
+ [48] Chris Waites. Pyvacy. https://github.com/ChrisWaites/pyvacy/network, March 2019. URL https://github.com/ChrisWaites/pyvacy. License: Apache 2.0 License.
281
+
282
+ [49] Chris Waites and Rachel Cummings. Differentially private normalizing flows for privacypreserving density estimation. ICML Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models, 2020.
283
+
284
+ [50] Richard Wei, Dan Zheng, Marc Rasi, and Bart Chrzaszcz. Differentiable programming manifesto. URL https://github.com/apple/swift/blob/main/docs/ DifferentiableProgramming.md.
285
+
286
+ [51] Ashkan Yousefpour, Igor Shilov, Alexandre Sablayrolles, Davide Testuggine, Karthik Prasad, Mani Malek, John Nguyen, Sayan Gosh, Akash Bharadwaj, Jessica Zhao, Graham Cormode, and Ilya Mironov. Opacus: User-friendly differential privacy library in PyTorch. arXiv preprint arXiv:2109.12298, 2021.
287
+
288
+ [52] Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In Proceedings of the 32nd International Conference on Machine Learning, ICML ’15, pages 1–9. JMLR, Inc., 2015.
parse/train/hw2VfWAr6t6/hw2VfWAr6t6_content_list.json ADDED
@@ -0,0 +1,1520 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Enabling Fast Differentially Private SGD via Just-in-Time Compilation and Vectorization ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 210,
8
+ 122,
9
+ 787,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Pranav Subramani∗ \nCheriton School of Computer Science University of Waterloo \npranav.subramani@uwaterloo.ca ",
17
+ "bbox": [
18
+ 220,
19
+ 226,
20
+ 472,
21
+ 281
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Nicholas Vadivelu∗ Cheriton School of Computer Science University of Waterloo nbvadive@uwaterloo.ca ",
28
+ "bbox": [
29
+ 526,
30
+ 226,
31
+ 776,
32
+ 281
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Gautam Kamath Cheriton School of Computer Science University of Waterloo g@csail.mit.edu ",
39
+ "bbox": [
40
+ 372,
41
+ 303,
42
+ 624,
43
+ 358
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Abstract ",
50
+ "text_level": 1,
51
+ "bbox": [
52
+ 462,
53
+ 395,
54
+ 535,
55
+ 411
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "A common pain point in differentially private machine learning is the significant runtime overhead incurred when executing Differentially Private Stochastic Gradient Descent (DPSGD), which may be as large as two orders of magnitude. We thoroughly demonstrate that by exploiting powerful language primitives, including vectorization, just-in-time compilation, and static graph optimization, one can dramatically reduce these overheads, in many cases nearly matching the best nonprivate running times. These gains are realized in two frameworks: one is JAX, which provides rich support for these primitives through the XLA compiler. We also rebuild core parts of TensorFlow Privacy, integrating more effective vectorization as well as XLA compilation, granting significant memory and runtime improvements over previous release versions. Our proposed approaches allow us to achieve up to $5 0 \\mathrm { x }$ speedups compared to the best alternatives. Our code is available at https://github.com/TheSalon/fast-dpsgd. ",
62
+ "bbox": [
63
+ 233,
64
+ 425,
65
+ 766,
66
+ 604
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "1 Introduction ",
73
+ "text_level": 1,
74
+ "bbox": [
75
+ 174,
76
+ 627,
77
+ 310,
78
+ 645
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Machine learning has recently experienced tremedous growth, being used to solve problems with unprecedented accuracy in a myriad of domains. However, not all domains are alike—while many datasets are freely available, we often would like to train ML models on sensitive data. Troublingly, it has been demonstrated that disregarding these concerns, or even using heuristic and best-effort privacy approaches, can result in significant leakage of private information [9, 12]. Differential privacy (DP) [16] has emerged as a strong and rigorous notion of data privacy, capable of protecting against privacy violations in a variety of settings. ",
85
+ "bbox": [
86
+ 174,
87
+ 659,
88
+ 825,
89
+ 756
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "One of the workhorse algorithms in machine learning is stochastic gradient descent (SGD) which has a differentially private analogue, DPSGD [43, 8, 2] which was introduced as a drop-in replacement for SGD. The primary differences include a per-example gradient clipping step and a batch-level addition of Gaussian noise. While these modifications seem relatively innocuous, they have so far led to non-trivial costs in terms of running time and final accuracy. In this paper, we address and mitigate the running time overhead of DPSGD. ",
96
+ "bbox": [
97
+ 174,
98
+ 762,
99
+ 825,
100
+ 845
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Most modern machine learning frameworks allow efficient access to average minibatch gradients, and not at a per-example level. Access to these objects is critical in DPSGD, as well as other applications beyond privacy [52]. Lack of support for fast computation of per-example gradients has been noted and lamented numerous times for both TensorFlow [35, 42, 3] and PyTorch [32, 6]. ",
107
+ "bbox": [
108
+ 176,
109
+ 852,
110
+ 823,
111
+ 880
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "",
118
+ "bbox": [
119
+ 173,
120
+ 92,
121
+ 823,
122
+ 119
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Numerous attempts to avoid these computational roadblocks have been proposed. Goodfellow [20] proposed an algorithmic solution for computing per-example $\\ell _ { 2 }$ -norms of the gradients for fullyconnected networks. Other proposed solutions work by exploiting Jacobians [14] or parallelizing over the batch dimension [4]. Several of these approaches are are restricted to specific types of architectures—for example, [20] is restricted to fully-connected layers, though [41] extends this to convolutional layers, and a very recent work [33] further considers layers including recurrent networks, attention, and more. BackPACK [14] currently supports only fully connected and convolutional layers, and while the paper states that it can be extended to recurrent and residual layers, GitHub issues related to implementation of these features have been open since November 2019 [13]. Facebook’s Opacus [51] emphasizes speed and scalability as the main selling points. We briefly mention microbatching, in which comparatively small subsets of the minibatch called “microbatches” of points are averaged before clipping, reducing the number of clipping operations (and thus the running time), at the cost of requiring additional noise to achieve the same privacy guarantee. Since this generally results in significantly worse accuracy, we do not investigate it further in our work. A more thorough description of approaches is provided in Section 2.1. ",
129
+ "bbox": [
130
+ 174,
131
+ 126,
132
+ 825,
133
+ 333
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "As mentioned in the literature (and thoroughly explored later in this paper), all existing approaches seem to incur moderate to severe running time overhead versus non-private SGD, with slowdowns as large as two orders of magnitude. For instance, Carlini et al. [12] comment “Training a differentially private algorithm is known to be slower than standard training; our implementation of this algorithm is 10-100x slower than standard training,” where their implementation is based on TensorFlow Privacy. Additionally, Thomas et al. [45] document a slowdown from 12 minutes to 14 hours due to the introduction of differential privacy, a 70x slowdown. The effect of these slowdowns can range from an inconvenience when it comes to rapid prototyping of smaller models, to prohibitively expensive for a single training run of a larger model. Overcoming this obstacle is an important step in helping differentially private machine learning transition from its present nascent state to widespread adoption. ",
140
+ "bbox": [
141
+ 174,
142
+ 339,
143
+ 825,
144
+ 491
145
+ ],
146
+ "page_idx": 1
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "1.1 Results ",
151
+ "text_level": 1,
152
+ "bbox": [
153
+ 174,
154
+ 508,
155
+ 263,
156
+ 523
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "We demonstrate that one can mostly eliminate the significant running time overhead of differentially private SGD by exploiting language primitives such as vectorization, just-in-time (JIT) compilation, and static graph optimization. These features are core primitives within JAX [19, 10] and TensorFlow 2 (TF2) [1], both tensor-processing libraries from Google. These frameworks combine JIT compilation backed by the Accelerated Linear Algebra (XLA) [22] just-in-time compiler (JIT) with auto differentiation for high-performance machine learning. As we will see, JAX is consistently the fastest method for running DPSGD, with running times comparable to the non-private case. Our custom TensorFlow Privacy (TFP) implementation (referred to as Custom TFP), which leverages vectorization and XLA compilation in TensorFlow 2, demonstrates similar performance to JAX and significantly outperforms the existing TFP library. These changes have since been merged into TensorFlow Privacy. ",
163
+ "bbox": [
164
+ 174,
165
+ 535,
166
+ 825,
167
+ 688
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "Our primary contributions are as follows: ",
174
+ "bbox": [
175
+ 176,
176
+ 694,
177
+ 444,
178
+ 708
179
+ ],
180
+ "page_idx": 1
181
+ },
182
+ {
183
+ "type": "text",
184
+ "text": "1. We thoroughly benchmark several frameworks and libraries for DPSGD. \n2. We extend TensorFlow Privacy to support TF2, more efficient vectorization, and XLA compilation, significantly improving its running time in most cases (referred to as Custom TFP in this paper). We also contribute a variant of our implementation to TensorFlow Privacy, which is now the fastest DPSGD algorithm the library provides. \n3. We demonstrate that methods which use vectorization, JIT compilation, and static graph optimization are consistently the fastest and most memory-efficient: specifically, JAX and Custom TFP. \n4. We find that, despite similarities in the compilation pipeline, JAX is generally faster than Custom TFP. We examine and discuss compiled XLA assembly to explain the discrepancy. \n5. Finally, our supplement contains code to reproduce these experiments, as well as guide researchers and engineers in developing fast code for private ML. ",
185
+ "bbox": [
186
+ 210,
187
+ 719,
188
+ 825,
189
+ 911
190
+ ],
191
+ "page_idx": 1
192
+ },
193
+ {
194
+ "type": "table",
195
+ "img_path": "images/77e977fc8fdfb1b926f22781f34df9f320bad2bd9d8cc2eacd6273dc7ee1f2cd.jpg",
196
+ "table_caption": [
197
+ "Table 1: Median running time (s) per epoch of training various models at batch size 128. FCNN stands for Fully-Connected Neural Network; CNN stands for Convolutinal Neural Network. "
198
+ ],
199
+ "table_footnote": [],
200
+ "table_body": "<table><tr><td></td><td colspan=\"2\">Private Training</td><td>Non-Private Training</td></tr><tr><td>Architecture</td><td>JAX/Custom TFP</td><td>Best Alternative</td><td>Best Time</td></tr><tr><td>FCNN</td><td>0.21</td><td>0.77</td><td>0.55</td></tr><tr><td>CNN</td><td>7.3</td><td>12</td><td>1.7</td></tr><tr><td>LSTM</td><td>8.2</td><td>407</td><td>4.8</td></tr></table>",
201
+ "bbox": [
202
+ 233,
203
+ 125,
204
+ 759,
205
+ 210
206
+ ],
207
+ "page_idx": 2
208
+ },
209
+ {
210
+ "type": "text",
211
+ "text": "Table 1 summarizes some of our experimental results, with median running time per epoch for a variety of settings. JAX and Custom TFP are consistently the fastest. ",
212
+ "bbox": [
213
+ 174,
214
+ 233,
215
+ 821,
216
+ 261
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "We observe dramatic improvements for LSTMs [28], potentially significant enough to bring LSTMs from impractical into the realm of feasibility. JAX is able to privately train these models $1 7 \\mathbf { x }$ and $5 0 \\mathrm { x }$ faster than the best alternative.2 Examining the overhead due to privacy: JAX’s running time increases by roughly 2x, compared to factors closer to $1 0 \\mathrm { x }$ for alternatives. ",
223
+ "bbox": [
224
+ 174,
225
+ 267,
226
+ 825,
227
+ 323
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "For fully-connected and convolutional networks, JAX or Custom TFP almost entirely remove the overhead due to privacy. In fact, the running times are significantly better than some alternatives without privacy. Recall that these are per-epoch times: while an improvement of 0.5 seconds might seem insignificant, this can add up when training for many epochs. We perform an ablation study (Table 2) for all models to pinpoint the source of all improvements. ",
234
+ "bbox": [
235
+ 174,
236
+ 329,
237
+ 825,
238
+ 398
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "While our investigations show the consistent and substantial superiority of JAX for fast private machine learning, these benefits remain relatively unknown. Though a small number of experts are aware [44], and the official JAX repo contains a toy demonstration [25], before the initial posting of our paper a Google Scholar search revealed only two papers which use JAX for differential privacy [49, 38], and neither emphasizes or even comments on the computational advantages of JAX. Similarly, while efficient per-example gradients have been studied in TensorFlow [5], efficient application of these techniques is not readily available to privacy researchers. We hope that our investigation will document this phenomenon and encourage others to adopt it for their private machine learning needs. ",
245
+ "bbox": [
246
+ 174,
247
+ 405,
248
+ 825,
249
+ 530
250
+ ],
251
+ "page_idx": 2
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": "1.2 Simultaneous and Subsequent Work ",
256
+ "text_level": 1,
257
+ "bbox": [
258
+ 176,
259
+ 545,
260
+ 464,
261
+ 560
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "Simultaneous to our work, [11] employ Johnson-Lindenstrauss projections to quickly approximate per-example gradient norms. This is an algorithmic modification, and will not be functionally equivalent to DPSGD – similar to microbatching, there is a time-accuracy tradeoff (though not as severe in this case). ",
268
+ "bbox": [
269
+ 174,
270
+ 570,
271
+ 825,
272
+ 626
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "Subsequent to the initial posting of this paper, we worked with Google engineers to implement our improvements into TensorFlow Privacy. Vadivelu contributed an JAX implementation of DPSGD to the Optax library [27]. [7] employed our findings to efficiently privately train BERT-Large. In a recent Opacus whitepaper [51], the authors repeat some of our experiments on more recent versions of these frameworks; we defer to their work for discussion of these results. ",
279
+ "bbox": [
280
+ 174,
281
+ 632,
282
+ 825,
283
+ 702
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "2 Description of Approaches ",
290
+ "text_level": 1,
291
+ "bbox": [
292
+ 176,
293
+ 722,
294
+ 428,
295
+ 738
296
+ ],
297
+ "page_idx": 2
298
+ },
299
+ {
300
+ "type": "text",
301
+ "text": "2.1 Libraries Enabling DPSGD ",
302
+ "text_level": 1,
303
+ "bbox": [
304
+ 176,
305
+ 751,
306
+ 405,
307
+ 767
308
+ ],
309
+ "page_idx": 2
310
+ },
311
+ {
312
+ "type": "text",
313
+ "text": "JAX [19, 10]. JAX is a recently introduced framework for machine learning, defined by its automatic differentiation capabilities and JIT compilation via the XLA compiler [22]. Programs written in pure Python and JAX’s NumPy [26] API can be translated to an intermediate language (XLA-HLO) to be JIT compiled, i.e., to generate custom assembly instructions for the hardware. This enables optimizations such as kernel-fusions, buffer reuse, improved memory layout, and more. Additionally, one of the core functions present in JAX is VMAP, a vectorized map, which enables easy-to-write and efficient batch level parallelism that is fundamental to DPSGD. As we will demonstrate, these enable the fastest approach for DPSGD that we are aware of. ",
314
+ "bbox": [
315
+ 173,
316
+ 776,
317
+ 825,
318
+ 888
319
+ ],
320
+ "page_idx": 2
321
+ },
322
+ {
323
+ "type": "text",
324
+ "text": "Custom TFP. Vectorization and XLA-driven JIT compilation is also available in TensorFlow 2 [1], which we leverage in our implementation, Custom TFP. With these primitives, we achieve performance comparable to JAX and surpassing existing DPSGD implementations in TensorFlow. We augment TensorFlow Privacy to better utilize tf.vectorized_map and follow TensorFlow 2 best practices while retaining the existing functionality. ",
325
+ "bbox": [
326
+ 173,
327
+ 90,
328
+ 825,
329
+ 161
330
+ ],
331
+ "page_idx": 3
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "Chain-Rule-Based Per-Example Gradients [20, 41]. This suite of techniques is implemented on top of PyTorch [39]. They support efficient GPU-accelerated per-example gradients for fullyconnected layers via [20], as well as convolutional layers via [41], which we describe in the detail in the following paragraphs. ",
336
+ "bbox": [
337
+ 173,
338
+ 174,
339
+ 826,
340
+ 231
341
+ ],
342
+ "page_idx": 3
343
+ },
344
+ {
345
+ "type": "text",
346
+ "text": "Let $C , D , T$ , and $B$ refer to the number of input channels, output channels, the spatial dimension, and the batch size. The shape of the input $x$ is $( B , C , T )$ . The conventional formula for the discrete convolution can be written as: ",
347
+ "bbox": [
348
+ 173,
349
+ 236,
350
+ 825,
351
+ 279
352
+ ],
353
+ "page_idx": 3
354
+ },
355
+ {
356
+ "type": "equation",
357
+ "img_path": "images/e39293d34928c5cbcb2bed0eba7e2653691fc64a3ee40db075eb5c6ee4e8957f.jpg",
358
+ "text": "$$\n\\sum _ { c = 0 } ^ { C - 1 } \\sum _ { k = 0 } ^ { K - 1 } x [ b , c , t + K ] h [ d , c , k ] .\n$$",
359
+ "text_format": "latex",
360
+ "bbox": [
361
+ 390,
362
+ 279,
363
+ 606,
364
+ 323
365
+ ],
366
+ "page_idx": 3
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "The gradient of this expression can be efficiently computed via automatic differentiation [40]. PyTorch’s automatic differentiation cannot be parallelized across the batch dimension $b$ [41], which is required to backpropagate through the above expression. Instead, they rewrite the convolution as follows: ",
371
+ "bbox": [
372
+ 173,
373
+ 325,
374
+ 826,
375
+ 378
376
+ ],
377
+ "page_idx": 3
378
+ },
379
+ {
380
+ "type": "equation",
381
+ "img_path": "images/f0b20a1f9538f8f50b65207dce238722dee8ba34959ad38b06c31561d6cf401b.jpg",
382
+ "text": "$$\n\\sum _ { c = 0 } ^ { C / G - 1 } \\sum _ { k = 0 } ^ { K - 1 } x \\left[ b , c , g \\frac { C } { G } , t + K \\right] h [ d , g , c , k ] ,\n$$",
383
+ "text_format": "latex",
384
+ "bbox": [
385
+ 352,
386
+ 376,
387
+ 643,
388
+ 421
389
+ ],
390
+ "page_idx": 3
391
+ },
392
+ {
393
+ "type": "text",
394
+ "text": "where $G$ is the number of groups and the shape of $x$ is $( 1 , B , C , { \\cal T } )$ . The initial convolution is 1-dimensional, while the above expression includes an added dimension. Similarly, to allow backpropagation through a $k$ -dimensional convolutional layer, a $( k + 1 )$ -dimensional convolutional layer is required. This can be achieved by utilizing the group attribute in the convolution function in PyTorch, since splitting it into groups implies that the same convolution is applied to each individual group. ",
395
+ "bbox": [
396
+ 173,
397
+ 421,
398
+ 826,
399
+ 506
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "BackPACK [14]. The chain rule gives the following expression for the gradient of a loss function: ",
406
+ "bbox": [
407
+ 173,
408
+ 518,
409
+ 825,
410
+ 535
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "equation",
416
+ "img_path": "images/5e7d220c78255c36e4f55c7ea8873eda602b94c51c2e41dcc2bcd9caba14be16.jpg",
417
+ "text": "$$\n\\nabla _ { \\theta ^ { ( i ) } } \\ell ( \\theta ) = ( J _ { \\theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } \\left( \\prod _ { j = i } ^ { L - 1 } ( J _ { z _ { n } ^ { ( j ) } } z _ { n } ^ { ( j + 1 ) } ) ^ { T } \\right) ( \\nabla _ { z _ { n } ^ { ( L ) } } \\ell _ { n } ( \\theta ) ) .\n$$",
418
+ "text_format": "latex",
419
+ "bbox": [
420
+ 292,
421
+ 542,
422
+ 705,
423
+ 594
424
+ ],
425
+ "page_idx": 3
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "In order to compute this quantity, one requires the ability to multiply the Jacobian by a vector and by a matrix, which is not currently supported in PyTorch’s automatic differentiation framework. In BackPACK, Dangel et al. [14] extend several layers within PyTorch to support fast Jacobian-vector and Jacobian-matrix products in order to extract quantities like individual gradients, variance, $\\ell _ { 2 }$ - norm of the gradients, and second-order quantities. In particular, to extract first-order gradients, their method multiplies the transposed Jacobian with the outputs of the layer: ",
430
+ "bbox": [
431
+ 173,
432
+ 595,
433
+ 826,
434
+ 679
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "equation",
440
+ "img_path": "images/f41e14a356a9807b5c74380869b5ef0d5ec31f84336fb052fe3be130ec5b4fd3.jpg",
441
+ "text": "$$\n\\frac { 1 } { N } \\nabla _ { \\theta ^ { ( i ) } } \\ell ( \\theta ) = \\frac { 1 } { N } ( J _ { \\theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } ( \\nabla _ { z _ { n } ^ { ( i ) } } \\ell ( \\theta ) ) ,\n$$",
442
+ "text_format": "latex",
443
+ "bbox": [
444
+ 357,
445
+ 681,
446
+ 638,
447
+ 712
448
+ ],
449
+ "page_idx": 3
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "where $i = 1 , \\ldots , N$ and each $\\theta ^ { ( i ) }$ has a gradient which is of shape $( N , d ^ { ( i ) } )$ . BackPACK provides efficient computation for the transpose of the Jacobian as well as the Jacobian. ",
454
+ "bbox": [
455
+ 173,
456
+ 715,
457
+ 823,
458
+ 744
459
+ ],
460
+ "page_idx": 3
461
+ },
462
+ {
463
+ "type": "text",
464
+ "text": "Opacus [51]. Opacus is a library for training PyTorch models with differential privacy, recently released by Facebook. It supports per-example gradients, using PyTorch’s forward and backward hooks to propagate gradients. They provide support for several PyTorch layers including LSTM layers, which are not supported in either of the previous two frameworks. Note that Opacus does not support PyTorch’s nn.LSTM but instead implements a separate opacus.layers.DPLSTM, with adjustments that allow individual gradients to propagate through it. ",
465
+ "bbox": [
466
+ 173,
467
+ 757,
468
+ 825,
469
+ 842
470
+ ],
471
+ "page_idx": 3
472
+ },
473
+ {
474
+ "type": "text",
475
+ "text": "PyVacy [48]. Before the release of Opacus (and its predecessor PyTorch-DP), PyVacy was the most popular library for DP machine learning in PyTorch. PyVacy has no custom support for parallelization across the batch dimension for any layer since it processes each sample individually (by way of a for-loop). This generally leads to a large increase in runtime for models trained using PyVacy. ",
476
+ "bbox": [
477
+ 174,
478
+ 854,
479
+ 825,
480
+ 911
481
+ ],
482
+ "page_idx": 3
483
+ },
484
+ {
485
+ "type": "text",
486
+ "text": "TensorFlow Privacy [37] TensorFlow Privacy is a library for differentially private machine learning, built on top of TensorFlow. TensorFlow Privacy has general support for a vectorized implementation of DPSGD via vectorized_map which allows it to parallelize across the batch dimension, used to extract per-example gradients. The library recently introduced a TensorFlow 2 compatible API that leverages GradientTape.jacobian to compute per-example gradients, which we compare seperately to the TensorFlow 1 API in our experiments. ",
487
+ "bbox": [
488
+ 174,
489
+ 90,
490
+ 826,
491
+ 174
492
+ ],
493
+ "page_idx": 4
494
+ },
495
+ {
496
+ "type": "text",
497
+ "text": "2.2 Notable Framework Features ",
498
+ "text_level": 1,
499
+ "bbox": [
500
+ 176,
501
+ 190,
502
+ 416,
503
+ 205
504
+ ],
505
+ "page_idx": 4
506
+ },
507
+ {
508
+ "type": "text",
509
+ "text": "Static versus Dynamic Graph. TensorFlow and JAX use a static graph to track computation in order to optimize execution and compute gradients. This means the sequence of operations is traced and a large proportion of shapes are determined during the first invocation of the function, allowing for kernel fusion, buffer reuse, and other optimizations on subsequent calls. PyTorch uses a dynamic graph to track computation flow in order to compute gradients, but does not optimize execution. This enables increased dynamism in the shapes and types of computations, at the cost of losing all the aforementioned optimizations. ",
510
+ "bbox": [
511
+ 174,
512
+ 215,
513
+ 825,
514
+ 313
515
+ ],
516
+ "page_idx": 4
517
+ },
518
+ {
519
+ "type": "text",
520
+ "text": "Grappler versus XLA. TensorFlow has two optimization engines: Grappler [21] and XLA. Grappler, TensorFlow’s original graph optimizer, takes as input the computation graph and is able to prune dead nodes, remove redundant computation, improve memory layouts, and more. XLA, TensorFlow’s new optimizing compiler, can perform the same optimizations as Grappler, in addition to generating code for fused kernels. For this reason, XLA has the potential to extract more performance out of TensorFlow graphs than Grappler, but does not always accomplish this due to Grappler’s maturity. ",
521
+ "bbox": [
522
+ 174,
523
+ 327,
524
+ 825,
525
+ 411
526
+ ],
527
+ "page_idx": 4
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "JAX and XLA. JAX was built from the ground up to leverage XLA, and so many of its operations map directly to XLA primitives. We often observe that JAX is able to extract better performance out of XLA than TensorFlow. ",
532
+ "bbox": [
533
+ 174,
534
+ 424,
535
+ 825,
536
+ 465
537
+ ],
538
+ "page_idx": 4
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "Pytorch and Static Graphs. Recently, PyTorch has released the capability to JIT compile its code through torch.jit or PyTorch XLA [18]. Due to the early nature of these two efforts, they were not successful in JIT compiling the methods we tried, thus we do not consider them further. ",
543
+ "bbox": [
544
+ 176,
545
+ 481,
546
+ 823,
547
+ 522
548
+ ],
549
+ "page_idx": 4
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "Just-In-Time Compilation JIT compilation is a method of compilation that happens at runtime, as opposed to before program execution. JAX and TensorFlow perform JIT compilation by recording operations that are executed on tensors/arrays (i.e. “tracing”), generating the low-level instructions to perform these operations, optimizing these instructions, then producing fast low-level kernels. The XLA compiler requires all array shapes to be known at trace-time so it can statically determine how much memory should be allocated for each operation. While compilation can be relatively slow compared to execution $\\mathord { \\sim } 1 0 \\mathrm { x }$ the time), you only pay this price once at the first training iteration, provided the input shapes do not change. ",
554
+ "bbox": [
555
+ 174,
556
+ 536,
557
+ 825,
558
+ 648
559
+ ],
560
+ "page_idx": 4
561
+ },
562
+ {
563
+ "type": "text",
564
+ "text": "3 Empirical Findings ",
565
+ "text_level": 1,
566
+ "bbox": [
567
+ 174,
568
+ 666,
569
+ 367,
570
+ 684
571
+ ],
572
+ "page_idx": 4
573
+ },
574
+ {
575
+ "type": "text",
576
+ "text": "We evaluate the aforementioned implementations of DPSGD in runtime and memory consumption on three datasets: CIFAR10 [31], a dataset of small colour images with 60,000 training examples of size $3 2 \\times 3 2 \\times 3$ each, IMDb [36], a movie review sentiment classification dataset with 25,000 training examples padded to a sequence length of 256 each, and Adult [15], containing 45,220 examples with 104 features, which was preprocessed via methods from [29]. These datasets are available for open use and do not contain personally identifiable information or offensive content. ",
577
+ "bbox": [
578
+ 174,
579
+ 696,
580
+ 825,
581
+ 780
582
+ ],
583
+ "page_idx": 4
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "We perform our evaluations on three different architectures. We start with the smallest dataset, Adult, training a 5,532-parameter fully-connected neural network (FCNN). Then, we train a CIFAR10 convolutional neural network classifier architecture with 605,226 parameters used by Papernot et al. [38]. For IMDb, we use an LSTM network with 1,081,002 parameters, demonstrating the method on a relatively large model. This selection covers the common data and architecture types at realistic sizes for differentially private learning. In particular, we did not consider the exceptionally large models which are not prevalent in non-private machine learning. Additional experiments can be found in the supplement that are omitted due to space constraints. These experiments cover a wider range of parameters and architectures to elucidate the benefits of using XLA JIT for DPSGD. ",
588
+ "bbox": [
589
+ 174,
590
+ 786,
591
+ 825,
592
+ 911
593
+ ],
594
+ "page_idx": 4
595
+ },
596
+ {
597
+ "type": "image",
598
+ "img_path": "images/9a3f8cf843b83e05d46d37bb1dab0d71dd07186f22e67c295be8ec268dbd6807.jpg",
599
+ "image_caption": [],
600
+ "image_footnote": [],
601
+ "bbox": [
602
+ 179,
603
+ 108,
604
+ 816,
605
+ 279
606
+ ],
607
+ "page_idx": 5
608
+ },
609
+ {
610
+ "type": "image",
611
+ "img_path": "images/e3cbf49e714ad7c8fc70099904ccc592e020e2bd158108cc7dfb3beeb3af456f.jpg",
612
+ "image_caption": [
613
+ "Figure 1: Runtimes for the fully connected network on the Adult dataset. We observe that JAX and Custom TFP are the fastest by a large margin in both settings, with DPSGD having low overhead over the non-private setting. The y-axis is truncated for clarity. ",
614
+ "Figure 2: Runtimes for the CNN on the CIFAR10 dataset. We observe that JAX has the fastest runtime in the private case while TensorFlow 2 with XLA and JAX are the fastest in the non-private case at most batch sizes. Similar to the MNIST case, TFP struggles at the largest batch size due to an inability to properly parallelize per-gradient computation with this level of memory consumption. The y-axis is truncated for clarity. "
615
+ ],
616
+ "image_footnote": [],
617
+ "bbox": [
618
+ 178,
619
+ 359,
620
+ 816,
621
+ 545
622
+ ],
623
+ "page_idx": 5
624
+ },
625
+ {
626
+ "type": "text",
627
+ "text": "We compare a number of different methods for fast DPSGD, including JAX [19, 10], BackPACK [14], the chain-rule based method (CRB) [20, 41], Opacus [51], PyVacy [48], TensorFlow Privacy (TFP) [37] and our modification of TFP, dubbed Custom TFP. For TensorFlow based frameworks, we evaluate performance both with and without XLA JIT compilation in both TF 1 and TF 2. We refer to TensorFlow 2 and JAX as modern XLA-compiled libraries. ",
628
+ "bbox": [
629
+ 174,
630
+ 662,
631
+ 825,
632
+ 732
633
+ ],
634
+ "page_idx": 5
635
+ },
636
+ {
637
+ "type": "text",
638
+ "text": "These architectures and datasets are evaluated in terms of runtime at batch sizes 16, 32, 64, 128, and 256. This showcases a comparison of runtimes across a variety of batch sizes to present a holistic picture of the running times, as well as demonstrating the impact of memory utilization on runtime. Each experiment was run for 20 epochs and the median epoch run-time is reported. The variance of these experiments was low enough that the errors bars are negligible (full results provided in the supplement). Outside of the initial compilation time required for the static graph frameworks, the runtime showed little variance between epochs, resulting in narrow confidence intervals for the epoch runtime (data available upon request). We preprocess all the data in advance and use an identical generator-based dataloader for all frameworks, to ensure consistency. ",
639
+ "bbox": [
640
+ 174,
641
+ 738,
642
+ 825,
643
+ 863
644
+ ],
645
+ "page_idx": 5
646
+ },
647
+ {
648
+ "type": "text",
649
+ "text": "All experiments were run on Ubuntu 18.04 with an Intel Core i7-7800X CPU $3 . 5 0 \\mathrm { G H z }$ , 6 cores), NVIDIA GTX Titan V GPU (12GB VRAM), and 32GB of RAM. The code is provided in the supplement and is publicly released. ",
650
+ "bbox": [
651
+ 176,
652
+ 869,
653
+ 825,
654
+ 911
655
+ ],
656
+ "page_idx": 5
657
+ },
658
+ {
659
+ "type": "image",
660
+ "img_path": "images/45a88e3275af77554f562c1bcdd642452bdab37b718759590bc3c59fe3bbbcb5.jpg",
661
+ "image_caption": [
662
+ "Figure 3: Runtimes for the LSTM network on the IMDb dataset. JAX is by far the fastest option, resulting in a roughly $5 0 \\mathrm { x }$ speedup for batch size 256. The quadratic memory cost of Opacus prevents us from evaluating this implementation at these batch sizes, however, we observe a median runtime of 1024.16s at batch size 10. Excessive memory consumption prevent us from evaluating Custom TFP and TFP at larger batch sizes. An open TensorFlow 2 bug prevents us from evaluating Custom TFP (XLA) in this setting [46]. BackPACK and CRB do not support embedding layers. The y-axis is truncated for clarity. "
663
+ ],
664
+ "image_footnote": [],
665
+ "bbox": [
666
+ 178,
667
+ 93,
668
+ 816,
669
+ 279
670
+ ],
671
+ "page_idx": 6
672
+ },
673
+ {
674
+ "type": "text",
675
+ "text": "First, we evaluate the FCNN model (Figure 1), where we observe that JAX and Custom TFP are significantly faster than the other options in both the private and non-private setting. With such a simple architecture, the compiler can perform significant optimizations. Notably, JAX and Custom TFP show little overhead over their non-private counterparts. The non-statically compiled frameworks (apart from PyVacy) remain competitive in this setting due to the shallow network size and low parameter count. TFP 2 without XLA performs unexpectedly poorly, due to the Jacobian computation which does not account for per-example independence of gradients. ",
676
+ "bbox": [
677
+ 173,
678
+ 421,
679
+ 825,
680
+ 518
681
+ ],
682
+ "page_idx": 6
683
+ },
684
+ {
685
+ "type": "text",
686
+ "text": "We then evaluate the CIFAR10 CNN model (Figure 2), where JAX is by far the most performant implementation in the private case, and the modern XLA-compiled frameworks are the fastest non-private methods. Custom TFP is noticeably slower than JAX—we conjecture that this is due to different utilization of the JIT compiler, see Section 4. Also, at the largest batch size, TFP’s performance deteriorates due to the memory consumption preventing it from effectively parallelizing the per-example gradient computation. ",
687
+ "bbox": [
688
+ 174,
689
+ 525,
690
+ 825,
691
+ 608
692
+ ],
693
+ "page_idx": 6
694
+ },
695
+ {
696
+ "type": "text",
697
+ "text": "For the final runtime experiment we evaluate the LSTM network (Figure 3). A TensorFlow 2 bug [46] and lack of support from BackPACK and CRB prevent us from evaluating this setting on those implementations. We see a similar phenomenon to the CIFAR10 CNN case for TFP: at larger batch sizes, the library fails to parallelize effectively pessimizing the runtime. TensorFlow and PyTorch benefit from a fast cuDNN LSTM implementation in the non-private case which they fail to leverage in the private case, explaining the significant difference in performance. JAX, on the other hand, uses an LSTM implementation based on primitive operations, which allows it to retain similar performance in both the private and non-private settings. ",
698
+ "bbox": [
699
+ 174,
700
+ 614,
701
+ 825,
702
+ 726
703
+ ],
704
+ "page_idx": 6
705
+ },
706
+ {
707
+ "type": "text",
708
+ "text": "To understand the importance of vectorization (via VMAP) and JIT compilation (JIT), we ablate JAX’s performance on these tasks with and without these two components (Table 2). We observe that JIT alone provides up to a $4 3 5 \\mathrm { x }$ improvement, and VMAP alone provides up to a $6 4 \\mathrm { x }$ improvement. When used in tandem, both complement each other, providing up to a 5160x improvement. ",
709
+ "bbox": [
710
+ 174,
711
+ 731,
712
+ 825,
713
+ 787
714
+ ],
715
+ "page_idx": 6
716
+ },
717
+ {
718
+ "type": "text",
719
+ "text": "Similarly, we ablate the components in Custom TFP (Table 2). In TensorFlow, vectorized_map automatically compiles the code, preventing us from ablating it alone. We observe that XLA in TensorFlow 2 is able to reclaim performance lost by not vectorizing, seeing that the non-VMAP XLA performance comes close to VMAP Graph performance in many settings. We further see the non-compiled runtimes are not as extreme as seen in JAX: TensorFlow is better optimized to run reasonably fast in all settings. ",
720
+ "bbox": [
721
+ 174,
722
+ 792,
723
+ 825,
724
+ 877
725
+ ],
726
+ "page_idx": 6
727
+ },
728
+ {
729
+ "type": "text",
730
+ "text": "Finally, we explore the memory consumption behaviour of these implementations (Table 3), observing that running time has a strong negative correlation to memory consumption. The modern XLAcompiled libraries provide impressive batch size capability. Also, all the frameworks except JAX and PyVacy struggle with batch sizes on the LSTM. Since PyVacy processes examples sequentially, it has a constant memory consumption with respect to batch size, effectively trading off running time for optimal memory use. The other frameworks are crippled without access to their fused cuDNN LSTM implementation, while JAX has no issues as its LSTM is composed of primitives. Finally, due to the specialized per-example gradient computation afforded by CRB for convolutions, it shows the best memory utilization among the PyTorch frameworks, even beating Custom TFP (without XLA) in the CIFAR10 CNN case. ",
731
+ "bbox": [
732
+ 174,
733
+ 883,
734
+ 821,
735
+ 911
736
+ ],
737
+ "page_idx": 6
738
+ },
739
+ {
740
+ "type": "table",
741
+ "img_path": "images/a9cdb63f76355a16c330a9eaf203cb78441cd6d7e886cf9825085ffadf887e1b.jpg",
742
+ "table_caption": [
743
+ "Table 2: Ablation of JIT compilation and vectorization in Custom TFP (left) and JAX (right). Median runtime per epoch for a run of 20 epochs at batch size 128 for DPSGD. In TensorFlow, one can not use vectorization without graph compilation, which is why there is no standalone vectorization. Empty entries are due to confirmed active bugs in TensorFlow [47, 46]. We exclude LSTMs, as JAX runs out of memory without JIT compilation for this model. "
744
+ ],
745
+ "table_footnote": [],
746
+ "table_body": "<table><tr><td>Graph</td><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td><td>LSTM</td></tr><tr><td></td><td></td><td></td><td>147</td><td>561</td><td>717</td></tr><tr><td>√</td><td></td><td></td><td>12.7</td><td>85.5</td><td>361</td></tr><tr><td></td><td>√</td><td></td><td>1.83</td><td>71.5</td><td></td></tr><tr><td>√</td><td></td><td>:</td><td>0.770</td><td>33.8</td><td>68.6</td></tr><tr><td></td><td>√</td><td></td><td>0.209</td><td>23.3</td><td></td></tr></table>",
747
+ "bbox": [
748
+ 197,
749
+ 165,
750
+ 552,
751
+ 265
752
+ ],
753
+ "page_idx": 7
754
+ },
755
+ {
756
+ "type": "table",
757
+ "img_path": "images/c1d5d4620544dcdc7ffda8a33c51994d008bd5a2c6341a3ca37764a6697b9ba0.jpg",
758
+ "table_caption": [],
759
+ "table_footnote": [],
760
+ "table_body": "<table><tr><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td></tr><tr><td rowspan=\"5\">·</td><td rowspan=\"5\">√</td><td>1240</td><td>3840</td></tr><tr><td>19.2</td><td>64.8</td></tr><tr><td>2.85</td><td>84.0</td></tr><tr><td>0.239</td><td>7.28</td></tr><tr><td></td><td></td></tr></table>",
761
+ "bbox": [
762
+ 565,
763
+ 171,
764
+ 795,
765
+ 257
766
+ ],
767
+ "page_idx": 7
768
+ },
769
+ {
770
+ "type": "table",
771
+ "img_path": "images/19af3199cda7926c5972b0d84e944cf553edd50ba2305d92991aa5825f9cc648.jpg",
772
+ "table_caption": [
773
+ "Table 3: Maximum batch size supported by each library before encountering out of memory errors. Missing entries represent missing functionality or bugs in the frameworks. PyVacy handles examples sequentially, giving constant memory consumption with respect to batch size. "
774
+ ],
775
+ "table_footnote": [],
776
+ "table_body": "<table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td>JAX TensorFlow 2 (XLA)</td><td>10,448 15,040</td><td>11,984</td></tr><tr><td>TensorFlow 2</td><td>11,328</td><td>9,221</td></tr><tr><td>TensorFlow 1 (XLA)</td><td>10,880</td><td>5,070</td></tr><tr><td>TensorFlow 1</td><td>11,480</td><td>5,264</td></tr><tr><td>PyTorch</td><td>10,752</td><td>9,943</td></tr></table>",
777
+ "bbox": [
778
+ 205,
779
+ 327,
780
+ 498,
781
+ 508
782
+ ],
783
+ "page_idx": 7
784
+ },
785
+ {
786
+ "type": "table",
787
+ "img_path": "images/39cbc627847561b0afc7d2f454bba4d1e36239a682d105f0cc001a206d2305e5.jpg",
788
+ "table_caption": [],
789
+ "table_footnote": [],
790
+ "table_body": "<table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td> JAX (DP)</td><td>4,264</td><td>2,487</td></tr><tr><td>Custom TFP (XLA) TFP 2 (XLA)</td><td>3,144 168</td><td></td></tr><tr><td>Custom TFP</td><td>1,944</td><td>137</td></tr><tr><td>TFP 2</td><td>104</td><td>105</td></tr><tr><td>TFP (XLA)</td><td>168</td><td>88</td></tr><tr><td>TFP</td><td>104</td><td>105</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Opacus</td><td>1,920</td><td>10</td></tr><tr><td>BackPACK</td><td>1,216</td><td></td></tr><tr><td>CRB</td><td>2,184</td><td></td></tr><tr><td>PyVacy</td><td>8</td><td>8</td></tr></table>",
791
+ "bbox": [
792
+ 513,
793
+ 327,
794
+ 787,
795
+ 508
796
+ ],
797
+ "page_idx": 7
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "",
802
+ "bbox": [
803
+ 173,
804
+ 535,
805
+ 825,
806
+ 645
807
+ ],
808
+ "page_idx": 7
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "4 Discussion ",
813
+ "text_level": 1,
814
+ "bbox": [
815
+ 174,
816
+ 665,
817
+ 292,
818
+ 683
819
+ ],
820
+ "page_idx": 7
821
+ },
822
+ {
823
+ "type": "text",
824
+ "text": "JAX and Custom TFP’s runtime advancements can be primarily attributed to the advancement of the compiler present in both of these languages. The XLA compiler performs a variety of operations ranging from memory scheduling to kernel fusion. The memory optimizations are vital for larger models where DPSGD becomes a memory-bound algorithm. One of the core features of XLA is buffer reutilization which has a significant impact on the maximum memory used [22]. Furthermore, the memory scheduler can mitigate peak memory usage to prevent a runtime exception for overusing available memory. ",
825
+ "bbox": [
826
+ 174,
827
+ 696,
828
+ 825,
829
+ 795
830
+ ],
831
+ "page_idx": 7
832
+ },
833
+ {
834
+ "type": "text",
835
+ "text": "The effectiveness of XLA is demonstrated through the peak batch size experiment (which serves as a proxy for memory efficiency): in both the private and non-private settings, XLA far exceeds alternatives in the peak batch size it supports. Through this experiment, we also see the benefits of using small operation primitives as opposed to large fused kernels: TensorFlow and PyTorch both leverage the optimized cuDNN kernel in the non-private setting for performance [23, 17], but cannot in the private setting, leading to significantly worse performance. Modifying all existing cuDNN kernels to enable use in the private case would require a non-trivial engineering investment. JAX instead focuses on optimizing operation primitives, so even in foreign computational circumstances, its performance is comparatively strong. Succinctly, JAX sacrifices the ability to use highly optimized fused kernels for generalizability. ",
836
+ "bbox": [
837
+ 173,
838
+ 800,
839
+ 825,
840
+ 911
841
+ ],
842
+ "page_idx": 7
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "",
847
+ "bbox": [
848
+ 173,
849
+ 92,
850
+ 823,
851
+ 119
852
+ ],
853
+ "page_idx": 8
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "Our implementation of Custom TFP leverages the vectorized map for both the forward and backward pass, unlike existing implementations which only use vectorized map for the backward pass (identical to the JAX version). This gives the compiler explicit information about the independence of batches in the computation, enabling significant optimizations, explaining the improvement in Custom TFP compared to the existing TensorFlow implementations. Details about the implementation are provided in the supplementary code. ",
858
+ "bbox": [
859
+ 174,
860
+ 126,
861
+ 825,
862
+ 209
863
+ ],
864
+ "page_idx": 8
865
+ },
866
+ {
867
+ "type": "text",
868
+ "text": "We notice that the runtimes and memory consumption are different between Custom TFP and JAX despite having the same backend compiler. We investigate differences in the XLA-assembly for simple code segments in both frameworks in the supplemental material. TensorFlow 1.0 does not have the same capability to integrate with XLA as TF 2.0 does. The primary optimization available is autoclustering, which we observe does not optimize operations nearly as much as the full JIT. ",
869
+ "bbox": [
870
+ 174,
871
+ 215,
872
+ 825,
873
+ 285
874
+ ],
875
+ "page_idx": 8
876
+ },
877
+ {
878
+ "type": "text",
879
+ "text": "Through the ablation study of VMAP and JIT in JAX shown in Table 2, we observe that both components complement each other. In general, we observe that JIT provides the larger performance gain, as shown with the FCNN. For the CNN, the large matrix operations coupled with JAX’s asynchronous execution [34] allow reasonable utilization of the GPU even without VMAP, which is why we observe less of an improvement from JIT alone in this experiment. The runtimes without these two primitives is significantly slower than the other frameworks–this is because JAX was built ground-up to leverage these primitives [10]. ",
880
+ "bbox": [
881
+ 174,
882
+ 291,
883
+ 825,
884
+ 388
885
+ ],
886
+ "page_idx": 8
887
+ },
888
+ {
889
+ "type": "text",
890
+ "text": "In the ablation for Custom TFP in Table 2, we see some key differences with JAX. First, the mechanism for VMAP in TensorFlow 2 is different from that in JAX: JAX performs op-by-op batching without compilation, while TensorFlow always compiles the vectorized map [24]. We observe that the non-compiled code still runs in a reasonable amount of time since TensorFlow is optimized to have a competitive eager execution, while JAX is not. Also, in TensorFlow, XLA’s JIT compilation without vectorization is often able to bring the runtime performance close to that of the graph mode with vectorization, implying that XLA is able to recognize opportunities for parallelization even when the user does not explicitly request it. Finally, we observe the benefit of having a fast, fused implementation for LSTMs: while JAX ran out of memory outside of a compiled and vectorized context, Custom TFP is able to achieve reasonable runtimes by leveraging the fused kernel. ",
891
+ "bbox": [
892
+ 174,
893
+ 393,
894
+ 825,
895
+ 532
896
+ ],
897
+ "page_idx": 8
898
+ },
899
+ {
900
+ "type": "text",
901
+ "text": "4.1 Drawbacks ",
902
+ "text_level": 1,
903
+ "bbox": [
904
+ 174,
905
+ 551,
906
+ 290,
907
+ 566
908
+ ],
909
+ "page_idx": 8
910
+ },
911
+ {
912
+ "type": "text",
913
+ "text": "While integrating XLA into DPSGD presents a massive runtime and memory advantage, there is a cost. XLA is a subset of all permissable operations in JAX and TensorFlow, requiring users to be cognizant of functionality they use. For example, jax.numpy.unique $\\left( \\mathbf { x } \\right)$ produces a result whose shape is not known at compile time, preventing it from being used with JIT compilation. More subtle errors involving unintended recompilation of code are also possible which can lead to enormous slowdowns. ",
914
+ "bbox": [
915
+ 174,
916
+ 578,
917
+ 825,
918
+ 661
919
+ ],
920
+ "page_idx": 8
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "Another potential downside is that these benefits are not observed if the batch size is large enough and the bottleneck becomes the actual network evaluation. In a situation like this, all of the frameworks would perform at approximately the same speeds. However, in practice, this is rarely true and moreso in differentially private machine learning where models are not particularly large. ",
925
+ "bbox": [
926
+ 174,
927
+ 667,
928
+ 825,
929
+ 724
930
+ ],
931
+ "page_idx": 8
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "5 Conclusion and Future Work ",
936
+ "text_level": 1,
937
+ "bbox": [
938
+ 176,
939
+ 746,
940
+ 449,
941
+ 763
942
+ ],
943
+ "page_idx": 8
944
+ },
945
+ {
946
+ "type": "text",
947
+ "text": "We have demonstrated that language primitives like vectorization, JIT compilation, and static graph optimization can dramatically improve the running time of DPSGD, realized by JAX and our Custom TFP. In particular, we find that using JAX can almost entirely remove the computational overhead introduced by DPSGD, thus alleviating a major pain point of private machine learning practitioners. ",
948
+ "bbox": [
949
+ 174,
950
+ 779,
951
+ 825,
952
+ 835
953
+ ],
954
+ "page_idx": 8
955
+ },
956
+ {
957
+ "type": "text",
958
+ "text": "In our work, we focus on conventional set-ups for academic researchers; for future work, it would be insightful to explore the performance of distributed DPSGD, as distributed set-ups are becoming increasingly commonplace. Furthermore, implementing a PyTorch JIT compatible version of DPSGD could provide an alternative to TensorFlow and JAX, particularly if said implementation is compatible with PyTorch XLA. Though these two compilation systems are immature compared to TensorFlow and JAX, they are rapidly improving and should not be ignored. Outside of Python, there are powerful autodifferentiation methods in other more perfomant languages such as Julia [30] and Swift [50] which are worthy of study. ",
959
+ "bbox": [
960
+ 174,
961
+ 842,
962
+ 823,
963
+ 911
964
+ ],
965
+ "page_idx": 8
966
+ },
967
+ {
968
+ "type": "text",
969
+ "text": "",
970
+ "bbox": [
971
+ 174,
972
+ 90,
973
+ 823,
974
+ 133
975
+ ],
976
+ "page_idx": 9
977
+ },
978
+ {
979
+ "type": "text",
980
+ "text": "Acknowledgements ",
981
+ "text_level": 1,
982
+ "bbox": [
983
+ 176,
984
+ 154,
985
+ 338,
986
+ 170
987
+ ],
988
+ "page_idx": 9
989
+ },
990
+ {
991
+ "type": "text",
992
+ "text": "We would like to thank Roy Frostig for helpful discussions on JAX, Steve Chien and Shuang Song for their work in implementing our improvements in TensorFlow Privacy, Xi He and Om Thakkar for valuable feedback on drafts of this work, and several JAX, TensorFlow, and Opacus developers who helped answer our issues, including James Bradbury, Peter Buchlovsky, Peter Hawkins, Matthew Johnson, Karthik Prasad, Github handle ravikyram, and Qianli Scott Zhu. ",
993
+ "bbox": [
994
+ 174,
995
+ 185,
996
+ 825,
997
+ 255
998
+ ],
999
+ "page_idx": 9
1000
+ },
1001
+ {
1002
+ "type": "text",
1003
+ "text": "Funding Transparency Statement ",
1004
+ "text_level": 1,
1005
+ "bbox": [
1006
+ 176,
1007
+ 273,
1008
+ 455,
1009
+ 291
1010
+ ],
1011
+ "page_idx": 9
1012
+ },
1013
+ {
1014
+ "type": "text",
1015
+ "text": "Funding in direct support of this work: an NSERC Discovery Grant, a Compute Canada RRG grant, and a University of Waterloo startup grant. ",
1016
+ "bbox": [
1017
+ 176,
1018
+ 306,
1019
+ 825,
1020
+ 334
1021
+ ],
1022
+ "page_idx": 9
1023
+ },
1024
+ {
1025
+ "type": "text",
1026
+ "text": "References ",
1027
+ "text_level": 1,
1028
+ "bbox": [
1029
+ 174,
1030
+ 354,
1031
+ 266,
1032
+ 371
1033
+ ],
1034
+ "page_idx": 9
1035
+ },
1036
+ {
1037
+ "type": "text",
1038
+ "text": "[1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems. https://www.tensorflow.org/, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org. \n[2] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM Conference on Computer and Communications Security, CCS ’16, pages 308–318, New York, NY, USA, 2016. ACM. \n[3] act65. Custom gradient aggregation methods. https://github.com/tensorflow/ tensorflow/issues/15760, December 2017. URL https://github.com/tensorflow/ tensorflow/issues/15760. \n[4] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond. arXiv preprint arXiv:1903.04243, 2019. \n[5] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond, 2019. \n[6] alexdepremia. [feature request] expanding gradient function with variances. https://github. com/pytorch/pytorch/issues/8897, June 2018. URL https://github.com/pytorch/ pytorch/issues/8897. \n[7] Rohan Anil, Badih Ghazi, Vineet Gupta, Ravi Kumar, and Pasin Manurangsi. Large-scale differentially private BERT. arXiv preprint arXiv:2108.01624, 2021. \n[8] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’14, pages 464–473, Washington, DC, USA, 2014. IEEE Computer Society. \n[9] Abhishek Bhowmick, John Duchi, Julien Freudiger, Gaurav Kapoor, and Ryan Rogers. Protection against reconstruction and its applications in private federated learning. arXiv preprint arXiv:1812.00984, 2018. ",
1039
+ "bbox": [
1040
+ 179,
1041
+ 376,
1042
+ 828,
1043
+ 916
1044
+ ],
1045
+ "page_idx": 9
1046
+ },
1047
+ {
1048
+ "type": "text",
1049
+ "text": "[10] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax. ",
1050
+ "bbox": [
1051
+ 171,
1052
+ 90,
1053
+ 823,
1054
+ 133
1055
+ ],
1056
+ "page_idx": 10
1057
+ },
1058
+ {
1059
+ "type": "text",
1060
+ "text": "[11] Zhiqi Bu, Sivakanth Gopi, Janardhan Kulkarni, Yin Tat Lee, Judy Hanwen Shen, and Uthaipon Tantipongpipat. Fast and memory efficient differentially private-sgd via JL projections. In Advances in Neural Information Processing Systems 34, NeurIPS ’21. Curran Associates, Inc., 2021. ",
1061
+ "bbox": [
1062
+ 173,
1063
+ 142,
1064
+ 823,
1065
+ 199
1066
+ ],
1067
+ "page_idx": 10
1068
+ },
1069
+ {
1070
+ "type": "text",
1071
+ "text": "[12] Nicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: Evaluating and testing unintended memorization in neural networks. In 28th USENIX Security Symposium, USENIX Security ’19, pages 267–284. USENIX Association, 2019. ",
1072
+ "bbox": [
1073
+ 171,
1074
+ 208,
1075
+ 823,
1076
+ 252
1077
+ ],
1078
+ "page_idx": 10
1079
+ },
1080
+ {
1081
+ "type": "text",
1082
+ "text": "[13] Felix Dangel. Support for recurrent units. https://github.com/f-dangel/backpack/ issues/16, 2019. URL https://github.com/f-dangel/backpack/issues/16. ",
1083
+ "bbox": [
1084
+ 171,
1085
+ 261,
1086
+ 825,
1087
+ 290
1088
+ ],
1089
+ "page_idx": 10
1090
+ },
1091
+ {
1092
+ "type": "text",
1093
+ "text": "[14] Felix Dangel, Frederik Kunstner, and Philipp Hennig. BackPACK: Packing more into backprop. In Proceedings of the 8th International Conference on Learning Representations, ICLR ’20, 2020. ",
1094
+ "bbox": [
1095
+ 173,
1096
+ 299,
1097
+ 825,
1098
+ 342
1099
+ ],
1100
+ "page_idx": 10
1101
+ },
1102
+ {
1103
+ "type": "text",
1104
+ "text": "[15] Dheeru Dua and Casey Graff. UCI machine learning repository. http://archive.ics.uci. edu/ml, 2017. URL http://archive.ics.uci.edu/ml. License: Open Data Commons. ",
1105
+ "bbox": [
1106
+ 173,
1107
+ 351,
1108
+ 825,
1109
+ 381
1110
+ ],
1111
+ "page_idx": 10
1112
+ },
1113
+ {
1114
+ "type": "text",
1115
+ "text": "[16] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the 3rd Conference on Theory of Cryptography, TCC ’06, pages 265–284, Berlin, Heidelberg, 2006. Springer. ",
1116
+ "bbox": [
1117
+ 173,
1118
+ 388,
1119
+ 825,
1120
+ 433
1121
+ ],
1122
+ "page_idx": 10
1123
+ },
1124
+ {
1125
+ "type": "text",
1126
+ "text": "[17] Facebook. Lstm. https://pytorch.org/docs/stable/_modules/torch/nn/modules/ rnn.html#LSTM. URL https://pytorch.org/docs/stable/_modules/torch/nn/ modules/rnn.html#LSTM. ",
1127
+ "bbox": [
1128
+ 173,
1129
+ 441,
1130
+ 825,
1131
+ 484
1132
+ ],
1133
+ "page_idx": 10
1134
+ },
1135
+ {
1136
+ "type": "text",
1137
+ "text": "[18] FaceBook. Pytorch xla, 2020. URL https://github.com/pytorch/xla. ",
1138
+ "bbox": [
1139
+ 174,
1140
+ 493,
1141
+ 709,
1142
+ 510
1143
+ ],
1144
+ "page_idx": 10
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "[19] Roy Frostig, Matthew James Johnson, and Chris Leary. Compiling machine learning programs via high-level tracing. In The 1st Conference on Systems and Machine Learning, SysML ’18, 2018. ",
1149
+ "bbox": [
1150
+ 174,
1151
+ 518,
1152
+ 825,
1153
+ 560
1154
+ ],
1155
+ "page_idx": 10
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "[20] Ian Goodfellow. Efficient per-example gradient computations. arXiv preprint arXiv:1510.01799, 2015. ",
1160
+ "bbox": [
1161
+ 173,
1162
+ 570,
1163
+ 823,
1164
+ 599
1165
+ ],
1166
+ "page_idx": 10
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "text": "[21] Google. Tensorflow graph optimization with grappler. https://www.tensorflow.org/ guide/graph_optimization, . URL https://www.tensorflow.org/guide/graph_ optimization. License: Apache 2.0 License. ",
1171
+ "bbox": [
1172
+ 173,
1173
+ 608,
1174
+ 823,
1175
+ 651
1176
+ ],
1177
+ "page_idx": 10
1178
+ },
1179
+ {
1180
+ "type": "text",
1181
+ "text": "[22] Google. XLA: Optimizing compiler for machine learning. https://www.tensorflow.org/ xla, . URL https://www.tensorflow.org/xla. License: Apache 2.0 License. ",
1182
+ "bbox": [
1183
+ 173,
1184
+ 660,
1185
+ 825,
1186
+ 689
1187
+ ],
1188
+ "page_idx": 10
1189
+ },
1190
+ {
1191
+ "type": "text",
1192
+ "text": "[23] Google. tf.keras.layers.lstm. https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM, . URL https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM. ",
1193
+ "bbox": [
1194
+ 173,
1195
+ 699,
1196
+ 826,
1197
+ 742
1198
+ ],
1199
+ "page_idx": 10
1200
+ },
1201
+ {
1202
+ "type": "text",
1203
+ "text": "[24] Google. tf.vectorized_map. https://www.tensorflow.org/api_docs/python/tf/ vectorized_map, . URL https://www.tensorflow.org/api_docs/python/tf/ vectorized_map. ",
1204
+ "bbox": [
1205
+ 174,
1206
+ 751,
1207
+ 826,
1208
+ 794
1209
+ ],
1210
+ "page_idx": 10
1211
+ },
1212
+ {
1213
+ "type": "text",
1214
+ "text": "[25] Google. differentially_private_sgd.py. https://github.com/google/jax/blob/master/ examples/differentially_private_sgd.py, April 2019. URL https://github.com/ google/jax/blob/master/examples/differentially_private_sgd.py. License: Apache License 2.0. ",
1215
+ "bbox": [
1216
+ 174,
1217
+ 804,
1218
+ 826,
1219
+ 858
1220
+ ],
1221
+ "page_idx": 10
1222
+ },
1223
+ {
1224
+ "type": "text",
1225
+ "text": "[26] Charles R Harris, K Jarrod Millman, Stéfan J van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J Smith, et al. Array programming with numpy. Nature, 585(7825):357–362, 2020. ",
1226
+ "bbox": [
1227
+ 174,
1228
+ 869,
1229
+ 826,
1230
+ 911
1231
+ ],
1232
+ "page_idx": 10
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "[27] Matteo Hessel, David Budden, Fabio Viola, Mihaela Rosca, Eren Sezener, and Tom Hennigan. Optax: composable gradient transformation and optimisation, in JAX!, 2020. URL http: //github.com/deepmind/optax. ",
1237
+ "bbox": [
1238
+ 173,
1239
+ 90,
1240
+ 825,
1241
+ 133
1242
+ ],
1243
+ "page_idx": 11
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "[28] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. ",
1248
+ "bbox": [
1249
+ 173,
1250
+ 143,
1251
+ 823,
1252
+ 172
1253
+ ],
1254
+ "page_idx": 11
1255
+ },
1256
+ {
1257
+ "type": "text",
1258
+ "text": "[29] Roger Iyengar, Joseph P Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In Proceedings of the 40th IEEE Symposium on Security and Privacy, SP ’19, pages 299–316, Washington, DC, USA, 2019. IEEE Computer Society. ",
1259
+ "bbox": [
1260
+ 173,
1261
+ 184,
1262
+ 826,
1263
+ 241
1264
+ ],
1265
+ "page_idx": 11
1266
+ },
1267
+ {
1268
+ "type": "text",
1269
+ "text": "[30] Julia. Juliadiff. https://www.juliadiff.org/. URL https://www.juliadiff.org/. ",
1270
+ "bbox": [
1271
+ 169,
1272
+ 251,
1273
+ 812,
1274
+ 267
1275
+ ],
1276
+ "page_idx": 11
1277
+ },
1278
+ {
1279
+ "type": "text",
1280
+ "text": "[31] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. ",
1281
+ "bbox": [
1282
+ 171,
1283
+ 277,
1284
+ 825,
1285
+ 306
1286
+ ],
1287
+ "page_idx": 11
1288
+ },
1289
+ {
1290
+ "type": "text",
1291
+ "text": "[32] Frederik Kunstner. [feature request] simple and efficient way to get gradients of each element of a sum. https://github.com/pytorch/pytorch/issues/7786, May 2018. URL https: //github.com/pytorch/pytorch/issues/7786. ",
1292
+ "bbox": [
1293
+ 174,
1294
+ 316,
1295
+ 823,
1296
+ 359
1297
+ ],
1298
+ "page_idx": 11
1299
+ },
1300
+ {
1301
+ "type": "text",
1302
+ "text": "[33] Jaewoo Lee and Daniel Kifer. Scaling up differentially private deep learning with fast perexample gradient clipping. arXiv preprint arXiv:2009.03106, 2020. ",
1303
+ "bbox": [
1304
+ 173,
1305
+ 369,
1306
+ 823,
1307
+ 400
1308
+ ],
1309
+ "page_idx": 11
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": "[34] Anselm Levskaya and Matthew James Johnson. Asynchronous dispatch. https:// jax.readthedocs.io/en/latest/async_dispatch.html, 2019. URL https://jax. readthedocs.io/en/latest/async_dispatch.html. ",
1314
+ "bbox": [
1315
+ 173,
1316
+ 410,
1317
+ 828,
1318
+ 453
1319
+ ],
1320
+ "page_idx": 11
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "[35] Zachary C. Lipton. Gradients of non-scalars (higher rank jacobians). https://github. com/tensorflow/tensorflow/issues/675, January 2016. URL https://github.com/ tensorflow/tensorflow/issues/675. ",
1325
+ "bbox": [
1326
+ 173,
1327
+ 463,
1328
+ 825,
1329
+ 506
1330
+ ],
1331
+ "page_idx": 11
1332
+ },
1333
+ {
1334
+ "type": "text",
1335
+ "text": "[36] Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. License: No explicit license, but explicitly is made available for research. ",
1336
+ "bbox": [
1337
+ 173,
1338
+ 517,
1339
+ 826,
1340
+ 601
1341
+ ],
1342
+ "page_idx": 11
1343
+ },
1344
+ {
1345
+ "type": "text",
1346
+ "text": "[37] Nicolas Papernot, Andrew Galen, and Steven Chien. Tensorflow privacy. https://github. com/tensorflow/privacy, December 2018. URL https://github.com/tensorflow/ privacy. License: Apache 2.0 License. ",
1347
+ "bbox": [
1348
+ 173,
1349
+ 612,
1350
+ 825,
1351
+ 655
1352
+ ],
1353
+ "page_idx": 11
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "[38] Nicolas Papernot, Abhradeep Thakurta, Shuang Song, Steve Chien, and Úlfar Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. arXiv preprint arXiv:2007.14191, 2020. ",
1358
+ "bbox": [
1359
+ 173,
1360
+ 666,
1361
+ 825,
1362
+ 709
1363
+ ],
1364
+ "page_idx": 11
1365
+ },
1366
+ {
1367
+ "type": "text",
1368
+ "text": "[39] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf. License: BSD. ",
1369
+ "bbox": [
1370
+ 174,
1371
+ 720,
1372
+ 826,
1373
+ 832
1374
+ ],
1375
+ "page_idx": 11
1376
+ },
1377
+ {
1378
+ "type": "text",
1379
+ "text": "[40] Louis B Rall. Automatic Differentiation: Techniques and Applications, volume 120 of Lecture Notes in Computer Science. Springer, 1981. ",
1380
+ "bbox": [
1381
+ 169,
1382
+ 843,
1383
+ 825,
1384
+ 872
1385
+ ],
1386
+ "page_idx": 11
1387
+ },
1388
+ {
1389
+ "type": "text",
1390
+ "text": "[41] Gaspar Rochette, Andre Manoel, and Eric W Tramel. Efficient per-example gradient computations in convolutional neural networks. arXiv preprint arXiv:1912.06015, 2019. ",
1391
+ "bbox": [
1392
+ 173,
1393
+ 882,
1394
+ 821,
1395
+ 911
1396
+ ],
1397
+ "page_idx": 11
1398
+ },
1399
+ {
1400
+ "type": "text",
1401
+ "text": "[42] seerdecker. Provide unaggregated gradients tensors. https://github.com/tensorflow/ tensorflow/issues/4897, October 2016. URL https://github.com/tensorflow/ tensorflow/issues/4897. ",
1402
+ "bbox": [
1403
+ 171,
1404
+ 92,
1405
+ 825,
1406
+ 133
1407
+ ],
1408
+ "page_idx": 12
1409
+ },
1410
+ {
1411
+ "type": "text",
1412
+ "text": "[43] Shuang Song, Kamalika Chaudhuri, and Anand D Sarwate. Stochastic gradient descent with differentially private updates. In Proceedings of the 2013 IEEE Global Conference on Signal and Information Processing, GlobalSIP ’13, pages 245–248, Washington, DC, USA, 2013. IEEE Computer Society. ",
1413
+ "bbox": [
1414
+ 173,
1415
+ 142,
1416
+ 826,
1417
+ 199
1418
+ ],
1419
+ "page_idx": 12
1420
+ },
1421
+ {
1422
+ "type": "text",
1423
+ "text": "[44] Kunal Talwar. Personal communication, July 2020. ",
1424
+ "bbox": [
1425
+ 173,
1426
+ 207,
1427
+ 547,
1428
+ 223
1429
+ ],
1430
+ "page_idx": 12
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "[45] Aleena Thomas, David Adelani, Ali Davody, Aditya Mogadala, and Dietrich Klakow. Investigating the impact of pre-trained word embeddings on memorization in neural networks. In Proceedings of the 23rd International Conference on Text, Speech and Dialogue, TSD $^ { , } 2 0$ , 2020. ",
1435
+ "bbox": [
1436
+ 174,
1437
+ 231,
1438
+ 826,
1439
+ 286
1440
+ ],
1441
+ "page_idx": 12
1442
+ },
1443
+ {
1444
+ "type": "text",
1445
+ "text": "[46] Nicholas Vadivelu. Xla compilation does not work with embeddings layer. https: //github.com/tensorflow/tensorflow/issues/43687, October 2020. URL https: //github.com/tensorflow/tensorflow/issues/43687. ",
1446
+ "bbox": [
1447
+ 174,
1448
+ 296,
1449
+ 826,
1450
+ 338
1451
+ ],
1452
+ "page_idx": 12
1453
+ },
1454
+ {
1455
+ "type": "text",
1456
+ "text": "[47] Nicholas Vadivelu. Xla compilation bug. https://github.com/tensorflow/tensorflow/ issues/43723, October 2020. URL https://github.com/tensorflow/tensorflow/ issues/43723. ",
1457
+ "bbox": [
1458
+ 173,
1459
+ 348,
1460
+ 826,
1461
+ 390
1462
+ ],
1463
+ "page_idx": 12
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "[48] Chris Waites. Pyvacy. https://github.com/ChrisWaites/pyvacy/network, March 2019. URL https://github.com/ChrisWaites/pyvacy. License: Apache 2.0 License. ",
1468
+ "bbox": [
1469
+ 171,
1470
+ 398,
1471
+ 825,
1472
+ 429
1473
+ ],
1474
+ "page_idx": 12
1475
+ },
1476
+ {
1477
+ "type": "text",
1478
+ "text": "[49] Chris Waites and Rachel Cummings. Differentially private normalizing flows for privacypreserving density estimation. ICML Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models, 2020. ",
1479
+ "bbox": [
1480
+ 171,
1481
+ 436,
1482
+ 825,
1483
+ 479
1484
+ ],
1485
+ "page_idx": 12
1486
+ },
1487
+ {
1488
+ "type": "text",
1489
+ "text": "[50] Richard Wei, Dan Zheng, Marc Rasi, and Bart Chrzaszcz. Differentiable programming manifesto. URL https://github.com/apple/swift/blob/main/docs/ DifferentiableProgramming.md. ",
1490
+ "bbox": [
1491
+ 173,
1492
+ 488,
1493
+ 826,
1494
+ 531
1495
+ ],
1496
+ "page_idx": 12
1497
+ },
1498
+ {
1499
+ "type": "text",
1500
+ "text": "[51] Ashkan Yousefpour, Igor Shilov, Alexandre Sablayrolles, Davide Testuggine, Karthik Prasad, Mani Malek, John Nguyen, Sayan Gosh, Akash Bharadwaj, Jessica Zhao, Graham Cormode, and Ilya Mironov. Opacus: User-friendly differential privacy library in PyTorch. arXiv preprint arXiv:2109.12298, 2021. ",
1501
+ "bbox": [
1502
+ 174,
1503
+ 540,
1504
+ 826,
1505
+ 595
1506
+ ],
1507
+ "page_idx": 12
1508
+ },
1509
+ {
1510
+ "type": "text",
1511
+ "text": "[52] Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In Proceedings of the 32nd International Conference on Machine Learning, ICML ’15, pages 1–9. JMLR, Inc., 2015. ",
1512
+ "bbox": [
1513
+ 176,
1514
+ 604,
1515
+ 825,
1516
+ 648
1517
+ ],
1518
+ "page_idx": 12
1519
+ }
1520
+ ]
parse/train/hw2VfWAr6t6/hw2VfWAr6t6_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/hw2VfWAr6t6/hw2VfWAr6t6_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/jnRqf0CzBK/jnRqf0CzBK.md ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HIERARCHICAL PROBABILISTIC MODEL FOR BLIND SOURCE SEPARATION VIA LEGENDRE TRANSFORMATION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We present a novel blind source separation (BSS) method, called information geometric blind source separation (IGBSS). Our formulation is based on the loglinear model equipped with a hierarchically structured sample space, which has theoretical guarantees to uniquely recover a set of source signals by minimizing the KL divergence from a set of mixed signals. Source signals, received signals, and mixing matrices are realized as different layers in our hierarchical sample space. Our empirical results have demonstrated on images and time series data that our approach is superior to well established techniques and is able to separate signals with complex interactions.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ The objective of blind source separation (BSS) is to identify a set of source signals from a set of multivariate mixed signals1. BSS is widely used for applications which are considered to be the “cocktail party problem”. Examples include image/signal processing (Isomura & Toyoizumi, 2016), artifact removal in medical imaging (Vigario et al., 1998), and electroencephalogram (EEG) signal ´ separation (Congedo et al., 2008). Currently, there are a number of solutions for the BSS problem. The most widely used approaches are variations of principal component analysis (PCA) (Pearson, 1901; Murphy, 2012) and independent component analysis (ICA) (Comon, 1994; Murphy, 2012). However, they all have limitations with their approaches.
12
+
13
+ PCA and its modern variations such as sparse PCA (SPCA) (Zou et al., 2006), non-linear PCA (NLPCA) (Scholz et al., 2005), and Robust PCA $\mathrm { { X u } }$ et al., 2010) extract a specified number of components with the largest variance under an orthogonal constraint, which are composed of a linear combination of variables. They create a set of uncorrelated orthogonal basis vectors that represent the source signal. The basis vectors with the $N$ largest variance are called the principal components and is the output of the model. PCA has shown to be effective for many applications such as dimensionality reduction and feature extraction. However, for BSS, PCA makes the assumption that the source signals are orthogonal, which is often not the case in most practical applications.
14
+
15
+ Similarly, ICA also attempts to find the $N$ components with the largest variance, but relaxes the orthogonality constraint. All variations of ICA such as infomax (Bell & Sejnowski, 1995), FastICA (Hyvarinen & Oja, 2000) and JADE (Cardoso, 1999) separate a multivariate signal into addi- ¨ tive subcomponents by maximizing statistical independence of each component. ICA assumes that each component is non-gaussian and the relationship between the source signal and the mixed signal is an affine transformation. In addition to these assumptions, ICA is sensitive to the initialization of the weights as the optimization is non-convex and is likely to converge to a local optimum.
16
+
17
+ Other potential methods which can perform BSS include non-negative matrix factorization (NMF) (Lee & Seung, 2001; Berne et al., 2007), dictionary learning (DL) (Olshausen & Field, 1997), and reconstruction ICA (RICA) (Le et al., 2011). NMF, DL and RICA are degenerate approaches to recover the source signal from the mixed signal. These approaches are more typically used for feature extraction. NMF factorizes a matrix into two matrices with nonnegative elements representing weights and features. The features extracted by NMF can be used to recover the source signal. More recently there are more advanced techniques that uses Short-time Fourier transform (STFT) to transform the signal into the frequency domain to construct a spectrogram before applying NMF (Sawada et al., 2019). However, NMF does not maximize statistical independence which is required to completely separate the mixed signal into the source signal, and it is also sensitive to initialization as the optimization is non-convex. Due to the non-convexity, additional constraints or heuristics for weight initialization is often applied to NMF to achieve better results (Ding et al., 2008; Boutsidis & Gallopoulos, 2008). DL can be thought of as a variation of the ICA approaches which requires an over-complete basis vector for the mixing matrix. DL may be advantageous because additional constraints such as a positive code or a dictionary can be applied to the model. However, since it requires an over-complete basis vector, information may be lost when reconstructing the source signal. In addition, like all the other approaches, DL is also non-convex and it is sensitive to the initialization of the weights.
18
+
19
+ All previous approaches have limitations such as loss of information or non-convex optimization and require constraints or assumptions such as orthogonality or an affine transformation which are not ideal for BSS. In the following, we introduce our approach to BSS, called IGBSS (Information Geometric BSS), using the log-linear model (Agresti, 2012), which can introduce relationships between possible states into its sample space (Sugiyama et al., 2017). Unlike the previous approaches, our proposed approach does not have the assumptions or limitations that they require. We provide a flexible solution by introducing a hierarchical structure between signals into our model, which allows us to treat interactions between signals that are more complex than an affine transformation. Unlike other existing methods, our approach does not require the inversion of the mixing matrix and is able to recover the sign of the signal. Thanks to the well-developed information geometric analysis of the log-linear model (Amari, 2001), optimization of our method is achieved via convex optimization, hence it always arrives at the globally optimal unique solution. Moreover, we theoretically show that it always minimizes the Kullback–Leibler (KL) divergence from a set of mixed signals to a set of source signals. Our experimental results demonstrate that our hierarchical model leads to better separation of signals including complex interaction such as higher-order feature interactions (Luo & Sugiyama, 2019) than existing methods.
20
+
21
+ # 2 FORMULATION
22
+
23
+ BSS is formulated as a function $f$ that separates a set of received signals $X$ into a set of source signals $Z$ , i.e., $Z = f ( X )$ . For example, if one employs ICA based formulation, the BSS problem reduces to ${ \bf X } = { \bf A } { \bf Z }$ , where the received signal $\mathbf { X } \in \mathbf { \mathbb { R } } ^ { L \times M }$ with $L$ signals with the sample size $M$ is affine transformation of the source signal $\mathbf { Z } \in \mathbb { R } ^ { N \times M }$ with $N$ signals and a mixing matrix $\mathbf { A } \in \mathbb { R } ^ { L \times N }$ . The objective is to estimate $\mathbf { Z }$ by learning A given $\mathbf { X }$ . Our idea is to use the log-linear model (Agresti, 2012), which is a well-known energy-based model, to take non-affine transformation into account and formulate BSS as a convex optimization problem.
24
+
25
+ # 2.1 LOG-LINEAR MODEL ON PARTIALLY ORDERED SET
26
+
27
+ We use the log-linear model given in the form of
28
+
29
+ $$
30
+ \log p ( \omega ) = \sum _ { s \in \mathcal { S } } \mathbf { 1 } _ { s \preceq \omega } \theta _ { s } - \psi ( \theta ) ,
31
+ $$
32
+
33
+ where $p ( \omega ) \in ( 0 , 1 )$ is probability of each state $\omega \in \Omega$ and ${ \mathcal { S } } \subseteq \Omega$ is a parameter space such that a parameter value $\theta _ { s } \in \mathbb { R }$ is associated with each $s \in S$ , and $\psi ( \theta )$ is the partition function so that $\begin{array} { r } { \sum _ { \omega \in \Omega } p ( \omega ) = 1 } \end{array}$ . In this formulation, we assume that the set $\Omega$ of possible states, equivalent to the sample space in the statistical sense, is a partially ordered set (poset); that is, it is equipped with a partial order $\stackrel { \left. } { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b \ b { \ b { \ b { \ b \ b { \ b { \ b \ b { \ b { \ b \ b { \ b } } } } } } } } } } } } } } } } } } } } } \preceq \stackrel { \right. } { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b \ b { \ b { \ b } } } } } } } } } } } } } } $ (Gierz et al., 2003) and $\mathbf { 1 } _ { s \preceq \omega } = 1$ if $s \preceq \omega$ and 0 otherwise. This formulation is firstly introduced by Sugiyama et al. (2016) and used to model the matrix balancing problem (Sugiyama et al., 2017), which includes Boltzmann machines as a special case (Luo $\&$ Sugiyama, 2019). If we index $\Omega$ as $\boldsymbol { \Omega } = \{ \omega _ { 1 } , \omega _ { 2 } , \ldots , \omega _ { | \Omega | } \}$ , we obtain the following matrix form:
34
+
35
+ $$
36
+ \log p = \mathbf { F } \pmb { \theta } - \pmb { \psi } ( \theta ) ,
37
+ $$
38
+
39
+ where $\pmb { p } \in ( 0 , 1 ) ^ { | \Omega | }$ with $p _ { i } = p ( \omega _ { i } )$ , $\pmb { \theta } \in \mathbb { R } ^ { | \Omega | }$ such that $\theta _ { i } = \theta _ { \omega _ { i } }$ if $\omega _ { i } \in \mathcal { S }$ and $\theta _ { i } = 0$ otherwise, $\mathbf { F } = ( f _ { i j } ) \in \{ 0 , 1 \} ^ { | \Omega | \times | \Omega | }$ with $f _ { i j } = \mathbf { 1 } _ { \omega _ { j } \preceq \omega _ { i } }$ , and $\boldsymbol { \psi } ( \boldsymbol { \theta } ) = ( \boldsymbol { \psi } ( \boldsymbol { \theta } ) , \ldots , \boldsymbol { \psi } ( \boldsymbol { \theta } ) ) \in \mathbb { R } ^ { | \Omega | }$ . Each vector is treated as a column vector, and log is entry-wise operation. This matrix form is often used as a general form of the log-linear model (Coull & Agresti, 2003) and $\mathbf { F }$ is called a model matrix, which represents relationship between states. The assumption to the log-linear model is that $\mathbf { F }$ is needed to be non-singular, and Sugiyama et al. (2017) showed that Equation (1) with a poset $\Omega$ always provides a non-singular model matrix; that is, $\mathbf { F }$ is regular as long as each entry is given as $f _ { i j } = \mathbf { 1 } _ { \omega _ { j } \preceq \omega _ { i } }$ . This property is powerful in mathematical modeling as we can introduce any partial order structure into $\Omega$ , which we will use to introduce our hierarchical structure in tne next subsection to solve BSS.
40
+
41
+ # 2.2 LAYER CONFIGURATION FOR BLIND SOURCE SEPARATION
42
+
43
+ Our key idea is to introduce a hierarchical layered structure into the sample space $\Omega$ of the log-linear model to achieve BSS. We call this model information geometric BSS (IGBSS) as its optimality is supported by the tight connection between the log-linear model and information geometric property of the space of distributions (statistical manifold), which will be shown in the next subsection. We implement three layers of BSS, the mixing layer, the source layer, and the received layer, into $\Omega$ as partial orders and learn the joint representation on it using the log-linear model. The received layer and the source layer represent the input received signal and the output source signal of BSS, respectively, and the mixing layer encodes information of how to mix the source signal. In the following, we consistently assume that $L$ is the number of received signals, $M$ is the sample size, and $N$ is the number of source signals.
44
+
45
+ Let us construct three layers in the sample space $\Omega$ as $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \dot { \mathcal { X } }$ with $\mathcal { A } = \{ a _ { 1 1 } , \ldots , a _ { L N } \}$ , $\mathcal { Z } = \{ z _ { 1 1 } , \ldots , z _ { N M } \}$ , and $\mathcal { X } = \{ x _ { 1 1 } , . . . , x _ { L M } \}$ . The element $\perp$ denotes the least element, and it acts as a partition function and $\theta _ { \perp } ~ = ~ - \psi ( \theta )$ always holds. We use 2D indexing of elements in each layer to make the correspondence between our formulation and ICA based formulation clear; that is, these three layers $A , { \mathcal { Z } }$ , and $\mathcal { X }$ are analogue to a mixing matrix $\mathbf { \bar { A } } \in \mathbb { R } ^ { L \times N }$ , a source matrix $\mathbf { Z } \in \mathbb { R } ^ { N \times M }$ , and a received matrix $\mathbf { X } \in \mathbb { R } ^ { L \times M }$ , respectively2. We will also use symbols $\omega$ and $s$ to denote elements of $\Omega$ , i.e., they can be $\perp$ , $a _ { l n }$ , $z _ { n m }$ , and $x _ { l m }$ . It is always assumed that the parameter space of the loglinear model $\mathcal { S } = \mathcal { A } \cup \mathcal { Z } \subset \Omega$ , meaning that mixing and source layers are used as parameters to represent distributions in our model. Here we introduce a partial order $\preceq$ between layers. Define
46
+
47
+ ![](images/1943cbf853f5732bdd21b06544f2c4204a93f389ee82231f30fc423844abc8c9.jpg)
48
+ Figure 1: An example of our sample space. Dashed lines show removed partial orders to allow for learning.
49
+
50
+ $$
51
+ \begin{array} { r } { \left\{ \begin{array} { l l } { a _ { i j } \preceq z _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { i f ~ } j = i ^ { \prime } , } \\ { a _ { i j } \diamond { \not \perp } z _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { o t h e r w i s e } , } \end{array} \right. \quad \left\{ \begin{array} { l l } { z _ { i j } \preceq x _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { i f ~ } j = j ^ { \prime } , } \\ { z _ { i j } \diamond { \not \perp } x _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
52
+ $$
53
+
54
+ for each element in three layers $A , { \mathcal { Z } }$ , and $\mathcal { X }$ , and we do not any ordering among elements in the same layer. Since it is a partial order, transitivity always holds, for example, $a _ { 1 1 } \preceq x _ { 2 2 }$ as $a _ { 1 1 } \preceq z _ { 1 2 }$ and $z _ { 1 2 } \preceq x _ { 2 2 }$ . The first condition encodes the structure such that the source layer is higher than the mixing layer, and the second condition encodes that the received layer is higher than the source layer. An example of our sample space with $L = M = N = 2$ is illustrated in Figure 1.
55
+
56
+ The joint distribution for BSS is described by the log-linear model in Equation (1) over the sample space $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \mathcal { X }$ equipped with the partial order defined in Equation (2). If we learn the joint distribution from a received signal $\mathbf { X }$ , we will obtain probabilities on the source layer $p ( z _ { 1 1 } ) , \allowbreak . . . , p ( z _ { N M } )$ , which represents normalized source signals. The rational of our approach is given as follows: The connections between each layer is structured so that the log-linear model performs a similar computation with the ICA based approach ${ \bf X } = { \bf A } { \bf Z }$ . Our structure ensures that each $p ( x _ { l m } )$ is determined by $( \theta _ { a _ { l n } } ) _ { n \in [ N ] }$ and $( \theta _ { z _ { m n } } ) _ { n \in [ N ] }$ with $[ N ] = \{ 1 , \dots , N \}$ , as we always have $a _ { l n } \preceq x _ { l m }$ and $z _ { n m } \preceq x _ { l m }$ . Moreover, this formulation allows us to model more complex interaction than affine transformation, such as higher-order interactions, between signals if we additionally include partial order structure into $\mathcal { Z }$ and/or $\mathcal { A }$ , which cannot be treated by a simple matrix multiplication.
57
+
58
+ # 2.3 OPTIMIZATION
59
+
60
+ We train the log-linear model by minimizing the KL divergence from an empirical distribution $\hat { p }$ , which is identical to the normalized received signal $\mathbf { X } \in \breve { \mathbb { R } } ^ { L \times M }$ , to the model joint distribution $p$ given by Equation (1) or, equivalently, maximizing the likelihood. More precisely, we normalize a given $\mathbf { X }$ by dividing each entry by the sum of all entries; that is, an empirical distribution $\hat { p }$ is obtained as $\hat { p } ( x _ { l m } ) \bar { = } ~ x _ { l m } / \bar { \sum _ { l , m } } { x _ { l m } }$ . If $\mathbf { X }$ contains negative values, an exponential kernel $\exp { ( { x } _ { l m } ) / { \sum } _ { l , m } } \exp { ( { x } _ { l m } ) }$ or min-max normalization $( x _ { l m } + \epsilon - \mathrm { m i n } ( \mathbf X ) ) / ( \mathrm { m a x } ( \mathbf X ) + \epsilon - \mathrm { m i n } ( \mathbf X ) )$ can be used, where $\epsilon$ is some arbitrary small value to avoid zero probability. We also assume that $\hat { p } ( a _ { l n } ) = 0$ and $\hat { p } ( z _ { n m } ) = 0$ for all $a _ { l n } \in \mathcal { A }$ and $z _ { n m } \in \mathcal { Z }$ . The objective function is given as
61
+
62
+ $$
63
+ \underset { p \in \mathfrak { P } _ { \theta } } { \arg \operatorname* { m i n } } \mathrm { D } _ { \mathrm { K L } } \left( \hat { p } \| p \right) = \underset { p \in \mathfrak { P } _ { \theta } } { \arg \operatorname* { m i n } } \sum _ { \omega \in \Omega } \hat { p } ( \omega ) \log \frac { \hat { p } ( \omega ) } { p ( \omega ) } ,
64
+ $$
65
+
66
+ where ${ \mathfrak { P } } _ { \theta }$ is the set of distributions that can be represented by Equation (1) with our structured sample space $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \mathcal { X }$ and $S = A \cup \mathcal { Z }$ .
67
+
68
+ The remarkable property of our model is that this optimization problem is convex and it is guaranteed that gradient-based methods can always arrive at the globally optimal unique solution. To show this, we analyze the geometric structure of the statistical manifold, the set of probability distributions, generated by the log-linear model. Let $\Omega ^ { + } = \Omega \backslash \{ \bot \}$ . First we introduce another parameterization $\bar { ( \eta _ { \omega } ) } _ { \omega \in \Omega ^ { + } }$ of the log-linear model, which is defined as
69
+
70
+ $$
71
+ \eta _ { \omega } = \sum _ { s \in \Omega } \mathbf { 1 } _ { \omega \preceq s } p ( s ) .
72
+ $$
73
+
74
+ Note that $\eta _ { \perp } = 1$ always holds and we do not include it into parameters. In addition, for theoretical consistency we change the parameter space used in Equation (1) from $s$ to $\Omega ^ { + }$ and assume that $\theta _ { \omega } ~ = ~ 0$ if $\omega ~ \notin ~ { \mathcal { S } }$ . Again we do not include $\theta _ { \perp }$ as a parameter as it is the partition function. Two parameters $( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ and $( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ have clear statistical interpretation as it is widely known that any log-linear model belongs to the exponential family, where $\theta$ and $\eta$ correspond to natural and expectation parameters, respectively. $\theta$ and $\eta$ are connected via a Legendre transformation which means that they are both differentiable and have a one-to-one correspondence. To simplify the notation, we denote by $\hat { \theta }$ and $\hat { \eta }$ the corresponding $\theta$ and $\eta$ of the empirical distribution $\hat { p }$ . Let $\mathfrak { P } = \{ p \ | \ 0 < p ( \omega ) \ < \ 1$ for all $\omega \in \Omega \}$ be the set of all probability distributions. This set forms a statistical manifold with dually flat structure, which is the canonical geometric structure in information geometry (Amari, 2016), with its dual coordinate system $( ( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } } , ( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } } )$ ; that is, both of $( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ and $( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ work as coordinate systems and determine a distribution in $\mathfrak { P }$ . The Riemannian metric with respect to $\theta$ is given as
75
+
76
+ $$
77
+ g _ { s s ^ { \prime } } = \frac { \partial \eta _ { s } } { \partial \theta _ { s ^ { \prime } } } = \mathbb { E } \left[ \frac { \partial \log p ( \boldsymbol { \omega } ) } { \partial \theta _ { s } } \frac { \partial \log p ( \boldsymbol { \omega } ) } { \partial \theta _ { s ^ { \prime } } } \right] = \sum _ { \boldsymbol { \omega } \in \Omega } \mathbf { 1 } _ { s \preceq \boldsymbol { \omega } } \mathbf { 1 } _ { s ^ { \prime } \preceq \boldsymbol { \omega } } p ( \boldsymbol { \omega } ) - \eta _ { s } \eta _ { s ^ { \prime } } ,
78
+ $$
79
+
80
+ which coincides with the Fisher information (Sugiyama et al., 2017, Theorem 3) and we will use it for natural gradient.
81
+
82
+ Now we consider two submanifolds $\mathfrak { P } _ { \theta } , \mathfrak { P } _ { \eta } \subseteq \mathfrak { P }$ , which we define as
83
+
84
+ $$
85
+ \begin{array} { r l r } & { \mathfrak { P } _ { \theta } = \left\{ p \in \mathfrak { P } \mid \theta _ { \omega } = 0 , \forall \omega \in \mathcal { E } \right\} , \qquad } & { \mathcal { E } = \Omega ^ { + } \backslash \mathcal { S } , } \\ & { \mathfrak { P } _ { \eta } = \left\{ p \in \mathfrak { P } \mid \eta _ { \omega } = \hat { \eta } _ { \omega } , \forall \omega \in \mathcal { M } \right\} , \qquad } & { \mathcal { M } = \mathcal { S } . } \end{array}
86
+ $$
87
+
88
+ Note that this ${ \mathfrak { P } } _ { \theta }$ coincides with that in Equation (3). The submanifold ${ \mathfrak { P } } _ { \theta }$ is called an $e$ -flat submanifold and $\mathfrak { P } _ { \eta }$ an $m$ -flat submanifold in information geometry. The highlight of considering these two types of submanifolds is that, if $\mathcal { E } \cap \mathcal { M } = \emptyset$ and $\bar { \mathcal { E } } \cup \mathcal { M } \overset { \cdot } { = } \Omega ^ { + }$ , it is theoretically guaranteed that the intersection $\mathfrak { P } _ { \theta } \cap \mathfrak { P } _ { \eta }$ is always a singleton and it is the optimizer of Equation (3) (Amari, 2009, Theorem 3), that is, it is the globally optimal solution of our model.
89
+
90
+ Optimization is achieved by $e$ -projection, which seeks $\mathfrak { P } _ { \theta } \cap \mathfrak { P } _ { \eta }$ in the $e$ -flat submanifold ${ \mathfrak { P } } _ { \theta }$ . The $e$ -projection is always convex optimization as ${ \mathfrak { P } } _ { \theta }$ is convex with respect to $\theta$ ; this is because $\theta$ is
91
+
92
+ # Algorithm 1 Information Geometric BSS
93
+
94
+ 1: Function $\mathrm { I G B S S } ( \mathbf { X } , S )$ :
95
+ 2: Compute $\hat { p }$ from $\mathbf { X }$
96
+ 3: Compute $\hat { \pmb { \eta } } = ( \hat { \eta } _ { s } ) _ { s \in \mathcal { S } }$ from $\hat { p }$
97
+ 4: Initialize $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$ (randomly or $\theta _ { s } = 0$ )
98
+ 5: repeat
99
+ 6: Compute $p$ using the current parameter $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$
100
+ 7: Compute $( \eta _ { s } ) _ { s \in { \mathcal { S } } }$ from $p$
101
+ 8: $( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } ( \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } - ( \hat { \eta } _ { \omega } ) _ { \omega \in \mathcal { Z } }$
102
+ 9: $( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } } ( \eta _ { \omega } ) _ { \omega \in \mathcal { A } } - ( \hat { \eta } _ { \omega } ) _ { \omega \in \mathcal { A } }$
103
+ 10: Compute the Fisher information matrix for source layer $\mathbf { G } _ { Z }$ and the mixing layer $\mathbf { G } _ { A }$
104
+ 11: $( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } ^ { \bullet } ( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } - \mathbf { G } _ { Z } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } }$
105
+ 12: $( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } \gets ( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } - \mathbf { G } _ { A } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } }$
106
+ 13: until convergence of $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$
107
+ 14: End Function
108
+
109
+ a coordinate system of ${ \mathfrak { P } } _ { \theta }$ that is linearly constrained on $\theta$ . We can therefore use the standard gradient descent strategy to optimize the log-linear model. The derivative of the KL divergence with respect to $\theta _ { s }$ is known to be the difference between expectation parameters $\eta$ (Sugiyama et al., 2017, Theorem 2): $( \partial / \partial \theta _ { s } ) D _ { \mathrm { K L } } ( \hat { p } \parallel p ) = \eta _ { s } - \hat { \eta } _ { s }$ , and the KL divergence $D _ { \mathrm { K L } } ( \hat { p } \Vert p )$ is minimized if and only if $\eta _ { s } = \hat { \eta } _ { s }$ for all $s \in S$ .
110
+
111
+ From our definition of $\Omega$ in Equation (2), we have $\eta _ { z _ { k l } } = \eta _ { z _ { k ^ { \prime } l } }$ for all $z _ { k l } , z _ { k ^ { \prime } l } \in \mathcal { Z }$ . Therefore all elements in the source layer will learn the same value. This problem can be avoided by removing some of partial orders between source and received layers. We propose to systematically remove the partial order $z _ { i j } \preceq x _ { i ^ { \prime } j ^ { \prime } }$ if $i = i ^ { \prime }$ to ensure $\eta _ { z _ { k l } } \neq \eta _ { z _ { k ^ { \prime } l } }$ (see Figure 1), while other strategies are possible as long as $\eta _ { z _ { k l } } \neq \eta _ { z _ { k ^ { \prime } l } }$ is satisfied, for example, random deletion of such orders.
112
+
113
+ Using the above results, gradient descent can be directly applied to achieve Equation (3). However, this may need a large number of iterations to reach convergence. To reduce the number of iterations, we propose to use natural gradient (Amari, 1998), which is a second-order optimization approach and will also always find the global optimum. Let us re-index $S = A \cup \mathcal { Z }$ as $\boldsymbol { S } = \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { | \boldsymbol { S } | } \}$ and assume that $\pmb { \theta } = [ \theta _ { s _ { 1 } } , \ldots , \theta _ { s _ { | \pmb { S } | } } ] ^ { \mathrm { T } }$ and $\pmb { \eta } = [ \eta _ { s _ { 1 } } , \dots , \eta _ { s _ { | S | } } ] ^ { \mathrm { T } }$ . In each step of natural gradient, the current $\pmb \theta$ is updated to $\theta _ { \mathrm { n e x t } }$ by the following formula:
114
+
115
+ $$
116
+ \pmb { \theta } _ { \mathrm { n e x t } } = \pmb { \theta } - \mathbf { G } ^ { - 1 } ( \pmb { \eta } - \hat { \pmb { \eta } } )
117
+ $$
118
+
119
+ where $\mathbf { G } = ( g _ { i j } ) \in \mathbb { R } ^ { | S | \times | S | }$ is the Fisher information matrix such that each $g _ { i j }$ is given as $g _ { s _ { i } s _ { j } }$ in Equation (5).
120
+
121
+ Although the natural gradient requires much less iterations compared to the gradient descent, matrix inversion $\mathbf { G } ^ { - 1 }$ is computationally expensive as it has the complexity of $\mathcal { O } ( | \boldsymbol { S } | ^ { 3 } )$ . In addition, FIM values are often too small and optimization becomes numerically unstable. To solve these problems, we separate the update steps in the source layer and the mixing layer:
122
+
123
+ $$
124
+ \begin{array} { r } { ( \theta _ { \omega , \mathrm { n e x t } } ) _ { \omega \in \mathcal { Z } } = ( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } - \mathbf { G } _ { Z } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } , } \\ { ( \theta _ { \omega , \mathrm { n e x t } } ) _ { \omega \in \mathcal { A } } = ( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } - \mathbf { G } _ { A } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } } , } \end{array}
125
+ $$
126
+
127
+ where $\mathbf { G } _ { Z }$ and $\mathbf { G } _ { A }$ are the Fisher information matrices for source and mixing layers, respectively. Note that this also leads to the same global optimum. They are constructed by assuming all the other parameters are fixed. This approach reduces the time complexity to $O ( | \mathcal { Z } | ^ { 3 } + | \mathcal { A } | ^ { 3 } )$ . The full algorithm using natural gradient is given in Algorithm 1. Computation of $p$ from $\theta$ and $\eta$ from $p$ can be achieved using Equations (1) and (4). We also give more explicit description of $p$ and $\eta$ for each layer in Appendix. The time complexity to compute $p$ in Algorithm 1 Line 6 is $\mathcal { O } ( | \Omega | | S | )$ . The complexity to compute $\Delta \eta$ in Algorithm 1 Line 8 and Line 9 is $\mathcal { O } ( \vert \mathcal { Z } \vert ) + \mathcal { O } ( \vert A \vert ) = \mathcal { O } ( \vert S \vert )$ . Therefore the total complexity of each iteration is $\mathcal { O } ( \vert \mathcal { Z } \vert ^ { 3 } + \vert \mathcal { A } \vert ^ { 3 } + \vert \Omega \vert \vert \boldsymbol { S } \vert )$ .
128
+
129
+ ![](images/91e48d8152c8fa29ca6b29f3971e9e180c5a615ec8441d01ef6589ef0a13a269.jpg)
130
+ Figure 2: First-order interaction experiment.
131
+
132
+ ![](images/761043c60863db54e09b9282b4e925075d329973de664f940bea92eef1637107.jpg)
133
+ Figure 3: Third-order interaction experiment.
134
+
135
+ Table 1: Signal-to-Noise Ratio of reconstructed signal. $( \ast )$ Results for Figure 2. (†) Results for Figure 3. Scores are means $\pm$ standard deviation after 40 runs. We have applied different weight initialization after each run.
136
+
137
+ <table><tr><td rowspan="2">Exp.</td><td rowspan="2">Order</td><td colspan="4">Root Mean Squared Error (RMSE)</td><td colspan="4">Signal-to-noise ratio (SNR)(units in dB)</td></tr><tr><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td></tr><tr><td rowspan="3">1</td><td>First*</td><td>0.252 ±0.000</td><td>0.300± 0.089</td><td>0.394 ± 0.041</td><td>0.622 ± 0.000</td><td>12.588 ± 0.000</td><td>11.688 ± 4.829</td><td>6.810± 0.008</td><td>1.704 ± 0.000</td></tr><tr><td>Second</td><td>0.260 ±0.000</td><td>0.285 ± 0.096</td><td>0.441 ± 0.080</td><td>0.662 ± 0.000</td><td>10.729 ± 0.000</td><td>12.353±4.255</td><td>0.526 ± 0.448</td><td>-3.426 ±0.000</td></tr><tr><td>Thirdt</td><td>0.252 ±0.000</td><td>0.260 ± 0.111</td><td>0.362 ± 0.030</td><td>0.612 ±0.000</td><td>12.588 ± 0.000</td><td>12.922 ± 5.590</td><td>1.471 ± 0.358</td><td>0.039 ±0.000</td></tr><tr><td rowspan="3">2</td><td>First</td><td>0.133± 0.000</td><td>0.284± 0.064</td><td>0.474 ± 0.067</td><td>0.591± 0.000</td><td>14.215±0.000</td><td>11.218 ± 1.964</td><td>2.098 ± 2.140</td><td>-0.940± 0.000</td></tr><tr><td>Second</td><td>0.256 ±0.000</td><td>0.263 ± 0.066</td><td>0.576± 0.008</td><td>0.684± 0.000</td><td>10.612 ±0.000</td><td>11.986 ± 2.157</td><td>-1.589 ± 0.269</td><td>-3.675 ± 0.000</td></tr><tr><td>Third</td><td>0.282 ± 0.000</td><td>0.239 ± 0.056</td><td>0.593 ± 0.007</td><td>0.665± 0.000</td><td>9.346 ± 0.000</td><td>11.475 ± 2.145</td><td>-2.274 ± 0.227</td><td>-4.073 ± 0.000</td></tr><tr><td rowspan="3">3</td><td>First</td><td>0.155 ± 0.000</td><td>0.699 ± 0.047</td><td>0.478 ± 0.121</td><td>0.628 ± 0.000</td><td>11.285 ± 0.000</td><td>10.785 ± 2.176</td><td>1.448 ± 4.249</td><td>0.628 ±0.000</td></tr><tr><td>Second</td><td>0.200±0.000</td><td>0.280 ± 0.049</td><td>0.515 ± 0.007</td><td>0.709 ±0.000</td><td>10.862 ±0.000</td><td>10.171 ± 2.353</td><td>0.529 ±0.228</td><td>-5.579 ± 0.000</td></tr><tr><td>Third</td><td>0.203±0.000</td><td>0.239 ± 0.056</td><td>0.536± 0.006</td><td>0.682 ± 0.000</td><td>11.075 ± 0.000</td><td>11.041 ± 2.708</td><td>-0.244± 0.185</td><td>-4.961± 0.000</td></tr></table>
138
+
139
+ # 3 EXPERIMENTS
140
+
141
+ We empirically examine the effectiveness of IGBSS to perform BSS using real-world image and synthetic time-series datasets for an affine transformation and higher-order interactions between signals. All experiments were run on CentOS Linux 7 with Intel Xeon CPU E5-2623 v4 and Nvidia QuadroGP100 3.
142
+
143
+ # 3.1 BLIND SOURCE SEPARATION FOR AFFINE TRANSFORMATIONS ON IMAGES
144
+
145
+ In our experiments, we use three benchmark images widely used in computer vision from the University of Southern California’s Signal and Image Processing Institute (USC-SIPI)4, which include “airplane (F-16)”, “lake” and “peppers”. Each image is standardized to have $3 2 \mathrm { x } 3 2 $ pixels with red, green and blue color channels with integer values between 0 and 255 to represent the intensity of each pixel. These images shown in Figure 2a are the source signal $\mathbf { Z }$ which are unknown to the model. They are only used as ground truth to evaluate the model’s output. The equation ${ \bf X } = { \bf A } { \bf Z }$ is used to generate the received signal $\mathbf { X }$ by randomly generating values for a mixing matrix A using the uniform distribution which generates real numbers between 1 and 6. The images are then rescaled to integer values within the range between 0 and 255. The received signal $\mathbf { X }$ , which is the input to the model, is the three images shown in Figure 2b. The three images for the mixed signal may look visually similar, however, they are actually superposition of the source signal with different intensity. The objective of our model is to reconstruct the source signal $\mathbf { Z }$ without knowing the mixing matrix A.
146
+
147
+ We compare our approach to FastICA (Hyvarinen & Oja, 2000) with the ¨ log cosh function as the signal prior, dictionary learning (DL) (Olshausen & Field, 1997) with constraint for positive dictionary and positive code, and NMF with the coordinate descent solver and non-negative double singular value decomposition (NNDSVD) initialization (Boutsidis & Gallopoulos, 2008) with zero values replaced with the mean of the input.
148
+
149
+ ![](images/151d7988a298edc332a3112cd896b77df7b2eb25f831ab8e58d9b2dfdadae6fb.jpg)
150
+ Figure 4: Time series signal experiment.
151
+
152
+ Since BSS is an unsupervised learning problem, the order of the signal is not recovered. We identify the corresponding signal by taking all permutations of the output and calculate the minimum euclidean distance with the ground truth. The permutation which returns the minimum error is considered as the correct order of the image. The scale of the output is also not recovered, thereby we have used min-max normalization to the output of each model.
153
+
154
+ Separation results for images are shown in Figure 2. Our proposed approach IGBSS is able to recover majority of the “shape” of the source signal, while the intensity of each image appears to larger than the ground truth for all images. Small residuals of each image can be seen on the other images. For instance, in the airplane (F-16) image, there residuals from the lake image can be clearly seen. Compared to the reconstruction of IGBSS with FastICA, DL and NMF, IGBSS performs significantly better as all the other approaches are unable to clearly separate the mixed signal. FastICA was unable to provide a reasonable reconstruction with 3 mixed signal. To overcome this limitation of FastICA, we randomly generated another column of the mixing matrix and append it to the current mixing matrix to create 4 mixed signals as an input to FastICA to recover a more reasonable signal.
155
+
156
+ The root mean square error (RMSE) of the Euclidean distance and the signal-to-noise ratio (SNR) between the reconstruction and the ground truth is calculated to quantify results of each method. The SNR is computed by $\mathrm { S N R } _ { d B } = 2 0 \log _ { 1 0 } ( z _ { \mathrm { n o r m } } / | ( z - z _ { \mathrm { n o r m } } ) | )$ . The full results are shown in Table 1 (top row for each experiment). In the table, we present three experiments with different RGB images from USC-SIPI dataset, for each experiment we generate a new mixing matrix, where the second and the third experiments uses images of “mandrill”, “splash”, “jelly beans” and “mandrill”, “lake”, “peppers”, respectively. Ground truth and resulting images for second and third experiments are presented in Supplement. Our results clearly show that IGBSS is superior to other methods, that is, IGBSS has consistently produced the lowest RMSE error for every experiment. When looking at the SNR ratio, our model has produce the highest SNR for majority of the cases and is always able to recover the same result after each run as it is formulated as convex optimization.
157
+
158
+ # 3.2 BLIND SOURCE SEPARATION WITH HIGHER-ORDER FEATURE INTERACTIONS
159
+
160
+ We demonstrate the ability of BSS for our model to include higher-order feature interactions in BSS. We use the same benchmark images in the standard BSS as the source signal $\mathbf { Z }$ for our experiment. We generate the higher-order feature interactions of the received signal by using the multiplicative product of the source signal. If we take into account up to $k$ th order interaction $( k \leq N )$ ,
161
+
162
+ $$
163
+ \begin{array} { l } { { \displaystyle x _ { l m } = \sum _ { n } a _ { l n } z _ { n m } + \sum _ { n 1 } \sum _ { n _ { 2 } > n _ { 1 } } a _ { l n _ { 1 } n _ { 2 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } + \sum _ { n 1 } \sum _ { n _ { 2 } > n _ { 1 } } \sum _ { n _ { 3 } > n _ { 2 } } a _ { l n _ { 1 } n _ { 2 } n _ { 3 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } z _ { n _ { 3 } m } } } \\ { { \displaystyle \qquad + \cdot \cdot + \sum _ { n _ { 1 } } \cdot \cdot \cdot \sum _ { n _ { k } > n _ { k - 1 } } a _ { l n _ { 1 } . . . n _ { k } } z _ { n _ { 1 } m } \cdot . . \ z _ { n _ { k } m } . } } \end{array}
164
+ $$
165
+
166
+ All the other known approaches take into account only first order interactions (that is, affine transformation) between features. Differently, our model can directly incorporate the higher-order features as we do not have any assumption of the affine transformation. When we consider up to $k \mathrm { t h }$ order interactions, we additionally include elements corresponding to new mixing parameters into the mixing layer. For example, if $k = 2$ , nodes for $a _ { l n _ { 1 } n _ { 2 } }$ are added and $a _ { l n _ { 1 } n _ { 2 } } \ \preceq \ z _ { n m }$ if $n _ { 1 } = n$ or $n _ { 2 } = n$ . Figure 3 shows experimental results for the third-order feature experiment. Our approach IGBSS shows superior reconstruction of the source signal to other approaches. All the other approaches except for NMF is able to achieve reasonable reconstruction. NMF is able to recover the “shape” of the image, however, unlike IBSS, NMF is a degenerate approach, so it is unable to recover all color channels in the correct proportion, creating discoloring for the image which is clearly shown in the SNR values. Since the proportion of the intensity of the pixel is not recovered. In terms of both of the RMSE and the SNR shown in Table 1, IGBSS again shows the best results for both second- and third-order interactions of signals across three experiments.
167
+
168
+ Table 2: Quantitative results for time-series separation experiment (mean $\pm$ standard deviation with 40 runs).
169
+ (a) Root Mean Squared Error (RMSE)
170
+
171
+ <table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>0.702 ±0.000</td><td>0.703±0.000</td><td>0.414± 0.286</td></tr><tr><td>Second</td><td>0.921 ± 0.000</td><td>0.921 ± 0.000</td><td>1.700 ± 0.167</td></tr><tr><td>Third</td><td>0.967 ± 0.000</td><td>0.961± 0.000</td><td>1.388 ± 0.178</td></tr></table>
172
+
173
+ (b) Signal-to-noise (SNR) (units in dB)
174
+
175
+ <table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>3.596±0.000</td><td>3.600±0.000</td><td>15.391± 3.813</td></tr><tr><td>Second</td><td>0.291± 0.000</td><td>0.042 ± 0.000</td><td>-5.803 ± 1.124</td></tr><tr><td>Third</td><td>0.340 ± 0.000</td><td>0.128 ± 0.000</td><td>-3.427 ± 1.249</td></tr></table>
176
+
177
+ # 3.3 TIME SERIES DATA ANALYSIS
178
+
179
+ We demonstrate the effectiveness of our model on time series data. In our experiments, we create three signals with 500 observations each using the sinusoidal function, sign function, and the sawtooth function. The synthetic data simulates typical signals from a wide range of applications including audio, medical and sensors. We randomly generate a mixing matrix by drawing from a uniform distribution with values between 0.5 and 2. In our experiment, we provide comparison of using both min-max normalization and exponential kernel as a pre-processing step and compare our approach with FastICA.
180
+
181
+ Experimental results are illustrated in Figure 4. These results show that IGBSS is superior to all the ICA approaches because it is able to recover both the shape of the signal and the sign of the signal, while all the other ICA approaches are only able to recover the shape of the signal and are unable to recover the sign of the signal. This means that ICA could recover a flipped signal. We have paired the recovered signal of ICA with the ground truth by finding the signal and sign with the lowest RMSE error. In any practical application, this is not possible for ICA because the latent signal is unknown. Through visual inspection, IGBSS is able to recover all visual signals with high accuracy, while FastICA is only able to recover the first-order interaction and it is unable to produce a reasonable recovery for second- and third-order interactions. In addition to our visual comparison, we have also performed a quantitative analysis on the experimental results using RMSE error with the ground truth. Results are shown in Table 2. FastICA has shown to have better performance for First-Order interactions. However, for second- and third-order SNR results for FastICA is unable to recover a reasonable signal because the noise is more dominant. IGBSS has shown superior performance and is able to recover the signal for second- and third-order interactions with better scores for both RMSE and SNR.
182
+
183
+ # 4 CONCLUSION
184
+
185
+ We have proposed a novel blind source separation (BSS) method, called Information Geometric Blind Source Separation (IGBSS). We have formulated our approach using the log-linear model, which enables us to introduce a hierarchical structure into its sample space to achieve BSS. We have theoretically shown that IGBSS has desirable properties for BSS such as unique recover of source signals as it solves the convex optimization problem by minimizing the KL divergence from mixed signals to source signals. We have experimentally shown that IGBSS recovers images and signals closer to the ground truth than independent component analysis (ICA), dictionary learning (DL) and non-negative matrix factorization (NMF). Thanks to the flexibility of the hierarchical structure, IGBSS is able to separate signals with complex interactions such as higher-order interactions. Our model is superior to the other approaches because it is non-degenerate and is able to recover the sign of the signal. Since our approach is flexible and requires less assumptions than alternative approaches, it can be applied to various real world applications such as medical imaging, signal processing, and image processing.
186
+
187
+ REFERENCES
188
+ A. Agresti. Categorical Data Analysis. Wiley, 3 edition, 2012.
189
+ S. Amari. Information geometry on hierarchy of probability distributions. IEEE Transactions on Information Theory, 47(5):1701–1711, 2001.
190
+ Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10(2):251– 276, 1998.
191
+ Shun-Ichi. Amari. Information geometry and its applications: Convex function and dually flat manifold. In F. Nielsen (ed.), Emerging Trends in Visual Computing: LIX Fall Colloquium, ETVC 2008, Revised Invited Papers, pp. 75–102. Springer, 2009.
192
+ Shun-Ichi. Amari. Information Geometry and Its Applications. Springer, 2016.
193
+ Anthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural Computation, 7(6):1129–1159, 1995.
194
+ Olivier Berne, C Joblin, Y Deville, JD Smith, M Rapacioli, JP Bernard, J Thomas, W Reach, and A Abergel. Analysis of the emission of very small dust particles from spitzer spectro-imagery data using blind signal separation methods. Astronomy & Astrophysics, 469(2):575–586, 2007.
195
+ Christos Boutsidis and Efstratios Gallopoulos. SVD based initialization: A head start for nonnegative matrix factorization. Pattern Recognition, 41(4):1350–1362, 2008.
196
+ Jean-Franc¸ois Cardoso. High-order contrasts for independent component analysis. Neural Computation, 11(1):157–192, 1999.
197
+ Pierre Comon. Independent component analysis, a new concept? Signal Processing, 36(3):287–314, 1994.
198
+ Marco Congedo, Cedric Gouy-Pailler, and Christian Jutten. On the blind source separation of human ´ electroencephalogram by approximate joint diagonalization of second order statistics. Clinical Neurophysiology, 119(12):2677–2686, 2008.
199
+ B. A. Coull and A. Agresti. Generalized log-linear models with random effects, with application to smoothing contingency tables. Statistical Modelling, 3(4):251–271, 2003.
200
+ Chris HQ Ding, Tao Li, and Michael I Jordan. Convex and semi-nonnegative matrix factorizations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(1):45–55, 2008.
201
+ Gerhard Gierz, Karl Heinrich Hofmann, Klaus Keimel, Jimmie D Lawson, Michael Mislove, and Dana S Scott. Continuous lattices and domains, volume 93. Cambridge university press, 2003.
202
+ Aapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. ¨ Neural Networks, 13(4-5):411–430, 2000.
203
+ Takuya Isomura and Taro Toyoizumi. A local learning rule for independent component analysis. Scientific Reports, 6:28073, 2016.
204
+ Quoc V Le, Alexandre Karpenko, Jiquan Ngiam, and Andrew Y Ng. ICA with reconstruction cost for efficient overcomplete feature learning. In Advances in Neural Information Processing Systems 24, pp. 1017–1025, 2011.
205
+ Daniel D Lee and H Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems 13, pp. 556–562, 2001.
206
+ Simon Luo and Mahito Sugiyama. Bias-variance trade-off in hierarchical probabilistic models using higher-order feature interactions. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, pp. 4488–4495, 2019.
207
+ Kevin P Murphy. Machine Learning: A Probabilistic Perspective. MIT press, 2012.
208
+ Bruno A Olshausen and David J Field. Sparse coding with an overcomplete basis set: A strategy employed by V1? Vision Research, 37(23):3311–3325, 1997.
209
+ Karl Pearson. LIII. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901.
210
+ Hiroshi Sawada, Nobutaka Ono, Hirokazu Kameoka, Daichi Kitamura, and Hiroshi Saruwatari. A review of blind source separation methods: two converging routes to ILRMA originating from ICA and NMF. APSIPA Transactions on Signal and Information Processing, 8, 2019.
211
+ Matthias Scholz, Fatma Kaplan, Charles L Guy, Joachim Kopka, and Joachim Selbig. Non-linear PCA: a missing data approach. Bioinformatics, 21(20):3887–3895, 2005.
212
+ Mahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Information decomposition on structured space. In 2016 IEEE International Symposium on Information Theory, pp. 575–579, 2016.
213
+ Mahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Tensor balancing on statistical manifold. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3270–3279, 2017.
214
+ Ricardo Vigario, Veikko Jousm ´ aki, Matti H ¨ am¨ al¨ ainen, Riitta Hari, and Erkki Oja. Independent ¨ component analysis for identification of artifacts in magnetoencephalographic recordings. In Advances in Neural Information Processing Systems 10, pp. 229–235, 1998.
215
+ Huan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust PCA via outlier pursuit. In Advances in Neural Information Processing Systems, pp. 2496–2504, 2010.
216
+ Hui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of Computational and Graphical Statistics, 15(2):265–286, 2006.
217
+
218
+ # A APPENDIX
219
+
220
+ # A.1 PARAMETER COMPUTATION FOR EACH LAYER
221
+
222
+ In the following, we give $p , \eta$ , and the gradient for each layer, which are used in gradient descent.
223
+
224
+ Received Layer (Input Layer): Probability $p ( x )$ on the received layer $x \in \mathcal { X }$ is obtained as
225
+
226
+ $$
227
+ \begin{array} { c } { \log p ( x ) = \displaystyle \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { z \preceq x } \theta _ { z } + \displaystyle \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq x } \theta _ { a } + \theta _ { \perp } , } \\ { \eta _ { x } = \displaystyle \sum _ { x ^ { \prime } \in \mathcal { X } } \mathbf { 1 } _ { x \preceq x ^ { \prime } } p ( x ^ { \prime } ) = p ( x ) . } \end{array}
228
+ $$
229
+
230
+ We do not need to compute gradient for the received layer as there is no parameter on this layer and $\theta _ { x } = 0$ for all $x \in \mathcal { X }$ .
231
+
232
+ Source Layer (Output Layer): Probability $p ( z )$ on the source layer for each $z \in { \mathcal { Z } }$ is given as
233
+
234
+ $$
235
+ \begin{array} { c } { { \displaystyle \log p ( z ) = \sum _ { z ^ { \prime } \in \mathcal { Z } , \atop { z \in \mathcal { X } } } \mathbf { 1 } _ { z ^ { \prime } \preceq z } \theta _ { z ^ { \prime } } + \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq z } \theta _ { a } + \theta _ { \bot } = \theta _ { z } + \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq z } \theta _ { a } + \theta _ { \bot } , } } \\ { { \displaystyle \eta _ { z } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } p ( x ) + \sum _ { z ^ { \prime } \in \mathcal { Z } } \mathbf { 1 } _ { z \preceq z ^ { \prime } } p ( z ^ { \prime } ) = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } p ( x ) + p ( z ) . } } \end{array}
236
+ $$
237
+
238
+ Thus the gradient for the source layer is given as
239
+
240
+ $$
241
+ \frac { \partial } { \partial \theta _ { z } } D _ { K L } ( \hat { p } \| p ) = \eta _ { z } - \hat { \eta } _ { z } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } \left( p ( x ) - \hat { p } ( x ) \right) + p ( z ) .
242
+ $$
243
+
244
+ Mixing Layer: Probability $p ( a )$ on this layer for each $a \in { \mathcal { A } }$ is given as
245
+
246
+ $$
247
+ \begin{array} { c } { { \displaystyle \log p ( a ) = \sum _ { a ^ { \prime } \in \mathcal { A } } \mathbf { 1 } _ { a ^ { \prime } \preceq a } \theta _ { a ^ { \prime } } + \theta _ { \bot } = \theta _ { a } + \theta _ { \bot } , } } \\ { { \displaystyle \eta _ { a } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } p ( x ) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + \sum _ { a ^ { \prime } \in \mathcal { A } } \mathbf { 1 } _ { a \preceq a ^ { \prime } } p ( a ^ { \prime } ) } } \\ { { \displaystyle = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } p ( x ) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + p ( a ) . } } \end{array}
248
+ $$
249
+
250
+ The gradient of the mixing layer is given as
251
+
252
+ $$
253
+ \frac { \partial } { \partial \theta _ { a } } D _ { K L } ( \hat { p } \| p ) = \eta _ { a } - \hat { \eta } _ { a } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } \left( p ( x ) - \hat { p } ( x ) \right) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + p ( a ) .
254
+ $$
255
+
256
+ Parameter values $\theta _ { a }$ in the mixing layer represent the degree of mixing between source signals. Hence they can be used to perform feature selection and extraction. For example, if $\theta _ { a } = 0$ in the extreme case, the corresponding node $a$ does not have any contribution to the source mixing.
257
+
258
+ # A.2 FEATURE EXTRACTION FOR A 2D POINT CLOUD EXPERIMENT
259
+
260
+ We demonstrate the effectiveness for IGBSS to identify independent components on a 2-dimensional point cloud to be used for feature extraction or dimensionality reduction. In our experiment, we generate a 2-dimensional point cloud using two standard Student’s $t$ -distribution with 1.3 degree of freedom and have scaled the first dimension by $1 / 5$ and the second dimension by $1 / 1 0$ to the point cloud, illustrated in Figure 5a. Then we have randomly generated a mixing matrix for our experiment to generate a mixed signal shown in Figure 5b. We run the experiment on our model IGBSS using min-max normalization as a pre-processing step and compare it to PCA and ICA. We apply the reverse transformation of the min-max normalization on the recovered signal and have plotted the results in Figure 5. From the experimental results, we can see that PCA is able to recover the same scale of the point cloud. However, the sign of the signal is not recovered as we have recovered reversed sign of the signal. PCA also recovers signals which are orthogonal to the largest variance. Therefore the axes of the point cloud recovered by PCA does not align with the source signal in Figure 5a, that is, the axes do not run parallel to the $\mathbf { X } ^ { - }$ and y- axes but instead is still in the same orientation as the mixed signal. This is not what we want as the signal is still mixed, and we would like to recover the signal in the same orientation as the source signal in blind source separation. ICA aims to recover statistically independent signals that are generally considered as the axes with the largest variances and not necessarily orthogonal to each other. However, the limitations of ICA is that it is unable to recover the sign and the scale of the signal. Therefore the scale of the recovered signal does not match with the source signal. In our experiment, we have plotted the results with unit variance as the recovered signal is generally unnormalized in ICA. Since our experiment is synthetically generated, we are able to quantitatively measure the the error in each approach by normalizing both the recovered signal and the source signal by its standard deviation then computing the root mean squared error (RMSE) and the signal-to-noise ratio (SNR). The results of this is shown in Table 3. Our proposed approach IGBSS has clear advantages, where it is able to recover the same orientation as the source signal as well as preserve the signal.
261
+
262
+ Table 3: Signal-to-Noise Ratio (SNR) and Root Mean Square Error (RMSE) between the recovered signal and the latent source signal for the 2-dimensional point cloud experiment.
263
+
264
+ <table><tr><td>Model</td><td>PCA</td><td>ICA</td><td>IGBSS</td></tr><tr><td>RMSE</td><td>2.011</td><td>1.445</td><td>1.421</td></tr><tr><td>SNR</td><td>25.997</td><td>27.431</td><td>27.503</td></tr></table>
265
+
266
+ # A.3 RUNTIME ANALYSIS
267
+
268
+ In our experiment, we used a learning rate of 1.0 for gradient descent. Although the time complexity for each iteration of natural gradient is $\mathcal { O } ( \vert \mathcal { Z } \vert ^ { 3 } + \vert \bar { \mathcal { A } } \vert ^ { 3 } + \vert \Omega \vert \vert S \vert )$ , which is larger than $\mathcal { O } ( | \Omega | \bar { | } S | ^ { 2 } )$ for gradient descent, natural gradient is able to reach convergence faster because it is quadratic convergence and requires significantly less iterations compared to gradient descent, which linearly converges. Increasing the size of the input will increase the size of $| \Omega |$ only, while the number of parameters $| { \mathcal { Z } } | , | \mathbf { A } |$ remain this same. Since the complexity of natural gradient is linear with respect to the size $| \Omega |$ of the input, increasing the size of the input is unlikely to increase the runtime significantly. Our experimental analysis in Figure 6 supports this analysis: our model scales linearly for both natural gradient and gradient descent when increasing the order of interactions in our model. This is because for practical application it is unlikely that $| { \mathcal { A } } | > | { \mathcal { Z } } |$ . The different between the runtime for natural gradient and gradient descent becomes larger as the order of interactions increased.
269
+
270
+ ![](images/9b470b8454bc2ff4564d89a17b2eb695f6afb4a3e6b33716033d1699fc05d23c.jpg)
271
+ Figure 5: 2-dimensional point cloud experiment.
272
+
273
+ # A.4 SIGN INVERSION IN ICA
274
+
275
+ When demonstrate the problem of the sign inversion in ICA. We use the same experimental set-up explained in Section 3.1 on blind source separation for affine transformation. We run the experiment on the dataset used for experimental 1 for the first order experiment and have shown the output of several runs in FastICA to show the problem of the sign inversion in Figure 7. For the 6 runs, we can see that none of the experiments were able to obtain the correct sign of the signal. This means that apply FastICA to applications where the sign of the signal is important is quite problematic.
276
+
277
+ ![](images/5b071035957f1f08dc4c34e87c300d9d015b50125eee38383e4c7ec93575e456.jpg)
278
+ Figure 6: Experimental analysis of the scalability of number of parameters and higher-order features in the model for both natural gradient approach and gradient descent
279
+
280
+ ![](images/4582ce9d991bf86c5a50d20f0ba5bef1e4cf89751c1f7ba1a75b86d7f3cfb9b7.jpg)
281
+ Figure 7: Six different runs of FastICA with the same experimental input experimental dataset as exp1 with first order interactions. The different results can demonstrate that the FastICA model is non-convex leading to potential problemic results such as the sign inversion.
parse/train/jnRqf0CzBK/jnRqf0CzBK_content_list.json ADDED
@@ -0,0 +1,1221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "HIERARCHICAL PROBABILISTIC MODEL FOR BLIND SOURCE SEPARATION VIA LEGENDRE TRANSFORMATION ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 656,
10
+ 171
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 195,
20
+ 398,
21
+ 223
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 260,
32
+ 544,
33
+ 275
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "We present a novel blind source separation (BSS) method, called information geometric blind source separation (IGBSS). Our formulation is based on the loglinear model equipped with a hierarchically structured sample space, which has theoretical guarantees to uniquely recover a set of source signals by minimizing the KL divergence from a set of mixed signals. Source signals, received signals, and mixing matrices are realized as different layers in our hierarchical sample space. Our empirical results have demonstrated on images and time series data that our approach is superior to well established techniques and is able to separate signals with complex interactions. ",
40
+ "bbox": [
41
+ 233,
42
+ 291,
43
+ 764,
44
+ 416
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 443,
55
+ 334,
56
+ 459
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "The objective of blind source separation (BSS) is to identify a set of source signals from a set of multivariate mixed signals1. BSS is widely used for applications which are considered to be the “cocktail party problem”. Examples include image/signal processing (Isomura & Toyoizumi, 2016), artifact removal in medical imaging (Vigario et al., 1998), and electroencephalogram (EEG) signal ´ separation (Congedo et al., 2008). Currently, there are a number of solutions for the BSS problem. The most widely used approaches are variations of principal component analysis (PCA) (Pearson, 1901; Murphy, 2012) and independent component analysis (ICA) (Comon, 1994; Murphy, 2012). However, they all have limitations with their approaches. ",
63
+ "bbox": [
64
+ 174,
65
+ 474,
66
+ 825,
67
+ 587
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "PCA and its modern variations such as sparse PCA (SPCA) (Zou et al., 2006), non-linear PCA (NLPCA) (Scholz et al., 2005), and Robust PCA $\\mathrm { { X u } }$ et al., 2010) extract a specified number of components with the largest variance under an orthogonal constraint, which are composed of a linear combination of variables. They create a set of uncorrelated orthogonal basis vectors that represent the source signal. The basis vectors with the $N$ largest variance are called the principal components and is the output of the model. PCA has shown to be effective for many applications such as dimensionality reduction and feature extraction. However, for BSS, PCA makes the assumption that the source signals are orthogonal, which is often not the case in most practical applications. ",
74
+ "bbox": [
75
+ 174,
76
+ 593,
77
+ 825,
78
+ 704
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Similarly, ICA also attempts to find the $N$ components with the largest variance, but relaxes the orthogonality constraint. All variations of ICA such as infomax (Bell & Sejnowski, 1995), FastICA (Hyvarinen & Oja, 2000) and JADE (Cardoso, 1999) separate a multivariate signal into addi- ¨ tive subcomponents by maximizing statistical independence of each component. ICA assumes that each component is non-gaussian and the relationship between the source signal and the mixed signal is an affine transformation. In addition to these assumptions, ICA is sensitive to the initialization of the weights as the optimization is non-convex and is likely to converge to a local optimum. ",
85
+ "bbox": [
86
+ 174,
87
+ 712,
88
+ 825,
89
+ 809
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Other potential methods which can perform BSS include non-negative matrix factorization (NMF) (Lee & Seung, 2001; Berne et al., 2007), dictionary learning (DL) (Olshausen & Field, 1997), and reconstruction ICA (RICA) (Le et al., 2011). NMF, DL and RICA are degenerate approaches to recover the source signal from the mixed signal. These approaches are more typically used for feature extraction. NMF factorizes a matrix into two matrices with nonnegative elements representing weights and features. The features extracted by NMF can be used to recover the source signal. More recently there are more advanced techniques that uses Short-time Fourier transform (STFT) to transform the signal into the frequency domain to construct a spectrogram before applying NMF (Sawada et al., 2019). However, NMF does not maximize statistical independence which is required to completely separate the mixed signal into the source signal, and it is also sensitive to initialization as the optimization is non-convex. Due to the non-convexity, additional constraints or heuristics for weight initialization is often applied to NMF to achieve better results (Ding et al., 2008; Boutsidis & Gallopoulos, 2008). DL can be thought of as a variation of the ICA approaches which requires an over-complete basis vector for the mixing matrix. DL may be advantageous because additional constraints such as a positive code or a dictionary can be applied to the model. However, since it requires an over-complete basis vector, information may be lost when reconstructing the source signal. In addition, like all the other approaches, DL is also non-convex and it is sensitive to the initialization of the weights. ",
96
+ "bbox": [
97
+ 174,
98
+ 815,
99
+ 823,
100
+ 900
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 174,
109
+ 103,
110
+ 825,
111
+ 270
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "All previous approaches have limitations such as loss of information or non-convex optimization and require constraints or assumptions such as orthogonality or an affine transformation which are not ideal for BSS. In the following, we introduce our approach to BSS, called IGBSS (Information Geometric BSS), using the log-linear model (Agresti, 2012), which can introduce relationships between possible states into its sample space (Sugiyama et al., 2017). Unlike the previous approaches, our proposed approach does not have the assumptions or limitations that they require. We provide a flexible solution by introducing a hierarchical structure between signals into our model, which allows us to treat interactions between signals that are more complex than an affine transformation. Unlike other existing methods, our approach does not require the inversion of the mixing matrix and is able to recover the sign of the signal. Thanks to the well-developed information geometric analysis of the log-linear model (Amari, 2001), optimization of our method is achieved via convex optimization, hence it always arrives at the globally optimal unique solution. Moreover, we theoretically show that it always minimizes the Kullback–Leibler (KL) divergence from a set of mixed signals to a set of source signals. Our experimental results demonstrate that our hierarchical model leads to better separation of signals including complex interaction such as higher-order feature interactions (Luo & Sugiyama, 2019) than existing methods. ",
118
+ "bbox": [
119
+ 173,
120
+ 277,
121
+ 825,
122
+ 500
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "2 FORMULATION ",
129
+ "text_level": 1,
130
+ "bbox": [
131
+ 176,
132
+ 518,
133
+ 331,
134
+ 535
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "BSS is formulated as a function $f$ that separates a set of received signals $X$ into a set of source signals $Z$ , i.e., $Z = f ( X )$ . For example, if one employs ICA based formulation, the BSS problem reduces to ${ \\bf X } = { \\bf A } { \\bf Z }$ , where the received signal $\\mathbf { X } \\in \\mathbf { \\mathbb { R } } ^ { L \\times M }$ with $L$ signals with the sample size $M$ is affine transformation of the source signal $\\mathbf { Z } \\in \\mathbb { R } ^ { N \\times M }$ with $N$ signals and a mixing matrix $\\mathbf { A } \\in \\mathbb { R } ^ { L \\times N }$ . The objective is to estimate $\\mathbf { Z }$ by learning A given $\\mathbf { X }$ . Our idea is to use the log-linear model (Agresti, 2012), which is a well-known energy-based model, to take non-affine transformation into account and formulate BSS as a convex optimization problem. ",
141
+ "bbox": [
142
+ 173,
143
+ 550,
144
+ 825,
145
+ 648
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "2.1 LOG-LINEAR MODEL ON PARTIALLY ORDERED SET ",
152
+ "text_level": 1,
153
+ "bbox": [
154
+ 173,
155
+ 665,
156
+ 576,
157
+ 679
158
+ ],
159
+ "page_idx": 1
160
+ },
161
+ {
162
+ "type": "text",
163
+ "text": "We use the log-linear model given in the form of ",
164
+ "bbox": [
165
+ 176,
166
+ 690,
167
+ 495,
168
+ 705
169
+ ],
170
+ "page_idx": 1
171
+ },
172
+ {
173
+ "type": "equation",
174
+ "img_path": "images/8bc574b917e8f775b062a6d679d0469c9a0f93de96085a2c8d428fbfecf7463e.jpg",
175
+ "text": "$$\n\\log p ( \\omega ) = \\sum _ { s \\in \\mathcal { S } } \\mathbf { 1 } _ { s \\preceq \\omega } \\theta _ { s } - \\psi ( \\theta ) ,\n$$",
176
+ "text_format": "latex",
177
+ "bbox": [
178
+ 392,
179
+ 710,
180
+ 604,
181
+ 744
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "where $p ( \\omega ) \\in ( 0 , 1 )$ is probability of each state $\\omega \\in \\Omega$ and ${ \\mathcal { S } } \\subseteq \\Omega$ is a parameter space such that a parameter value $\\theta _ { s } \\in \\mathbb { R }$ is associated with each $s \\in S$ , and $\\psi ( \\theta )$ is the partition function so that $\\begin{array} { r } { \\sum _ { \\omega \\in \\Omega } p ( \\omega ) = 1 } \\end{array}$ . In this formulation, we assume that the set $\\Omega$ of possible states, equivalent to the sample space in the statistical sense, is a partially ordered set (poset); that is, it is equipped with a partial order $\\stackrel { \\left. } { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b \\ b { \\ b { \\ b { \\ b \\ b { \\ b { \\ b \\ b { \\ b { \\ b \\ b { \\ b } } } } } } } } } } } } } } } } } } } } } \\preceq \\stackrel { \\right. } { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b { \\ b \\ b { \\ b { \\ b } } } } } } } } } } } } } } $ (Gierz et al., 2003) and $\\mathbf { 1 } _ { s \\preceq \\omega } = 1$ if $s \\preceq \\omega$ and 0 otherwise. This formulation is firstly introduced by Sugiyama et al. (2016) and used to model the matrix balancing problem (Sugiyama et al., 2017), which includes Boltzmann machines as a special case (Luo $\\&$ Sugiyama, 2019). If we index $\\Omega$ as $\\boldsymbol { \\Omega } = \\{ \\omega _ { 1 } , \\omega _ { 2 } , \\ldots , \\omega _ { | \\Omega | } \\}$ , we obtain the following matrix form: ",
188
+ "bbox": [
189
+ 173,
190
+ 750,
191
+ 825,
192
+ 863
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "equation",
198
+ "img_path": "images/82bcc8af588acc4186a995ff0e754ecda2e98fe82307ee04514e4e799b9d66c4.jpg",
199
+ "text": "$$\n\\log p = \\mathbf { F } \\pmb { \\theta } - \\pmb { \\psi } ( \\theta ) ,\n$$",
200
+ "text_format": "latex",
201
+ "bbox": [
202
+ 429,
203
+ 869,
204
+ 566,
205
+ 886
206
+ ],
207
+ "page_idx": 1
208
+ },
209
+ {
210
+ "type": "text",
211
+ "text": "where $\\pmb { p } \\in ( 0 , 1 ) ^ { | \\Omega | }$ with $p _ { i } = p ( \\omega _ { i } )$ , $\\pmb { \\theta } \\in \\mathbb { R } ^ { | \\Omega | }$ such that $\\theta _ { i } = \\theta _ { \\omega _ { i } }$ if $\\omega _ { i } \\in \\mathcal { S }$ and $\\theta _ { i } = 0$ otherwise, $\\mathbf { F } = ( f _ { i j } ) \\in \\{ 0 , 1 \\} ^ { | \\Omega | \\times | \\Omega | }$ with $f _ { i j } = \\mathbf { 1 } _ { \\omega _ { j } \\preceq \\omega _ { i } }$ , and $\\boldsymbol { \\psi } ( \\boldsymbol { \\theta } ) = ( \\boldsymbol { \\psi } ( \\boldsymbol { \\theta } ) , \\ldots , \\boldsymbol { \\psi } ( \\boldsymbol { \\theta } ) ) \\in \\mathbb { R } ^ { | \\Omega | }$ . Each vector is treated as a column vector, and log is entry-wise operation. This matrix form is often used as a general form of the log-linear model (Coull & Agresti, 2003) and $\\mathbf { F }$ is called a model matrix, which represents relationship between states. The assumption to the log-linear model is that $\\mathbf { F }$ is needed to be non-singular, and Sugiyama et al. (2017) showed that Equation (1) with a poset $\\Omega$ always provides a non-singular model matrix; that is, $\\mathbf { F }$ is regular as long as each entry is given as $f _ { i j } = \\mathbf { 1 } _ { \\omega _ { j } \\preceq \\omega _ { i } }$ . This property is powerful in mathematical modeling as we can introduce any partial order structure into $\\Omega$ , which we will use to introduce our hierarchical structure in tne next subsection to solve BSS. ",
212
+ "bbox": [
213
+ 173,
214
+ 892,
215
+ 825,
216
+ 926
217
+ ],
218
+ "page_idx": 1
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "",
223
+ "bbox": [
224
+ 173,
225
+ 103,
226
+ 825,
227
+ 202
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "2.2 LAYER CONFIGURATION FOR BLIND SOURCE SEPARATION ",
234
+ "text_level": 1,
235
+ "bbox": [
236
+ 174,
237
+ 220,
238
+ 620,
239
+ 234
240
+ ],
241
+ "page_idx": 2
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "Our key idea is to introduce a hierarchical layered structure into the sample space $\\Omega$ of the log-linear model to achieve BSS. We call this model information geometric BSS (IGBSS) as its optimality is supported by the tight connection between the log-linear model and information geometric property of the space of distributions (statistical manifold), which will be shown in the next subsection. We implement three layers of BSS, the mixing layer, the source layer, and the received layer, into $\\Omega$ as partial orders and learn the joint representation on it using the log-linear model. The received layer and the source layer represent the input received signal and the output source signal of BSS, respectively, and the mixing layer encodes information of how to mix the source signal. In the following, we consistently assume that $L$ is the number of received signals, $M$ is the sample size, and $N$ is the number of source signals. ",
246
+ "bbox": [
247
+ 173,
248
+ 247,
249
+ 825,
250
+ 386
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "Let us construct three layers in the sample space $\\Omega$ as $\\Omega = \\{ \\bot \\} \\cup \\mathcal { A } \\cup \\mathcal { Z } \\cup \\dot { \\mathcal { X } }$ with $\\mathcal { A } = \\{ a _ { 1 1 } , \\ldots , a _ { L N } \\}$ , $\\mathcal { Z } = \\{ z _ { 1 1 } , \\ldots , z _ { N M } \\}$ , and $\\mathcal { X } = \\{ x _ { 1 1 } , . . . , x _ { L M } \\}$ . The element $\\perp$ denotes the least element, and it acts as a partition function and $\\theta _ { \\perp } ~ = ~ - \\psi ( \\theta )$ always holds. We use 2D indexing of elements in each layer to make the correspondence between our formulation and ICA based formulation clear; that is, these three layers $A , { \\mathcal { Z } }$ , and $\\mathcal { X }$ are analogue to a mixing matrix $\\mathbf { \\bar { A } } \\in \\mathbb { R } ^ { L \\times N }$ , a source matrix $\\mathbf { Z } \\in \\mathbb { R } ^ { N \\times M }$ , and a received matrix $\\mathbf { X } \\in \\mathbb { R } ^ { L \\times M }$ , respectively2. We will also use symbols $\\omega$ and $s$ to denote elements of $\\Omega$ , i.e., they can be $\\perp$ , $a _ { l n }$ , $z _ { n m }$ , and $x _ { l m }$ . It is always assumed that the parameter space of the loglinear model $\\mathcal { S } = \\mathcal { A } \\cup \\mathcal { Z } \\subset \\Omega$ , meaning that mixing and source layers are used as parameters to represent distributions in our model. Here we introduce a partial order $\\preceq$ between layers. Define ",
257
+ "bbox": [
258
+ 174,
259
+ 392,
260
+ 517,
261
+ 642
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "image",
267
+ "img_path": "images/1943cbf853f5732bdd21b06544f2c4204a93f389ee82231f30fc423844abc8c9.jpg",
268
+ "image_caption": [
269
+ "Figure 1: An example of our sample space. Dashed lines show removed partial orders to allow for learning. "
270
+ ],
271
+ "image_footnote": [],
272
+ "bbox": [
273
+ 532,
274
+ 388,
275
+ 823,
276
+ 588
277
+ ],
278
+ "page_idx": 2
279
+ },
280
+ {
281
+ "type": "equation",
282
+ "img_path": "images/2ead22a54f490bd90ef4191439e9f24636e11c1c8a3a21f4b7409472dc5266cd.jpg",
283
+ "text": "$$\n\\begin{array} { r } { \\left\\{ \\begin{array} { l l } { a _ { i j } \\preceq z _ { i ^ { \\prime } j ^ { \\prime } } } & { \\mathrm { i f ~ } j = i ^ { \\prime } , } \\\\ { a _ { i j } \\diamond { \\not \\perp } z _ { i ^ { \\prime } j ^ { \\prime } } } & { \\mathrm { o t h e r w i s e } , } \\end{array} \\right. \\quad \\left\\{ \\begin{array} { l l } { z _ { i j } \\preceq x _ { i ^ { \\prime } j ^ { \\prime } } } & { \\mathrm { i f ~ } j = j ^ { \\prime } , } \\\\ { z _ { i j } \\diamond { \\not \\perp } x _ { i ^ { \\prime } j ^ { \\prime } } } & { \\mathrm { o t h e r w i s e } } \\end{array} \\right. } \\end{array}\n$$",
284
+ "text_format": "latex",
285
+ "bbox": [
286
+ 303,
287
+ 650,
288
+ 679,
289
+ 686
290
+ ],
291
+ "page_idx": 2
292
+ },
293
+ {
294
+ "type": "text",
295
+ "text": "for each element in three layers $A , { \\mathcal { Z } }$ , and $\\mathcal { X }$ , and we do not any ordering among elements in the same layer. Since it is a partial order, transitivity always holds, for example, $a _ { 1 1 } \\preceq x _ { 2 2 }$ as $a _ { 1 1 } \\preceq z _ { 1 2 }$ and $z _ { 1 2 } \\preceq x _ { 2 2 }$ . The first condition encodes the structure such that the source layer is higher than the mixing layer, and the second condition encodes that the received layer is higher than the source layer. An example of our sample space with $L = M = N = 2$ is illustrated in Figure 1. ",
296
+ "bbox": [
297
+ 174,
298
+ 694,
299
+ 825,
300
+ 763
301
+ ],
302
+ "page_idx": 2
303
+ },
304
+ {
305
+ "type": "text",
306
+ "text": "The joint distribution for BSS is described by the log-linear model in Equation (1) over the sample space $\\Omega = \\{ \\bot \\} \\cup \\mathcal { A } \\cup \\mathcal { Z } \\cup \\mathcal { X }$ equipped with the partial order defined in Equation (2). If we learn the joint distribution from a received signal $\\mathbf { X }$ , we will obtain probabilities on the source layer $p ( z _ { 1 1 } ) , \\allowbreak . . . , p ( z _ { N M } )$ , which represents normalized source signals. The rational of our approach is given as follows: The connections between each layer is structured so that the log-linear model performs a similar computation with the ICA based approach ${ \\bf X } = { \\bf A } { \\bf Z }$ . Our structure ensures that each $p ( x _ { l m } )$ is determined by $( \\theta _ { a _ { l n } } ) _ { n \\in [ N ] }$ and $( \\theta _ { z _ { m n } } ) _ { n \\in [ N ] }$ with $[ N ] = \\{ 1 , \\dots , N \\}$ , as we always have $a _ { l n } \\preceq x _ { l m }$ and $z _ { n m } \\preceq x _ { l m }$ . Moreover, this formulation allows us to model more complex interaction than affine transformation, such as higher-order interactions, between signals if we additionally include partial order structure into $\\mathcal { Z }$ and/or $\\mathcal { A }$ , which cannot be treated by a simple matrix multiplication. ",
307
+ "bbox": [
308
+ 173,
309
+ 770,
310
+ 825,
311
+ 896
312
+ ],
313
+ "page_idx": 2
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "",
318
+ "bbox": [
319
+ 173,
320
+ 103,
321
+ 823,
322
+ 132
323
+ ],
324
+ "page_idx": 3
325
+ },
326
+ {
327
+ "type": "text",
328
+ "text": "2.3 OPTIMIZATION ",
329
+ "text_level": 1,
330
+ "bbox": [
331
+ 174,
332
+ 148,
333
+ 320,
334
+ 162
335
+ ],
336
+ "page_idx": 3
337
+ },
338
+ {
339
+ "type": "text",
340
+ "text": "We train the log-linear model by minimizing the KL divergence from an empirical distribution $\\hat { p }$ , which is identical to the normalized received signal $\\mathbf { X } \\in \\breve { \\mathbb { R } } ^ { L \\times M }$ , to the model joint distribution $p$ given by Equation (1) or, equivalently, maximizing the likelihood. More precisely, we normalize a given $\\mathbf { X }$ by dividing each entry by the sum of all entries; that is, an empirical distribution $\\hat { p }$ is obtained as $\\hat { p } ( x _ { l m } ) \\bar { = } ~ x _ { l m } / \\bar { \\sum _ { l , m } } { x _ { l m } }$ . If $\\mathbf { X }$ contains negative values, an exponential kernel $\\exp { ( { x } _ { l m } ) / { \\sum } _ { l , m } } \\exp { ( { x } _ { l m } ) }$ or min-max normalization $( x _ { l m } + \\epsilon - \\mathrm { m i n } ( \\mathbf X ) ) / ( \\mathrm { m a x } ( \\mathbf X ) + \\epsilon - \\mathrm { m i n } ( \\mathbf X ) )$ can be used, where $\\epsilon$ is some arbitrary small value to avoid zero probability. We also assume that $\\hat { p } ( a _ { l n } ) = 0$ and $\\hat { p } ( z _ { n m } ) = 0$ for all $a _ { l n } \\in \\mathcal { A }$ and $z _ { n m } \\in \\mathcal { Z }$ . The objective function is given as ",
341
+ "bbox": [
342
+ 173,
343
+ 174,
344
+ 825,
345
+ 291
346
+ ],
347
+ "page_idx": 3
348
+ },
349
+ {
350
+ "type": "equation",
351
+ "img_path": "images/2eb6b650574ae1d7b63b159fc303522a8b03b9f652f9f4bb452b42e3e4e70c62.jpg",
352
+ "text": "$$\n\\underset { p \\in \\mathfrak { P } _ { \\theta } } { \\arg \\operatorname* { m i n } } \\mathrm { D } _ { \\mathrm { K L } } \\left( \\hat { p } \\| p \\right) = \\underset { p \\in \\mathfrak { P } _ { \\theta } } { \\arg \\operatorname* { m i n } } \\sum _ { \\omega \\in \\Omega } \\hat { p } ( \\omega ) \\log \\frac { \\hat { p } ( \\omega ) } { p ( \\omega ) } ,\n$$",
353
+ "text_format": "latex",
354
+ "bbox": [
355
+ 330,
356
+ 296,
357
+ 666,
358
+ 334
359
+ ],
360
+ "page_idx": 3
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "where ${ \\mathfrak { P } } _ { \\theta }$ is the set of distributions that can be represented by Equation (1) with our structured sample space $\\Omega = \\{ \\bot \\} \\cup \\mathcal { A } \\cup \\mathcal { Z } \\cup \\mathcal { X }$ and $S = A \\cup \\mathcal { Z }$ . ",
365
+ "bbox": [
366
+ 173,
367
+ 339,
368
+ 823,
369
+ 368
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "The remarkable property of our model is that this optimization problem is convex and it is guaranteed that gradient-based methods can always arrive at the globally optimal unique solution. To show this, we analyze the geometric structure of the statistical manifold, the set of probability distributions, generated by the log-linear model. Let $\\Omega ^ { + } = \\Omega \\backslash \\{ \\bot \\}$ . First we introduce another parameterization $\\bar { ( \\eta _ { \\omega } ) } _ { \\omega \\in \\Omega ^ { + } }$ of the log-linear model, which is defined as ",
376
+ "bbox": [
377
+ 173,
378
+ 375,
379
+ 825,
380
+ 444
381
+ ],
382
+ "page_idx": 3
383
+ },
384
+ {
385
+ "type": "equation",
386
+ "img_path": "images/1f591cfd7da2a91a200569ee12e5df218fdabf85922e663e649db070045d3b68.jpg",
387
+ "text": "$$\n\\eta _ { \\omega } = \\sum _ { s \\in \\Omega } \\mathbf { 1 } _ { \\omega \\preceq s } p ( s ) .\n$$",
388
+ "text_format": "latex",
389
+ "bbox": [
390
+ 429,
391
+ 450,
392
+ 568,
393
+ 484
394
+ ],
395
+ "page_idx": 3
396
+ },
397
+ {
398
+ "type": "text",
399
+ "text": "Note that $\\eta _ { \\perp } = 1$ always holds and we do not include it into parameters. In addition, for theoretical consistency we change the parameter space used in Equation (1) from $s$ to $\\Omega ^ { + }$ and assume that $\\theta _ { \\omega } ~ = ~ 0$ if $\\omega ~ \\notin ~ { \\mathcal { S } }$ . Again we do not include $\\theta _ { \\perp }$ as a parameter as it is the partition function. Two parameters $( \\theta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } }$ and $( \\eta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } }$ have clear statistical interpretation as it is widely known that any log-linear model belongs to the exponential family, where $\\theta$ and $\\eta$ correspond to natural and expectation parameters, respectively. $\\theta$ and $\\eta$ are connected via a Legendre transformation which means that they are both differentiable and have a one-to-one correspondence. To simplify the notation, we denote by $\\hat { \\theta }$ and $\\hat { \\eta }$ the corresponding $\\theta$ and $\\eta$ of the empirical distribution $\\hat { p }$ . Let $\\mathfrak { P } = \\{ p \\ | \\ 0 < p ( \\omega ) \\ < \\ 1$ for all $\\omega \\in \\Omega \\}$ be the set of all probability distributions. This set forms a statistical manifold with dually flat structure, which is the canonical geometric structure in information geometry (Amari, 2016), with its dual coordinate system $( ( \\theta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } } , ( \\eta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } } )$ ; that is, both of $( \\theta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } }$ and $( \\eta _ { \\omega } ) _ { \\omega \\in \\Omega ^ { + } }$ work as coordinate systems and determine a distribution in $\\mathfrak { P }$ . The Riemannian metric with respect to $\\theta$ is given as ",
400
+ "bbox": [
401
+ 173,
402
+ 488,
403
+ 825,
404
+ 672
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "equation",
410
+ "img_path": "images/c825fb5813f0d774c90096146b5e8b455b46ae21ded0cd4293332d6e385122b6.jpg",
411
+ "text": "$$\ng _ { s s ^ { \\prime } } = \\frac { \\partial \\eta _ { s } } { \\partial \\theta _ { s ^ { \\prime } } } = \\mathbb { E } \\left[ \\frac { \\partial \\log p ( \\boldsymbol { \\omega } ) } { \\partial \\theta _ { s } } \\frac { \\partial \\log p ( \\boldsymbol { \\omega } ) } { \\partial \\theta _ { s ^ { \\prime } } } \\right] = \\sum _ { \\boldsymbol { \\omega } \\in \\Omega } \\mathbf { 1 } _ { s \\preceq \\boldsymbol { \\omega } } \\mathbf { 1 } _ { s ^ { \\prime } \\preceq \\boldsymbol { \\omega } } p ( \\boldsymbol { \\omega } ) - \\eta _ { s } \\eta _ { s ^ { \\prime } } ,\n$$",
412
+ "text_format": "latex",
413
+ "bbox": [
414
+ 253,
415
+ 676,
416
+ 743,
417
+ 717
418
+ ],
419
+ "page_idx": 3
420
+ },
421
+ {
422
+ "type": "text",
423
+ "text": "which coincides with the Fisher information (Sugiyama et al., 2017, Theorem 3) and we will use it for natural gradient. ",
424
+ "bbox": [
425
+ 173,
426
+ 722,
427
+ 823,
428
+ 751
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "Now we consider two submanifolds $\\mathfrak { P } _ { \\theta } , \\mathfrak { P } _ { \\eta } \\subseteq \\mathfrak { P }$ , which we define as ",
435
+ "bbox": [
436
+ 176,
437
+ 756,
438
+ 632,
439
+ 772
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "equation",
445
+ "img_path": "images/340c0858576709ed0e6e42a04038a1b47d49d1735d55db34af8c16e9f33837c6.jpg",
446
+ "text": "$$\n\\begin{array} { r l r } & { \\mathfrak { P } _ { \\theta } = \\left\\{ p \\in \\mathfrak { P } \\mid \\theta _ { \\omega } = 0 , \\forall \\omega \\in \\mathcal { E } \\right\\} , \\qquad } & { \\mathcal { E } = \\Omega ^ { + } \\backslash \\mathcal { S } , } \\\\ & { \\mathfrak { P } _ { \\eta } = \\left\\{ p \\in \\mathfrak { P } \\mid \\eta _ { \\omega } = \\hat { \\eta } _ { \\omega } , \\forall \\omega \\in \\mathcal { M } \\right\\} , \\qquad } & { \\mathcal { M } = \\mathcal { S } . } \\end{array}\n$$",
447
+ "text_format": "latex",
448
+ "bbox": [
449
+ 277,
450
+ 777,
451
+ 704,
452
+ 815
453
+ ],
454
+ "page_idx": 3
455
+ },
456
+ {
457
+ "type": "text",
458
+ "text": "Note that this ${ \\mathfrak { P } } _ { \\theta }$ coincides with that in Equation (3). The submanifold ${ \\mathfrak { P } } _ { \\theta }$ is called an $e$ -flat submanifold and $\\mathfrak { P } _ { \\eta }$ an $m$ -flat submanifold in information geometry. The highlight of considering these two types of submanifolds is that, if $\\mathcal { E } \\cap \\mathcal { M } = \\emptyset$ and $\\bar { \\mathcal { E } } \\cup \\mathcal { M } \\overset { \\cdot } { = } \\Omega ^ { + }$ , it is theoretically guaranteed that the intersection $\\mathfrak { P } _ { \\theta } \\cap \\mathfrak { P } _ { \\eta }$ is always a singleton and it is the optimizer of Equation (3) (Amari, 2009, Theorem 3), that is, it is the globally optimal solution of our model. ",
459
+ "bbox": [
460
+ 174,
461
+ 818,
462
+ 825,
463
+ 890
464
+ ],
465
+ "page_idx": 3
466
+ },
467
+ {
468
+ "type": "text",
469
+ "text": "Optimization is achieved by $e$ -projection, which seeks $\\mathfrak { P } _ { \\theta } \\cap \\mathfrak { P } _ { \\eta }$ in the $e$ -flat submanifold ${ \\mathfrak { P } } _ { \\theta }$ . The $e$ -projection is always convex optimization as ${ \\mathfrak { P } } _ { \\theta }$ is convex with respect to $\\theta$ ; this is because $\\theta$ is ",
470
+ "bbox": [
471
+ 173,
472
+ 895,
473
+ 823,
474
+ 924
475
+ ],
476
+ "page_idx": 3
477
+ },
478
+ {
479
+ "type": "text",
480
+ "text": "Algorithm 1 Information Geometric BSS ",
481
+ "text_level": 1,
482
+ "bbox": [
483
+ 178,
484
+ 103,
485
+ 447,
486
+ 117
487
+ ],
488
+ "page_idx": 4
489
+ },
490
+ {
491
+ "type": "text",
492
+ "text": "1: Function $\\mathrm { I G B S S } ( \\mathbf { X } , S )$ : \n2: Compute $\\hat { p }$ from $\\mathbf { X }$ \n3: Compute $\\hat { \\pmb { \\eta } } = ( \\hat { \\eta } _ { s } ) _ { s \\in \\mathcal { S } }$ from $\\hat { p }$ \n4: Initialize $( \\theta _ { s } ) _ { s \\in { \\mathcal { S } } }$ (randomly or $\\theta _ { s } = 0$ ) \n5: repeat \n6: Compute $p$ using the current parameter $( \\theta _ { s } ) _ { s \\in { \\mathcal { S } } }$ \n7: Compute $( \\eta _ { s } ) _ { s \\in { \\mathcal { S } } }$ from $p$ \n8: $( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } ( \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } - ( \\hat { \\eta } _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } }$ \n9: $( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } ( \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } - ( \\hat { \\eta } _ { \\omega } ) _ { \\omega \\in \\mathcal { A } }$ \n10: Compute the Fisher information matrix for source layer $\\mathbf { G } _ { Z }$ and the mixing layer $\\mathbf { G } _ { A }$ \n11: $( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } ^ { \\bullet } ( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } - \\mathbf { G } _ { Z } ^ { - 1 } ( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } }$ \n12: $( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } \\gets ( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } - \\mathbf { G } _ { A } ^ { - 1 } ( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } }$ \n13: until convergence of $( \\theta _ { s } ) _ { s \\in { \\mathcal { S } } }$ \n14: End Function ",
493
+ "bbox": [
494
+ 179,
495
+ 122,
496
+ 781,
497
+ 320
498
+ ],
499
+ "page_idx": 4
500
+ },
501
+ {
502
+ "type": "text",
503
+ "text": "a coordinate system of ${ \\mathfrak { P } } _ { \\theta }$ that is linearly constrained on $\\theta$ . We can therefore use the standard gradient descent strategy to optimize the log-linear model. The derivative of the KL divergence with respect to $\\theta _ { s }$ is known to be the difference between expectation parameters $\\eta$ (Sugiyama et al., 2017, Theorem 2): $( \\partial / \\partial \\theta _ { s } ) D _ { \\mathrm { K L } } ( \\hat { p } \\parallel p ) = \\eta _ { s } - \\hat { \\eta } _ { s }$ , and the KL divergence $D _ { \\mathrm { K L } } ( \\hat { p } \\Vert p )$ is minimized if and only if $\\eta _ { s } = \\hat { \\eta } _ { s }$ for all $s \\in S$ . ",
504
+ "bbox": [
505
+ 173,
506
+ 357,
507
+ 825,
508
+ 428
509
+ ],
510
+ "page_idx": 4
511
+ },
512
+ {
513
+ "type": "text",
514
+ "text": "From our definition of $\\Omega$ in Equation (2), we have $\\eta _ { z _ { k l } } = \\eta _ { z _ { k ^ { \\prime } l } }$ for all $z _ { k l } , z _ { k ^ { \\prime } l } \\in \\mathcal { Z }$ . Therefore all elements in the source layer will learn the same value. This problem can be avoided by removing some of partial orders between source and received layers. We propose to systematically remove the partial order $z _ { i j } \\preceq x _ { i ^ { \\prime } j ^ { \\prime } }$ if $i = i ^ { \\prime }$ to ensure $\\eta _ { z _ { k l } } \\neq \\eta _ { z _ { k ^ { \\prime } l } }$ (see Figure 1), while other strategies are possible as long as $\\eta _ { z _ { k l } } \\neq \\eta _ { z _ { k ^ { \\prime } l } }$ is satisfied, for example, random deletion of such orders. ",
515
+ "bbox": [
516
+ 173,
517
+ 434,
518
+ 825,
519
+ 506
520
+ ],
521
+ "page_idx": 4
522
+ },
523
+ {
524
+ "type": "text",
525
+ "text": "Using the above results, gradient descent can be directly applied to achieve Equation (3). However, this may need a large number of iterations to reach convergence. To reduce the number of iterations, we propose to use natural gradient (Amari, 1998), which is a second-order optimization approach and will also always find the global optimum. Let us re-index $S = A \\cup \\mathcal { Z }$ as $\\boldsymbol { S } = \\{ s _ { 1 } , s _ { 2 } , \\ldots , s _ { | \\boldsymbol { S } | } \\}$ and assume that $\\pmb { \\theta } = [ \\theta _ { s _ { 1 } } , \\ldots , \\theta _ { s _ { | \\pmb { S } | } } ] ^ { \\mathrm { T } }$ and $\\pmb { \\eta } = [ \\eta _ { s _ { 1 } } , \\dots , \\eta _ { s _ { | S | } } ] ^ { \\mathrm { T } }$ . In each step of natural gradient, the current $\\pmb \\theta$ is updated to $\\theta _ { \\mathrm { n e x t } }$ by the following formula: ",
526
+ "bbox": [
527
+ 173,
528
+ 511,
529
+ 825,
530
+ 599
531
+ ],
532
+ "page_idx": 4
533
+ },
534
+ {
535
+ "type": "equation",
536
+ "img_path": "images/082814cc95c95231e31f9443406bb05f9915e8cb00619300d1d6ee8f18892f27.jpg",
537
+ "text": "$$\n\\pmb { \\theta } _ { \\mathrm { n e x t } } = \\pmb { \\theta } - \\mathbf { G } ^ { - 1 } ( \\pmb { \\eta } - \\hat { \\pmb { \\eta } } )\n$$",
538
+ "text_format": "latex",
539
+ "bbox": [
540
+ 410,
541
+ 613,
542
+ 588,
543
+ 632
544
+ ],
545
+ "page_idx": 4
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "where $\\mathbf { G } = ( g _ { i j } ) \\in \\mathbb { R } ^ { | S | \\times | S | }$ is the Fisher information matrix such that each $g _ { i j }$ is given as $g _ { s _ { i } s _ { j } }$ in Equation (5). ",
550
+ "bbox": [
551
+ 174,
552
+ 648,
553
+ 825,
554
+ 680
555
+ ],
556
+ "page_idx": 4
557
+ },
558
+ {
559
+ "type": "text",
560
+ "text": "Although the natural gradient requires much less iterations compared to the gradient descent, matrix inversion $\\mathbf { G } ^ { - 1 }$ is computationally expensive as it has the complexity of $\\mathcal { O } ( | \\boldsymbol { S } | ^ { 3 } )$ . In addition, FIM values are often too small and optimization becomes numerically unstable. To solve these problems, we separate the update steps in the source layer and the mixing layer: ",
561
+ "bbox": [
562
+ 174,
563
+ 685,
564
+ 825,
565
+ 742
566
+ ],
567
+ "page_idx": 4
568
+ },
569
+ {
570
+ "type": "equation",
571
+ "img_path": "images/f591374084338e854026af309f3786e8708ddd40f18921bddfc3d7af83c97407.jpg",
572
+ "text": "$$\n\\begin{array} { r } { ( \\theta _ { \\omega , \\mathrm { n e x t } } ) _ { \\omega \\in \\mathcal { Z } } = ( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } - \\mathbf { G } _ { Z } ^ { - 1 } ( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { Z } } , } \\\\ { ( \\theta _ { \\omega , \\mathrm { n e x t } } ) _ { \\omega \\in \\mathcal { A } } = ( \\theta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } - \\mathbf { G } _ { A } ^ { - 1 } ( \\Delta \\eta _ { \\omega } ) _ { \\omega \\in \\mathcal { A } } , } \\end{array}\n$$",
573
+ "text_format": "latex",
574
+ "bbox": [
575
+ 348,
576
+ 756,
577
+ 648,
578
+ 800
579
+ ],
580
+ "page_idx": 4
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "where $\\mathbf { G } _ { Z }$ and $\\mathbf { G } _ { A }$ are the Fisher information matrices for source and mixing layers, respectively. Note that this also leads to the same global optimum. They are constructed by assuming all the other parameters are fixed. This approach reduces the time complexity to $O ( | \\mathcal { Z } | ^ { 3 } + | \\mathcal { A } | ^ { 3 } )$ . The full algorithm using natural gradient is given in Algorithm 1. Computation of $p$ from $\\theta$ and $\\eta$ from $p$ can be achieved using Equations (1) and (4). We also give more explicit description of $p$ and $\\eta$ for each layer in Appendix. The time complexity to compute $p$ in Algorithm 1 Line 6 is $\\mathcal { O } ( | \\Omega | | S | )$ . The complexity to compute $\\Delta \\eta$ in Algorithm 1 Line 8 and Line 9 is $\\mathcal { O } ( \\vert \\mathcal { Z } \\vert ) + \\mathcal { O } ( \\vert A \\vert ) = \\mathcal { O } ( \\vert S \\vert )$ . Therefore the total complexity of each iteration is $\\mathcal { O } ( \\vert \\mathcal { Z } \\vert ^ { 3 } + \\vert \\mathcal { A } \\vert ^ { 3 } + \\vert \\Omega \\vert \\vert \\boldsymbol { S } \\vert )$ . ",
585
+ "bbox": [
586
+ 173,
587
+ 810,
588
+ 825,
589
+ 925
590
+ ],
591
+ "page_idx": 4
592
+ },
593
+ {
594
+ "type": "image",
595
+ "img_path": "images/91e48d8152c8fa29ca6b29f3971e9e180c5a615ec8441d01ef6589ef0a13a269.jpg",
596
+ "image_caption": [
597
+ "Figure 2: First-order interaction experiment. "
598
+ ],
599
+ "image_footnote": [],
600
+ "bbox": [
601
+ 179,
602
+ 101,
603
+ 486,
604
+ 247
605
+ ],
606
+ "page_idx": 5
607
+ },
608
+ {
609
+ "type": "image",
610
+ "img_path": "images/761043c60863db54e09b9282b4e925075d329973de664f940bea92eef1637107.jpg",
611
+ "image_caption": [
612
+ "Figure 3: Third-order interaction experiment. "
613
+ ],
614
+ "image_footnote": [],
615
+ "bbox": [
616
+ 500,
617
+ 101,
618
+ 808,
619
+ 247
620
+ ],
621
+ "page_idx": 5
622
+ },
623
+ {
624
+ "type": "table",
625
+ "img_path": "images/b6f21b2275d648d86ebce470a7a8184f629dcc1d01b686b0795628652579d3c6.jpg",
626
+ "table_caption": [
627
+ "Table 1: Signal-to-Noise Ratio of reconstructed signal. $( \\ast )$ Results for Figure 2. (†) Results for Figure 3. Scores are means $\\pm$ standard deviation after 40 runs. We have applied different weight initialization after each run. "
628
+ ],
629
+ "table_footnote": [],
630
+ "table_body": "<table><tr><td rowspan=\"2\">Exp.</td><td rowspan=\"2\">Order</td><td colspan=\"4\">Root Mean Squared Error (RMSE)</td><td colspan=\"4\">Signal-to-noise ratio (SNR)(units in dB)</td></tr><tr><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td></tr><tr><td rowspan=\"3\">1</td><td>First*</td><td>0.252 ±0.000</td><td>0.300± 0.089</td><td>0.394 ± 0.041</td><td>0.622 ± 0.000</td><td>12.588 ± 0.000</td><td>11.688 ± 4.829</td><td>6.810± 0.008</td><td>1.704 ± 0.000</td></tr><tr><td>Second</td><td>0.260 ±0.000</td><td>0.285 ± 0.096</td><td>0.441 ± 0.080</td><td>0.662 ± 0.000</td><td>10.729 ± 0.000</td><td>12.353±4.255</td><td>0.526 ± 0.448</td><td>-3.426 ±0.000</td></tr><tr><td>Thirdt</td><td>0.252 ±0.000</td><td>0.260 ± 0.111</td><td>0.362 ± 0.030</td><td>0.612 ±0.000</td><td>12.588 ± 0.000</td><td>12.922 ± 5.590</td><td>1.471 ± 0.358</td><td>0.039 ±0.000</td></tr><tr><td rowspan=\"3\">2</td><td>First</td><td>0.133± 0.000</td><td>0.284± 0.064</td><td>0.474 ± 0.067</td><td>0.591± 0.000</td><td>14.215±0.000</td><td>11.218 ± 1.964</td><td>2.098 ± 2.140</td><td>-0.940± 0.000</td></tr><tr><td>Second</td><td>0.256 ±0.000</td><td>0.263 ± 0.066</td><td>0.576± 0.008</td><td>0.684± 0.000</td><td>10.612 ±0.000</td><td>11.986 ± 2.157</td><td>-1.589 ± 0.269</td><td>-3.675 ± 0.000</td></tr><tr><td>Third</td><td>0.282 ± 0.000</td><td>0.239 ± 0.056</td><td>0.593 ± 0.007</td><td>0.665± 0.000</td><td>9.346 ± 0.000</td><td>11.475 ± 2.145</td><td>-2.274 ± 0.227</td><td>-4.073 ± 0.000</td></tr><tr><td rowspan=\"3\">3</td><td>First</td><td>0.155 ± 0.000</td><td>0.699 ± 0.047</td><td>0.478 ± 0.121</td><td>0.628 ± 0.000</td><td>11.285 ± 0.000</td><td>10.785 ± 2.176</td><td>1.448 ± 4.249</td><td>0.628 ±0.000</td></tr><tr><td>Second</td><td>0.200±0.000</td><td>0.280 ± 0.049</td><td>0.515 ± 0.007</td><td>0.709 ±0.000</td><td>10.862 ±0.000</td><td>10.171 ± 2.353</td><td>0.529 ±0.228</td><td>-5.579 ± 0.000</td></tr><tr><td>Third</td><td>0.203±0.000</td><td>0.239 ± 0.056</td><td>0.536± 0.006</td><td>0.682 ± 0.000</td><td>11.075 ± 0.000</td><td>11.041 ± 2.708</td><td>-0.244± 0.185</td><td>-4.961± 0.000</td></tr></table>",
631
+ "bbox": [
632
+ 176,
633
+ 343,
634
+ 812,
635
+ 454
636
+ ],
637
+ "page_idx": 5
638
+ },
639
+ {
640
+ "type": "text",
641
+ "text": "3 EXPERIMENTS ",
642
+ "text_level": 1,
643
+ "bbox": [
644
+ 176,
645
+ 479,
646
+ 326,
647
+ 494
648
+ ],
649
+ "page_idx": 5
650
+ },
651
+ {
652
+ "type": "text",
653
+ "text": "We empirically examine the effectiveness of IGBSS to perform BSS using real-world image and synthetic time-series datasets for an affine transformation and higher-order interactions between signals. All experiments were run on CentOS Linux 7 with Intel Xeon CPU E5-2623 v4 and Nvidia QuadroGP100 3. ",
654
+ "bbox": [
655
+ 174,
656
+ 512,
657
+ 825,
658
+ 566
659
+ ],
660
+ "page_idx": 5
661
+ },
662
+ {
663
+ "type": "text",
664
+ "text": "3.1 BLIND SOURCE SEPARATION FOR AFFINE TRANSFORMATIONS ON IMAGES ",
665
+ "text_level": 1,
666
+ "bbox": [
667
+ 176,
668
+ 587,
669
+ 728,
670
+ 599
671
+ ],
672
+ "page_idx": 5
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "In our experiments, we use three benchmark images widely used in computer vision from the University of Southern California’s Signal and Image Processing Institute (USC-SIPI)4, which include “airplane (F-16)”, “lake” and “peppers”. Each image is standardized to have $3 2 \\mathrm { x } 3 2 $ pixels with red, green and blue color channels with integer values between 0 and 255 to represent the intensity of each pixel. These images shown in Figure 2a are the source signal $\\mathbf { Z }$ which are unknown to the model. They are only used as ground truth to evaluate the model’s output. The equation ${ \\bf X } = { \\bf A } { \\bf Z }$ is used to generate the received signal $\\mathbf { X }$ by randomly generating values for a mixing matrix A using the uniform distribution which generates real numbers between 1 and 6. The images are then rescaled to integer values within the range between 0 and 255. The received signal $\\mathbf { X }$ , which is the input to the model, is the three images shown in Figure 2b. The three images for the mixed signal may look visually similar, however, they are actually superposition of the source signal with different intensity. The objective of our model is to reconstruct the source signal $\\mathbf { Z }$ without knowing the mixing matrix A. ",
677
+ "bbox": [
678
+ 173,
679
+ 613,
680
+ 825,
681
+ 792
682
+ ],
683
+ "page_idx": 5
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "We compare our approach to FastICA (Hyvarinen & Oja, 2000) with the ¨ log cosh function as the signal prior, dictionary learning (DL) (Olshausen & Field, 1997) with constraint for positive dictionary and positive code, and NMF with the coordinate descent solver and non-negative double singular value decomposition (NNDSVD) initialization (Boutsidis & Gallopoulos, 2008) with zero values replaced with the mean of the input. ",
688
+ "bbox": [
689
+ 174,
690
+ 800,
691
+ 823,
692
+ 871
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "image",
698
+ "img_path": "images/151d7988a298edc332a3112cd896b77df7b2eb25f831ab8e58d9b2dfdadae6fb.jpg",
699
+ "image_caption": [
700
+ "Figure 4: Time series signal experiment. "
701
+ ],
702
+ "image_footnote": [],
703
+ "bbox": [
704
+ 171,
705
+ 98,
706
+ 825,
707
+ 252
708
+ ],
709
+ "page_idx": 6
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Since BSS is an unsupervised learning problem, the order of the signal is not recovered. We identify the corresponding signal by taking all permutations of the output and calculate the minimum euclidean distance with the ground truth. The permutation which returns the minimum error is considered as the correct order of the image. The scale of the output is also not recovered, thereby we have used min-max normalization to the output of each model. ",
714
+ "bbox": [
715
+ 173,
716
+ 301,
717
+ 823,
718
+ 371
719
+ ],
720
+ "page_idx": 6
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "Separation results for images are shown in Figure 2. Our proposed approach IGBSS is able to recover majority of the “shape” of the source signal, while the intensity of each image appears to larger than the ground truth for all images. Small residuals of each image can be seen on the other images. For instance, in the airplane (F-16) image, there residuals from the lake image can be clearly seen. Compared to the reconstruction of IGBSS with FastICA, DL and NMF, IGBSS performs significantly better as all the other approaches are unable to clearly separate the mixed signal. FastICA was unable to provide a reasonable reconstruction with 3 mixed signal. To overcome this limitation of FastICA, we randomly generated another column of the mixing matrix and append it to the current mixing matrix to create 4 mixed signals as an input to FastICA to recover a more reasonable signal. ",
725
+ "bbox": [
726
+ 173,
727
+ 377,
728
+ 825,
729
+ 517
730
+ ],
731
+ "page_idx": 6
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "The root mean square error (RMSE) of the Euclidean distance and the signal-to-noise ratio (SNR) between the reconstruction and the ground truth is calculated to quantify results of each method. The SNR is computed by $\\mathrm { S N R } _ { d B } = 2 0 \\log _ { 1 0 } ( z _ { \\mathrm { n o r m } } / | ( z - z _ { \\mathrm { n o r m } } ) | )$ . The full results are shown in Table 1 (top row for each experiment). In the table, we present three experiments with different RGB images from USC-SIPI dataset, for each experiment we generate a new mixing matrix, where the second and the third experiments uses images of “mandrill”, “splash”, “jelly beans” and “mandrill”, “lake”, “peppers”, respectively. Ground truth and resulting images for second and third experiments are presented in Supplement. Our results clearly show that IGBSS is superior to other methods, that is, IGBSS has consistently produced the lowest RMSE error for every experiment. When looking at the SNR ratio, our model has produce the highest SNR for majority of the cases and is always able to recover the same result after each run as it is formulated as convex optimization. ",
736
+ "bbox": [
737
+ 173,
738
+ 523,
739
+ 825,
740
+ 676
741
+ ],
742
+ "page_idx": 6
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "3.2 BLIND SOURCE SEPARATION WITH HIGHER-ORDER FEATURE INTERACTIONS ",
747
+ "text_level": 1,
748
+ "bbox": [
749
+ 174,
750
+ 693,
751
+ 751,
752
+ 708
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "We demonstrate the ability of BSS for our model to include higher-order feature interactions in BSS. We use the same benchmark images in the standard BSS as the source signal $\\mathbf { Z }$ for our experiment. We generate the higher-order feature interactions of the received signal by using the multiplicative product of the source signal. If we take into account up to $k$ th order interaction $( k \\leq N )$ , ",
759
+ "bbox": [
760
+ 176,
761
+ 718,
762
+ 825,
763
+ 775
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "equation",
769
+ "img_path": "images/6d6bc810d1266c0aad88a8572fa62075e6019c4d1961b90962f3758b37152abf.jpg",
770
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle x _ { l m } = \\sum _ { n } a _ { l n } z _ { n m } + \\sum _ { n 1 } \\sum _ { n _ { 2 } > n _ { 1 } } a _ { l n _ { 1 } n _ { 2 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } + \\sum _ { n 1 } \\sum _ { n _ { 2 } > n _ { 1 } } \\sum _ { n _ { 3 } > n _ { 2 } } a _ { l n _ { 1 } n _ { 2 } n _ { 3 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } z _ { n _ { 3 } m } } } \\\\ { { \\displaystyle \\qquad + \\cdot \\cdot + \\sum _ { n _ { 1 } } \\cdot \\cdot \\cdot \\sum _ { n _ { k } > n _ { k - 1 } } a _ { l n _ { 1 } . . . n _ { k } } z _ { n _ { 1 } m } \\cdot . . \\ z _ { n _ { k } m } . } } \\end{array}\n$$",
771
+ "text_format": "latex",
772
+ "bbox": [
773
+ 191,
774
+ 779,
775
+ 805,
776
+ 852
777
+ ],
778
+ "page_idx": 6
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "All the other known approaches take into account only first order interactions (that is, affine transformation) between features. Differently, our model can directly incorporate the higher-order features as we do not have any assumption of the affine transformation. When we consider up to $k \\mathrm { t h }$ order interactions, we additionally include elements corresponding to new mixing parameters into the mixing layer. For example, if $k = 2$ , nodes for $a _ { l n _ { 1 } n _ { 2 } }$ are added and $a _ { l n _ { 1 } n _ { 2 } } \\ \\preceq \\ z _ { n m }$ if $n _ { 1 } = n$ or $n _ { 2 } = n$ . Figure 3 shows experimental results for the third-order feature experiment. Our approach IGBSS shows superior reconstruction of the source signal to other approaches. All the other approaches except for NMF is able to achieve reasonable reconstruction. NMF is able to recover the “shape” of the image, however, unlike IBSS, NMF is a degenerate approach, so it is unable to recover all color channels in the correct proportion, creating discoloring for the image which is clearly shown in the SNR values. Since the proportion of the intensity of the pixel is not recovered. In terms of both of the RMSE and the SNR shown in Table 1, IGBSS again shows the best results for both second- and third-order interactions of signals across three experiments. ",
783
+ "bbox": [
784
+ 174,
785
+ 854,
786
+ 823,
787
+ 924
788
+ ],
789
+ "page_idx": 6
790
+ },
791
+ {
792
+ "type": "table",
793
+ "img_path": "images/c355fffe2d3f364145a37ec055f3068f13308c507dcf57f4b603bca3347147c0.jpg",
794
+ "table_caption": [
795
+ "Table 2: Quantitative results for time-series separation experiment (mean $\\pm$ standard deviation with 40 runs). ",
796
+ "(a) Root Mean Squared Error (RMSE) "
797
+ ],
798
+ "table_footnote": [],
799
+ "table_body": "<table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>0.702 ±0.000</td><td>0.703±0.000</td><td>0.414± 0.286</td></tr><tr><td>Second</td><td>0.921 ± 0.000</td><td>0.921 ± 0.000</td><td>1.700 ± 0.167</td></tr><tr><td>Third</td><td>0.967 ± 0.000</td><td>0.961± 0.000</td><td>1.388 ± 0.178</td></tr></table>",
800
+ "bbox": [
801
+ 176,
802
+ 161,
803
+ 485,
804
+ 213
805
+ ],
806
+ "page_idx": 7
807
+ },
808
+ {
809
+ "type": "table",
810
+ "img_path": "images/2750a8a9066b96c460b7e75855d241688f1226e2a4d184bbb48ceee12b4ac2ff.jpg",
811
+ "table_caption": [
812
+ "(b) Signal-to-noise (SNR) (units in dB) "
813
+ ],
814
+ "table_footnote": [],
815
+ "table_body": "<table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>3.596±0.000</td><td>3.600±0.000</td><td>15.391± 3.813</td></tr><tr><td>Second</td><td>0.291± 0.000</td><td>0.042 ± 0.000</td><td>-5.803 ± 1.124</td></tr><tr><td>Third</td><td>0.340 ± 0.000</td><td>0.128 ± 0.000</td><td>-3.427 ± 1.249</td></tr></table>",
816
+ "bbox": [
817
+ 496,
818
+ 161,
819
+ 812,
820
+ 212
821
+ ],
822
+ "page_idx": 7
823
+ },
824
+ {
825
+ "type": "text",
826
+ "text": "",
827
+ "bbox": [
828
+ 173,
829
+ 224,
830
+ 825,
831
+ 337
832
+ ],
833
+ "page_idx": 7
834
+ },
835
+ {
836
+ "type": "text",
837
+ "text": "3.3 TIME SERIES DATA ANALYSIS ",
838
+ "text_level": 1,
839
+ "bbox": [
840
+ 176,
841
+ 353,
842
+ 423,
843
+ 367
844
+ ],
845
+ "page_idx": 7
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "We demonstrate the effectiveness of our model on time series data. In our experiments, we create three signals with 500 observations each using the sinusoidal function, sign function, and the sawtooth function. The synthetic data simulates typical signals from a wide range of applications including audio, medical and sensors. We randomly generate a mixing matrix by drawing from a uniform distribution with values between 0.5 and 2. In our experiment, we provide comparison of using both min-max normalization and exponential kernel as a pre-processing step and compare our approach with FastICA. ",
850
+ "bbox": [
851
+ 174,
852
+ 378,
853
+ 825,
854
+ 477
855
+ ],
856
+ "page_idx": 7
857
+ },
858
+ {
859
+ "type": "text",
860
+ "text": "Experimental results are illustrated in Figure 4. These results show that IGBSS is superior to all the ICA approaches because it is able to recover both the shape of the signal and the sign of the signal, while all the other ICA approaches are only able to recover the shape of the signal and are unable to recover the sign of the signal. This means that ICA could recover a flipped signal. We have paired the recovered signal of ICA with the ground truth by finding the signal and sign with the lowest RMSE error. In any practical application, this is not possible for ICA because the latent signal is unknown. Through visual inspection, IGBSS is able to recover all visual signals with high accuracy, while FastICA is only able to recover the first-order interaction and it is unable to produce a reasonable recovery for second- and third-order interactions. In addition to our visual comparison, we have also performed a quantitative analysis on the experimental results using RMSE error with the ground truth. Results are shown in Table 2. FastICA has shown to have better performance for First-Order interactions. However, for second- and third-order SNR results for FastICA is unable to recover a reasonable signal because the noise is more dominant. IGBSS has shown superior performance and is able to recover the signal for second- and third-order interactions with better scores for both RMSE and SNR. ",
861
+ "bbox": [
862
+ 174,
863
+ 483,
864
+ 825,
865
+ 690
866
+ ],
867
+ "page_idx": 7
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "4 CONCLUSION ",
872
+ "text_level": 1,
873
+ "bbox": [
874
+ 176,
875
+ 712,
876
+ 318,
877
+ 728
878
+ ],
879
+ "page_idx": 7
880
+ },
881
+ {
882
+ "type": "text",
883
+ "text": "We have proposed a novel blind source separation (BSS) method, called Information Geometric Blind Source Separation (IGBSS). We have formulated our approach using the log-linear model, which enables us to introduce a hierarchical structure into its sample space to achieve BSS. We have theoretically shown that IGBSS has desirable properties for BSS such as unique recover of source signals as it solves the convex optimization problem by minimizing the KL divergence from mixed signals to source signals. We have experimentally shown that IGBSS recovers images and signals closer to the ground truth than independent component analysis (ICA), dictionary learning (DL) and non-negative matrix factorization (NMF). Thanks to the flexibility of the hierarchical structure, IGBSS is able to separate signals with complex interactions such as higher-order interactions. Our model is superior to the other approaches because it is non-degenerate and is able to recover the sign of the signal. Since our approach is flexible and requires less assumptions than alternative approaches, it can be applied to various real world applications such as medical imaging, signal processing, and image processing. ",
884
+ "bbox": [
885
+ 174,
886
+ 743,
887
+ 825,
888
+ 924
889
+ ],
890
+ "page_idx": 7
891
+ },
892
+ {
893
+ "type": "text",
894
+ "text": "REFERENCES \nA. Agresti. Categorical Data Analysis. Wiley, 3 edition, 2012. \nS. Amari. Information geometry on hierarchy of probability distributions. IEEE Transactions on Information Theory, 47(5):1701–1711, 2001. \nShun-Ichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10(2):251– 276, 1998. \nShun-Ichi. Amari. Information geometry and its applications: Convex function and dually flat manifold. In F. Nielsen (ed.), Emerging Trends in Visual Computing: LIX Fall Colloquium, ETVC 2008, Revised Invited Papers, pp. 75–102. Springer, 2009. \nShun-Ichi. Amari. Information Geometry and Its Applications. Springer, 2016. \nAnthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural Computation, 7(6):1129–1159, 1995. \nOlivier Berne, C Joblin, Y Deville, JD Smith, M Rapacioli, JP Bernard, J Thomas, W Reach, and A Abergel. Analysis of the emission of very small dust particles from spitzer spectro-imagery data using blind signal separation methods. Astronomy & Astrophysics, 469(2):575–586, 2007. \nChristos Boutsidis and Efstratios Gallopoulos. SVD based initialization: A head start for nonnegative matrix factorization. Pattern Recognition, 41(4):1350–1362, 2008. \nJean-Franc¸ois Cardoso. High-order contrasts for independent component analysis. Neural Computation, 11(1):157–192, 1999. \nPierre Comon. Independent component analysis, a new concept? Signal Processing, 36(3):287–314, 1994. \nMarco Congedo, Cedric Gouy-Pailler, and Christian Jutten. On the blind source separation of human ´ electroencephalogram by approximate joint diagonalization of second order statistics. Clinical Neurophysiology, 119(12):2677–2686, 2008. \nB. A. Coull and A. Agresti. Generalized log-linear models with random effects, with application to smoothing contingency tables. Statistical Modelling, 3(4):251–271, 2003. \nChris HQ Ding, Tao Li, and Michael I Jordan. Convex and semi-nonnegative matrix factorizations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(1):45–55, 2008. \nGerhard Gierz, Karl Heinrich Hofmann, Klaus Keimel, Jimmie D Lawson, Michael Mislove, and Dana S Scott. Continuous lattices and domains, volume 93. Cambridge university press, 2003. \nAapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. ¨ Neural Networks, 13(4-5):411–430, 2000. \nTakuya Isomura and Taro Toyoizumi. A local learning rule for independent component analysis. Scientific Reports, 6:28073, 2016. \nQuoc V Le, Alexandre Karpenko, Jiquan Ngiam, and Andrew Y Ng. ICA with reconstruction cost for efficient overcomplete feature learning. In Advances in Neural Information Processing Systems 24, pp. 1017–1025, 2011. \nDaniel D Lee and H Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems 13, pp. 556–562, 2001. \nSimon Luo and Mahito Sugiyama. Bias-variance trade-off in hierarchical probabilistic models using higher-order feature interactions. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, pp. 4488–4495, 2019. \nKevin P Murphy. Machine Learning: A Probabilistic Perspective. MIT press, 2012. \nBruno A Olshausen and David J Field. Sparse coding with an overcomplete basis set: A strategy employed by V1? Vision Research, 37(23):3311–3325, 1997. \nKarl Pearson. LIII. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901. \nHiroshi Sawada, Nobutaka Ono, Hirokazu Kameoka, Daichi Kitamura, and Hiroshi Saruwatari. A review of blind source separation methods: two converging routes to ILRMA originating from ICA and NMF. APSIPA Transactions on Signal and Information Processing, 8, 2019. \nMatthias Scholz, Fatma Kaplan, Charles L Guy, Joachim Kopka, and Joachim Selbig. Non-linear PCA: a missing data approach. Bioinformatics, 21(20):3887–3895, 2005. \nMahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Information decomposition on structured space. In 2016 IEEE International Symposium on Information Theory, pp. 575–579, 2016. \nMahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Tensor balancing on statistical manifold. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3270–3279, 2017. \nRicardo Vigario, Veikko Jousm ´ aki, Matti H ¨ am¨ al¨ ainen, Riitta Hari, and Erkki Oja. Independent ¨ component analysis for identification of artifacts in magnetoencephalographic recordings. In Advances in Neural Information Processing Systems 10, pp. 229–235, 1998. \nHuan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust PCA via outlier pursuit. In Advances in Neural Information Processing Systems, pp. 2496–2504, 2010. \nHui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of Computational and Graphical Statistics, 15(2):265–286, 2006. ",
895
+ "bbox": [
896
+ 171,
897
+ 70,
898
+ 828,
899
+ 928
900
+ ],
901
+ "page_idx": 8
902
+ },
903
+ {
904
+ "type": "text",
905
+ "text": "",
906
+ "bbox": [
907
+ 171,
908
+ 103,
909
+ 826,
910
+ 429
911
+ ],
912
+ "page_idx": 9
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "A APPENDIX ",
917
+ "text_level": 1,
918
+ "bbox": [
919
+ 174,
920
+ 446,
921
+ 299,
922
+ 463
923
+ ],
924
+ "page_idx": 9
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "A.1 PARAMETER COMPUTATION FOR EACH LAYER ",
929
+ "text_level": 1,
930
+ "bbox": [
931
+ 173,
932
+ 477,
933
+ 540,
934
+ 493
935
+ ],
936
+ "page_idx": 9
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "In the following, we give $p , \\eta$ , and the gradient for each layer, which are used in gradient descent. ",
941
+ "bbox": [
942
+ 169,
943
+ 503,
944
+ 812,
945
+ 520
946
+ ],
947
+ "page_idx": 9
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "Received Layer (Input Layer): Probability $p ( x )$ on the received layer $x \\in \\mathcal { X }$ is obtained as ",
952
+ "bbox": [
953
+ 171,
954
+ 525,
955
+ 781,
956
+ 540
957
+ ],
958
+ "page_idx": 9
959
+ },
960
+ {
961
+ "type": "equation",
962
+ "img_path": "images/44cab45c8562165ecc7a058c7d32d359d24b7744874492b030340d57081cb436.jpg",
963
+ "text": "$$\n\\begin{array} { c } { \\log p ( x ) = \\displaystyle \\sum _ { z \\in \\mathcal { Z } } \\mathbf { 1 } _ { z \\preceq x } \\theta _ { z } + \\displaystyle \\sum _ { a \\in \\mathcal { A } } \\mathbf { 1 } _ { a \\preceq x } \\theta _ { a } + \\theta _ { \\perp } , } \\\\ { \\eta _ { x } = \\displaystyle \\sum _ { x ^ { \\prime } \\in \\mathcal { X } } \\mathbf { 1 } _ { x \\preceq x ^ { \\prime } } p ( x ^ { \\prime } ) = p ( x ) . } \\end{array}\n$$",
964
+ "text_format": "latex",
965
+ "bbox": [
966
+ 349,
967
+ 542,
968
+ 643,
969
+ 614
970
+ ],
971
+ "page_idx": 9
972
+ },
973
+ {
974
+ "type": "text",
975
+ "text": "We do not need to compute gradient for the received layer as there is no parameter on this layer and $\\theta _ { x } = 0$ for all $x \\in \\mathcal { X }$ . ",
976
+ "bbox": [
977
+ 173,
978
+ 614,
979
+ 823,
980
+ 643
981
+ ],
982
+ "page_idx": 9
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "Source Layer (Output Layer): Probability $p ( z )$ on the source layer for each $z \\in { \\mathcal { Z } }$ is given as ",
987
+ "bbox": [
988
+ 169,
989
+ 648,
990
+ 797,
991
+ 665
992
+ ],
993
+ "page_idx": 9
994
+ },
995
+ {
996
+ "type": "equation",
997
+ "img_path": "images/3900f7c245d06dfeaeb188b47bce39f79cba7b5dc58531633412756d9e3e6d8a.jpg",
998
+ "text": "$$\n\\begin{array} { c } { { \\displaystyle \\log p ( z ) = \\sum _ { z ^ { \\prime } \\in \\mathcal { Z } , \\atop { z \\in \\mathcal { X } } } \\mathbf { 1 } _ { z ^ { \\prime } \\preceq z } \\theta _ { z ^ { \\prime } } + \\sum _ { a \\in \\mathcal { A } } \\mathbf { 1 } _ { a \\preceq z } \\theta _ { a } + \\theta _ { \\bot } = \\theta _ { z } + \\sum _ { a \\in \\mathcal { A } } \\mathbf { 1 } _ { a \\preceq z } \\theta _ { a } + \\theta _ { \\bot } , } } \\\\ { { \\displaystyle \\eta _ { z } = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { z \\preceq x } p ( x ) + \\sum _ { z ^ { \\prime } \\in \\mathcal { Z } } \\mathbf { 1 } _ { z \\preceq z ^ { \\prime } } p ( z ^ { \\prime } ) = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { z \\preceq x } p ( x ) + p ( z ) . } } \\end{array}\n$$",
999
+ "text_format": "latex",
1000
+ "bbox": [
1001
+ 259,
1002
+ 666,
1003
+ 732,
1004
+ 739
1005
+ ],
1006
+ "page_idx": 9
1007
+ },
1008
+ {
1009
+ "type": "text",
1010
+ "text": "Thus the gradient for the source layer is given as ",
1011
+ "bbox": [
1012
+ 176,
1013
+ 741,
1014
+ 493,
1015
+ 756
1016
+ ],
1017
+ "page_idx": 9
1018
+ },
1019
+ {
1020
+ "type": "equation",
1021
+ "img_path": "images/1bb1300c087439d2b1247149e3a2baddacc489ab3b59aa498ee5ac2e2bbc610f.jpg",
1022
+ "text": "$$\n\\frac { \\partial } { \\partial \\theta _ { z } } D _ { K L } ( \\hat { p } \\| p ) = \\eta _ { z } - \\hat { \\eta } _ { z } = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { z \\preceq x } \\left( p ( x ) - \\hat { p } ( x ) \\right) + p ( z ) .\n$$",
1023
+ "text_format": "latex",
1024
+ "bbox": [
1025
+ 295,
1026
+ 757,
1027
+ 702,
1028
+ 795
1029
+ ],
1030
+ "page_idx": 9
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Mixing Layer: Probability $p ( a )$ on this layer for each $a \\in { \\mathcal { A } }$ is given as ",
1035
+ "bbox": [
1036
+ 173,
1037
+ 797,
1038
+ 648,
1039
+ 813
1040
+ ],
1041
+ "page_idx": 9
1042
+ },
1043
+ {
1044
+ "type": "equation",
1045
+ "img_path": "images/96e78c485260f4dd3332b86af2a81d380de56f8dccf0aa66eebad60a75e6ca0c.jpg",
1046
+ "text": "$$\n\\begin{array} { c } { { \\displaystyle \\log p ( a ) = \\sum _ { a ^ { \\prime } \\in \\mathcal { A } } \\mathbf { 1 } _ { a ^ { \\prime } \\preceq a } \\theta _ { a ^ { \\prime } } + \\theta _ { \\bot } = \\theta _ { a } + \\theta _ { \\bot } , } } \\\\ { { \\displaystyle \\eta _ { a } = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { a \\preceq x } p ( x ) + \\sum _ { z \\in \\mathcal { Z } } \\mathbf { 1 } _ { a \\preceq z } p ( z ) + \\sum _ { a ^ { \\prime } \\in \\mathcal { A } } \\mathbf { 1 } _ { a \\preceq a ^ { \\prime } } p ( a ^ { \\prime } ) } } \\\\ { { \\displaystyle = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { a \\preceq x } p ( x ) + \\sum _ { z \\in \\mathcal { Z } } \\mathbf { 1 } _ { a \\preceq z } p ( z ) + p ( a ) . } } \\end{array}\n$$",
1047
+ "text_format": "latex",
1048
+ "bbox": [
1049
+ 297,
1050
+ 814,
1051
+ 697,
1052
+ 922
1053
+ ],
1054
+ "page_idx": 9
1055
+ },
1056
+ {
1057
+ "type": "text",
1058
+ "text": "The gradient of the mixing layer is given as ",
1059
+ "bbox": [
1060
+ 176,
1061
+ 103,
1062
+ 460,
1063
+ 118
1064
+ ],
1065
+ "page_idx": 10
1066
+ },
1067
+ {
1068
+ "type": "equation",
1069
+ "img_path": "images/f16ce081f9c9970d7d65c40769f8e68257bc87a56bc78a48198855309bb2cc3b.jpg",
1070
+ "text": "$$\n\\frac { \\partial } { \\partial \\theta _ { a } } D _ { K L } ( \\hat { p } \\| p ) = \\eta _ { a } - \\hat { \\eta } _ { a } = \\sum _ { x \\in \\mathcal { X } } \\mathbf { 1 } _ { a \\preceq x } \\left( p ( x ) - \\hat { p } ( x ) \\right) + \\sum _ { z \\in \\mathcal { Z } } \\mathbf { 1 } _ { a \\preceq z } p ( z ) + p ( a ) .\n$$",
1071
+ "text_format": "latex",
1072
+ "bbox": [
1073
+ 238,
1074
+ 123,
1075
+ 758,
1076
+ 161
1077
+ ],
1078
+ "page_idx": 10
1079
+ },
1080
+ {
1081
+ "type": "text",
1082
+ "text": "Parameter values $\\theta _ { a }$ in the mixing layer represent the degree of mixing between source signals. Hence they can be used to perform feature selection and extraction. For example, if $\\theta _ { a } = 0$ in the extreme case, the corresponding node $a$ does not have any contribution to the source mixing. ",
1083
+ "bbox": [
1084
+ 174,
1085
+ 166,
1086
+ 826,
1087
+ 208
1088
+ ],
1089
+ "page_idx": 10
1090
+ },
1091
+ {
1092
+ "type": "text",
1093
+ "text": "A.2 FEATURE EXTRACTION FOR A 2D POINT CLOUD EXPERIMENT ",
1094
+ "text_level": 1,
1095
+ "bbox": [
1096
+ 176,
1097
+ 224,
1098
+ 651,
1099
+ 239
1100
+ ],
1101
+ "page_idx": 10
1102
+ },
1103
+ {
1104
+ "type": "text",
1105
+ "text": "We demonstrate the effectiveness for IGBSS to identify independent components on a 2-dimensional point cloud to be used for feature extraction or dimensionality reduction. In our experiment, we generate a 2-dimensional point cloud using two standard Student’s $t$ -distribution with 1.3 degree of freedom and have scaled the first dimension by $1 / 5$ and the second dimension by $1 / 1 0$ to the point cloud, illustrated in Figure 5a. Then we have randomly generated a mixing matrix for our experiment to generate a mixed signal shown in Figure 5b. We run the experiment on our model IGBSS using min-max normalization as a pre-processing step and compare it to PCA and ICA. We apply the reverse transformation of the min-max normalization on the recovered signal and have plotted the results in Figure 5. From the experimental results, we can see that PCA is able to recover the same scale of the point cloud. However, the sign of the signal is not recovered as we have recovered reversed sign of the signal. PCA also recovers signals which are orthogonal to the largest variance. Therefore the axes of the point cloud recovered by PCA does not align with the source signal in Figure 5a, that is, the axes do not run parallel to the $\\mathbf { X } ^ { - }$ and y- axes but instead is still in the same orientation as the mixed signal. This is not what we want as the signal is still mixed, and we would like to recover the signal in the same orientation as the source signal in blind source separation. ICA aims to recover statistically independent signals that are generally considered as the axes with the largest variances and not necessarily orthogonal to each other. However, the limitations of ICA is that it is unable to recover the sign and the scale of the signal. Therefore the scale of the recovered signal does not match with the source signal. In our experiment, we have plotted the results with unit variance as the recovered signal is generally unnormalized in ICA. Since our experiment is synthetically generated, we are able to quantitatively measure the the error in each approach by normalizing both the recovered signal and the source signal by its standard deviation then computing the root mean squared error (RMSE) and the signal-to-noise ratio (SNR). The results of this is shown in Table 3. Our proposed approach IGBSS has clear advantages, where it is able to recover the same orientation as the source signal as well as preserve the signal. ",
1106
+ "bbox": [
1107
+ 173,
1108
+ 251,
1109
+ 825,
1110
+ 598
1111
+ ],
1112
+ "page_idx": 10
1113
+ },
1114
+ {
1115
+ "type": "table",
1116
+ "img_path": "images/bffe76799909f5b90d337a93ff9ee138e8ff05b9c37d3b9e2473fee545e17a9f.jpg",
1117
+ "table_caption": [
1118
+ "Table 3: Signal-to-Noise Ratio (SNR) and Root Mean Square Error (RMSE) between the recovered signal and the latent source signal for the 2-dimensional point cloud experiment. "
1119
+ ],
1120
+ "table_footnote": [],
1121
+ "table_body": "<table><tr><td>Model</td><td>PCA</td><td>ICA</td><td>IGBSS</td></tr><tr><td>RMSE</td><td>2.011</td><td>1.445</td><td>1.421</td></tr><tr><td>SNR</td><td>25.997</td><td>27.431</td><td>27.503</td></tr></table>",
1122
+ "bbox": [
1123
+ 367,
1124
+ 650,
1125
+ 629,
1126
+ 708
1127
+ ],
1128
+ "page_idx": 10
1129
+ },
1130
+ {
1131
+ "type": "text",
1132
+ "text": "A.3 RUNTIME ANALYSIS ",
1133
+ "text_level": 1,
1134
+ "bbox": [
1135
+ 174,
1136
+ 731,
1137
+ 361,
1138
+ 746
1139
+ ],
1140
+ "page_idx": 10
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "In our experiment, we used a learning rate of 1.0 for gradient descent. Although the time complexity for each iteration of natural gradient is $\\mathcal { O } ( \\vert \\mathcal { Z } \\vert ^ { 3 } + \\vert \\bar { \\mathcal { A } } \\vert ^ { 3 } + \\vert \\Omega \\vert \\vert S \\vert )$ , which is larger than $\\mathcal { O } ( | \\Omega | \\bar { | } S | ^ { 2 } )$ for gradient descent, natural gradient is able to reach convergence faster because it is quadratic convergence and requires significantly less iterations compared to gradient descent, which linearly converges. Increasing the size of the input will increase the size of $| \\Omega |$ only, while the number of parameters $| { \\mathcal { Z } } | , | \\mathbf { A } |$ remain this same. Since the complexity of natural gradient is linear with respect to the size $| \\Omega |$ of the input, increasing the size of the input is unlikely to increase the runtime significantly. Our experimental analysis in Figure 6 supports this analysis: our model scales linearly for both natural gradient and gradient descent when increasing the order of interactions in our model. This is because for practical application it is unlikely that $| { \\mathcal { A } } | > | { \\mathcal { Z } } |$ . The different between the runtime for natural gradient and gradient descent becomes larger as the order of interactions increased. ",
1145
+ "bbox": [
1146
+ 173,
1147
+ 757,
1148
+ 825,
1149
+ 922
1150
+ ],
1151
+ "page_idx": 10
1152
+ },
1153
+ {
1154
+ "type": "image",
1155
+ "img_path": "images/9b470b8454bc2ff4564d89a17b2eb695f6afb4a3e6b33716033d1699fc05d23c.jpg",
1156
+ "image_caption": [
1157
+ "Figure 5: 2-dimensional point cloud experiment. "
1158
+ ],
1159
+ "image_footnote": [],
1160
+ "bbox": [
1161
+ 187,
1162
+ 112,
1163
+ 792,
1164
+ 659
1165
+ ],
1166
+ "page_idx": 11
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "text": "A.4 SIGN INVERSION IN ICA ",
1171
+ "text_level": 1,
1172
+ "bbox": [
1173
+ 176,
1174
+ 708,
1175
+ 390,
1176
+ 722
1177
+ ],
1178
+ "page_idx": 11
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "When demonstrate the problem of the sign inversion in ICA. We use the same experimental set-up explained in Section 3.1 on blind source separation for affine transformation. We run the experiment on the dataset used for experimental 1 for the first order experiment and have shown the output of several runs in FastICA to show the problem of the sign inversion in Figure 7. For the 6 runs, we can see that none of the experiments were able to obtain the correct sign of the signal. This means that apply FastICA to applications where the sign of the signal is important is quite problematic. ",
1183
+ "bbox": [
1184
+ 173,
1185
+ 733,
1186
+ 825,
1187
+ 818
1188
+ ],
1189
+ "page_idx": 11
1190
+ },
1191
+ {
1192
+ "type": "image",
1193
+ "img_path": "images/5b071035957f1f08dc4c34e87c300d9d015b50125eee38383e4c7ec93575e456.jpg",
1194
+ "image_caption": [
1195
+ "Figure 6: Experimental analysis of the scalability of number of parameters and higher-order features in the model for both natural gradient approach and gradient descent "
1196
+ ],
1197
+ "image_footnote": [],
1198
+ "bbox": [
1199
+ 179,
1200
+ 154,
1201
+ 816,
1202
+ 476
1203
+ ],
1204
+ "page_idx": 12
1205
+ },
1206
+ {
1207
+ "type": "image",
1208
+ "img_path": "images/4582ce9d991bf86c5a50d20f0ba5bef1e4cf89751c1f7ba1a75b86d7f3cfb9b7.jpg",
1209
+ "image_caption": [
1210
+ "Figure 7: Six different runs of FastICA with the same experimental input experimental dataset as exp1 with first order interactions. The different results can demonstrate that the FastICA model is non-convex leading to potential problemic results such as the sign inversion. "
1211
+ ],
1212
+ "image_footnote": [],
1213
+ "bbox": [
1214
+ 197,
1215
+ 627,
1216
+ 800,
1217
+ 818
1218
+ ],
1219
+ "page_idx": 12
1220
+ }
1221
+ ]
parse/train/jnRqf0CzBK/jnRqf0CzBK_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/jnRqf0CzBK/jnRqf0CzBK_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rylnK6VtDH/rylnK6VtDH.md ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MULTIPLICATIVE INTERACTIONSAND WHERE TO FIND THEM
2
+
3
+ Siddhant M. Jayakumar, Wojciech M. Czarnecki, Jacob Menick, Jonathan Schwarz,
4
+ Jack Rae, Simon Osidnero, Yee Whye Teh, Tim Harley, Razvan Pascanu
5
+ DeepMind
6
+ {sidmj, lejlot, jmenick, schwarzjn, jwrae, osindero,
7
+ ywteh, tharley, razp}@google.com
8
+
9
+ # ABSTRACT
10
+
11
+ We explore the role of multiplicative interaction as a unifying framework to describe a range of classical and modern neural network architectural motifs, such as gating, attention layers, hypernetworks, and dynamic convolutions amongst others. Multiplicative interaction layers as primitive operations have a long-established presence in the literature, though this often not emphasized and thus under-appreciated. We begin by showing that such layers strictly enrich the representable function classes of neural networks. We conjecture that multiplicative interactions offer a particularly powerful inductive bias when fusing multiple streams of information or when conditional computation is required. We therefore argue that they should be considered in many situation where multiple compute or information paths need to be combined, in place of the simple and oft-used concatenation operation. Finally, we back up our claims and demonstrate the potential of multiplicative interactions by applying them in large-scale complex RL and sequence modelling tasks, where their use allows us to deliver state-of-the-art results, and thereby provides new evidence in support of multiplicative interactions playing a more prominent role when designing new neural network architectures.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Much attention has recently turned toward the design of custom neural network architectures and components in order to increase efficiency, maximise performance, or otherwise introduce desirable inductive biases. While there have been a plethora of newer, intricate architectures proposed, in this work we train our sights instead on an older staple of the deep learning toolkit: multiplicative interactions.
16
+
17
+ Although the term itself has fallen somewhat out of favour, multiplicative interactions have reappeared in a range of modern architectural designs. We start this work by considering multiplicative interactions as an object of study in their own right. We describe various formulations and how they relate to each other as well as connect more recent architectural developments (e.g. hypernetworks Ha et al. (2017), dynamic convolutions Wu et al. (2019)) to the rich and longer-standing literature on multiplicative interactions.
18
+
19
+ We hypothesise that multiplicative interactions are suitable for representing certain meaningful classes of functions needed to build algorithmic operations such as conditional statements or similarity metrics, and more generally as an effective way of integrating contextual information in a network in a way that generalizes effectively. We show this empirically in controlled synthetic scenarios, and also demonstrate significant performance improvement on a variety of challenging, large-scale reinforcement learning (RL) and sequence modelling tasks when a conceptually simple multiplicative interaction module is incorporated.
20
+
21
+ Such improvements are consistent with our hypothesis that the use of appropriately applied multiplicative interactions can provide a more suitable inductive bias over function classes leading to more data-efficient learning, better generalization, and stronger performance. We argue that these operations should feature more widely in neural networks in and of themselves, especially in the increasingly important setting of integrating multiple streams of information (including endogenously created streams e.g. in branching architectures).
22
+
23
+ ![](images/a2f0a3451a80ae8cf8c0e7f969c4507af41e847022a7f2ca6a71facce67cd6c1.jpg)
24
+ Figure 1: (Left) Venn diagrams of multiplicative interactions with respect to other model classes commonly used in ML. (Right) Comparison of various orders of multiplicative interactions and their relation to other perspectives.
25
+
26
+ Our contributions are thus: (i) to re-explore multiplicative interactions and their design principles; (ii) to aid the community’s understanding of other models (hypernetworks, gating, multiplicative RNNs) through them; (iii) to show their efficacy at representing certain solutions; and (iv) to empirically apply them to large scale sequence modeling and reinforcement learning problems, where we demonstrate state-of-the-art results.
27
+
28
+ # 2 MULTIPLICATIVE INTERACTIONS
29
+
30
+ We start by introducing notation and formalising the concept of multiplicative interactions. The underlying question we are trying to answer is how to combine two different streams of information. Specifically, given $\mathbf { x } \in \mathbb { R } ^ { n }$ and $\mathbf { z } \in \mathbb { R } ^ { m }$ , our goal is to model an unknown function $f _ { \mathrm { t a r g e t } } ( \mathbf { x } , \mathbf { z } ) \in \mathbb { R } ^ { k }$ that entails some interaction between the two variables. In practice $\mathbf { x }$ and $\mathbf { z }$ might be arbitary hidden activations, different input modalities (e.g. vision and language), or conditioning information and inputs.
31
+
32
+ The standard approach is to approximate $f _ { \mathrm { t a r g e t } }$ by a neural network $f$ . If $f$ is restricted to employ a single layer of weights, we typically use $\breve { f } ( \mathbf { x } , \mathbf { z } ) = \mathbf { W } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { b }$ , where $\left[ \mathbf { x } ; \mathbf { z } \right]$ represents the concatenation of $\mathbf { x }$ and $\mathbf { z }$ , and $\mathbf { W } \in \mathbb { R } ^ { ( m + n ) \times k }$ and $\mathbf { b } \in \mathbb { R } ^ { k }$ are learned parameters. The interaction between $\mathbf { x }$ and $\mathbf { z }$ is only additive given this formulation. However through stacking multiple similar layers (with element-wise nonlinearities inbetween), $f$ can approximate any function $f _ { \mathrm { t a r g e t } }$ given sufficient data (and capacity).
33
+
34
+ In contrast, a single layer with multiplicative interactions would impose the functional form
35
+
36
+ $$
37
+ f ( \mathbf { x } , \mathbf { z } ) = \mathbf { z } ^ { T } \mathbb { W } \mathbf { x } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { V } \mathbf { x } + \mathbf { b }
38
+ $$
39
+
40
+ where $\mathbb { W }$ is a 3D weight tensor, $\mathbf { U } , \mathbf { V }$ are regular weight matrices and $\mathbf { b }$ is a vector1. We posit that this specific form, while more costly, is more flexible, providing the right inductive bias to learn certain families of functions that are of interest in practice. Additionally, many existing techniques can be shown to rely on variations of the above bilinear form as detailed below.
41
+
42
+ Hypernetworks as Multiplicative Interactions. A Hypernetwork Ha et al. (2017) is a neural network $g$ that is used to generate the weights of another neural network given some context or input vector $\mathbf { z }$ . Particularly $f ( \bar { \mathbf { x } } ; \theta )$ becomes $f ( \mathbf { x } ; g ( \mathbf { z } ; \phi ) )$ . In the case where $f$ and $g$ are affine (as in the original work), such a network is exactly equivalent to the multiplicative form described above.
43
+
44
+ Specifically, we can decompose equation (1) and set $\mathbf { W } ^ { \prime } = \mathbf { z } ^ { T } \mathbb { W } + \mathbf { V }$ and $\mathbf { b } ^ { \prime } = \mathbf { z } ^ { T } \mathbf { U } + \mathbf { b }$ . We can now see $\mathbf { W } ^ { \prime }$ as the generated 2D weight matrix and $\mathbf { b } ^ { \prime }$ as the generated bias from some hypernetwork.
45
+
46
+ This allows us to have an input-conditional weight matrix and bias vector that are then used to generate output $\mathbf { y } = \mathbf { W } ^ { \prime } \mathbf { x } + \mathbf { b } ^ { \prime }$ . We can also consider the more general case of any affine transformation being generated by some arbitrary neural network, which can also be viewed as a multiplicative interaction where we first embed the context $\mathbf { z }$ and then use it in the equation above. This provides a basis for thinking about hypernetworks themselves as variations on the theme of multiplicative interactions, potentially accounting for a considerable amount of their efficacy.
47
+
48
+ Diagonal Forms and Gating Mechanisms. Let us consider a diagonal approximation to the projected $\mathbf { W } ^ { \prime }$ . This is given by a particular parametrization of ${ \bf W } ^ { \prime } = { \bf \bar { z } } ^ { T } { \mathbb { W } } + { \bf \bar { V } }$ above (see Figure 1 right). Multiplying with $\mathbf { W } ^ { \prime } = \mathrm { { d i a g } } ( a _ { 1 } , . . . , a _ { n } )$ can be implemented efficiently as $f = \mathbf { a } \odot \mathbf { x }$ where $\odot$ represents elementwise multiplication or the Hadamard product (similarly for the bias). This form now resembles commonly used gating methods, albeit they are often used with additional non-linearities (e.g. sigmoid units Dauphin et al. (2017); Van den Oord et al. (2016)). It can be viewed as a hypernetwork as well, where $\mathbf { z } ^ { T } \mathbf { W }$ represents the function generating parameters.
49
+
50
+ Attention and Multiplicative Interactions. While not the focus of this work, we note that attention systems in sequence modelling (Vaswani et al., 2017; Bahdanau et al., 2014) similarly use multiplicative interactions to effectively scale different parts of the input. This is typically done using the diagonal form above with $\mathbf { m } = { \bar { f } } ( \mathbf { x } , \mathbf { z } ) , \mathbf { y } = \mathbf { m } { \bar { \odot } } \mathbf { x }$ where $\mathbf { m }$ is often a bounded mask. Attention systems are typically used with different aims to those we describe here: they can suppress or amplify certain inputs and allow long-range dependencies by combining inputs across time-steps (when masking above is followed by a pooling layer, for example). We use these insights to posit that while more expensive, considering a higher order interaction (generating a vector mask) might prove more beneficial to such systems but we do not specifically consider attention in this paper and leave it to future work.
51
+
52
+ Scales and Biases. Further, we can make another low-rank approximation to the diagonal form and generate instead a scalar matrix – i.e. the hypernetwork outputs a single scalar scale (and/or bias) parameter per channel or feature vector we are considering, instead of a vector. We can again write this as $f = \mathbf { z } ^ { T } \mathbb { W } \odot \mathbf { x }$ where $\mathbf { z } ^ { T } \mathbb { W } = \alpha \mathbb { I }$ . This is common in methods such as FiLM (Perez et al., 2018; Dumoulin et al., 2018; 2017).
53
+
54
+ Multiplicative Interaction and Metric Learning. Another highly related field of active research is that of metric learning, where one tries to find the most suitable metric to measure similarity between objects in some parametrised space of metrics. One of the most commonly used classes is that of Mahalanobis distances $d _ { \mathbf { C } } ( \mathbf { x } , \bar { \mathbf { z } } ) = \| \mathbf { x } - \mathbf { z } \| _ { \mathbf { C } } = ( \mathbf { x } - \mathbf { z } ) ^ { T } \mathbf { C } ^ { - 1 } ( \mathbf { x } - \mathbf { z } )$ , which again maps onto multiplicative interaction units as $d _ { \bf C } ( { \bf x } , { \bf z } ) = ( { \bf x } - { \bf z } ) ^ { T } \dot { \bf C } ^ { - 1 } ( { \bf x } - { \bf z } ) = { \bf x } ^ { T } { \bf C } ^ { - 1 } { \bf x } - 2 { \bf x } ^ { T } \dot { \bf C } ^ { - 1 } { \bf z } +$ ${ \bf z } ^ { T } { \bf C } ^ { - 1 } { \bf z }$ . In metric learning, however, one usually explicitly defines losses over tuples (or higher order n-tuples) with direct supervision, while here we consider building blocks that can learn a metric internally, without direct supervision.
55
+
56
+ The Taxonomy of Multiplicative Interactions. Finally, we summarise these relationships in figure 1. We can think of multiplicative interactions equivalently in terms of either: (a) the approximation to the 3D tensor made; (b) the output of the “projected” context by the hypernetwork; or (c) the operation used to combine the generated weights/context and the input. For example, the general bilinear form is equivalent to a vanilla hypernetwork that generates a weight matrix for a matrix multiplication. Similarly, a diagonal 3D tensor is equivalent to a hypernetwork that generates a vector and is combined with a hadamard product.
57
+
58
+ # 3 EXPRESSIVITY OF THE MODEL
59
+
60
+ Vanilla MLPs are universal approximators – that is, for every continuous function $[ 0 , 1 ] ^ { d } \to \mathbb { R }$ (considered our target) and every approximation error $\epsilon > 0$ there exist hidden units $H$ and corresponding parameter values $\theta$ such that the distance in function space between the MLP output and the target function is smaller than . Consequently adding new modules/building blocks does not affect the approximation power of neural nets, however such modifications can change the hypotheses space – the set of functions that can be represented exactly (with 0 error), and the compactness of a good estimator (how many parameters are needed), as well as learnability.
61
+
62
+ We first show that multiplicative interactions strictly enlarge the hypotheses space of vanilla MLPs – that is, we add new functions which multi-layer multiplicative models can now represent perfectly, while also preserving our ability to represent those in the existing set modeled perfectly by vanilla MLPs (full proof in appendix A).
63
+
64
+ ![](images/2d4c375b87f644062f527d4858ae397804d5aaf032d941bc90249458b56fac8d.jpg)
65
+ Figure 2: Number of parameters needed for a regular, single layer MLP (blue line) to represent the function up to $0 . 1 ~ \mathrm { M S E }$ over the domain of a standard $d$ -dimensional Gaussian compared to the same quantity for a multiplicative model (green line). $\sigma$ denotes sigmoid. Dotted lines represent pruned models where all weights below absolute value of 0.001 were dropped. Note that for MLP all parameters are actually used, while for MI module some of these functions (summation and dot product) can be compactly represented with pruning.
66
+
67
+ Theorem 1. Let $\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with a multiplicative layer, then we have $\mathcal { H } _ { m l p } \subsetneq \mathcal { H } _ { m u }$ .
68
+
69
+ While valuable, such a result can also be trivially obtained by adding somewhat exotic activation functions (e.g. Weierstrass function $\begin{array} { r } { \sigma ( x ) = \sum _ { n = 0 } ^ { \infty } 0 . 5 ^ { n } \cos ( \dot { 7 } ^ { n } \pi x ) } \end{array}$ which is a continuous function but nowhere differentiable (Weierstrass, 1895); see appendix for the proof) to the pool of typically used ones. While increasing the hypothesis space on its own is not of great significance, the crucial point here is that the set $\mathcal { \bar { H } } _ { \mathrm { m u } } \backslash \mathcal { \bar { H } } _ { \mathrm { m l p } }$ helps extend our coverage to the set of basic functions that one would expect to need in composing solutions that mimic systems of interest – such as logical, physical, or biological ones.
70
+
71
+ Figure 2 shows the learnability (up to a certain error) of some simple two input functions against the number of parameters needed. We consider summation, gating, and dot products – which are basic buildings blocks of operations such as conditional statements or similarity metrics, and fundamental for implementing rich behaviours when combining different sources of information. For the gating and dot-product function classes, the complexity of MLPs required to learn them seems to grow exponentially, while the growth for multiplicative models is quadratic. On the other hand summation is trivially easier for an MLP. Thus we do not argue that multiplicative interactions are a silver bullet – but that such interactions add an important class of functions to the hypothesis set that are often the right inductive bias, or algorithmic building block, for many kinds of problems. In subsequent sections we show empirically that using them as context-integration layers leads to good performance gains across a range of tasks.
72
+
73
+ # 4 RELATED WORK
74
+
75
+ There is a vast body of literature surrounding multiplicative interactions, and these ideas have a long history, for example being discussed in the foundational era of connectionism (Rumelhart et al., 1986). Below we highlight some of the key works developed in the community over the last few decades and aim to show how these relate to each other.
76
+
77
+ Some of the earliest models leveraging multiplicative interactions were higher-order Boltzmann machines or autoencoders (Sejnowski, 1986; Memisevic & Hinton, 2007; Taylor & Hinton, 2009). Currently, the most common usage of multiplicative interactions seen in models that enjoy widespread adoption is via a factorised or diagonal representation of the necessary 3D weight tensor. The LSTM cell (Hochreiter & Schmidhuber, 1997) (and its descendents such as the GRU (Cho et al., 2014)) employ multiplicative interactions of this form in the gating units that are crucial for the long-term stability of memories. Enhanced multiplicative versions of LSTMs have also been formulated (Sutskever et al., 2011; Wu et al., 2016; Krause et al., 2016): these approaches essentially combine the previous hidden state and current input via an element-wise or hadamard product between projected representations.
78
+
79
+ Similarly, bilinear layers (often low-rank factorizations) have appeared extensively in the computer vision literature (Gao et al., 2016; Kim et al., 2016) and beyond (Dumoulin et al., 2018). Squeezeand-excitation networks, for example, can be seen as an instantiation of this idea (Hu et al., 2018). Specifically in visual-question answering systems, models like FiLM (Perez et al., 2018) or classconditional batch norm (Brock et al., 2019; Perez et al., 2017) use such diagonal forms to generate per-channel scales and biases as a function of some context. This has been shown to be effective at capturing relationships between the two different modalities (text and vision), as well as providing a powerful mechanism to allow a single network to conditionally specialize on multiple different tasks. Further, multimodal domains such as VQA have also seen such bilinear models used in combination with attention systems (Yu et al., 2017; Lu et al., 2016; Xu & Saenko, 2016; Schwartz et al., 2017).
80
+
81
+ Further, there are many additional works using gating mechanisms which can be thought of as such diagonal approximations used in conjunction with additional point-wise non-linearities or softmaxes. Recent examples of such include pixelCNNs (Van den Oord et al., 2016) and Highway Networks (Srivastava et al., 2015; Zilly et al., 2017), among others (Dauphin et al., 2017), and earlier examples can be seen in works such as Mixtures of Experts (Jacobs et al., 1991) and successors.
82
+
83
+ Multiplicative interactions in the non-factorised sense can also be thought of as a restricted class of Hypernetworks (Ha et al., 2017): models that generate the weights of one network from another. While the original presentation (Ha et al., 2017) considered their use for model compression in feed-forward nets (i.e. using layer IDs to generate weights), they also investigate HyperLSTMs, in which per timestep multiplicative biases are generated. A similar approach has also been applied to generating parameters in convolutional nets via “dynamic convolutions” where the size of the generated parameters is controlled by tying filters (Wu et al., 2019). Further, these ideas have been extended to Bayesian forms (Krueger et al., 2017) and also used for example, in architecture search (Brock et al., 2017).
84
+
85
+ Lastly, multiplicative interactions used to scale contributions from different spatial or temporal components play a key role in attention mechanisms (Bahdanau et al., 2014; Vaswani et al., 2017). They have also been used in some RL works to better condition information, e.g. in Feudal Networks (Vezhnevets et al., 2017) as a way for manager and worker units to interact, and better actionconditioning (Oh et al., 2015).
86
+
87
+ # 5 EXPERIMENTAL SETUP
88
+
89
+ We aim to demonstrate that the incorporation of multiplicative interactions can boost performance across a wide range of problems and domains, and we conjecture that this is because they effectively allow for better routing and integration of different kinds of information. Specifically we will show that multiplicative interactions allow better integration of (a) latent variables in decoder models, $( b )$ task or contextual information in multitask learning, (c) recurrent state in sequence models. We use neural process regression, multitask RL and language modelling as exemplar domains. Further details of architectures and hyper-parameters can be found in the appendix.
90
+
91
+ A Note on Implementation and Terminology. We use $\mathcal { M } ( \mathbf { x } , \mathbf { z } )$ below to mean the function $f ( \mathbf { x } , \mathbf { z } ) = \mathbf { z } ^ { T } \hat { \mathbb { W } } \mathbf { x } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { B } \mathbf { x } + \mathbf { b }$ (or referred to as MI in the legends). In all cases we implement this using a series of standard linear layers with a reshape operation in between to form the intermediate matrix (equivalently this can be done with einsum or tensor product notation; we provide a simple implementation in the appendix). The quantity $f _ { 1 } ( \mathbf { z } ) = \mathbf { z } ^ { T } \mathbb { W } + \mathbf { B }$ , (where as above $\mathbb { W }$ is 3D and $\mathbf { B }$ a 2D bias) represents the 2D output of projecting the contextual information. We refer to this interchangeably as the 2D-contextual projection or “generated weights” using the hypernet terminology. Similarly the “generated bias” is the 1D projection of the context $\mathbf { z }$ , that is, $\dot { f _ { 2 } } \dot { ( } z ) = \mathbf { z } ^ { T } \mathbf { U } + \mathbf { b }$ (and thus $f ( \mathbf { x } ; \mathbf { z } ) = f _ { 1 } ( \mathbf { z } ) \mathbf { x } + f _ { 2 } ( \mathbf { z } ) )$ .
92
+
93
+ While we aim to draw connections to other models and approximations in the literature above, our aim is not to advertise one specific instantiation or approximation over the other . As such, we use the same form above in all experiments (unless specified otherwise) and control parameter count by controlling the size of $\mathbf { z }$ . Undoubtedly, practitioners will find that task-specific tuning of the above form might yield comparable or better results with fewer parameters, given the right approximations.
94
+
95
+ ![](images/12b1283de791d8ac96cbeafc215a8cfdc031cb8d8343a82625fcb85fe15f5382.jpg)
96
+ Figure 3: Averaged learning curves for different models while varying the number of tasks in the toy multitask regression domain. Shaded regions represent standard error of mean estimation.
97
+
98
+ # 6 LEARNING CONTEXT DEPENDENT LAYERS FOR MULTITASK LEARNING
99
+
100
+ We start by considering the general paradigm of multitask-learning, wherein the goal is to train one model to solve $K$ different tasks. We show that we can boost performance here by learning context or task-conditional layers with multiplicative interactions. There is generally a trade-off between the transfer from similar tasks and the negative interference between those with very different solutions. Our claim is thus that context-conditional layers provide a best-of-both-worlds approach, with an inductive bias that allows transfer (as opposed to a multiheaded architecture) while also limiting interference.
101
+
102
+ We first demonstrate this with a toy example, where we attempt to regress two different classes of functions, affine and sines, with one model. Specifically, $y = a _ { i } x + b _ { i }$ and $y = a _ { i } \sin ( 1 0 x ) + b _ { i }$ where $a _ { i }$ and $b _ { i }$ are sampled per task from a uniform distribution. In Figure 3 we show results averaged over multiple runs, as we vary the number of tasks. We train both a standard MLP with multiple heads and one with that is given task ID as additional input and can see that the neither is able to use task information to do any better. On the other hand, the results show that a task-conditioned $\mathcal { M } ( x , \mathbf { t } )$ layer allows the model to learn both tasks better with less interference and also increased data efficiency. We see that the gains with using an $\mathcal { M }$ layer are more pronounced as we increase the number of tasks. More details are provided in appendix D.
103
+
104
+ # 6.1 MULTITASK RL ON DMLAB-30
105
+
106
+ Next, we consider a larger scale problem: multitask RL on the DeepMind Lab-30 domain (Beattie et al., 2016). This is a suite of 30 tasks in a partially-observable, first-person-perspective 3D environment, encompassing a range of laser-tag, navigation, and memory levels. We use a typical actor-critic RL setup within the Impala framework of Espeholt et al. (2018), with multiple actors and a single learner with off-policy correction (further details provided in appendix section E). We use exactly the architecture as in the original works (Espeholt et al., 2018; Hessel et al., 2019): a stack of convolutional layers followed by an LSTM, with output $\mathbf { h } _ { t }$ at each timestep. Normally these are then projected to policies $\pi$ and value functions $V$ that are shared across all tasks. At test time agents are typically not allowed to access ground truth task ID (e.g. this means value functions at training time could use this information).
107
+
108
+ Multi-head Policy and Value Layers We first show that a multi-headed agent architecture with one policy and value head per level does in fact boost performance. While this does use privileged information (task ID), this does show that there is some degree of interference between levels from sharing policy and value layers.
109
+
110
+ Multiplicative Policy and Value Layers We can instead consider using multiplicative layers here to integrate task information (one-hot task ID $\mathbf { I } _ { i }$ ) to modulate compute-paths. We learn a task embedding as below, and use it in a multiplicative layer that projects to policy and value functions. That is, we now have $\mathbf { c } = \mathrm { r e l u } ( \mathrm { M L P } ( \mathbf { I } _ { i } ) )$ as a context, and $\pi _ { t } , V _ { t } = \mathcal { M } ( \mathbf { h } _ { t } , \mathbf { c } )$ .
111
+
112
+ We show results in the same figure and find that such a layer provides a further boost in performance. This can be viewed as generating policy layers from some learnt embedding of the task ID. Our hypothesis is that while multiheaded architectures reduce interference, they also remove the ability of policy-transfer between the different layers. Further, each head only gets $1 / K$ of the number of gradient updates (when training on $K$ tasks).
113
+
114
+ ![](images/6f1cb7d5e76bb2f8a0d9399034528e959e5c647d7d7ca692a6e7acec52949e99.jpg)
115
+ Figure 4: (a) A t-SNE plot of the generated weights from an $\mathcal { M }$ layer. (b) Human normalised performance (capped at 100) when using task ID as context to an $\mathcal { M }$ layer. (c) Using a learnt context instead.
116
+
117
+ Multiplicative Policies with Learnt Contexts We find (somewhat surprisingly) that we can get similar or greater performance gains without using any task information, replacing task $\mathrm { I D } \mathbf { I } _ { i }$ instead with a learnt non-linear projection of the LSTM output. We now have, $\mathbf { c } = \mathrm { r e l u } ( \mathrm { M L P } ( \mathbf { h } _ { t } ) )$ and $\pi _ { t } , V _ { t } = \mathcal { M } ( \mathbf { h } _ { t } , \mathbf { c } )$ .
118
+
119
+ We show a t-SNE plot of the 2D projection of the state of the LSTM in Figure 4. This is coloured by level name and the transparency value indicates the timestep. We see at timestep 0, all weights are the same, and as the levels progress, we find that it can naturally detect or cluster task information, showing that the model can readily detect the current task type. We posit however that the affine policyvalue decoders may not have the right inductive bias to use this information well. We conjecture that the multiplicative interaction, via the learnt embedding, $c .$ , provides the right inductive bias: allowing the model to integrate information and providing additional densely-gated conditional-compute paths that leverage task similarity where appropriate, whilst guarding against interference where tasks differ – and thus more effectively learning task conditioned behaviour.
120
+
121
+ We note that we match state-of-the-art performance on this domain which previously used the PopArt Method (Hessel et al., 2019) (both achieve $7 3 \%$ normalised human score), with a simpler method. PopArt involves having task-specific value functions and using adaptive gradient normalisation (to limit interference between different reward scales). Our method also reduces the number of extra hyper-parameters needed to zero. As such, PopArt solves an orthogonal problem to the one considered here and we posit that these methods can be combined in future work. We also leave as future work the analysis of whether such hyper-value functions are able to implicitly learn the different reward scales that are explictly parameterised in methods like PopArt.
122
+
123
+ # 7 LATENT VARIABLE MODELS WITH MULTIPLICATIVE DECODERS
124
+
125
+ We previously demonstrated the ability of multiplicative interactions to extract and efficiently combine contextual information. We next explore the paradigm where the two streams of information being combined refer to semantically different features. Specifically, we investigate how contextual latent variables can be better integrated into neural decoders. We consider neural processes for few-shot regression. Briefly, neural processes (Garnelo et al., 2018b;a) are a neural analogue to Gaussian Processes. For few shot regression, they work by predicting a function value $\mathbf { y } ^ { * }$ at new observations $\mathbf { x } ^ { * }$ having observed previous values $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ (referred to as contexts) of the same function. As opposed to training a single predictor on the $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ , Neural Processes learn to infer a distribution over functions that are consistent with the observations collected so far.
126
+
127
+ This is achieved by embedding context points $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ individually with an encoder network, and then taking the mean of these embeddings. This gives latent variables $\mathbf { z }$ that are a representation of the function that maps $\mathbf { x }$ to $\mathbf { y }$ , i.e. $\mathbf { y } = f ( \mathbf { x } , \mathbf { z } )$ . A new data point $\mathbf { x } ^ { * }$ is mapped to $\mathbf { y } ^ { * }$ by passing $\left[ \mathbf { z } ; \mathbf { x } ^ { * } \right]$ through a decoder network.
128
+
129
+ We aim to increase the expressivity of the decoder by improving the conditioning on $\mathbf { z }$ . The standard approach is to concatenate $\mathbf { x }$ and $\mathbf { z }$ (denoted as $\mathbf { M L P } ( [ \mathbf { x } ; \mathbf { z } ] ) ,$ ) leading to a purely additive relationship.
130
+
131
+ Instead, we replace the final layer of the MLP decoder with the multiplicative form $\mathcal { M } ( \mathbf { x } , \mathbf { z } )$ . As an additional baseline, we consider skip connections between the latent variable and each layer of the decoder (denoted Skip $\mathbf { M L P } ( [ \mathbf { x } ; \mathbf { z } ] )$ Dieng et al. (2018)), as a means to avoid latent variable collapse. We apply all methods to the regression task on function draws from a GP prior Garnelo et al. (2018b) and summarize results in Figure 5 a). The results show that multiplicative forms are able to better condition on latent information compared to the baseline MLPs. Further experimental details are provided in the appendix F.
132
+
133
+ # 8 MULTIPLICATIVE EMBEDDINGS FOR LANGUAGE MODELLING
134
+
135
+ Finally, we consider word-level language modelling with recurrent models. At each time-step, the network outputs a prediction about the next-word in the sequence, given the current generated word (ground truth at training) and its recurrent state. A standard architecture is to project one-hot word vectors $\mathbf { x } _ { t }$ to input embeddings $\mathbf { z } _ { t } ^ { i } = \mathbf { W } \mathbf { x } _ { t }$ , followed by an LSTM with output $\mathbf { h } _ { t }$ . We then produce our predicted output embedding $\mathbf { z } _ { t + 1 } ^ { o } = \mathbf { W } _ { 2 } \mathbf { h } _ { t } \mathbf { x } _ { t } + \mathbf { b }$ and output yt+1 = softmax $( \mathbf { z } _ { t + 1 } ^ { o } \mathbf { W } ^ { T } + b _ { 2 } )$ where the embedding weights W are tied.
136
+
137
+ We posit that computing embeddings with multiplicative interactions instead will allow the model to better take its recurrent context into account. We thus compute the output embedding as follows: $\mathbf { c } = \mathrm { r e l u } ( \mathbf { W } _ { 3 } \mathbf { h } _ { t } + \mathbf { b } )$ and $\mathbf { z } _ { t + 1 } ^ { o } = \mathcal { M } ( \mathbf { c } ^ { T } , \mathbf { h } _ { t } )$ . Instead of being quadratic in $\mathbf { h } _ { t }$ directly we use this context vector c defined above. This serves two purposes: firstly, we introduce an additional on-linear pathway in the network and secondly, we have $\dim ( \mathbf { c } ) \ll \dim ( \mathbf { h } _ { t } )$ which allows us to drastically cut down the parameter count (for example, we have an LSTM output size of 2048, but a context size of only 32). This is an alternative to having a diagonal approximation.
138
+
139
+ We can similarly also have a multiplicative input embedding to the LSTM such that $ { \mathbf { z } } _ { t } ^ { i }$ also integrates recurrent information from $\mathbf { h } _ { t - 1 }$ . We could define $ { \mathbf { z } } _ { t } ^ { i }$ analogous to above: $\mathbf { z } _ { t + 1 } ^ { \prime } = \mathrm { \mathcal { M } } ( \mathbf { z } _ { t } ^ { i } , \mathbf { h } _ { t - 1 } ) =$ $\mathbf { z } _ { t } ^ { i ^ { T } } \mathbb { W } ^ { \prime \prime } \mathbf { h } _ { t - 1 } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { V } \mathbf { h } _ { t - 1 } + \mathbf { b }$ . This equation is in fact very similar to the expression used to generate the gates and candidate cell of the LSTM: the last three terms are identical. A diagonal form of the first term has been used in used inside multiplicative RNNs and LSTMs (Sutskever et al., 2011; Krause et al., 2016).
140
+
141
+ We report results (in Table 1) on running this model on Wikitext-103. For multiplicative output embeddings we use the 3D form (with the low-rank bottleneck as described above) and we use a diagonal form for the input embeddings when combining the approaches. The rest of architectural choices and hyper-parameters are reported in the appendix. We find that adding multiplicative decoder (output) embeddings provides a boost in performance and further adding input embeddings increases these gains. We ascribe this to the ability of the embeddings to now be markedly changed by context and allowing better integration of information by the inductive bias in these interactions.
142
+
143
+ Table 1: Word-level perplexity on WikiText-103
144
+
145
+ <table><tr><td>Model</td><td>Valid</td><td>Test</td><td>No. Params</td></tr><tr><td>LSTM Rae et al. (2018)</td><td>34.1</td><td>34.3</td><td>88M</td></tr><tr><td>Gated CNN Dauphin et al. (2017)</td><td>1</td><td>37.2</td><td>-</td></tr><tr><td>RMC Santoro et al. (2018)</td><td>30.8</td><td>31.6</td><td>-</td></tr><tr><td>Trellis Networks Bai et al. (2019)</td><td>1</td><td>30.35</td><td>180M</td></tr><tr><td>TransformerXL Dai et al. (2018)</td><td>17.7</td><td>18.3</td><td>257M</td></tr><tr><td>LSTM (ours)</td><td>34.7</td><td>36.7</td><td>88M</td></tr><tr><td>LSTM + MultDec</td><td>31.7</td><td>33.7</td><td>105M</td></tr><tr><td>LSTM+ MultEncDec</td><td>28.9</td><td>30.3</td><td>110M</td></tr></table>
146
+
147
+ We note that we have competitive results using only a single-layer LSTM as our base model and far fewer parameters overall. Our intuition is that using such embeddings is orthognal to most of the other recent advances proposed and can thus be stacked on top of them. We leave as future work the integration of these ideas with Transformer based models.
148
+
149
+ ![](images/74a1055512e03077cc26e4e55ed32a13fdf782e22755baa068f65c3cf15639aa.jpg)
150
+ Figure 5: Results on Neural Processes and language modelling on WikiText-103.
151
+
152
+ # 9 CONCLUSION AND FUTURE WORK
153
+
154
+ In this work we considered multiplicative interactions and various formulations thereof, connecting them to a variety of architectures, both older and modern, such as Hypernetworks, multplicative LSTMs or gating methods. We hypothesise that the ability of such networks to better represent a broader range of algorithmic primitives (e.g. conditional-statements or inner products) allows them to better integrate contextual or task-conditional information to fuse multiple stream of data. We first tested empirically this hypothesis in two controlled settings, in order to minimize the effect of confounding factors. We further show that we could match state-of-the-art methods on multiple domains with only LSTMs and multiplicative units. While we do not necessarily advocate for a specific instance of the above methods, we hope that this work leads to a broader understanding and consideration of such methods by practitioners, and in some cases replacing the standard practice of concatenation when using conditioning, contextual inputs, or additional sources of information.
155
+
156
+ We believe there are many ways to explore this space of ideas more broadly, for instance looking at: the role of various approximations to these methods; ways to make their implementations more efficient; and their application to newer domains. Finally, while attention models use some of these multiplicative interactions, we hope that applying some of the lessons from this work (such as higher order interactions) will allow even greater integration of information in attention systems.
157
+
158
+ # ACKNOWLEDGEMENTS
159
+
160
+ The authors would like to thank Karen Simonyan and Sander Dieleman for their inputs and comments on the experiments as well as early drafts of the paper. We’d also like to thank Ali Razavi, Pablo Sprechmann, Alex Pritzel and Erich Elsen for insightful discussions around such multiplicative models and their applications.
161
+
162
+ # REFERENCES
163
+
164
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
165
+
166
+ Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. ICLR, 2019.
167
+
168
+ Charles Beattie, Joel Z Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Küttler, Andrew Lefrancq, Simon Green, Víctor Valdés, Amir Sadik, et al. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016.
169
+
170
+ Andrew Brock, Theodore Lim, J. M. Ritchie, and Nick Weston. Smash: One-shot model architecture search through hypernetworks, 2017.
171
+
172
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. ICLR, 2019.
173
+
174
+ 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. arXiv preprint arXiv:1406.1078, 2014.
175
+
176
+ Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Language modeling with longer-term dependency. 2018.
177
+
178
+ Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 933–941. JMLR. org, 2017.
179
+
180
+ Adji B Dieng, Yoon Kim, Alexander M Rush, and David M Blei. Avoiding latent variable collapse with generative skip models. arXiv preprint arXiv:1807.04863, 2018.
181
+
182
+ Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. Proc. of ICLR, 2, 2017.
183
+
184
+ Vincent Dumoulin, Ethan Perez, Nathan Schucher, Florian Strub, Harm de Vries, Aaron Courville, and Yoshua Bengio. Feature-wise transformations. Distill, 2018. doi: 10.23915/distill.00011. https://distill.pub/2018/feature-wise-transformations.
185
+
186
+ Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. ICML, 2018.
187
+
188
+ Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact bilinear pooling. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 317–326, 2016.
189
+
190
+ 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. ICML, 2018a.
191
+
192
+ Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018b.
193
+
194
+ David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. ICLR, 2017.
195
+
196
+ Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. AAAI, 2019.
197
+
198
+ Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
199
+
200
+ Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018.
201
+
202
+ Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
203
+
204
+ Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017.
205
+
206
+ Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019.
207
+
208
+ Jin-Hwa Kim, Kyoung-Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. arXiv preprint arXiv:1610.04325, 2016.
209
+
210
+ Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling, 2016.
211
+
212
+ David Krueger, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville. Bayesian hypernetworks. arXiv preprint arXiv:1710.04759, 2017.
213
+
214
+ Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In Advances In Neural Information Processing Systems, pp. 289–297, 2016.
215
+
216
+ Roland Memisevic and Geoffrey Hinton. Unsupervised learning of image transformations. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–8. IEEE, 2007.
217
+
218
+ Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015.
219
+
220
+ Ethan Perez, Harm De Vries, Florian Strub, Vincent Dumoulin, and Aaron Courville. Learning visual reasoning without strong priors. arXiv preprint arXiv:1707.03017, 2017.
221
+
222
+ Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
223
+
224
+ Jack W Rae, Chris Dyer, Peter Dayan, and Timothy P Lillicrap. Fast parametric learning with activation memorization. arXiv preprint arXiv:1803.10049, 2018.
225
+
226
+ Malcolm Reynolds, Gabriel Barth-Maron, Frederic Besse, Diego de Las Casas, Andreas Fidjeland, Tim Green, Andria Puigdomenech, Sébastien Racanière, Jack Rae, and Fabio Viola. Open sourcing Sonnet - a new library for constructing neural networks. https://deepmind.com/blog/ open-sourcing-sonnet/, 2017.
227
+
228
+ D. E. Rumelhart, G. E. Hinton, and J. L. McClelland. Parallel distributed processing: Explorations in the microstructure of cognition, vol. 1. chapter 2: A General Framework for Parallel Distributed Processing, pp. 45–76. MIT Press, Cambridge, MA, USA, 1986. ISBN 0-262-68053-X. URL http://dl.acm.org/citation.cfm?id=104279.104286.
229
+
230
+ Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 7299–7310, 2018.
231
+
232
+ Idan Schwartz, Alexander Schwing, and Tamir Hazan. High-order attention models for visual question answering. In Advances in Neural Information Processing Systems, pp. 3664–3674, 2017.
233
+
234
+ Terrence J Sejnowski. Higher-order boltzmann machines. In AIP Conference Proceedings, volume 151, pp. 398–403. AIP, 1986.
235
+
236
+ Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015.
237
+
238
+ Ilya Sutskever, James Martens, and Geoffrey E Hinton. Generating text with recurrent neural networks. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 1017–1024, 2011.
239
+
240
+ Graham W Taylor and Geoffrey E Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In Proceedings of the 26th annual international conference on machine learning, pp. 1025–1032. ACM, 2009.
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3540–3549. JMLR. org, 2017.
247
+
248
+ Karl Weierstrass. On continuous functions of a real argument which possess a definite derivative for no value of the argument. Königlich Preussichen Akademie der Wissenschaften, 2:71–74, 1895.
249
+
250
+ Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. ICLR, 2019.
251
+
252
+ 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.
253
+
254
+ Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In European Conference on Computer Vision, pp. 451–466. Springer, 2016.
255
+
256
+ Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multi-modal factorized bilinear pooling with co-attention learning for visual question answering. In Proceedings of the IEEE international conference on computer vision, pp. 1821–1830, 2017.
257
+
258
+ Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 4189–4198. JMLR. org, 2017.
259
+
260
+ # A EXPRESSIVITY OF THE MODEL
261
+
262
+ Theorem 1. Let $\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with multiplicative layer, then we have $\mathcal { H } _ { m l p } \subsetneq \mathcal { H } _ { m u }$ .
263
+
264
+ Proof. Inclusion comes directly from the fact that if we split input into arbitrary parts $[ \mathbf { x } ; \mathbf { z } ]$ we get:
265
+
266
+ $$
267
+ \mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + \mathbf { x } ^ { T } \mathbf { B } + \mathbf { V } \mathbf { z } + \mathbf { c } = \mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + [ \mathbf { B } ^ { T } ; \mathbf { V } ] ^ { T } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { c } = \mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + \mathbf { A } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { c } ,
268
+ $$
269
+
270
+ which proves that $\mathcal { H } _ { \mathrm { m l p } } \subset \mathcal { H } _ { \mathrm { m u } }$ . Thus, the only aspect of the theorm left to prove is that the inclusion is strict. Let us consider a 1D function $x \to x ^ { 2 }$ , and for simplicity let $x = z$ (a domain where context equals input). A single layer MLP with a single multiplicative unit can represent this function exactly, by using $A = 0$ and $W = I$ , as then we obtain $x ^ { T } W \overset { \cdot } { x } = x ^ { T } x = \| x \| ^ { 2 }$ . Since our function is positive, it is not affecting the multiplicative network output. For a regular MLP, let us first notice that we need at least one hidden layer, as otherwise MLP is a linear function and $f$ is not. Lets denote by ${ \mathbf V } , { \mathbf c }$ and $\mathbf { w } , \mathbf { b }$ weights and biases of second, and first layers respectively. Then we have to satisfy
271
+
272
+ $$
273
+ f ( x ) = g ( \mathbf { V } ^ { T } \operatorname* { m a x } ( 0 , \mathbf { w } x + \mathbf { b } ) + \mathbf { c } ) = x ^ { 2 } ,
274
+ $$
275
+
276
+ where $g$ is transformation represented by all higher layers of the MLP (in particular if there are just 2 layers, then $g ( x ) = x ,$ ). Note that RHS is differentiable everywhere, while LHS is differentiable iff for each $i$ and for each $x$ we have $w _ { i } x + b _ { i } \neq 0$ (or $f$ is independent from $x$ , which $x ^ { 2 }$ does not satisfy). However, this is impossible, as if $w _ { i } \neq 0$ , then we can always pick $x = - b _ { i } / w _ { i }$ , and if all $w _ { i } = 0$ , then $f ( x ) = g ( c ) \bar { \neq } x ^ { 2 }$ , leading to a contradiction. □
277
+
278
+ Theorem 2. Let $\mathcal { H } _ { \sigma }$ denote the hypotheses space of standard MLPs with $\sigma$ activation function, and ${ \mathcal { H } } _ { w }$ analogous set, where some activations are replaced with Weiestrass function $f _ { w }$ . Then we have $\mathcal { H } _ { r e l u } \subsetneq \mathcal { H } _ { w }$ , and $\mathcal { H } _ { \sigma } \subsetneq \mathcal { H } _ { w }$ , for any $\sigma$ that is differentiable everywhere.
279
+
280
+ Proof. Inclusion comes directly from the fact that only some activations are replaced, and in particular we can always replace none, thus leading to equality of hypotheses classes. To show that the inclusion is strict lets consider a Weierstrass function itself $f ( x ) = \sigma _ { \mathrm { w } } ( x )$ . We definitely have $f \in \mathcal { H } _ { \mathrm { w } }$ as we can define 1 hidden layer network, with one hidden neuron and all the weights set to 1, and all biases to 0. Now, relu networks are piece-wise linear while the Weierstrass function is nowhere differentiable Weierstrass (1895) and thus not piece-wise linear. Similarly, network with an activation that is differentiable everywhere (e.g. sigmoid or tanh) is everywhere differentiable wrt. inputs, while Weierstrass function – nowhere Weierstrass (1895). □
281
+
282
+ # B SIMPLE IMPLEMENTATION OF MI LAYER
283
+
284
+ We use Tensorflow and Sonnet Reynolds et al. (2017) for all our model implementations. The example below is a simple code snippet for adding a multiplicative layer to any model, using the Sonnet framework as an example.
285
+
286
+ # S i m p l e p y t h o n c o d e f o r MI L a y e r s i m p o r t s o n n e t a s s n t i m p o r t t e n s o r f l o w a s t f
287
+
288
+ # A s t a n d a r d l i n e a r l a y e r # B i s t h e b a t c h s i z e # E i s t h e i n p u t s i z e # C i s t h e c o n t e x t s i z e $\begin{array} { r l } { \mathbf { X } } & { { } = } \end{array}$ . . . # i n p u t o f s i z e [ B , E ] $\mathrm { ~ \bf ~ Z ~ } =$ # c o n t e x t o f s i z e [ B , C ] $\begin{array} { r l } { \mathbf { X } Z } & { { } = } \end{array}$ t f . c o n c a t ( [ x , z ] , 1 ) $\mathrm { ~ y ~ } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( x z )
289
+
290
+ # I n s t e a d , we g e n e r a t e a W a n d b # T h i s d e f i n e s a n i m p l i c i t 3D w e i g h t t e n s o r ${ \bf W _ { \alpha } } = { \bf \Phi }$ s n t . L i n e a r ( o u t p u t _ s i z e $^ *$ i n p u t _ s i z e ) ( z ) ${ \textbf { b } } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( z )
291
+
292
+ # R e s h a p e t o t h e c o r r e c t s h a p e # N o t e : we h a v e B w e i g h t m a t r i c e s # i . e . o n e p e r b a t c h e l e m e n t ${ \bf W _ { \alpha } } = { \bf \Phi }$ t f . r e s h a p e (W, [ B , i n p u t _ s i z e , o u t p u t _ s i z e ] )
293
+
294
+ # O u t p u t $\mathrm { ~ y ~ } =$ t f . m a t m u l ( x , W) + b
295
+
296
+ # C DETAILS FOR SIMPLE FUNCTION EXPERIMENTS
297
+
298
+ For the experiments modeling the simple two-input functions, we consider MLP and MI models and plot number of parameters against the input hidden size. The two models are
299
+
300
+ • MLP: linear(size), relu, linear(output_size) • MI Network: MI(size), linear(output_size).
301
+
302
+ Here size is the largest value such that the network has not more than N variables and we sweep over [1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 120, 140, 160, 180, 200]. We sweep over learning rates 0.1, 0.001, 0.0001 and pick the best result. Models are trained using Adam optimiser for 6,000 steps using Mean Squared Error loss (MSE) on mini-batches of size 100 sampled from a standard Gaussian. The reported error is based on 10,000 samples from the same distribution to minimize the estimation variance.
303
+
304
+ # D DETAILS FOR TOY REGRESSION EXPERIMENTS
305
+
306
+ In multitask toy regression we coinsider MLP, MI and multiheaded models. For $x \in \mathbb { R }$ (input to the task) and $z$ (represented as one-hot encoding of a task ID) we use:
307
+
308
+ • Conditional MLP: concat(x, linear(20)(z)), linear(30), relu, linear(20), relu, linear(1) • Conditional MI: MI( [linear(30), relu, linear(20), relu] $\mathbf { \tau } ( \mathbf { x } )$ , linear(20)(z) ) • Multiheaded MLP: linear(20), relu, linear(30), relu, linear(1); where the last linear is separate per task
309
+
310
+ Each of these models is trained in a multitask setup, where we first sample $T$ tasks (20, 40 or 60). Half of these tasks involve fitting an affine function $a x + b$ , where both $a$ and $b$ are sampled from uniform distribution over $[ 0 , 1 ]$ ; and half represent scaled sine waves, $a \sin ( 1 0 x ) + b$ with $a$ and $b$ sampled in the same way. Training is performed with Adam optimiser (with learning rate $3 e - 3$ ), on mini batches of size 50 per task (so the total batch size is $5 0 T$ ). Models are trained for 10,000 steps with Mean Squared Error loss (MSE), and the logarithm of the training MSE is reported for analysis. Each training is repeated 60 times to minimise the variance coming from the stochasticity.
311
+
312
+ # E DETAILS OF MULTITASK DEEPMIND LAB TRAINING
313
+
314
+ We train multi-task on 30 DeepMind lab levels Beattie et al. (2016) concurrently using 5 actors per task and a multi-gpu learner with 4 GPUs. We follow exactly the model and hyper-parameters used in the Impala architecture Espeholt et al. (2018). Our models are all trained with population based training (PBT) Jaderberg et al. (2017) and we show below the average over three populations with 24 independent learners each for both the baseline and our best method. We train all models for 10 billion frames of data across all levels. The human normalised score is calculated independently for each level and capped at 100 (i.e $s c o r e = m i n ( s c o r e , 1 0 0 ) )$
315
+
316
+ The architecture is as follows:
317
+
318
+ • Conv2D: 16ch, 8x8 kernels, stride=4
319
+ • ReLU
320
+ • Conv2D: 32ch 4x4 kernel,stride=2
321
+ • ReLU
322
+ • Linear layer with output size 256
323
+ • ReLU
324
+ • Concatenation with one hot encoded last action and last reward and language instruction
325
+ • LSTM (256 hidden units)
326
+ • Policy $=$ Linear layer or multiplicative interaction followed by a softmax
327
+ • Value function $=$ Linear layer or multiplicative intereaction
328
+
329
+ ![](images/2c9b0a3bd6a5007ec2d038500d8e477d58214ae5319a5f0ffaac1491337f1b55.jpg)
330
+
331
+ # F DETAILS OF NEURAL PROCESS EXPERIMENTS
332
+
333
+ Inspired by the experiments in Garnelo et al. (2018b), we apply Neural Processes to functions drawn for a Gaussian Process prior with an exponentiated quadratic kernel $k ( x , x ^ { \prime } ) = \sigma _ { f } ^ { 2 } \exp ( - { \textstyle \frac { 1 } { 2 } } ( x -$ $x ^ { \prime } ) ^ { 2 } / l ^ { 2 } )$ with fixed $\sigma ^ { f } = 1 . 0$ and, importantly, a random $l \sim U [ 0 . 1 , 1 0 . 0 ]$ for each draw, resulting in a broad distribution of functions. We also add Gaussian observation noise, i.e. $y \sim \mathcal { N } ( f , \sigma _ { n } ^ { 2 } )$ and set $\sigma _ { n } = 0 . 0 2$ . In all experiments, we provide a deterministic transformation $h$ of the context in addition to the latent variable $z$ , using separate encoder networks for each. For both SKIP MLP and the proposed MI, we concatenate $h$ and $z$ first, i.e. we use SKIP $\scriptstyle \mathrm { { M L P } } [ x$ ; concat $( z , h ) ]$ and $\mathbf { M I } ( x , \mathbf { c o n c a t } ( z , h ) )$ writing concat() to denote concatenation. A more detailed discussion on adding an the benefits of adding an additional deterministic path in provided in Kim et al. (2019).
334
+
335
+ The determinsitic encoder used to obtain $h$ is a deep MLP with 6 layers of 128 units each. The latent encoder used for $z$ consists of 3 hidden layers of 128 units, parameterising mean and standard deviation of a 64-dimensional Gaussian distributed latent variable. The decoder network used to predict on new target inputs $x ^ { * }$ consists of 4 layers of 128 units. We use relu activiatons throughout all components of the network. The network is trained until convergence with Adam, using a learning rate of 0.0001 and absolute value gradient clipping with a threshold of 10.0.
336
+
337
+ # G LANGUAGE MODELLING
338
+
339
+ We train a single layer LSTM of hidden size 2048 hidden units. The input to the LSTM is an embedding of size 256 and then output the LSTM is projected down to 256 with a single linear layer for the baseline. The input and output embedding-word matrices are tied. We use a training sequence length of 128. For the multiplicative model, the output embedding is calculated with an MI layer who’s context input $c$ is generated by a linear layer with output size 32 followed by a relu. We use dropout rate of 0.3 and a learning rate of 0.001 for all models. All models are trained with the Adam optimiser.
340
+
341
+ For the multiplicative encoder we use a diagonal form of the $\mathcal { M } ( . )$ layer and for the multiplicative deocder we use the full $\mathcal { M } ( . )$ form (with the bottleneck described above). This amounts to adding about 20M parameters which is the same as adding 1000 hidden units. We get 6 perplexity improvement in performance whereas naively adding 1000 hidden units only gave us an improvement of 1 perplexity. Further the parameter count could be drastically reduced by considering diagonal or low rank approximations, but we do not specifically optimise for this in this work.
parse/train/rylnK6VtDH/rylnK6VtDH_content_list.json ADDED
@@ -0,0 +1,1827 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MULTIPLICATIVE INTERACTIONSAND WHERE TO FIND THEM",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 99,
9
+ 570,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Siddhant M. Jayakumar, Wojciech M. Czarnecki, Jacob Menick, Jonathan Schwarz, \nJack Rae, Simon Osidnero, Yee Whye Teh, Tim Harley, Razvan Pascanu \nDeepMind \n{sidmj, lejlot, jmenick, schwarzjn, jwrae, osindero, \nywteh, tharley, razp}@google.com ",
17
+ "bbox": [
18
+ 184,
19
+ 169,
20
+ 772,
21
+ 239
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 276,
32
+ 544,
33
+ 291
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "We explore the role of multiplicative interaction as a unifying framework to describe a range of classical and modern neural network architectural motifs, such as gating, attention layers, hypernetworks, and dynamic convolutions amongst others. Multiplicative interaction layers as primitive operations have a long-established presence in the literature, though this often not emphasized and thus under-appreciated. We begin by showing that such layers strictly enrich the representable function classes of neural networks. We conjecture that multiplicative interactions offer a particularly powerful inductive bias when fusing multiple streams of information or when conditional computation is required. We therefore argue that they should be considered in many situation where multiple compute or information paths need to be combined, in place of the simple and oft-used concatenation operation. Finally, we back up our claims and demonstrate the potential of multiplicative interactions by applying them in large-scale complex RL and sequence modelling tasks, where their use allows us to deliver state-of-the-art results, and thereby provides new evidence in support of multiplicative interactions playing a more prominent role when designing new neural network architectures. ",
40
+ "bbox": [
41
+ 233,
42
+ 310,
43
+ 766,
44
+ 531
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 563,
55
+ 336,
56
+ 579
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Much attention has recently turned toward the design of custom neural network architectures and components in order to increase efficiency, maximise performance, or otherwise introduce desirable inductive biases. While there have been a plethora of newer, intricate architectures proposed, in this work we train our sights instead on an older staple of the deep learning toolkit: multiplicative interactions. ",
63
+ "bbox": [
64
+ 174,
65
+ 595,
66
+ 825,
67
+ 665
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Although the term itself has fallen somewhat out of favour, multiplicative interactions have reappeared in a range of modern architectural designs. We start this work by considering multiplicative interactions as an object of study in their own right. We describe various formulations and how they relate to each other as well as connect more recent architectural developments (e.g. hypernetworks Ha et al. (2017), dynamic convolutions Wu et al. (2019)) to the rich and longer-standing literature on multiplicative interactions. ",
74
+ "bbox": [
75
+ 174,
76
+ 672,
77
+ 825,
78
+ 756
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "We hypothesise that multiplicative interactions are suitable for representing certain meaningful classes of functions needed to build algorithmic operations such as conditional statements or similarity metrics, and more generally as an effective way of integrating contextual information in a network in a way that generalizes effectively. We show this empirically in controlled synthetic scenarios, and also demonstrate significant performance improvement on a variety of challenging, large-scale reinforcement learning (RL) and sequence modelling tasks when a conceptually simple multiplicative interaction module is incorporated. ",
85
+ "bbox": [
86
+ 174,
87
+ 763,
88
+ 825,
89
+ 861
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Such improvements are consistent with our hypothesis that the use of appropriately applied multiplicative interactions can provide a more suitable inductive bias over function classes leading to more data-efficient learning, better generalization, and stronger performance. We argue that these operations should feature more widely in neural networks in and of themselves, especially in the increasingly important setting of integrating multiple streams of information (including endogenously created streams e.g. in branching architectures). ",
96
+ "bbox": [
97
+ 174,
98
+ 868,
99
+ 823,
100
+ 922
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "image",
106
+ "img_path": "images/a2f0a3451a80ae8cf8c0e7f969c4507af41e847022a7f2ca6a71facce67cd6c1.jpg",
107
+ "image_caption": [
108
+ "Figure 1: (Left) Venn diagrams of multiplicative interactions with respect to other model classes commonly used in ML. (Right) Comparison of various orders of multiplicative interactions and their relation to other perspectives. "
109
+ ],
110
+ "image_footnote": [],
111
+ "bbox": [
112
+ 194,
113
+ 117,
114
+ 828,
115
+ 260
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "",
122
+ "bbox": [
123
+ 174,
124
+ 358,
125
+ 821,
126
+ 387
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "Our contributions are thus: (i) to re-explore multiplicative interactions and their design principles; (ii) to aid the community’s understanding of other models (hypernetworks, gating, multiplicative RNNs) through them; (iii) to show their efficacy at representing certain solutions; and (iv) to empirically apply them to large scale sequence modeling and reinforcement learning problems, where we demonstrate state-of-the-art results. ",
133
+ "bbox": [
134
+ 174,
135
+ 393,
136
+ 825,
137
+ 463
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "2 MULTIPLICATIVE INTERACTIONS ",
144
+ "text_level": 1,
145
+ "bbox": [
146
+ 176,
147
+ 483,
148
+ 480,
149
+ 500
150
+ ],
151
+ "page_idx": 1
152
+ },
153
+ {
154
+ "type": "text",
155
+ "text": "We start by introducing notation and formalising the concept of multiplicative interactions. The underlying question we are trying to answer is how to combine two different streams of information. Specifically, given $\\mathbf { x } \\in \\mathbb { R } ^ { n }$ and $\\mathbf { z } \\in \\mathbb { R } ^ { m }$ , our goal is to model an unknown function $f _ { \\mathrm { t a r g e t } } ( \\mathbf { x } , \\mathbf { z } ) \\in \\mathbb { R } ^ { k }$ that entails some interaction between the two variables. In practice $\\mathbf { x }$ and $\\mathbf { z }$ might be arbitary hidden activations, different input modalities (e.g. vision and language), or conditioning information and inputs. ",
156
+ "bbox": [
157
+ 173,
158
+ 515,
159
+ 826,
160
+ 599
161
+ ],
162
+ "page_idx": 1
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "The standard approach is to approximate $f _ { \\mathrm { t a r g e t } }$ by a neural network $f$ . If $f$ is restricted to employ a single layer of weights, we typically use $\\breve { f } ( \\mathbf { x } , \\mathbf { z } ) = \\mathbf { W } [ \\mathbf { x } ; \\mathbf { z } ] + \\mathbf { b }$ , where $\\left[ \\mathbf { x } ; \\mathbf { z } \\right]$ represents the concatenation of $\\mathbf { x }$ and $\\mathbf { z }$ , and $\\mathbf { W } \\in \\mathbb { R } ^ { ( m + n ) \\times k }$ and $\\mathbf { b } \\in \\mathbb { R } ^ { k }$ are learned parameters. The interaction between $\\mathbf { x }$ and $\\mathbf { z }$ is only additive given this formulation. However through stacking multiple similar layers (with element-wise nonlinearities inbetween), $f$ can approximate any function $f _ { \\mathrm { t a r g e t } }$ given sufficient data (and capacity). ",
167
+ "bbox": [
168
+ 174,
169
+ 606,
170
+ 825,
171
+ 693
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "In contrast, a single layer with multiplicative interactions would impose the functional form ",
178
+ "bbox": [
179
+ 168,
180
+ 698,
181
+ 774,
182
+ 713
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "equation",
188
+ "img_path": "images/5e1ac5b8e4be5e9de405a419a5e40e88d98a62ab534d6270ce1cc818db44806c.jpg",
189
+ "text": "$$\nf ( \\mathbf { x } , \\mathbf { z } ) = \\mathbf { z } ^ { T } \\mathbb { W } \\mathbf { x } + \\mathbf { z } ^ { T } \\mathbf { U } + \\mathbf { V } \\mathbf { x } + \\mathbf { b }\n$$",
190
+ "text_format": "latex",
191
+ "bbox": [
192
+ 375,
193
+ 719,
194
+ 622,
195
+ 738
196
+ ],
197
+ "page_idx": 1
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "where $\\mathbb { W }$ is a 3D weight tensor, $\\mathbf { U } , \\mathbf { V }$ are regular weight matrices and $\\mathbf { b }$ is a vector1. We posit that this specific form, while more costly, is more flexible, providing the right inductive bias to learn certain families of functions that are of interest in practice. Additionally, many existing techniques can be shown to rely on variations of the above bilinear form as detailed below. ",
202
+ "bbox": [
203
+ 174,
204
+ 744,
205
+ 825,
206
+ 801
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "Hypernetworks as Multiplicative Interactions. A Hypernetwork Ha et al. (2017) is a neural network $g$ that is used to generate the weights of another neural network given some context or input vector $\\mathbf { z }$ . Particularly $f ( \\bar { \\mathbf { x } } ; \\theta )$ becomes $f ( \\mathbf { x } ; g ( \\mathbf { z } ; \\phi ) )$ . In the case where $f$ and $g$ are affine (as in the original work), such a network is exactly equivalent to the multiplicative form described above. ",
213
+ "bbox": [
214
+ 174,
215
+ 808,
216
+ 825,
217
+ 864
218
+ ],
219
+ "page_idx": 1
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "Specifically, we can decompose equation (1) and set $\\mathbf { W } ^ { \\prime } = \\mathbf { z } ^ { T } \\mathbb { W } + \\mathbf { V }$ and $\\mathbf { b } ^ { \\prime } = \\mathbf { z } ^ { T } \\mathbf { U } + \\mathbf { b }$ . We can now see $\\mathbf { W } ^ { \\prime }$ as the generated 2D weight matrix and $\\mathbf { b } ^ { \\prime }$ as the generated bias from some hypernetwork. ",
224
+ "bbox": [
225
+ 176,
226
+ 869,
227
+ 825,
228
+ 900
229
+ ],
230
+ "page_idx": 1
231
+ },
232
+ {
233
+ "type": "text",
234
+ "text": "This allows us to have an input-conditional weight matrix and bias vector that are then used to generate output $\\mathbf { y } = \\mathbf { W } ^ { \\prime } \\mathbf { x } + \\mathbf { b } ^ { \\prime }$ . We can also consider the more general case of any affine transformation being generated by some arbitrary neural network, which can also be viewed as a multiplicative interaction where we first embed the context $\\mathbf { z }$ and then use it in the equation above. This provides a basis for thinking about hypernetworks themselves as variations on the theme of multiplicative interactions, potentially accounting for a considerable amount of their efficacy. ",
235
+ "bbox": [
236
+ 174,
237
+ 103,
238
+ 825,
239
+ 188
240
+ ],
241
+ "page_idx": 2
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "Diagonal Forms and Gating Mechanisms. Let us consider a diagonal approximation to the projected $\\mathbf { W } ^ { \\prime }$ . This is given by a particular parametrization of ${ \\bf W } ^ { \\prime } = { \\bf \\bar { z } } ^ { T } { \\mathbb { W } } + { \\bf \\bar { V } }$ above (see Figure 1 right). Multiplying with $\\mathbf { W } ^ { \\prime } = \\mathrm { { d i a g } } ( a _ { 1 } , . . . , a _ { n } )$ can be implemented efficiently as $f = \\mathbf { a } \\odot \\mathbf { x }$ where $\\odot$ represents elementwise multiplication or the Hadamard product (similarly for the bias). This form now resembles commonly used gating methods, albeit they are often used with additional non-linearities (e.g. sigmoid units Dauphin et al. (2017); Van den Oord et al. (2016)). It can be viewed as a hypernetwork as well, where $\\mathbf { z } ^ { T } \\mathbf { W }$ represents the function generating parameters. ",
246
+ "bbox": [
247
+ 173,
248
+ 194,
249
+ 825,
250
+ 291
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "Attention and Multiplicative Interactions. While not the focus of this work, we note that attention systems in sequence modelling (Vaswani et al., 2017; Bahdanau et al., 2014) similarly use multiplicative interactions to effectively scale different parts of the input. This is typically done using the diagonal form above with $\\mathbf { m } = { \\bar { f } } ( \\mathbf { x } , \\mathbf { z } ) , \\mathbf { y } = \\mathbf { m } { \\bar { \\odot } } \\mathbf { x }$ where $\\mathbf { m }$ is often a bounded mask. Attention systems are typically used with different aims to those we describe here: they can suppress or amplify certain inputs and allow long-range dependencies by combining inputs across time-steps (when masking above is followed by a pooling layer, for example). We use these insights to posit that while more expensive, considering a higher order interaction (generating a vector mask) might prove more beneficial to such systems but we do not specifically consider attention in this paper and leave it to future work. ",
257
+ "bbox": [
258
+ 174,
259
+ 297,
260
+ 825,
261
+ 438
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "Scales and Biases. Further, we can make another low-rank approximation to the diagonal form and generate instead a scalar matrix – i.e. the hypernetwork outputs a single scalar scale (and/or bias) parameter per channel or feature vector we are considering, instead of a vector. We can again write this as $f = \\mathbf { z } ^ { T } \\mathbb { W } \\odot \\mathbf { x }$ where $\\mathbf { z } ^ { T } \\mathbb { W } = \\alpha \\mathbb { I }$ . This is common in methods such as FiLM (Perez et al., 2018; Dumoulin et al., 2018; 2017). ",
268
+ "bbox": [
269
+ 174,
270
+ 444,
271
+ 825,
272
+ 513
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "Multiplicative Interaction and Metric Learning. Another highly related field of active research is that of metric learning, where one tries to find the most suitable metric to measure similarity between objects in some parametrised space of metrics. One of the most commonly used classes is that of Mahalanobis distances $d _ { \\mathbf { C } } ( \\mathbf { x } , \\bar { \\mathbf { z } } ) = \\| \\mathbf { x } - \\mathbf { z } \\| _ { \\mathbf { C } } = ( \\mathbf { x } - \\mathbf { z } ) ^ { T } \\mathbf { C } ^ { - 1 } ( \\mathbf { x } - \\mathbf { z } )$ , which again maps onto multiplicative interaction units as $d _ { \\bf C } ( { \\bf x } , { \\bf z } ) = ( { \\bf x } - { \\bf z } ) ^ { T } \\dot { \\bf C } ^ { - 1 } ( { \\bf x } - { \\bf z } ) = { \\bf x } ^ { T } { \\bf C } ^ { - 1 } { \\bf x } - 2 { \\bf x } ^ { T } \\dot { \\bf C } ^ { - 1 } { \\bf z } +$ ${ \\bf z } ^ { T } { \\bf C } ^ { - 1 } { \\bf z }$ . In metric learning, however, one usually explicitly defines losses over tuples (or higher order n-tuples) with direct supervision, while here we consider building blocks that can learn a metric internally, without direct supervision. ",
279
+ "bbox": [
280
+ 173,
281
+ 521,
282
+ 825,
283
+ 632
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "The Taxonomy of Multiplicative Interactions. Finally, we summarise these relationships in figure 1. We can think of multiplicative interactions equivalently in terms of either: (a) the approximation to the 3D tensor made; (b) the output of the “projected” context by the hypernetwork; or (c) the operation used to combine the generated weights/context and the input. For example, the general bilinear form is equivalent to a vanilla hypernetwork that generates a weight matrix for a matrix multiplication. Similarly, a diagonal 3D tensor is equivalent to a hypernetwork that generates a vector and is combined with a hadamard product. ",
290
+ "bbox": [
291
+ 174,
292
+ 640,
293
+ 825,
294
+ 737
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "3 EXPRESSIVITY OF THE MODEL ",
301
+ "text_level": 1,
302
+ "bbox": [
303
+ 176,
304
+ 758,
305
+ 462,
306
+ 775
307
+ ],
308
+ "page_idx": 2
309
+ },
310
+ {
311
+ "type": "text",
312
+ "text": "Vanilla MLPs are universal approximators – that is, for every continuous function $[ 0 , 1 ] ^ { d } \\to \\mathbb { R }$ (considered our target) and every approximation error $\\epsilon > 0$ there exist hidden units $H$ and corresponding parameter values $\\theta$ such that the distance in function space between the MLP output and the target function is smaller than \u000f. Consequently adding new modules/building blocks does not affect the approximation power of neural nets, however such modifications can change the hypotheses space – the set of functions that can be represented exactly (with 0 error), and the compactness of a good estimator (how many parameters are needed), as well as learnability. ",
313
+ "bbox": [
314
+ 174,
315
+ 790,
316
+ 826,
317
+ 888
318
+ ],
319
+ "page_idx": 2
320
+ },
321
+ {
322
+ "type": "text",
323
+ "text": "We first show that multiplicative interactions strictly enlarge the hypotheses space of vanilla MLPs – that is, we add new functions which multi-layer multiplicative models can now represent perfectly, while also preserving our ability to represent those in the existing set modeled perfectly by vanilla MLPs (full proof in appendix A). ",
324
+ "bbox": [
325
+ 173,
326
+ 895,
327
+ 823,
328
+ 924
329
+ ],
330
+ "page_idx": 2
331
+ },
332
+ {
333
+ "type": "image",
334
+ "img_path": "images/2d4c375b87f644062f527d4858ae397804d5aaf032d941bc90249458b56fac8d.jpg",
335
+ "image_caption": [
336
+ "Figure 2: Number of parameters needed for a regular, single layer MLP (blue line) to represent the function up to $0 . 1 ~ \\mathrm { M S E }$ over the domain of a standard $d$ -dimensional Gaussian compared to the same quantity for a multiplicative model (green line). $\\sigma$ denotes sigmoid. Dotted lines represent pruned models where all weights below absolute value of 0.001 were dropped. Note that for MLP all parameters are actually used, while for MI module some of these functions (summation and dot product) can be compactly represented with pruning. "
337
+ ],
338
+ "image_footnote": [],
339
+ "bbox": [
340
+ 187,
341
+ 102,
342
+ 803,
343
+ 207
344
+ ],
345
+ "page_idx": 3
346
+ },
347
+ {
348
+ "type": "text",
349
+ "text": "",
350
+ "bbox": [
351
+ 173,
352
+ 330,
353
+ 823,
354
+ 358
355
+ ],
356
+ "page_idx": 3
357
+ },
358
+ {
359
+ "type": "text",
360
+ "text": "Theorem 1. Let $\\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with a multiplicative layer, then we have $\\mathcal { H } _ { m l p } \\subsetneq \\mathcal { H } _ { m u }$ . ",
361
+ "bbox": [
362
+ 174,
363
+ 361,
364
+ 825,
365
+ 404
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "While valuable, such a result can also be trivially obtained by adding somewhat exotic activation functions (e.g. Weierstrass function $\\begin{array} { r } { \\sigma ( x ) = \\sum _ { n = 0 } ^ { \\infty } 0 . 5 ^ { n } \\cos ( \\dot { 7 } ^ { n } \\pi x ) } \\end{array}$ which is a continuous function but nowhere differentiable (Weierstrass, 1895); see appendix for the proof) to the pool of typically used ones. While increasing the hypothesis space on its own is not of great significance, the crucial point here is that the set $\\mathcal { \\bar { H } } _ { \\mathrm { m u } } \\backslash \\mathcal { \\bar { H } } _ { \\mathrm { m l p } }$ helps extend our coverage to the set of basic functions that one would expect to need in composing solutions that mimic systems of interest – such as logical, physical, or biological ones. ",
372
+ "bbox": [
373
+ 174,
374
+ 414,
375
+ 825,
376
+ 511
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "Figure 2 shows the learnability (up to a certain error) of some simple two input functions against the number of parameters needed. We consider summation, gating, and dot products – which are basic buildings blocks of operations such as conditional statements or similarity metrics, and fundamental for implementing rich behaviours when combining different sources of information. For the gating and dot-product function classes, the complexity of MLPs required to learn them seems to grow exponentially, while the growth for multiplicative models is quadratic. On the other hand summation is trivially easier for an MLP. Thus we do not argue that multiplicative interactions are a silver bullet – but that such interactions add an important class of functions to the hypothesis set that are often the right inductive bias, or algorithmic building block, for many kinds of problems. In subsequent sections we show empirically that using them as context-integration layers leads to good performance gains across a range of tasks. ",
383
+ "bbox": [
384
+ 173,
385
+ 518,
386
+ 825,
387
+ 671
388
+ ],
389
+ "page_idx": 3
390
+ },
391
+ {
392
+ "type": "text",
393
+ "text": "4 RELATED WORK ",
394
+ "text_level": 1,
395
+ "bbox": [
396
+ 176,
397
+ 690,
398
+ 344,
399
+ 707
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "There is a vast body of literature surrounding multiplicative interactions, and these ideas have a long history, for example being discussed in the foundational era of connectionism (Rumelhart et al., 1986). Below we highlight some of the key works developed in the community over the last few decades and aim to show how these relate to each other. ",
406
+ "bbox": [
407
+ 174,
408
+ 722,
409
+ 825,
410
+ 777
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "text",
416
+ "text": "Some of the earliest models leveraging multiplicative interactions were higher-order Boltzmann machines or autoencoders (Sejnowski, 1986; Memisevic & Hinton, 2007; Taylor & Hinton, 2009). Currently, the most common usage of multiplicative interactions seen in models that enjoy widespread adoption is via a factorised or diagonal representation of the necessary 3D weight tensor. The LSTM cell (Hochreiter & Schmidhuber, 1997) (and its descendents such as the GRU (Cho et al., 2014)) employ multiplicative interactions of this form in the gating units that are crucial for the long-term stability of memories. Enhanced multiplicative versions of LSTMs have also been formulated (Sutskever et al., 2011; Wu et al., 2016; Krause et al., 2016): these approaches essentially combine the previous hidden state and current input via an element-wise or hadamard product between projected representations. ",
417
+ "bbox": [
418
+ 174,
419
+ 785,
420
+ 825,
421
+ 924
422
+ ],
423
+ "page_idx": 3
424
+ },
425
+ {
426
+ "type": "text",
427
+ "text": "Similarly, bilinear layers (often low-rank factorizations) have appeared extensively in the computer vision literature (Gao et al., 2016; Kim et al., 2016) and beyond (Dumoulin et al., 2018). Squeezeand-excitation networks, for example, can be seen as an instantiation of this idea (Hu et al., 2018). Specifically in visual-question answering systems, models like FiLM (Perez et al., 2018) or classconditional batch norm (Brock et al., 2019; Perez et al., 2017) use such diagonal forms to generate per-channel scales and biases as a function of some context. This has been shown to be effective at capturing relationships between the two different modalities (text and vision), as well as providing a powerful mechanism to allow a single network to conditionally specialize on multiple different tasks. Further, multimodal domains such as VQA have also seen such bilinear models used in combination with attention systems (Yu et al., 2017; Lu et al., 2016; Xu & Saenko, 2016; Schwartz et al., 2017). ",
428
+ "bbox": [
429
+ 174,
430
+ 103,
431
+ 825,
432
+ 242
433
+ ],
434
+ "page_idx": 4
435
+ },
436
+ {
437
+ "type": "text",
438
+ "text": "Further, there are many additional works using gating mechanisms which can be thought of as such diagonal approximations used in conjunction with additional point-wise non-linearities or softmaxes. Recent examples of such include pixelCNNs (Van den Oord et al., 2016) and Highway Networks (Srivastava et al., 2015; Zilly et al., 2017), among others (Dauphin et al., 2017), and earlier examples can be seen in works such as Mixtures of Experts (Jacobs et al., 1991) and successors. ",
439
+ "bbox": [
440
+ 174,
441
+ 250,
442
+ 825,
443
+ 319
444
+ ],
445
+ "page_idx": 4
446
+ },
447
+ {
448
+ "type": "text",
449
+ "text": "Multiplicative interactions in the non-factorised sense can also be thought of as a restricted class of Hypernetworks (Ha et al., 2017): models that generate the weights of one network from another. While the original presentation (Ha et al., 2017) considered their use for model compression in feed-forward nets (i.e. using layer IDs to generate weights), they also investigate HyperLSTMs, in which per timestep multiplicative biases are generated. A similar approach has also been applied to generating parameters in convolutional nets via “dynamic convolutions” where the size of the generated parameters is controlled by tying filters (Wu et al., 2019). Further, these ideas have been extended to Bayesian forms (Krueger et al., 2017) and also used for example, in architecture search (Brock et al., 2017). ",
450
+ "bbox": [
451
+ 174,
452
+ 325,
453
+ 825,
454
+ 452
455
+ ],
456
+ "page_idx": 4
457
+ },
458
+ {
459
+ "type": "text",
460
+ "text": "Lastly, multiplicative interactions used to scale contributions from different spatial or temporal components play a key role in attention mechanisms (Bahdanau et al., 2014; Vaswani et al., 2017). They have also been used in some RL works to better condition information, e.g. in Feudal Networks (Vezhnevets et al., 2017) as a way for manager and worker units to interact, and better actionconditioning (Oh et al., 2015). ",
461
+ "bbox": [
462
+ 174,
463
+ 458,
464
+ 825,
465
+ 529
466
+ ],
467
+ "page_idx": 4
468
+ },
469
+ {
470
+ "type": "text",
471
+ "text": "5 EXPERIMENTAL SETUP ",
472
+ "text_level": 1,
473
+ "bbox": [
474
+ 176,
475
+ 571,
476
+ 398,
477
+ 588
478
+ ],
479
+ "page_idx": 4
480
+ },
481
+ {
482
+ "type": "text",
483
+ "text": "We aim to demonstrate that the incorporation of multiplicative interactions can boost performance across a wide range of problems and domains, and we conjecture that this is because they effectively allow for better routing and integration of different kinds of information. Specifically we will show that multiplicative interactions allow better integration of (a) latent variables in decoder models, $( b )$ task or contextual information in multitask learning, (c) recurrent state in sequence models. We use neural process regression, multitask RL and language modelling as exemplar domains. Further details of architectures and hyper-parameters can be found in the appendix. ",
484
+ "bbox": [
485
+ 174,
486
+ 617,
487
+ 825,
488
+ 715
489
+ ],
490
+ "page_idx": 4
491
+ },
492
+ {
493
+ "type": "text",
494
+ "text": "A Note on Implementation and Terminology. We use $\\mathcal { M } ( \\mathbf { x } , \\mathbf { z } )$ below to mean the function $f ( \\mathbf { x } , \\mathbf { z } ) = \\mathbf { z } ^ { T } \\hat { \\mathbb { W } } \\mathbf { x } + \\mathbf { z } ^ { T } \\mathbf { U } + \\mathbf { B } \\mathbf { x } + \\mathbf { b }$ (or referred to as MI in the legends). In all cases we implement this using a series of standard linear layers with a reshape operation in between to form the intermediate matrix (equivalently this can be done with einsum or tensor product notation; we provide a simple implementation in the appendix). The quantity $f _ { 1 } ( \\mathbf { z } ) = \\mathbf { z } ^ { T } \\mathbb { W } + \\mathbf { B }$ , (where as above $\\mathbb { W }$ is 3D and $\\mathbf { B }$ a 2D bias) represents the 2D output of projecting the contextual information. We refer to this interchangeably as the 2D-contextual projection or “generated weights” using the hypernet terminology. Similarly the “generated bias” is the 1D projection of the context $\\mathbf { z }$ , that is, $\\dot { f _ { 2 } } \\dot { ( } z ) = \\mathbf { z } ^ { T } \\mathbf { U } + \\mathbf { b }$ (and thus $f ( \\mathbf { x } ; \\mathbf { z } ) = f _ { 1 } ( \\mathbf { z } ) \\mathbf { x } + f _ { 2 } ( \\mathbf { z } ) )$ . ",
495
+ "bbox": [
496
+ 173,
497
+ 722,
498
+ 825,
499
+ 848
500
+ ],
501
+ "page_idx": 4
502
+ },
503
+ {
504
+ "type": "text",
505
+ "text": "While we aim to draw connections to other models and approximations in the literature above, our aim is not to advertise one specific instantiation or approximation over the other . As such, we use the same form above in all experiments (unless specified otherwise) and control parameter count by controlling the size of $\\mathbf { z }$ . Undoubtedly, practitioners will find that task-specific tuning of the above form might yield comparable or better results with fewer parameters, given the right approximations. ",
506
+ "bbox": [
507
+ 174,
508
+ 854,
509
+ 825,
510
+ 924
511
+ ],
512
+ "page_idx": 4
513
+ },
514
+ {
515
+ "type": "image",
516
+ "img_path": "images/12b1283de791d8ac96cbeafc215a8cfdc031cb8d8343a82625fcb85fe15f5382.jpg",
517
+ "image_caption": [
518
+ "Figure 3: Averaged learning curves for different models while varying the number of tasks in the toy multitask regression domain. Shaded regions represent standard error of mean estimation. "
519
+ ],
520
+ "image_footnote": [],
521
+ "bbox": [
522
+ 189,
523
+ 99,
524
+ 805,
525
+ 199
526
+ ],
527
+ "page_idx": 5
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "6 LEARNING CONTEXT DEPENDENT LAYERS FOR MULTITASK LEARNING ",
532
+ "text_level": 1,
533
+ "bbox": [
534
+ 171,
535
+ 273,
536
+ 802,
537
+ 290
538
+ ],
539
+ "page_idx": 5
540
+ },
541
+ {
542
+ "type": "text",
543
+ "text": "We start by considering the general paradigm of multitask-learning, wherein the goal is to train one model to solve $K$ different tasks. We show that we can boost performance here by learning context or task-conditional layers with multiplicative interactions. There is generally a trade-off between the transfer from similar tasks and the negative interference between those with very different solutions. Our claim is thus that context-conditional layers provide a best-of-both-worlds approach, with an inductive bias that allows transfer (as opposed to a multiheaded architecture) while also limiting interference. ",
544
+ "bbox": [
545
+ 173,
546
+ 306,
547
+ 825,
548
+ 404
549
+ ],
550
+ "page_idx": 5
551
+ },
552
+ {
553
+ "type": "text",
554
+ "text": "We first demonstrate this with a toy example, where we attempt to regress two different classes of functions, affine and sines, with one model. Specifically, $y = a _ { i } x + b _ { i }$ and $y = a _ { i } \\sin ( 1 0 x ) + b _ { i }$ where $a _ { i }$ and $b _ { i }$ are sampled per task from a uniform distribution. In Figure 3 we show results averaged over multiple runs, as we vary the number of tasks. We train both a standard MLP with multiple heads and one with that is given task ID as additional input and can see that the neither is able to use task information to do any better. On the other hand, the results show that a task-conditioned $\\mathcal { M } ( x , \\mathbf { t } )$ layer allows the model to learn both tasks better with less interference and also increased data efficiency. We see that the gains with using an $\\mathcal { M }$ layer are more pronounced as we increase the number of tasks. More details are provided in appendix D. ",
555
+ "bbox": [
556
+ 174,
557
+ 411,
558
+ 825,
559
+ 536
560
+ ],
561
+ "page_idx": 5
562
+ },
563
+ {
564
+ "type": "text",
565
+ "text": "6.1 MULTITASK RL ON DMLAB-30 ",
566
+ "text_level": 1,
567
+ "bbox": [
568
+ 176,
569
+ 555,
570
+ 434,
571
+ 569
572
+ ],
573
+ "page_idx": 5
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "Next, we consider a larger scale problem: multitask RL on the DeepMind Lab-30 domain (Beattie et al., 2016). This is a suite of 30 tasks in a partially-observable, first-person-perspective 3D environment, encompassing a range of laser-tag, navigation, and memory levels. We use a typical actor-critic RL setup within the Impala framework of Espeholt et al. (2018), with multiple actors and a single learner with off-policy correction (further details provided in appendix section E). We use exactly the architecture as in the original works (Espeholt et al., 2018; Hessel et al., 2019): a stack of convolutional layers followed by an LSTM, with output $\\mathbf { h } _ { t }$ at each timestep. Normally these are then projected to policies $\\pi$ and value functions $V$ that are shared across all tasks. At test time agents are typically not allowed to access ground truth task ID (e.g. this means value functions at training time could use this information). ",
578
+ "bbox": [
579
+ 173,
580
+ 582,
581
+ 825,
582
+ 720
583
+ ],
584
+ "page_idx": 5
585
+ },
586
+ {
587
+ "type": "text",
588
+ "text": "Multi-head Policy and Value Layers We first show that a multi-headed agent architecture with one policy and value head per level does in fact boost performance. While this does use privileged information (task ID), this does show that there is some degree of interference between levels from sharing policy and value layers. ",
589
+ "bbox": [
590
+ 174,
591
+ 728,
592
+ 825,
593
+ 784
594
+ ],
595
+ "page_idx": 5
596
+ },
597
+ {
598
+ "type": "text",
599
+ "text": "Multiplicative Policy and Value Layers We can instead consider using multiplicative layers here to integrate task information (one-hot task ID $\\mathbf { I } _ { i }$ ) to modulate compute-paths. We learn a task embedding as below, and use it in a multiplicative layer that projects to policy and value functions. That is, we now have $\\mathbf { c } = \\mathrm { r e l u } ( \\mathrm { M L P } ( \\mathbf { I } _ { i } ) )$ as a context, and $\\pi _ { t } , V _ { t } = \\mathcal { M } ( \\mathbf { h } _ { t } , \\mathbf { c } )$ . ",
600
+ "bbox": [
601
+ 174,
602
+ 791,
603
+ 825,
604
+ 848
605
+ ],
606
+ "page_idx": 5
607
+ },
608
+ {
609
+ "type": "text",
610
+ "text": "We show results in the same figure and find that such a layer provides a further boost in performance. This can be viewed as generating policy layers from some learnt embedding of the task ID. Our hypothesis is that while multiheaded architectures reduce interference, they also remove the ability of policy-transfer between the different layers. Further, each head only gets $1 / K$ of the number of gradient updates (when training on $K$ tasks). ",
611
+ "bbox": [
612
+ 174,
613
+ 854,
614
+ 825,
615
+ 924
616
+ ],
617
+ "page_idx": 5
618
+ },
619
+ {
620
+ "type": "image",
621
+ "img_path": "images/6f1cb7d5e76bb2f8a0d9399034528e959e5c647d7d7ca692a6e7acec52949e99.jpg",
622
+ "image_caption": [
623
+ "Figure 4: (a) A t-SNE plot of the generated weights from an $\\mathcal { M }$ layer. (b) Human normalised performance (capped at 100) when using task ID as context to an $\\mathcal { M }$ layer. (c) Using a learnt context instead. "
624
+ ],
625
+ "image_footnote": [],
626
+ "bbox": [
627
+ 189,
628
+ 99,
629
+ 808,
630
+ 250
631
+ ],
632
+ "page_idx": 6
633
+ },
634
+ {
635
+ "type": "text",
636
+ "text": "Multiplicative Policies with Learnt Contexts We find (somewhat surprisingly) that we can get similar or greater performance gains without using any task information, replacing task $\\mathrm { I D } \\mathbf { I } _ { i }$ instead with a learnt non-linear projection of the LSTM output. We now have, $\\mathbf { c } = \\mathrm { r e l u } ( \\mathrm { M L P } ( \\mathbf { h } _ { t } ) )$ and $\\pi _ { t } , V _ { t } = \\mathcal { M } ( \\mathbf { h } _ { t } , \\mathbf { c } )$ . ",
637
+ "bbox": [
638
+ 174,
639
+ 339,
640
+ 825,
641
+ 396
642
+ ],
643
+ "page_idx": 6
644
+ },
645
+ {
646
+ "type": "text",
647
+ "text": "We show a t-SNE plot of the 2D projection of the state of the LSTM in Figure 4. This is coloured by level name and the transparency value indicates the timestep. We see at timestep 0, all weights are the same, and as the levels progress, we find that it can naturally detect or cluster task information, showing that the model can readily detect the current task type. We posit however that the affine policyvalue decoders may not have the right inductive bias to use this information well. We conjecture that the multiplicative interaction, via the learnt embedding, $c .$ , provides the right inductive bias: allowing the model to integrate information and providing additional densely-gated conditional-compute paths that leverage task similarity where appropriate, whilst guarding against interference where tasks differ – and thus more effectively learning task conditioned behaviour. ",
648
+ "bbox": [
649
+ 174,
650
+ 401,
651
+ 825,
652
+ 527
653
+ ],
654
+ "page_idx": 6
655
+ },
656
+ {
657
+ "type": "text",
658
+ "text": "We note that we match state-of-the-art performance on this domain which previously used the PopArt Method (Hessel et al., 2019) (both achieve $7 3 \\%$ normalised human score), with a simpler method. PopArt involves having task-specific value functions and using adaptive gradient normalisation (to limit interference between different reward scales). Our method also reduces the number of extra hyper-parameters needed to zero. As such, PopArt solves an orthogonal problem to the one considered here and we posit that these methods can be combined in future work. We also leave as future work the analysis of whether such hyper-value functions are able to implicitly learn the different reward scales that are explictly parameterised in methods like PopArt. ",
659
+ "bbox": [
660
+ 174,
661
+ 535,
662
+ 825,
663
+ 646
664
+ ],
665
+ "page_idx": 6
666
+ },
667
+ {
668
+ "type": "text",
669
+ "text": "7 LATENT VARIABLE MODELS WITH MULTIPLICATIVE DECODERS ",
670
+ "text_level": 1,
671
+ "bbox": [
672
+ 176,
673
+ 667,
674
+ 738,
675
+ 684
676
+ ],
677
+ "page_idx": 6
678
+ },
679
+ {
680
+ "type": "text",
681
+ "text": "We previously demonstrated the ability of multiplicative interactions to extract and efficiently combine contextual information. We next explore the paradigm where the two streams of information being combined refer to semantically different features. Specifically, we investigate how contextual latent variables can be better integrated into neural decoders. We consider neural processes for few-shot regression. Briefly, neural processes (Garnelo et al., 2018b;a) are a neural analogue to Gaussian Processes. For few shot regression, they work by predicting a function value $\\mathbf { y } ^ { * }$ at new observations $\\mathbf { x } ^ { * }$ having observed previous values $\\left( \\mathbf { x } _ { i } , \\mathbf { y } _ { i } \\right)$ (referred to as contexts) of the same function. As opposed to training a single predictor on the $\\left( \\mathbf { x } _ { i } , \\mathbf { y } _ { i } \\right)$ , Neural Processes learn to infer a distribution over functions that are consistent with the observations collected so far. ",
682
+ "bbox": [
683
+ 173,
684
+ 700,
685
+ 825,
686
+ 825
687
+ ],
688
+ "page_idx": 6
689
+ },
690
+ {
691
+ "type": "text",
692
+ "text": "This is achieved by embedding context points $\\left( \\mathbf { x } _ { i } , \\mathbf { y } _ { i } \\right)$ individually with an encoder network, and then taking the mean of these embeddings. This gives latent variables $\\mathbf { z }$ that are a representation of the function that maps $\\mathbf { x }$ to $\\mathbf { y }$ , i.e. $\\mathbf { y } = f ( \\mathbf { x } , \\mathbf { z } )$ . A new data point $\\mathbf { x } ^ { * }$ is mapped to $\\mathbf { y } ^ { * }$ by passing $\\left[ \\mathbf { z } ; \\mathbf { x } ^ { * } \\right]$ through a decoder network. ",
693
+ "bbox": [
694
+ 174,
695
+ 833,
696
+ 825,
697
+ 888
698
+ ],
699
+ "page_idx": 6
700
+ },
701
+ {
702
+ "type": "text",
703
+ "text": "We aim to increase the expressivity of the decoder by improving the conditioning on $\\mathbf { z }$ . The standard approach is to concatenate $\\mathbf { x }$ and $\\mathbf { z }$ (denoted as $\\mathbf { M L P } ( [ \\mathbf { x } ; \\mathbf { z } ] ) ,$ ) leading to a purely additive relationship. ",
704
+ "bbox": [
705
+ 174,
706
+ 895,
707
+ 823,
708
+ 924
709
+ ],
710
+ "page_idx": 6
711
+ },
712
+ {
713
+ "type": "text",
714
+ "text": "Instead, we replace the final layer of the MLP decoder with the multiplicative form $\\mathcal { M } ( \\mathbf { x } , \\mathbf { z } )$ . As an additional baseline, we consider skip connections between the latent variable and each layer of the decoder (denoted Skip $\\mathbf { M L P } ( [ \\mathbf { x } ; \\mathbf { z } ] )$ Dieng et al. (2018)), as a means to avoid latent variable collapse. We apply all methods to the regression task on function draws from a GP prior Garnelo et al. (2018b) and summarize results in Figure 5 a). The results show that multiplicative forms are able to better condition on latent information compared to the baseline MLPs. Further experimental details are provided in the appendix F. ",
715
+ "bbox": [
716
+ 173,
717
+ 103,
718
+ 825,
719
+ 202
720
+ ],
721
+ "page_idx": 7
722
+ },
723
+ {
724
+ "type": "text",
725
+ "text": "8 MULTIPLICATIVE EMBEDDINGS FOR LANGUAGE MODELLING ",
726
+ "text_level": 1,
727
+ "bbox": [
728
+ 176,
729
+ 229,
730
+ 717,
731
+ 246
732
+ ],
733
+ "page_idx": 7
734
+ },
735
+ {
736
+ "type": "text",
737
+ "text": "Finally, we consider word-level language modelling with recurrent models. At each time-step, the network outputs a prediction about the next-word in the sequence, given the current generated word (ground truth at training) and its recurrent state. A standard architecture is to project one-hot word vectors $\\mathbf { x } _ { t }$ to input embeddings $\\mathbf { z } _ { t } ^ { i } = \\mathbf { W } \\mathbf { x } _ { t }$ , followed by an LSTM with output $\\mathbf { h } _ { t }$ . We then produce our predicted output embedding $\\mathbf { z } _ { t + 1 } ^ { o } = \\mathbf { W } _ { 2 } \\mathbf { h } _ { t } \\mathbf { x } _ { t } + \\mathbf { b }$ and output yt+1 = softmax $( \\mathbf { z } _ { t + 1 } ^ { o } \\mathbf { W } ^ { T } + b _ { 2 } )$ where the embedding weights W are tied. ",
738
+ "bbox": [
739
+ 173,
740
+ 265,
741
+ 825,
742
+ 349
743
+ ],
744
+ "page_idx": 7
745
+ },
746
+ {
747
+ "type": "text",
748
+ "text": "We posit that computing embeddings with multiplicative interactions instead will allow the model to better take its recurrent context into account. We thus compute the output embedding as follows: $\\mathbf { c } = \\mathrm { r e l u } ( \\mathbf { W } _ { 3 } \\mathbf { h } _ { t } + \\mathbf { b } )$ and $\\mathbf { z } _ { t + 1 } ^ { o } = \\mathcal { M } ( \\mathbf { c } ^ { T } , \\mathbf { h } _ { t } )$ . Instead of being quadratic in $\\mathbf { h } _ { t }$ directly we use this context vector c defined above. This serves two purposes: firstly, we introduce an additional on-linear pathway in the network and secondly, we have $\\dim ( \\mathbf { c } ) \\ll \\dim ( \\mathbf { h } _ { t } )$ which allows us to drastically cut down the parameter count (for example, we have an LSTM output size of 2048, but a context size of only 32). This is an alternative to having a diagonal approximation. ",
749
+ "bbox": [
750
+ 173,
751
+ 356,
752
+ 825,
753
+ 454
754
+ ],
755
+ "page_idx": 7
756
+ },
757
+ {
758
+ "type": "text",
759
+ "text": "We can similarly also have a multiplicative input embedding to the LSTM such that $ { \\mathbf { z } } _ { t } ^ { i }$ also integrates recurrent information from $\\mathbf { h } _ { t - 1 }$ . We could define $ { \\mathbf { z } } _ { t } ^ { i }$ analogous to above: $\\mathbf { z } _ { t + 1 } ^ { \\prime } = \\mathrm { \\mathcal { M } } ( \\mathbf { z } _ { t } ^ { i } , \\mathbf { h } _ { t - 1 } ) =$ $\\mathbf { z } _ { t } ^ { i ^ { T } } \\mathbb { W } ^ { \\prime \\prime } \\mathbf { h } _ { t - 1 } + \\mathbf { z } ^ { T } \\mathbf { U } + \\mathbf { V } \\mathbf { h } _ { t - 1 } + \\mathbf { b }$ . This equation is in fact very similar to the expression used to generate the gates and candidate cell of the LSTM: the last three terms are identical. A diagonal form of the first term has been used in used inside multiplicative RNNs and LSTMs (Sutskever et al., 2011; Krause et al., 2016). ",
760
+ "bbox": [
761
+ 173,
762
+ 460,
763
+ 825,
764
+ 549
765
+ ],
766
+ "page_idx": 7
767
+ },
768
+ {
769
+ "type": "text",
770
+ "text": "We report results (in Table 1) on running this model on Wikitext-103. For multiplicative output embeddings we use the 3D form (with the low-rank bottleneck as described above) and we use a diagonal form for the input embeddings when combining the approaches. The rest of architectural choices and hyper-parameters are reported in the appendix. We find that adding multiplicative decoder (output) embeddings provides a boost in performance and further adding input embeddings increases these gains. We ascribe this to the ability of the embeddings to now be markedly changed by context and allowing better integration of information by the inductive bias in these interactions. ",
771
+ "bbox": [
772
+ 173,
773
+ 556,
774
+ 825,
775
+ 654
776
+ ],
777
+ "page_idx": 7
778
+ },
779
+ {
780
+ "type": "table",
781
+ "img_path": "images/3800813d7854f19794db3c697b665b2ef4af0549ad6c7164ba0929fb6f7c757b.jpg",
782
+ "table_caption": [
783
+ "Table 1: Word-level perplexity on WikiText-103 "
784
+ ],
785
+ "table_footnote": [],
786
+ "table_body": "<table><tr><td>Model</td><td>Valid</td><td>Test</td><td>No. Params</td></tr><tr><td>LSTM Rae et al. (2018)</td><td>34.1</td><td>34.3</td><td>88M</td></tr><tr><td>Gated CNN Dauphin et al. (2017)</td><td>1</td><td>37.2</td><td>-</td></tr><tr><td>RMC Santoro et al. (2018)</td><td>30.8</td><td>31.6</td><td>-</td></tr><tr><td>Trellis Networks Bai et al. (2019)</td><td>1</td><td>30.35</td><td>180M</td></tr><tr><td>TransformerXL Dai et al. (2018)</td><td>17.7</td><td>18.3</td><td>257M</td></tr><tr><td>LSTM (ours)</td><td>34.7</td><td>36.7</td><td>88M</td></tr><tr><td>LSTM + MultDec</td><td>31.7</td><td>33.7</td><td>105M</td></tr><tr><td>LSTM+ MultEncDec</td><td>28.9</td><td>30.3</td><td>110M</td></tr></table>",
787
+ "bbox": [
788
+ 269,
789
+ 700,
790
+ 728,
791
+ 847
792
+ ],
793
+ "page_idx": 7
794
+ },
795
+ {
796
+ "type": "text",
797
+ "text": "We note that we have competitive results using only a single-layer LSTM as our base model and far fewer parameters overall. Our intuition is that using such embeddings is orthognal to most of the other recent advances proposed and can thus be stacked on top of them. We leave as future work the integration of these ideas with Transformer based models. ",
798
+ "bbox": [
799
+ 174,
800
+ 867,
801
+ 825,
802
+ 922
803
+ ],
804
+ "page_idx": 7
805
+ },
806
+ {
807
+ "type": "image",
808
+ "img_path": "images/74a1055512e03077cc26e4e55ed32a13fdf782e22755baa068f65c3cf15639aa.jpg",
809
+ "image_caption": [
810
+ "Figure 5: Results on Neural Processes and language modelling on WikiText-103. "
811
+ ],
812
+ "image_footnote": [],
813
+ "bbox": [
814
+ 204,
815
+ 99,
816
+ 794,
817
+ 213
818
+ ],
819
+ "page_idx": 8
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "9 CONCLUSION AND FUTURE WORK ",
824
+ "text_level": 1,
825
+ "bbox": [
826
+ 173,
827
+ 275,
828
+ 495,
829
+ 291
830
+ ],
831
+ "page_idx": 8
832
+ },
833
+ {
834
+ "type": "text",
835
+ "text": "In this work we considered multiplicative interactions and various formulations thereof, connecting them to a variety of architectures, both older and modern, such as Hypernetworks, multplicative LSTMs or gating methods. We hypothesise that the ability of such networks to better represent a broader range of algorithmic primitives (e.g. conditional-statements or inner products) allows them to better integrate contextual or task-conditional information to fuse multiple stream of data. We first tested empirically this hypothesis in two controlled settings, in order to minimize the effect of confounding factors. We further show that we could match state-of-the-art methods on multiple domains with only LSTMs and multiplicative units. While we do not necessarily advocate for a specific instance of the above methods, we hope that this work leads to a broader understanding and consideration of such methods by practitioners, and in some cases replacing the standard practice of concatenation when using conditioning, contextual inputs, or additional sources of information. ",
836
+ "bbox": [
837
+ 173,
838
+ 308,
839
+ 825,
840
+ 460
841
+ ],
842
+ "page_idx": 8
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "We believe there are many ways to explore this space of ideas more broadly, for instance looking at: the role of various approximations to these methods; ways to make their implementations more efficient; and their application to newer domains. Finally, while attention models use some of these multiplicative interactions, we hope that applying some of the lessons from this work (such as higher order interactions) will allow even greater integration of information in attention systems. ",
847
+ "bbox": [
848
+ 174,
849
+ 468,
850
+ 825,
851
+ 536
852
+ ],
853
+ "page_idx": 8
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "ACKNOWLEDGEMENTS ",
858
+ "text_level": 1,
859
+ "bbox": [
860
+ 176,
861
+ 554,
862
+ 334,
863
+ 568
864
+ ],
865
+ "page_idx": 8
866
+ },
867
+ {
868
+ "type": "text",
869
+ "text": "The authors would like to thank Karen Simonyan and Sander Dieleman for their inputs and comments on the experiments as well as early drafts of the paper. We’d also like to thank Ali Razavi, Pablo Sprechmann, Alex Pritzel and Erich Elsen for insightful discussions around such multiplicative models and their applications. ",
870
+ "bbox": [
871
+ 174,
872
+ 579,
873
+ 825,
874
+ 635
875
+ ],
876
+ "page_idx": 8
877
+ },
878
+ {
879
+ "type": "text",
880
+ "text": "REFERENCES ",
881
+ "text_level": 1,
882
+ "bbox": [
883
+ 174,
884
+ 656,
885
+ 285,
886
+ 672
887
+ ],
888
+ "page_idx": 8
889
+ },
890
+ {
891
+ "type": "text",
892
+ "text": "Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. ",
893
+ "bbox": [
894
+ 174,
895
+ 681,
896
+ 825,
897
+ 709
898
+ ],
899
+ "page_idx": 8
900
+ },
901
+ {
902
+ "type": "text",
903
+ "text": "Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. ICLR, 2019. ",
904
+ "bbox": [
905
+ 173,
906
+ 720,
907
+ 823,
908
+ 736
909
+ ],
910
+ "page_idx": 8
911
+ },
912
+ {
913
+ "type": "text",
914
+ "text": "Charles Beattie, Joel Z Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Küttler, Andrew Lefrancq, Simon Green, Víctor Valdés, Amir Sadik, et al. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016. ",
915
+ "bbox": [
916
+ 174,
917
+ 746,
918
+ 826,
919
+ 789
920
+ ],
921
+ "page_idx": 8
922
+ },
923
+ {
924
+ "type": "text",
925
+ "text": "Andrew Brock, Theodore Lim, J. M. Ritchie, and Nick Weston. Smash: One-shot model architecture search through hypernetworks, 2017. ",
926
+ "bbox": [
927
+ 171,
928
+ 801,
929
+ 823,
930
+ 829
931
+ ],
932
+ "page_idx": 8
933
+ },
934
+ {
935
+ "type": "text",
936
+ "text": "Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. ICLR, 2019. ",
937
+ "bbox": [
938
+ 169,
939
+ 840,
940
+ 823,
941
+ 869
942
+ ],
943
+ "page_idx": 8
944
+ },
945
+ {
946
+ "type": "text",
947
+ "text": "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. arXiv preprint arXiv:1406.1078, 2014. ",
948
+ "bbox": [
949
+ 176,
950
+ 882,
951
+ 825,
952
+ 924
953
+ ],
954
+ "page_idx": 8
955
+ },
956
+ {
957
+ "type": "text",
958
+ "text": "Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Language modeling with longer-term dependency. 2018. ",
959
+ "bbox": [
960
+ 171,
961
+ 103,
962
+ 823,
963
+ 133
964
+ ],
965
+ "page_idx": 9
966
+ },
967
+ {
968
+ "type": "text",
969
+ "text": "Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 933–941. JMLR. org, 2017. ",
970
+ "bbox": [
971
+ 176,
972
+ 141,
973
+ 823,
974
+ 185
975
+ ],
976
+ "page_idx": 9
977
+ },
978
+ {
979
+ "type": "text",
980
+ "text": "Adji B Dieng, Yoon Kim, Alexander M Rush, and David M Blei. Avoiding latent variable collapse with generative skip models. arXiv preprint arXiv:1807.04863, 2018. ",
981
+ "bbox": [
982
+ 171,
983
+ 194,
984
+ 823,
985
+ 223
986
+ ],
987
+ "page_idx": 9
988
+ },
989
+ {
990
+ "type": "text",
991
+ "text": "Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. Proc. of ICLR, 2, 2017. ",
992
+ "bbox": [
993
+ 173,
994
+ 233,
995
+ 823,
996
+ 262
997
+ ],
998
+ "page_idx": 9
999
+ },
1000
+ {
1001
+ "type": "text",
1002
+ "text": "Vincent Dumoulin, Ethan Perez, Nathan Schucher, Florian Strub, Harm de Vries, Aaron Courville, and Yoshua Bengio. Feature-wise transformations. Distill, 2018. doi: 10.23915/distill.00011. https://distill.pub/2018/feature-wise-transformations. ",
1003
+ "bbox": [
1004
+ 173,
1005
+ 272,
1006
+ 825,
1007
+ 314
1008
+ ],
1009
+ "page_idx": 9
1010
+ },
1011
+ {
1012
+ "type": "text",
1013
+ "text": "Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. ICML, 2018. ",
1014
+ "bbox": [
1015
+ 174,
1016
+ 324,
1017
+ 823,
1018
+ 367
1019
+ ],
1020
+ "page_idx": 9
1021
+ },
1022
+ {
1023
+ "type": "text",
1024
+ "text": "Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact bilinear pooling. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 317–326, 2016. ",
1025
+ "bbox": [
1026
+ 171,
1027
+ 377,
1028
+ 823,
1029
+ 406
1030
+ ],
1031
+ "page_idx": 9
1032
+ },
1033
+ {
1034
+ "type": "text",
1035
+ "text": "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. ICML, 2018a. ",
1036
+ "bbox": [
1037
+ 171,
1038
+ 415,
1039
+ 825,
1040
+ 445
1041
+ ],
1042
+ "page_idx": 9
1043
+ },
1044
+ {
1045
+ "type": "text",
1046
+ "text": "Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018b. ",
1047
+ "bbox": [
1048
+ 173,
1049
+ 454,
1050
+ 823,
1051
+ 484
1052
+ ],
1053
+ "page_idx": 9
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. ICLR, 2017. ",
1058
+ "bbox": [
1059
+ 173,
1060
+ 493,
1061
+ 635,
1062
+ 510
1063
+ ],
1064
+ "page_idx": 9
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. AAAI, 2019. ",
1069
+ "bbox": [
1070
+ 174,
1071
+ 518,
1072
+ 820,
1073
+ 547
1074
+ ],
1075
+ "page_idx": 9
1076
+ },
1077
+ {
1078
+ "type": "text",
1079
+ "text": "Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997. ",
1080
+ "bbox": [
1081
+ 173,
1082
+ 558,
1083
+ 823,
1084
+ 587
1085
+ ],
1086
+ "page_idx": 9
1087
+ },
1088
+ {
1089
+ "type": "text",
1090
+ "text": "Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018. ",
1091
+ "bbox": [
1092
+ 173,
1093
+ 595,
1094
+ 823,
1095
+ 626
1096
+ ],
1097
+ "page_idx": 9
1098
+ },
1099
+ {
1100
+ "type": "text",
1101
+ "text": "Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991. ",
1102
+ "bbox": [
1103
+ 171,
1104
+ 633,
1105
+ 823,
1106
+ 665
1107
+ ],
1108
+ "page_idx": 9
1109
+ },
1110
+ {
1111
+ "type": "text",
1112
+ "text": "Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017. ",
1113
+ "bbox": [
1114
+ 174,
1115
+ 672,
1116
+ 823,
1117
+ 717
1118
+ ],
1119
+ "page_idx": 9
1120
+ },
1121
+ {
1122
+ "type": "text",
1123
+ "text": "Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019. ",
1124
+ "bbox": [
1125
+ 174,
1126
+ 726,
1127
+ 825,
1128
+ 756
1129
+ ],
1130
+ "page_idx": 9
1131
+ },
1132
+ {
1133
+ "type": "text",
1134
+ "text": "Jin-Hwa Kim, Kyoung-Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. arXiv preprint arXiv:1610.04325, 2016. ",
1135
+ "bbox": [
1136
+ 171,
1137
+ 765,
1138
+ 825,
1139
+ 795
1140
+ ],
1141
+ "page_idx": 9
1142
+ },
1143
+ {
1144
+ "type": "text",
1145
+ "text": "Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling, 2016. ",
1146
+ "bbox": [
1147
+ 173,
1148
+ 803,
1149
+ 825,
1150
+ 833
1151
+ ],
1152
+ "page_idx": 9
1153
+ },
1154
+ {
1155
+ "type": "text",
1156
+ "text": "David Krueger, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville. Bayesian hypernetworks. arXiv preprint arXiv:1710.04759, 2017. ",
1157
+ "bbox": [
1158
+ 173,
1159
+ 842,
1160
+ 823,
1161
+ 872
1162
+ ],
1163
+ "page_idx": 9
1164
+ },
1165
+ {
1166
+ "type": "text",
1167
+ "text": "Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In Advances In Neural Information Processing Systems, pp. 289–297, 2016. ",
1168
+ "bbox": [
1169
+ 174,
1170
+ 882,
1171
+ 825,
1172
+ 922
1173
+ ],
1174
+ "page_idx": 9
1175
+ },
1176
+ {
1177
+ "type": "text",
1178
+ "text": "Roland Memisevic and Geoffrey Hinton. Unsupervised learning of image transformations. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–8. IEEE, 2007. ",
1179
+ "bbox": [
1180
+ 169,
1181
+ 103,
1182
+ 823,
1183
+ 132
1184
+ ],
1185
+ "page_idx": 10
1186
+ },
1187
+ {
1188
+ "type": "text",
1189
+ "text": "Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015. ",
1190
+ "bbox": [
1191
+ 173,
1192
+ 141,
1193
+ 823,
1194
+ 184
1195
+ ],
1196
+ "page_idx": 10
1197
+ },
1198
+ {
1199
+ "type": "text",
1200
+ "text": "Ethan Perez, Harm De Vries, Florian Strub, Vincent Dumoulin, and Aaron Courville. Learning visual reasoning without strong priors. arXiv preprint arXiv:1707.03017, 2017. ",
1201
+ "bbox": [
1202
+ 171,
1203
+ 193,
1204
+ 823,
1205
+ 223
1206
+ ],
1207
+ "page_idx": 10
1208
+ },
1209
+ {
1210
+ "type": "text",
1211
+ "text": "Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. ",
1212
+ "bbox": [
1213
+ 173,
1214
+ 231,
1215
+ 825,
1216
+ 275
1217
+ ],
1218
+ "page_idx": 10
1219
+ },
1220
+ {
1221
+ "type": "text",
1222
+ "text": "Jack W Rae, Chris Dyer, Peter Dayan, and Timothy P Lillicrap. Fast parametric learning with activation memorization. arXiv preprint arXiv:1803.10049, 2018. ",
1223
+ "bbox": [
1224
+ 171,
1225
+ 284,
1226
+ 823,
1227
+ 313
1228
+ ],
1229
+ "page_idx": 10
1230
+ },
1231
+ {
1232
+ "type": "text",
1233
+ "text": "Malcolm Reynolds, Gabriel Barth-Maron, Frederic Besse, Diego de Las Casas, Andreas Fidjeland, Tim Green, Andria Puigdomenech, Sébastien Racanière, Jack Rae, and Fabio Viola. Open sourcing Sonnet - a new library for constructing neural networks. https://deepmind.com/blog/ open-sourcing-sonnet/, 2017. ",
1234
+ "bbox": [
1235
+ 173,
1236
+ 321,
1237
+ 826,
1238
+ 378
1239
+ ],
1240
+ "page_idx": 10
1241
+ },
1242
+ {
1243
+ "type": "text",
1244
+ "text": "D. E. Rumelhart, G. E. Hinton, and J. L. McClelland. Parallel distributed processing: Explorations in the microstructure of cognition, vol. 1. chapter 2: A General Framework for Parallel Distributed Processing, pp. 45–76. MIT Press, Cambridge, MA, USA, 1986. ISBN 0-262-68053-X. URL http://dl.acm.org/citation.cfm?id=104279.104286. ",
1245
+ "bbox": [
1246
+ 174,
1247
+ 388,
1248
+ 825,
1249
+ 445
1250
+ ],
1251
+ "page_idx": 10
1252
+ },
1253
+ {
1254
+ "type": "text",
1255
+ "text": "Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 7299–7310, 2018. ",
1256
+ "bbox": [
1257
+ 178,
1258
+ 454,
1259
+ 825,
1260
+ 497
1261
+ ],
1262
+ "page_idx": 10
1263
+ },
1264
+ {
1265
+ "type": "text",
1266
+ "text": "Idan Schwartz, Alexander Schwing, and Tamir Hazan. High-order attention models for visual question answering. In Advances in Neural Information Processing Systems, pp. 3664–3674, 2017. ",
1267
+ "bbox": [
1268
+ 174,
1269
+ 506,
1270
+ 823,
1271
+ 536
1272
+ ],
1273
+ "page_idx": 10
1274
+ },
1275
+ {
1276
+ "type": "text",
1277
+ "text": "Terrence J Sejnowski. Higher-order boltzmann machines. In AIP Conference Proceedings, volume 151, pp. 398–403. AIP, 1986. ",
1278
+ "bbox": [
1279
+ 173,
1280
+ 544,
1281
+ 823,
1282
+ 574
1283
+ ],
1284
+ "page_idx": 10
1285
+ },
1286
+ {
1287
+ "type": "text",
1288
+ "text": "Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015. ",
1289
+ "bbox": [
1290
+ 173,
1291
+ 582,
1292
+ 821,
1293
+ 612
1294
+ ],
1295
+ "page_idx": 10
1296
+ },
1297
+ {
1298
+ "type": "text",
1299
+ "text": "Ilya Sutskever, James Martens, and Geoffrey E Hinton. Generating text with recurrent neural networks. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 1017–1024, 2011. ",
1300
+ "bbox": [
1301
+ 174,
1302
+ 621,
1303
+ 826,
1304
+ 664
1305
+ ],
1306
+ "page_idx": 10
1307
+ },
1308
+ {
1309
+ "type": "text",
1310
+ "text": "Graham W Taylor and Geoffrey E Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In Proceedings of the 26th annual international conference on machine learning, pp. 1025–1032. ACM, 2009. ",
1311
+ "bbox": [
1312
+ 174,
1313
+ 672,
1314
+ 826,
1315
+ 715
1316
+ ],
1317
+ "page_idx": 10
1318
+ },
1319
+ {
1320
+ "type": "text",
1321
+ "text": "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. ",
1322
+ "bbox": [
1323
+ 173,
1324
+ 724,
1325
+ 826,
1326
+ 767
1327
+ ],
1328
+ "page_idx": 10
1329
+ },
1330
+ {
1331
+ "type": "text",
1332
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017. ",
1333
+ "bbox": [
1334
+ 174,
1335
+ 776,
1336
+ 823,
1337
+ 820
1338
+ ],
1339
+ "page_idx": 10
1340
+ },
1341
+ {
1342
+ "type": "text",
1343
+ "text": "Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3540–3549. JMLR. org, 2017. ",
1344
+ "bbox": [
1345
+ 174,
1346
+ 829,
1347
+ 826,
1348
+ 886
1349
+ ],
1350
+ "page_idx": 10
1351
+ },
1352
+ {
1353
+ "type": "text",
1354
+ "text": "Karl Weierstrass. On continuous functions of a real argument which possess a definite derivative for no value of the argument. Königlich Preussichen Akademie der Wissenschaften, 2:71–74, 1895. ",
1355
+ "bbox": [
1356
+ 176,
1357
+ 895,
1358
+ 821,
1359
+ 924
1360
+ ],
1361
+ "page_idx": 10
1362
+ },
1363
+ {
1364
+ "type": "text",
1365
+ "text": "Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. ICLR, 2019. ",
1366
+ "bbox": [
1367
+ 171,
1368
+ 103,
1369
+ 823,
1370
+ 132
1371
+ ],
1372
+ "page_idx": 11
1373
+ },
1374
+ {
1375
+ "type": "text",
1376
+ "text": "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. ",
1377
+ "bbox": [
1378
+ 176,
1379
+ 140,
1380
+ 823,
1381
+ 184
1382
+ ],
1383
+ "page_idx": 11
1384
+ },
1385
+ {
1386
+ "type": "text",
1387
+ "text": "Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In European Conference on Computer Vision, pp. 451–466. Springer, 2016. ",
1388
+ "bbox": [
1389
+ 174,
1390
+ 193,
1391
+ 823,
1392
+ 234
1393
+ ],
1394
+ "page_idx": 11
1395
+ },
1396
+ {
1397
+ "type": "text",
1398
+ "text": "Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multi-modal factorized bilinear pooling with co-attention learning for visual question answering. In Proceedings of the IEEE international conference on computer vision, pp. 1821–1830, 2017. ",
1399
+ "bbox": [
1400
+ 173,
1401
+ 243,
1402
+ 826,
1403
+ 287
1404
+ ],
1405
+ "page_idx": 11
1406
+ },
1407
+ {
1408
+ "type": "text",
1409
+ "text": "Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 4189–4198. JMLR. org, 2017. ",
1410
+ "bbox": [
1411
+ 174,
1412
+ 296,
1413
+ 826,
1414
+ 338
1415
+ ],
1416
+ "page_idx": 11
1417
+ },
1418
+ {
1419
+ "type": "text",
1420
+ "text": "A EXPRESSIVITY OF THE MODEL ",
1421
+ "text_level": 1,
1422
+ "bbox": [
1423
+ 176,
1424
+ 102,
1425
+ 467,
1426
+ 118
1427
+ ],
1428
+ "page_idx": 12
1429
+ },
1430
+ {
1431
+ "type": "text",
1432
+ "text": "Theorem 1. Let $\\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with multiplicative layer, then we have $\\mathcal { H } _ { m l p } \\subsetneq \\mathcal { H } _ { m u }$ . ",
1433
+ "bbox": [
1434
+ 174,
1435
+ 133,
1436
+ 825,
1437
+ 178
1438
+ ],
1439
+ "page_idx": 12
1440
+ },
1441
+ {
1442
+ "type": "text",
1443
+ "text": "Proof. Inclusion comes directly from the fact that if we split input into arbitrary parts $[ \\mathbf { x } ; \\mathbf { z } ]$ we get: ",
1444
+ "bbox": [
1445
+ 173,
1446
+ 190,
1447
+ 823,
1448
+ 207
1449
+ ],
1450
+ "page_idx": 12
1451
+ },
1452
+ {
1453
+ "type": "equation",
1454
+ "img_path": "images/6745d8046b5de4e05f6ff4c04048188012515d911e3f86f85412341e21ae7ede.jpg",
1455
+ "text": "$$\n\\mathbf { x } ^ { T } \\mathbf { W } \\mathbf { z } + \\mathbf { x } ^ { T } \\mathbf { B } + \\mathbf { V } \\mathbf { z } + \\mathbf { c } = \\mathbf { x } ^ { T } \\mathbf { W } \\mathbf { z } + [ \\mathbf { B } ^ { T } ; \\mathbf { V } ] ^ { T } [ \\mathbf { x } ; \\mathbf { z } ] + \\mathbf { c } = \\mathbf { x } ^ { T } \\mathbf { W } \\mathbf { z } + \\mathbf { A } [ \\mathbf { x } ; \\mathbf { z } ] + \\mathbf { c } ,\n$$",
1456
+ "text_format": "latex",
1457
+ "bbox": [
1458
+ 215,
1459
+ 212,
1460
+ 781,
1461
+ 232
1462
+ ],
1463
+ "page_idx": 12
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "which proves that $\\mathcal { H } _ { \\mathrm { m l p } } \\subset \\mathcal { H } _ { \\mathrm { m u } }$ . Thus, the only aspect of the theorm left to prove is that the inclusion is strict. Let us consider a 1D function $x \\to x ^ { 2 }$ , and for simplicity let $x = z$ (a domain where context equals input). A single layer MLP with a single multiplicative unit can represent this function exactly, by using $A = 0$ and $W = I$ , as then we obtain $x ^ { T } W \\overset { \\cdot } { x } = x ^ { T } x = \\| x \\| ^ { 2 }$ . Since our function is positive, it is not affecting the multiplicative network output. For a regular MLP, let us first notice that we need at least one hidden layer, as otherwise MLP is a linear function and $f$ is not. Lets denote by ${ \\mathbf V } , { \\mathbf c }$ and $\\mathbf { w } , \\mathbf { b }$ weights and biases of second, and first layers respectively. Then we have to satisfy ",
1468
+ "bbox": [
1469
+ 173,
1470
+ 237,
1471
+ 825,
1472
+ 337
1473
+ ],
1474
+ "page_idx": 12
1475
+ },
1476
+ {
1477
+ "type": "equation",
1478
+ "img_path": "images/b84e2d244be8b71e5ffa4b9ddbca57ce47048f8c95f1163823dadf8a911edb0d.jpg",
1479
+ "text": "$$\nf ( x ) = g ( \\mathbf { V } ^ { T } \\operatorname* { m a x } ( 0 , \\mathbf { w } x + \\mathbf { b } ) + \\mathbf { c } ) = x ^ { 2 } ,\n$$",
1480
+ "text_format": "latex",
1481
+ "bbox": [
1482
+ 354,
1483
+ 343,
1484
+ 642,
1485
+ 361
1486
+ ],
1487
+ "page_idx": 12
1488
+ },
1489
+ {
1490
+ "type": "text",
1491
+ "text": "where $g$ is transformation represented by all higher layers of the MLP (in particular if there are just 2 layers, then $g ( x ) = x ,$ ). Note that RHS is differentiable everywhere, while LHS is differentiable iff for each $i$ and for each $x$ we have $w _ { i } x + b _ { i } \\neq 0$ (or $f$ is independent from $x$ , which $x ^ { 2 }$ does not satisfy). However, this is impossible, as if $w _ { i } \\neq 0$ , then we can always pick $x = - b _ { i } / w _ { i }$ , and if all $w _ { i } = 0$ , then $f ( x ) = g ( c ) \\bar { \\neq } x ^ { 2 }$ , leading to a contradiction. □ ",
1492
+ "bbox": [
1493
+ 174,
1494
+ 367,
1495
+ 825,
1496
+ 439
1497
+ ],
1498
+ "page_idx": 12
1499
+ },
1500
+ {
1501
+ "type": "text",
1502
+ "text": "Theorem 2. Let $\\mathcal { H } _ { \\sigma }$ denote the hypotheses space of standard MLPs with $\\sigma$ activation function, and ${ \\mathcal { H } } _ { w }$ analogous set, where some activations are replaced with Weiestrass function $f _ { w }$ . Then we have $\\mathcal { H } _ { r e l u } \\subsetneq \\mathcal { H } _ { w }$ , and $\\mathcal { H } _ { \\sigma } \\subsetneq \\mathcal { H } _ { w }$ , for any $\\sigma$ that is differentiable everywhere. ",
1503
+ "bbox": [
1504
+ 174,
1505
+ 445,
1506
+ 825,
1507
+ 488
1508
+ ],
1509
+ "page_idx": 12
1510
+ },
1511
+ {
1512
+ "type": "text",
1513
+ "text": "Proof. Inclusion comes directly from the fact that only some activations are replaced, and in particular we can always replace none, thus leading to equality of hypotheses classes. To show that the inclusion is strict lets consider a Weierstrass function itself $f ( x ) = \\sigma _ { \\mathrm { w } } ( x )$ . We definitely have $f \\in \\mathcal { H } _ { \\mathrm { w } }$ as we can define 1 hidden layer network, with one hidden neuron and all the weights set to 1, and all biases to 0. Now, relu networks are piece-wise linear while the Weierstrass function is nowhere differentiable Weierstrass (1895) and thus not piece-wise linear. Similarly, network with an activation that is differentiable everywhere (e.g. sigmoid or tanh) is everywhere differentiable wrt. inputs, while Weierstrass function – nowhere Weierstrass (1895). □ ",
1514
+ "bbox": [
1515
+ 173,
1516
+ 502,
1517
+ 825,
1518
+ 614
1519
+ ],
1520
+ "page_idx": 12
1521
+ },
1522
+ {
1523
+ "type": "text",
1524
+ "text": "B SIMPLE IMPLEMENTATION OF MI LAYER ",
1525
+ "text_level": 1,
1526
+ "bbox": [
1527
+ 174,
1528
+ 635,
1529
+ 549,
1530
+ 651
1531
+ ],
1532
+ "page_idx": 12
1533
+ },
1534
+ {
1535
+ "type": "text",
1536
+ "text": "We use Tensorflow and Sonnet Reynolds et al. (2017) for all our model implementations. The example below is a simple code snippet for adding a multiplicative layer to any model, using the Sonnet framework as an example. ",
1537
+ "bbox": [
1538
+ 176,
1539
+ 666,
1540
+ 825,
1541
+ 709
1542
+ ],
1543
+ "page_idx": 12
1544
+ },
1545
+ {
1546
+ "type": "text",
1547
+ "text": "# S i m p l e p y t h o n c o d e f o r MI L a y e r s i m p o r t s o n n e t a s s n t i m p o r t t e n s o r f l o w a s t f ",
1548
+ "bbox": [
1549
+ 174,
1550
+ 715,
1551
+ 506,
1552
+ 757
1553
+ ],
1554
+ "page_idx": 12
1555
+ },
1556
+ {
1557
+ "type": "text",
1558
+ "text": "# A s t a n d a r d l i n e a r l a y e r # B i s t h e b a t c h s i z e # E i s t h e i n p u t s i z e # C i s t h e c o n t e x t s i z e $\\begin{array} { r l } { \\mathbf { X } } & { { } = } \\end{array}$ . . . # i n p u t o f s i z e [ B , E ] $\\mathrm { ~ \\bf ~ Z ~ } =$ # c o n t e x t o f s i z e [ B , C ] $\\begin{array} { r l } { \\mathbf { X } Z } & { { } = } \\end{array}$ t f . c o n c a t ( [ x , z ] , 1 ) $\\mathrm { ~ y ~ } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( x z ) ",
1559
+ "bbox": [
1560
+ 174,
1561
+ 771,
1562
+ 488,
1563
+ 882
1564
+ ],
1565
+ "page_idx": 12
1566
+ },
1567
+ {
1568
+ "type": "text",
1569
+ "text": "# I n s t e a d , we g e n e r a t e a W a n d b # T h i s d e f i n e s a n i m p l i c i t 3D w e i g h t t e n s o r ${ \\bf W _ { \\alpha } } = { \\bf \\Phi }$ s n t . L i n e a r ( o u t p u t _ s i z e $^ *$ i n p u t _ s i z e ) ( z ) ${ \\textbf { b } } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( z ) ",
1570
+ "bbox": [
1571
+ 174,
1572
+ 896,
1573
+ 593,
1574
+ 924
1575
+ ],
1576
+ "page_idx": 12
1577
+ },
1578
+ {
1579
+ "type": "text",
1580
+ "text": "",
1581
+ "bbox": [
1582
+ 171,
1583
+ 103,
1584
+ 594,
1585
+ 132
1586
+ ],
1587
+ "page_idx": 13
1588
+ },
1589
+ {
1590
+ "type": "text",
1591
+ "text": "# R e s h a p e t o t h e c o r r e c t s h a p e # N o t e : we h a v e B w e i g h t m a t r i c e s # i . e . o n e p e r b a t c h e l e m e n t ${ \\bf W _ { \\alpha } } = { \\bf \\Phi }$ t f . r e s h a p e (W, [ B , i n p u t _ s i z e , o u t p u t _ s i z e ] ) ",
1592
+ "bbox": [
1593
+ 173,
1594
+ 145,
1595
+ 633,
1596
+ 202
1597
+ ],
1598
+ "page_idx": 13
1599
+ },
1600
+ {
1601
+ "type": "text",
1602
+ "text": "# O u t p u t $\\mathrm { ~ y ~ } =$ t f . m a t m u l ( x , W) + b ",
1603
+ "bbox": [
1604
+ 173,
1605
+ 214,
1606
+ 401,
1607
+ 243
1608
+ ],
1609
+ "page_idx": 13
1610
+ },
1611
+ {
1612
+ "type": "text",
1613
+ "text": "C DETAILS FOR SIMPLE FUNCTION EXPERIMENTS",
1614
+ "text_level": 1,
1615
+ "bbox": [
1616
+ 173,
1617
+ 272,
1618
+ 607,
1619
+ 289
1620
+ ],
1621
+ "page_idx": 13
1622
+ },
1623
+ {
1624
+ "type": "text",
1625
+ "text": "For the experiments modeling the simple two-input functions, we consider MLP and MI models and plot number of parameters against the input hidden size. The two models are ",
1626
+ "bbox": [
1627
+ 171,
1628
+ 304,
1629
+ 823,
1630
+ 333
1631
+ ],
1632
+ "page_idx": 13
1633
+ },
1634
+ {
1635
+ "type": "text",
1636
+ "text": "• MLP: linear(size), relu, linear(output_size) • MI Network: MI(size), linear(output_size). ",
1637
+ "bbox": [
1638
+ 215,
1639
+ 347,
1640
+ 529,
1641
+ 381
1642
+ ],
1643
+ "page_idx": 13
1644
+ },
1645
+ {
1646
+ "type": "text",
1647
+ "text": "Here size is the largest value such that the network has not more than N variables and we sweep over [1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 120, 140, 160, 180, 200]. We sweep over learning rates 0.1, 0.001, 0.0001 and pick the best result. Models are trained using Adam optimiser for 6,000 steps using Mean Squared Error loss (MSE) on mini-batches of size 100 sampled from a standard Gaussian. The reported error is based on 10,000 samples from the same distribution to minimize the estimation variance. ",
1648
+ "bbox": [
1649
+ 173,
1650
+ 395,
1651
+ 826,
1652
+ 478
1653
+ ],
1654
+ "page_idx": 13
1655
+ },
1656
+ {
1657
+ "type": "text",
1658
+ "text": "D DETAILS FOR TOY REGRESSION EXPERIMENTS ",
1659
+ "text_level": 1,
1660
+ "bbox": [
1661
+ 174,
1662
+ 501,
1663
+ 599,
1664
+ 517
1665
+ ],
1666
+ "page_idx": 13
1667
+ },
1668
+ {
1669
+ "type": "text",
1670
+ "text": "In multitask toy regression we coinsider MLP, MI and multiheaded models. For $x \\in \\mathbb { R }$ (input to the task) and $z$ (represented as one-hot encoding of a task ID) we use: ",
1671
+ "bbox": [
1672
+ 173,
1673
+ 532,
1674
+ 823,
1675
+ 560
1676
+ ],
1677
+ "page_idx": 13
1678
+ },
1679
+ {
1680
+ "type": "text",
1681
+ "text": "• Conditional MLP: concat(x, linear(20)(z)), linear(30), relu, linear(20), relu, linear(1) • Conditional MI: MI( [linear(30), relu, linear(20), relu] $\\mathbf { \\tau } ( \\mathbf { x } )$ , linear(20)(z) ) • Multiheaded MLP: linear(20), relu, linear(30), relu, linear(1); where the last linear is separate per task ",
1682
+ "bbox": [
1683
+ 215,
1684
+ 571,
1685
+ 825,
1686
+ 641
1687
+ ],
1688
+ "page_idx": 13
1689
+ },
1690
+ {
1691
+ "type": "text",
1692
+ "text": "Each of these models is trained in a multitask setup, where we first sample $T$ tasks (20, 40 or 60). Half of these tasks involve fitting an affine function $a x + b$ , where both $a$ and $b$ are sampled from uniform distribution over $[ 0 , 1 ]$ ; and half represent scaled sine waves, $a \\sin ( 1 0 x ) + b$ with $a$ and $b$ sampled in the same way. Training is performed with Adam optimiser (with learning rate $3 e - 3$ ), on mini batches of size 50 per task (so the total batch size is $5 0 T$ ). Models are trained for 10,000 steps with Mean Squared Error loss (MSE), and the logarithm of the training MSE is reported for analysis. Each training is repeated 60 times to minimise the variance coming from the stochasticity. ",
1693
+ "bbox": [
1694
+ 173,
1695
+ 654,
1696
+ 826,
1697
+ 752
1698
+ ],
1699
+ "page_idx": 13
1700
+ },
1701
+ {
1702
+ "type": "text",
1703
+ "text": "E DETAILS OF MULTITASK DEEPMIND LAB TRAINING ",
1704
+ "text_level": 1,
1705
+ "bbox": [
1706
+ 176,
1707
+ 772,
1708
+ 645,
1709
+ 789
1710
+ ],
1711
+ "page_idx": 13
1712
+ },
1713
+ {
1714
+ "type": "text",
1715
+ "text": "We train multi-task on 30 DeepMind lab levels Beattie et al. (2016) concurrently using 5 actors per task and a multi-gpu learner with 4 GPUs. We follow exactly the model and hyper-parameters used in the Impala architecture Espeholt et al. (2018). Our models are all trained with population based training (PBT) Jaderberg et al. (2017) and we show below the average over three populations with 24 independent learners each for both the baseline and our best method. We train all models for 10 billion frames of data across all levels. The human normalised score is calculated independently for each level and capped at 100 (i.e $s c o r e = m i n ( s c o r e , 1 0 0 ) )$ ",
1716
+ "bbox": [
1717
+ 174,
1718
+ 804,
1719
+ 825,
1720
+ 902
1721
+ ],
1722
+ "page_idx": 13
1723
+ },
1724
+ {
1725
+ "type": "text",
1726
+ "text": "The architecture is as follows: ",
1727
+ "bbox": [
1728
+ 174,
1729
+ 910,
1730
+ 370,
1731
+ 922
1732
+ ],
1733
+ "page_idx": 13
1734
+ },
1735
+ {
1736
+ "type": "text",
1737
+ "text": "• Conv2D: 16ch, 8x8 kernels, stride=4 \n• ReLU \n• Conv2D: 32ch 4x4 kernel,stride=2 \n• ReLU \n• Linear layer with output size 256 \n• ReLU \n• Concatenation with one hot encoded last action and last reward and language instruction \n• LSTM (256 hidden units) \n• Policy $=$ Linear layer or multiplicative interaction followed by a softmax \n• Value function $=$ Linear layer or multiplicative intereaction ",
1738
+ "bbox": [
1739
+ 215,
1740
+ 102,
1741
+ 813,
1742
+ 300
1743
+ ],
1744
+ "page_idx": 14
1745
+ },
1746
+ {
1747
+ "type": "image",
1748
+ "img_path": "images/2c9b0a3bd6a5007ec2d038500d8e477d58214ae5319a5f0ffaac1491337f1b55.jpg",
1749
+ "image_caption": [],
1750
+ "image_footnote": [],
1751
+ "bbox": [
1752
+ 338,
1753
+ 316,
1754
+ 653,
1755
+ 494
1756
+ ],
1757
+ "page_idx": 14
1758
+ },
1759
+ {
1760
+ "type": "text",
1761
+ "text": "F DETAILS OF NEURAL PROCESS EXPERIMENTS ",
1762
+ "text_level": 1,
1763
+ "bbox": [
1764
+ 173,
1765
+ 520,
1766
+ 591,
1767
+ 536
1768
+ ],
1769
+ "page_idx": 14
1770
+ },
1771
+ {
1772
+ "type": "text",
1773
+ "text": "Inspired by the experiments in Garnelo et al. (2018b), we apply Neural Processes to functions drawn for a Gaussian Process prior with an exponentiated quadratic kernel $k ( x , x ^ { \\prime } ) = \\sigma _ { f } ^ { 2 } \\exp ( - { \\textstyle \\frac { 1 } { 2 } } ( x -$ $x ^ { \\prime } ) ^ { 2 } / l ^ { 2 } )$ with fixed $\\sigma ^ { f } = 1 . 0$ and, importantly, a random $l \\sim U [ 0 . 1 , 1 0 . 0 ]$ for each draw, resulting in a broad distribution of functions. We also add Gaussian observation noise, i.e. $y \\sim \\mathcal { N } ( f , \\sigma _ { n } ^ { 2 } )$ and set $\\sigma _ { n } = 0 . 0 2$ . In all experiments, we provide a deterministic transformation $h$ of the context in addition to the latent variable $z$ , using separate encoder networks for each. For both SKIP MLP and the proposed MI, we concatenate $h$ and $z$ first, i.e. we use SKIP $\\scriptstyle \\mathrm { { M L P } } [ x$ ; concat $( z , h ) ]$ and $\\mathbf { M I } ( x , \\mathbf { c o n c a t } ( z , h ) )$ writing concat() to denote concatenation. A more detailed discussion on adding an the benefits of adding an additional deterministic path in provided in Kim et al. (2019). ",
1774
+ "bbox": [
1775
+ 173,
1776
+ 551,
1777
+ 825,
1778
+ 681
1779
+ ],
1780
+ "page_idx": 14
1781
+ },
1782
+ {
1783
+ "type": "text",
1784
+ "text": "The determinsitic encoder used to obtain $h$ is a deep MLP with 6 layers of 128 units each. The latent encoder used for $z$ consists of 3 hidden layers of 128 units, parameterising mean and standard deviation of a 64-dimensional Gaussian distributed latent variable. The decoder network used to predict on new target inputs $x ^ { * }$ consists of 4 layers of 128 units. We use relu activiatons throughout all components of the network. The network is trained until convergence with Adam, using a learning rate of 0.0001 and absolute value gradient clipping with a threshold of 10.0. ",
1785
+ "bbox": [
1786
+ 174,
1787
+ 688,
1788
+ 825,
1789
+ 772
1790
+ ],
1791
+ "page_idx": 14
1792
+ },
1793
+ {
1794
+ "type": "text",
1795
+ "text": "G LANGUAGE MODELLING ",
1796
+ "text_level": 1,
1797
+ "bbox": [
1798
+ 176,
1799
+ 794,
1800
+ 415,
1801
+ 810
1802
+ ],
1803
+ "page_idx": 14
1804
+ },
1805
+ {
1806
+ "type": "text",
1807
+ "text": "We train a single layer LSTM of hidden size 2048 hidden units. The input to the LSTM is an embedding of size 256 and then output the LSTM is projected down to 256 with a single linear layer for the baseline. The input and output embedding-word matrices are tied. We use a training sequence length of 128. For the multiplicative model, the output embedding is calculated with an MI layer who’s context input $c$ is generated by a linear layer with output size 32 followed by a relu. We use dropout rate of 0.3 and a learning rate of 0.001 for all models. All models are trained with the Adam optimiser. ",
1808
+ "bbox": [
1809
+ 173,
1810
+ 825,
1811
+ 825,
1812
+ 924
1813
+ ],
1814
+ "page_idx": 14
1815
+ },
1816
+ {
1817
+ "type": "text",
1818
+ "text": "For the multiplicative encoder we use a diagonal form of the $\\mathcal { M } ( . )$ layer and for the multiplicative deocder we use the full $\\mathcal { M } ( . )$ form (with the bottleneck described above). This amounts to adding about 20M parameters which is the same as adding 1000 hidden units. We get 6 perplexity improvement in performance whereas naively adding 1000 hidden units only gave us an improvement of 1 perplexity. Further the parameter count could be drastically reduced by considering diagonal or low rank approximations, but we do not specifically optimise for this in this work. ",
1819
+ "bbox": [
1820
+ 174,
1821
+ 103,
1822
+ 825,
1823
+ 188
1824
+ ],
1825
+ "page_idx": 15
1826
+ }
1827
+ ]
parse/train/rylnK6VtDH/rylnK6VtDH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rylnK6VtDH/rylnK6VtDH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
vlm/dev/3jooF27-0Wy/0.png ADDED

Git LFS Details

  • SHA256: a9fb4972e4c7981a64a563d390c34755aedcac157609eafb0cf392b17dcd0204
  • Pointer size: 131 Bytes
  • Size of remote file: 555 kB
vlm/dev/3jooF27-0Wy/1.png ADDED

Git LFS Details

  • SHA256: aded85c6387906b336c8b3b4b5c13d0290d2769bd4ebcadba693aa72f75c1d88
  • Pointer size: 131 Bytes
  • Size of remote file: 638 kB
vlm/dev/3jooF27-0Wy/10.png ADDED

Git LFS Details

  • SHA256: 74cf1dd48aa06b8835512b21a24b4a746be6b467ce803b4347edc25b5ed414d0
  • Pointer size: 131 Bytes
  • Size of remote file: 540 kB
vlm/dev/3jooF27-0Wy/11.png ADDED

Git LFS Details

  • SHA256: 3f7539ad5c3c02a8d6a535ce5265f9b8e51f1bbf257d41cf4258c59491995c7f
  • Pointer size: 131 Bytes
  • Size of remote file: 567 kB
vlm/dev/3jooF27-0Wy/12.png ADDED

Git LFS Details

  • SHA256: 9aef07e53ebf343b311bbda6151a5fb7eb6cd4a9abaeb331a00b48f3fdcbf8b7
  • Pointer size: 131 Bytes
  • Size of remote file: 556 kB
vlm/dev/3jooF27-0Wy/13.png ADDED

Git LFS Details

  • SHA256: 43e0299e2d9de558e6f7d7cab6d740311e986ce5b580a0161f395012ee47d0f0
  • Pointer size: 131 Bytes
  • Size of remote file: 239 kB
vlm/dev/3jooF27-0Wy/14.png ADDED

Git LFS Details

  • SHA256: f4112773ecc5f38f7d69daa7301435cc32339ec0913fca5c62b2a5d4e9aaa4ce
  • Pointer size: 131 Bytes
  • Size of remote file: 428 kB
vlm/dev/3jooF27-0Wy/15.png ADDED

Git LFS Details

  • SHA256: 2495b7e88b95dc29055e4c52e8afab3b820dd2753a661d46367a79c10ad1d2cc
  • Pointer size: 131 Bytes
  • Size of remote file: 303 kB
vlm/dev/3jooF27-0Wy/16.png ADDED

Git LFS Details

  • SHA256: 4796906e6f2827647de4e05a638fac4b339080417a23aa67b6613a5653afa98a
  • Pointer size: 131 Bytes
  • Size of remote file: 528 kB
vlm/dev/3jooF27-0Wy/17.png ADDED

Git LFS Details

  • SHA256: 5285ae6fef82e6c412e121a11691954d227a07b621fc61a187ac446021910023
  • Pointer size: 131 Bytes
  • Size of remote file: 392 kB