ZHANGYUXUAN-zR commited on
Commit
82be702
·
verified ·
1 Parent(s): 19ecef5

Add files using upload-large-folder tool

Browse files
parse/train/4pf_pOo0Dt/4pf_pOo0Dt.md ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Self-Supervised Learning with Data Augmentations Provably Isolates Content from Style
2
+
3
+ Julius von Kügelgen⇤1,2
4
+
5
+ Luigi Gresele⇤1
6
+
7
+ # Wieland Brendel 3 Bernhard Schölkopf†1 Michel Besserve†1 Francesco Locatello†5
8
+
9
+ 1 Max Planck Institute for Intelligent Systems Tübingen 2 University of Cambridge
10
+ 3 Tübingen AI Center, University of Tübingen 4 IMPRS for Intelligent Systems 5 Amazon
11
+
12
+ # Abstract
13
+
14
+ Self-supervised representation learning has shown remarkable success in a number of domains. A common practice is to perform data augmentation via hand-crafted transformations intended to leave the semantics of the data invariant. We seek to understand the empirical success of this approach from a theoretical perspective. We formulate the augmentation process as a latent variable model by postulating a partition of the latent representation into a content component, which is assumed invariant to augmentation, and a style component, which is allowed to change. Unlike prior work on disentanglement and independent component analysis, we allow for both nontrivial statistical and causal dependencies in the latent space. We study the identifiability of the latent representation based on pairs of views of the observations and prove sufficient conditions that allow us to identify the invariant content partition up to an invertible mapping in both generative and discriminative settings. We find numerical simulations with dependent latent variables are consistent with our theory. Lastly, we introduce Causal3DIdent, a dataset of high-dimensional, visually complex images with rich causal dependencies, which we use to study the effect of data augmentations performed in practice.
15
+
16
+ # 1 Introduction
17
+
18
+ Learning good representations of high-dimensional observations from large amounts of unlabelled data is widely recognised as an important step for more capable and data-efficient learning systems [10, 72]. Over the last decade, self-supervised learning (SSL) has emerged as the dominant paradigm for such unsupervised representation learning [1, 20, 21, 34, 41, 47, 48, 90, 91, 115, 122, 125, 126]. The main idea behind SSL is to extract a supervisory signal from unlabelled observations by leveraging known structure of the data, which allows for the application of supervised learning techniques. A common approach is to directly predict some part of the observation from another part (e.g., future from past, or original from corruption), thus forcing the model to learn a meaningful representation in the process. While this technique has shown remarkable success in natural language processing [13, 23, 30, 81, 84, 86, 95, 99] and speech recognition [5, 6, 100, 104], where a finite dictionary allows one to output a distribution over the missing part, such predictive SSL methods are not easily applied to continuous or high-dimensional domains such as vision. Here, a common approach is to learn a joint embedding of similar observations or views such that their representation is close [7, 12, 22, 44]. Different views can come, for example, from different modalities (text & speech; video & audio) or time points. As still images lack such multi-modality or temporal structure, recent advances in representation learning have relied on generating similar views by means of data augmentation.
19
+
20
+ In order to be useful, data augmentation is thought to require the transformations applied to generate additional views to be generally chosen to preserve the semantic characteristics of an observation, while changing other “nuisance” aspects. While this intuitively makes sense and has shown remarkable empirical results, the success of data augmentation techniques in practice is still not very well understood from a theoretical perspective—despite some efforts [17, 19, 28]. In the present work, we seek to better understand the empirical success of SSL with data augmentation by formulating the generative process as a latent variable model (LVM) and studying identifiability of the representation, i.e., under which conditions the ground truth latent factors can provably be inferred from the data [77].
21
+
22
+ Related work and its relation to the current. Prior work on unsupervised representation learning from an LVM perspective often postulates mutually independent latent factors: this independence assumption is, for example, at the heart of independent component analysis (ICA) [24, 56] and disentanglement [10, 14, 18, 49, 65, 71]. Since it is impossible to identify the true latent factors without any supervisory signal in the general nonlinear case [57, 82], recent work has turned to weakly- or self-supervised approaches which leverage additional information in the form of multiple views [39, 83, 108, 129], auxiliary variables [58, 63], or temporal structure [45, 54, 55, 69]. To identify or disentangle the individual independent latent factors, it is typically assumed that there is a chance that each factor changes across views, environments, or time points.
23
+
24
+ Our work—being directly motivated by common practices in SSL with data augmentation—differs from these works in the following two key aspects (see Fig. 1 for an overview). First, we do not assume independence and instead allow for both nontrivial statistical and causal relations between latent variables. This is in line with a recently proposed [105] shift towards causal representation learning [40, 76, 85, 87, 106, 107, 112, 123, 127], motivated by the fact that many underlying variables of interest may not be independent but causally related to each other.1 Second, instead of a scenario wherein all latent factors may change as a result of augmentation, we assume a partition of the latent space into two blocks: a content block which is shared or invariant across different augmented views, and a style block that may change. This is aligned with the notion that augmentations leave certain semantic aspects (i.e., content) intact and only affect style, and is thus a more appropriate assumption for studying SSL. In line with earlier work [39, 54, 57, 58, 63, 69, 82, 83, 129], we focus on the setting of continuous ground-truth latents, though we believe our results to hold more broadly.
25
+
26
+ ![](images/1b45e49bf6eb5ef330afbe331dde55d766f64036cbc1c07d661c104560489f74.jpg)
27
+ Figure 1: Overview of our problem formulation. We partition the latent variable $\mathbf { z }$ into content c and style s, and allow for statistical and causal dependence of style on content. We assume that only style changes between the original view $\mathbf { x }$ and the augmented view $\tilde { \mathbf { x } }$ , i.e., they are obtained by applying the same deterministic function f to ${ \bf z } = ( { \bf c } , { \bf s } )$ and $\tilde { \mathbf { z } } = ( \mathbf { c } , \tilde { \mathbf { s } } )$ .
28
+
29
+ Structure and contributions. Following a review of SSL with data augmentation and identifiability theory $( \ S 2 )$ , we formalise the process of data generation and augmentation as an LVM with content and style variables $( \ S 3 )$ . We then establish identifiability results of the invariant content partition $^ { ( \ S \mathrm { ~ \normalfont ~ ) ~ } }$ , validate our theoretical insights experimentally $^ { ( \ S \mathrm { ~ \sc ~ } ) }$ , and discuss our findings and their limitations in the broader context of SSL with data augmentation $( \ S \ G )$ . We highlight the following contributions:
30
+
31
+ • we prove that SSL with data augmentations identifies the invariant content partition of the representation in generative (Thm. 4.2) and discriminative learning with invertible (Thm. 4.3) and non-invertible encoders with entropy regularisation (Thm. 4.4); in particular, Thm. 4.4 provides a theoretical justification for the empirically observed effectiveness of contrastive SSL methods that use data augmentation and InfoNCE [91] as an objective, such as SimCLR [20]; • we show that our theory is consistent with results in simulating statistical dependencies within blocks of content and style variables, as well as with style causally dependent on content (§ 5.1); • we introduce Causal3DIdent, a dataset of 3D objects which allows for the study of identifiability in a causal representation learning setting, and use it to perform a systematic study of data augmentations used in practice, yielding novel insights on what particular data augmentations are truly isolating as invariant content and discarding as varying style when applied $\mathrm { ~ ~ { ~ \left( \ S ~ \right. ~ } ~ } )$ .
32
+
33
+ # 2 Preliminaries and background
34
+
35
+ Self-supervised representation learning with data augmentation. Given an unlabelled dataset of observations (e.g., images) $\mathbf { x }$ , data augmentation techniques proceed as follows. First, a set of observation-level transformations $\mathbf { t } \in \mathcal { T }$ are specified together with a distribution $p _ { \mathbf { t } }$ over $\tau$ . Both $\tau$ and $p _ { \mathbf { t } }$ are typically designed using human intelligence and domain knowledge with the intention of not changing the semantic characteristics of the data (which arguably constitutes a form of weak supervision).2 For images, for example, a common choice for $\tau$ are combinations of random crops [113], horizontal or vertical flips, blurring, colour distortion [52, 113], or cutouts [31]; and $p _ { \mathbf { t } }$ is a distribution over the parameterisation of these transformations, e.g., the centre and size of a crop [20, 31]. For each observation x, a pair of transformations $\mathbf { t } , \mathbf { t } ^ { \prime } \sim p _ { \mathbf { t } }$ is sampled and applied separately to $\mathbf { x }$ to generate a pair of augmented views $( \tilde { \mathbf { x } } , \tilde { \mathbf { x } } ^ { \prime } ) = ( \mathbf { t } ( \mathbf { x } ) , \mathbf { t } ^ { \prime } ( \mathbf { x } ) )$ .
36
+
37
+ The joint-embedding approach to SSL then uses a pair of encoder functions $( \mathbf { g } , \mathbf { g } ^ { \prime } )$ , i.e. deep nets, to map the pair $\big ( \tilde { \mathbf { x } } , \bar { \tilde { \mathbf { x } } } ^ { \prime } \big )$ to a typically lower-dimensional representation $( \tilde { \bf z } , \tilde { \bf z } ^ { \prime } ) = ( { \bf g } ( \tilde { \bf x } ) , { \bf g } ^ { \prime } ( \tilde { \bf x } ^ { \prime } ) )$ . Often, the two encoders are either identical, $\mathbf { g } = \mathbf { g } ^ { \prime }$ , or directly related (e.g., via shared parameters or asynchronous updates). Then, the encoder(s) $( \mathbf { g } , \mathbf { g } ^ { \prime } )$ are trained such that the representations $( \tilde { \mathbf { z } } , \tilde { \mathbf { z } } ^ { \prime } )$ are “close”, i.e., such that $\sin ( \tilde { \mathbf { z } } , \tilde { \mathbf { z } } ^ { \prime } )$ is large for some similarity metric $\mathrm { s i m } ( \cdot )$ , e.g., the cosine similarity [20, 129], or negative L2 norm [129]. The advantage of directly optimising for similarity in representation space over generative alternatives is that reconstruction can be very challenging for high-dimensional data. The disadvantage is the problem of collapsed representations. 3 To avoid collapsed representations and force the encoder(s) to learn a meaningful representation, two main families of approaches have been used: (i) contrastive learning (CL) [20, 47, 48, 91, 115, 126]; and (ii) regularisation-based SSL [21, 41, 128].
38
+
39
+ The idea behind CL is to not only learn similar representations for augmented views $( \tilde { \mathbf { x } } _ { i } , \tilde { \mathbf { x } } _ { i } ^ { \prime } )$ of the same $\mathbf { x } _ { i }$ , or positive pairs, but to also use other observations $\mathbf { x } _ { j }$ ${ j \neq i }$ ) to contrast with, i.e., to enforce a dissimilar representation across negative pairs $( \tilde { \mathbf { x } } _ { i } , \tilde { \mathbf { x } } _ { j } ^ { \prime } )$ . In other words, CL pulls representations of positive pairs together, and pushes those of negative pairs apart. Since both aims cannot be achieved simultaneously with a constant representation, collapse is avoided. A popular CL objective function (used, e.g., in SimCLR [20]) is InfoNCE [91] (based on noise-contrastive estimation [42, 43]):
40
+
41
+ $$
42
+ \begin{array} { r } { \mathcal { L } _ { \mathrm { I n f o N C E } } ( \mathbf { g } ; \tau , K ) = \mathbb { E } _ { \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { K } \sim p _ { \mathbf { x } } } \Big [ - \sum _ { i = 1 } ^ { K } \log \frac { \exp \{ \sin ( \tilde { \mathbf { z } } _ { i } , \tilde { \mathbf { z } } _ { i } ^ { \prime } ) / \tau \} } { \sum _ { j = 1 } ^ { K } \exp \{ \sin ( \tilde { \mathbf { z } } _ { i } , \tilde { \mathbf { z } } _ { j } ^ { \prime } ) / \tau \} } \Big ] } \end{array}
43
+ $$
44
+
45
+ where $\tilde { \mathbf { z } } = \mathbb { E } _ { \mathbf { t } \sim p _ { \mathbf { t } } } [ \mathbf { g } ( \mathbf { t } ( \mathbf { x } ) ) ]$ , $\tau$ is a temperature, and $K - 1$ is the number of negative pairs. InfoNCE (1) has an interpretation as multi-class logistic regression, and lower bounds the mutual information across similar views $( \tilde { \mathbf { z } } , \tilde { \mathbf { z } } ^ { \prime } )$ —a common representation learning objective [4, 9, 15, 50, 75, 79, 80, 97, 120]. Moreover, (1) can be interpreted as alignment (numerator) and uniformity (denominator) terms, the latter constituting a nonparametric entropy estimator of the representation as $K \infty$ [124]. CL with InfoNCE can thus be seen as alignment of positive pairs with (approximate) entropy regularisation.
46
+
47
+ Instead of using negative pairs, as in CL, a set of recent SSL methods only optimise for alignment and avoid collapsed representations through different forms of regularisation. For example, BYOL [41] and SimSiam [21] rely on “architectural regularisation” in the form of moving-average updates for a separate “target” net $\mathbf { g } ^ { \prime }$ (BYOL only) or a stop-gradient operation (both). BarlowTwins [128], on the other hand, optimises the cross correlation between $( \tilde { \bf z } , \bar { \tilde { \bf z } ^ { \prime } } )$ to be close to the identity matrix, thus enforcing redundancy reduction (zero off-diagonals) in addition to alignment (ones on the diagonal).
48
+
49
+ Identifiability of learned representations. In this work, we address the question of whether SSL with data augmentation can reveal or uncover properties of the underlying data generating process. Whether a representation learned from observations can be expected to match the true underlying latent factors—up to acceptable ambiguities and subject to suitable assumptions on the generative process and inference model—is captured by the notion of identifiability [77].
50
+
51
+ Within representation learning, identifiability has mainly been studied in the framework of (nonlinear) ICA which assumes a model of the form $\mathbf { x } = \mathbf { f } ( \mathbf { z } )$ and aims to recover the independent latents, or sources, z, typically up to permutation or element-wise transformation. A crucial negative result states that, with i.i.d. data and without further assumptions, this is fundamentally impossible [57]. However, recent breakthroughs have shown that identifiability can be achieved if an auxiliary variable (e.g., a time stamp or environment index) renders the sources conditionally independent [45, 54, 55, 58]. These methods rely on constructing positive and negative pairs using the auxiliary variable and learning a representation with CL. This development has sparked a renewed interest in identifiability in the context of deep representation learning [63, 64, 69, 83, 102, 108, 109, 129].
52
+
53
+ Most closely related to SSL with data augmentation are works which study identifiability when given a second view $\tilde { \mathbf { x } }$ of an observation $\mathbf { x }$ , resulting from a modified version $\tilde { \mathbf { z } }$ of the underlying latents or sources $\mathbf { z }$ [39, 69, 83, 101, 108, 129]. Here, $\tilde { \mathbf { z } }$ is either an element-wise corruption of z [39, 69, 101, 129] or may share a random subset of its components [83, 108]. Crucially, all previously mentioned works assume that any of the independent latents (are allowed to) change, and aim to identify the individual factors. However, in the context of SSL with data augmentation, where the semantic (content) part of the representation is intended to be shared between views, this assumption does not hold.
54
+
55
+ # 3 Problem formulation
56
+
57
+ We specify our problem setting by formalising the processes of data generation and augmentation. We take a latent-variable model perspective and assume that observations $\mathbf { x }$ (e.g., images) are generated by a mixing function f which takes a latent code $\mathbf { z }$ as input. Importantly, we describe the augmentation process through changes in this latent space as captured by a conditional distribution $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ , as opposed to traditionally describing the transformations $\mathbf { t }$ as acting directly at the observation level.
58
+
59
+ Formally, let $\mathbf { z }$ be a continuous r.v. taking values in an open, simply-connected $n$ -dim. representation space ${ \mathcal { Z } } \subseteq \mathbb { R } ^ { n }$ with associated probability density $p _ { \mathbf { z } }$ . Moreover, let f $: { \mathcal { Z } } { \mathcal { X } }$ be a smooth and invertible mapping to an observation space $\boldsymbol { \mathcal { X } } \subseteq \mathbb { R } ^ { d }$ and let $\mathbf { x }$ be the continuous r.v. defined as $\mathbf { x } = \mathbf { f } ( \mathbf { z } )$ . 4 The generative process for the dataset of original observations of $\mathbf { x }$ is thus given by:
60
+
61
+ $$
62
+ \begin{array} { r } { { \bf z } \sim p _ { \bf z } , \qquad { \bf x } = { \bf f } ( { \bf z } ) . } \end{array}
63
+ $$
64
+
65
+ Next, we formalise the data augmentation process. As stated above, we take a representation-centric view, i.e., we assume that an augmentation $\tilde { \bf x }$ of the original $\mathbf { x }$ is obtained by applying the same mixing or rendering function f to a modified representation $\tilde { \mathbf { z } }$ which is (stochastically) related to the original representation $\mathbf { z }$ of $\mathbf { x }$ . Specifying the effect of data augmentation thus corresponds to specifying a conditional distribution $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ which captures the relation between $\mathbf { z }$ and $\tilde { \mathbf { z } }$ .
66
+
67
+ In terms of the transformation-centric view presented in $\ S 2$ , we can view the modified representation $\widetilde { \mathbf z } \in \mathcal { Z }$ as obtained by applying $\mathbf { f } ^ { - 1 }$ to a transformed observation $\tilde { \mathbf { x } } = \mathbf { t } ( \mathbf { x } ) \in \mathcal { X }$ where t $\sim p _ { \mathbf { t } }$ , i.e., $\tilde { \mathbf { z } } = \mathbf { f } ^ { - 1 } ( \tilde { \mathbf { x } } )$ . The conditional distribution $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ in the representation space can thus be viewed as being induced by the distribution $p _ { \mathbf { t } }$ over transformations applied at the observation level.5
68
+
69
+ We now encode the notion that the set of transformations $\tau$ used for augmentation is typically chosen such that any transformation $\mathbf { t } \in \mathcal { T }$ leaves certain aspects of the data invariant. To this end, we assume that the representation z can be uniquely partitioned into two disjoint parts:
70
+
71
+ (i) an invariant part c which will always be shared across $( \mathbf { z } , \tilde { \mathbf { z } } )$ , and which we refer to as content;
72
+ (ii) a varying part s which may change across $( \mathbf { z } , \tilde { \mathbf { z } } )$ , and which we refer to as style.
73
+
74
+ We assume that c and s take values in content and style subspaces ${ \mathcal { C } } \subseteq \mathbb { R } ^ { n _ { c } }$ and $S \subseteq \mathbb { R } ^ { n _ { s } }$ , respectively, i.e., $n = n _ { c } + n _ { s }$ and ${ \mathcal { Z } } = { \mathcal { C } } \times { \mathcal { S } }$ . W.l.o.g., we let c corresponds to the first $n _ { c }$ dimensions of $\mathbf { z }$ :
75
+
76
+ $$
77
+ \begin{array} { r } { \mathbf { z } = ( \mathbf { c } , \mathbf { s } ) , \qquad \mathbf { c } : = \mathbf { z } _ { 1 : n _ { c } } , \qquad \mathbf { s } : = \mathbf { z } _ { ( n _ { c } + 1 ) : n } , } \end{array}
78
+ $$
79
+
80
+ We formalise the process of data augmentation with content-preserving transformations by definin the conditional $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ such that only a (random) subset of the style variables change at a time.
81
+
82
+ Assumption 3.1 (Content-invariance). The conditional density $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ over $\mathcal { Z } \times \mathcal { Z }$ takes the form
83
+
84
+ $$
85
+ p _ { \tilde { \mathbf { z } } | \mathbf { z } } ( \tilde { \mathbf { z } } | \mathbf { z } ) = \delta ( \tilde { \mathbf { c } } - \mathbf { c } ) p _ { \tilde { \mathbf { s } } | \mathbf { s } } ( \tilde { \mathbf { s } } | \mathbf { s } )
86
+ $$
87
+
88
+ for some continuous density $p _ { \tilde { \mathbf { s } } | \mathbf { s } }$ on $s \times s$ , where $\delta ( \cdot )$ is the Dirac delta function, i.e., $\tilde { \mathbf { c } } = \mathbf { c }$ a.e.
89
+
90
+ Assumption 3.2 (Style changes). Let $\mathcal { A }$ be the set of subsets of style variables $A \subseteq \{ 1 , . . . , n _ { s } \}$ and let $p _ { A }$ be a distribution on $\mathcal { A }$ . Then, the style conditional $p _ { \tilde { \mathbf { s } } | \mathbf { s } }$ is obtained via
91
+
92
+ $$
93
+ \begin{array} { r } { A \sim p _ { A } , \qquad p _ { \tilde { \mathbf { s } } | \mathbf { s } , A } ( \tilde { \mathbf { s } } | \mathbf { s } , A ) = \delta ( \tilde { \mathbf { s } } _ { A ^ { \mathrm { c } } } - \mathbf { s } _ { A ^ { \mathrm { c } } } ) p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } } ( \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } ) , } \end{array}
94
+ $$
95
+
96
+ where $p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } }$ is a continuous density on $S _ { A } \times S _ { A }$ , ${ \mathcal { S } } _ { A } \subseteq { \mathcal { S } }$ denotes the subspace of changing style variables specified by $A$ , and $A ^ { \mathrm { c } } = \{ 1 , . . . , n _ { s } \} \setminus A$ denotes the complement of $A$ .
97
+
98
+ Note that Assumption 3.2 is less restrictive than assuming that all style variables need to change, since it also allows for only a (possibly different) subset of style variables to change for any given observation. This is in line with the intuition that not all transformations affect all changeable (i.e., style) properties of the data: e.g., a colour distortion should not affect positional information, and, in the same vein, a (horizontal or vertical) flip should not affect the colour spectrum.
99
+
100
+ The generative process of an augmentation or transformed observation $\tilde { \bf x }$ is thus given by
101
+
102
+ $$
103
+ A \sim p _ { A } , \qquad { \tilde { \mathbf { z } } } | \mathbf { z } , A \sim p _ { { \tilde { \mathbf { z } } } | \mathbf { z } , A } , \qquad { \tilde { \mathbf { x } } } = \mathbf { f } ( { \tilde { \mathbf { z } } } ) .
104
+ $$
105
+
106
+ Our setting for modelling data augmentation differs from that commonly assumed in (multi-view) disentanglement and ICA in that we do not assume that the latent factors ${ \bf z } = ( { \bf c } , { \bf s } )$ are mutually (or conditionally) independent, i.e., we allow for arbitrary (non-factorised) marginals $p _ { \mathbf { z } }$ in (2).6
107
+
108
+ Causal interpretation: data augmentation as counterfactuals under soft style intervention. We now provide a causal account of the above data generating process by describing the (allowed) causal dependencies among latent variables using a structural causal model (SCM) [94]. As we will see, this leads to an interpretation of data augmentations as counterfactuals in the underlying latent SCM. The assumption that c stays invariant as s changes is consistent with the view that content may causally influence style, $\mathbf c \to \mathbf s$ , but not vice versa, see Fig. 1. We therefore formalise their relation as:
109
+
110
+ $$
111
+ \mathbf { c } : = \mathbf { f _ { c } } ( \mathbf { u _ { c } } ) , \qquad \mathbf { s } : = \mathbf { f _ { s } } ( \mathbf { c } , \mathbf { u _ { s } } ) , \qquad \mathbf { ( u _ { c } , u _ { s } ) } \sim p _ { \mathbf { u _ { c } } } \times p _ { \mathbf { u _ { s } } }
112
+ $$
113
+
114
+ where $\mathbf { u _ { c } } , \mathbf { u _ { s } }$ are independent exogenous variables, and $\mathbf { f _ { c } } , \mathbf { f _ { s } }$ are deterministic functions. The latent causal variables $( \mathbf { c } , \mathbf { s } )$ are subsequently decoded into observations $\mathbf { x } = \mathbf { f } ( \mathbf { c } , \mathbf { s } )$ . Given a factual observation $\mathbf { x } ^ { \mathrm { F } } = \mathbf { f } ( \mathbf { c } ^ { \mathrm { F } } , \mathbf { s } ^ { \mathrm { F } } )$ which resulted from $\left( \mathbf { u } _ { \mathbf { c } } ^ { \mathtt { F } } , \mathbf { u } _ { \mathbf { s } } ^ { \mathtt { F } } \right)$ , we may ask the counterfactual question: “what would have happened if the style variables had been (randomly) perturbed, all else being equal?”. Consider, e.g., a soft intervention [35] on s, i.e., an intervention that changes the mechanism $\mathbf { f _ { s } }$ to
115
+
116
+ $$
117
+ d o ( \mathbf { s } : = \tilde { \mathbf { f } } _ { \mathbf { s } } ( \mathbf { c } , \mathbf { u } _ { \mathbf { s } } , \mathbf { u } _ { A } ) ) ,
118
+ $$
119
+
120
+ where $\mathbf { u } _ { A }$ is an additional source of stochasticity accounting for the randomness of the augmentation process $( p _ { A } \times p _ { \tilde { \mathbf { s } } | \mathbf { s } , A } )$ . The resulting distribution over counterfactual observations $\mathbf { x } ^ { \mathtt { C F } } = \mathbf { f } ( \mathbf { c } ^ { \mathtt { F } } , \mathbf { s } ^ { \mathtt { C F } } )$ can be computed from the modified SCM by fixing the exogenous variables to their factual values and performing the soft intervention:
121
+
122
+ $$
123
+ \mathbf { c } ^ { \mathrm { { C F } } } : = \mathbf { c } ^ { \mathrm { { F } } } , \qquad \mathbf { s } ^ { \mathrm { { C F } } } : = \tilde { \mathbf { f } } _ { \mathrm { { s } } } ( \mathbf { c } ^ { \mathrm { { F } } } , \mathbf { u } _ { \mathrm { { s } } } ^ { \mathrm { { F } } } , \mathbf { u } _ { A } ) , \qquad \mathbf { u } _ { A } \sim p _ { \mathbf { u } _ { A } } .
124
+ $$
125
+
126
+ This aligns with our intuition and assumed problem setting of data augmentations as style corruptions.
127
+ We note that the notion of augmentation as (hard) style interventions is also at the heart of ReLIC [87], a recently proposed, causally-inspired SSL regularisation term for instance-discrimination [44, 126].
128
+ However, ReLIC assumes independence between content and style and does not address identifiability.
129
+ For another causal perspective on data augmentation in the context of domain generalisation, c.f. [59].
130
+
131
+ # 4 Theory: block-identifiability of the invariant content partition
132
+
133
+ Our goal is to prove that we can identify the invariant content partition c under a distinct, weaker set of assumptions, compared to existing results in disentanglement and nonlinear ICA [39, 69, 83, 108, 129]. We stress again that our primary interest is not to identify or disentangle individual (and independent) latent factors $z _ { j }$ , but instead to separate content from style, such that the content variables can be subsequently used for downstream tasks. We first define this distinct notion of block-identifiability.
134
+
135
+ Definition 4.1 (Block-identifiability). We say that the true content partition $\textbf { c } = \textbf { f } ^ { - 1 } ( \textbf x ) _ { 1 : n _ { c } }$ is block-identified by a function $\mathbf { g } : \mathcal { X } \mathcal { Z }$ if the inferred content partition $\hat { \mathbf { c } } = \mathbf { g } ( \mathbf { x } ) _ { 1 : n _ { c } }$ contains all and only information about c, i.e., if there exists an invertible function $\mathbf { h } : \mathbb { R } ^ { n _ { c } } \mathbb { R } ^ { n _ { c } }$ s.t. $\hat { \mathbf { c } } = \mathbf { h } ( \mathbf { c } )$
136
+
137
+ Defn. 4.1 is related to independent subspace analysis [16, 53, 73, 114], which also aims to identify blocks of random variables as opposed to individual factors, though under an independence assumption across blocks, and typically not within a multi-view setting as studied in the present work.
138
+
139
+ # 4.1 Generative self-supervised representation learning
140
+
141
+ First, we consider generative SSL, i.e., fitting a generative model to pairs $( { \bf x } , \tilde { { \bf x } } )$ of original and augmented views.7 We show that under our specified data generation and augmentation process $( \ S 3 )$
142
+
143
+ as well as suitable additional assumptions (stated and discussed in more detail below), it is possible to isolate (i.e., block-identify) the invariant content partition. Full proofs are included in Appendix A. Theorem 4.2 (Identifying content with a generative model). Consider the data generating process described in $\textrm { \tiny \oint } \textrm { \tiny { \left. \frac { } { } \right. { ~ , ~ } } }$ , i.e., the pairs $( { \bf x } , \tilde { { \bf x } } )$ of original and augmented views are generated according to (2) and (3) with $p _ { \tilde { \mathbf { z } } | \mathbf { z } }$ as defined in Assumptions 3.1 and 3.2. Assume further that
144
+
145
+ (i) $\mathbf { f } : \mathcal { Z } \mathcal { X }$ is smooth and invertible with smooth inverse (i.e., a diffeomorphism);
146
+
147
+ (ii) $p _ { \mathbf { z } }$ is a smooth, continuous density on $\mathcal { Z }$ with $p _ { \mathbf { z } } ( \mathbf { z } ) > 0$ almost everywhere;
148
+
149
+ (iii) for any $l \in \{ 1 , . . . , n _ { s } \}$ , $\exists A \subseteq \{ 1 , . . . , n _ { s } \}$ s.t. $l \in A$ ; $p _ { A } ( A ) > 0$ ; $p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } }$ is smooth w.r.t. both $\mathbf { s } _ { A }$ and $\tilde { \mathbf { s } } _ { A }$ ; and for any $\mathbf { s } _ { A }$ , $p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } } ( \cdot | \mathbf { s } _ { A } ) > 0$ in some open, non-empty subset containing $\mathbf { s } _ { A }$ .
150
+
151
+ If, for a given $n _ { s }$ $1 \leq n _ { s } < n ,$ ), a generative model $( \hat { p } _ { { \bf z } } , \hat { p } _ { A } , \hat { p } _ { { \bf \tilde { s } } | { \bf s } , A } , \hat { \bf f } )$ assumes the same generative process $( \ S \ 3 )$ , satisfies the above assumptions (i)-(iii), and matches the data likelihood,
152
+
153
+ $$
154
+ p _ { \mathbf { x } , \tilde { \mathbf { x } } } ( \mathbf { x } , \tilde { \mathbf { x } } ) = \hat { p } _ { \mathbf { x } , \tilde { \mathbf { x } } } ( \mathbf { x } , \tilde { \mathbf { x } } ) \qquad \forall ( \mathbf { x } , \tilde { \mathbf { x } } ) \in \mathcal { X } \times \mathcal { X }
155
+ $$
156
+
157
+ then it block-identifies the true content variables via $\mathbf { g } = \hat { \mathbf { f } } ^ { - 1 }$ in the sense of Defn. 4.1.
158
+
159
+ Proof sketch. First, show (using $( i )$ and the matching likelihoods) that the representation $\hat { \mathbf { z } } = \mathbf { g } ( \mathbf { x } )$ extracted by $\mathbf { g }$ is related to the true $\mathbf { z }$ by a smooth invertible mapping $\mathbf { h } = \mathbf { g } \circ \mathbf { f }$ such that $\hat { \mathbf { c } } = \mathbf { h } ( \mathbf { z } ) _ { 1 : n _ { c } }$ is invariant across $( \mathbf { z } , \tilde { \mathbf { z } } )$ almost surely w.r.t. $p _ { \mathbf { z } , \tilde { \mathbf { z } } }$ . 8 Second, show by contradiction (using (ii), (iii)) that $\mathbf { h } ( \cdot ) _ { 1 : n _ { c } }$ can, in fact, only depend on the true content c and not on style s, for otherwise the invariance from step 1 would be violated in a region of the style (sub)space of measure greater than zero.
160
+
161
+ Intuition. Thm. 4.2 assumes that the number of content $( n _ { c } )$ and style $( n _ { s } )$ variables is known, and that there is a positive probability that each style variable may change, though not necessarily on its own, according to $( i i i )$ . In this case, training a generative model of the form specified in $\ S$ (i.e., with an invariant content partition and subsets of changing style variables) by maximum likelihood on pairs $( { \bf x } , \tilde { { \bf x } } )$ will asymptotically (in the limit of infinite data) recover the true invariant content partition up to an invertible function, i.e., it isolates, or unmixes, content from style.
162
+
163
+ Discussion. The identifiability result of Thm. 4.2 for generative SSL is of potential relevance for existing variational autoencoder (VAE) [68] variants such as the GroupVAE [51],9 or its adaptive version AdaGVAE [83]. Since, contrary to existing results, Thm. 4.2 does not assume independent latents, it may also provide a principled basis for generative causal representation learning algorithms [76, 107, 127]. However, an important limitation to its practical applicability is that generative modelling does not tend to scale very well to complex high-dimensional observations, such as images.
164
+
165
+ # 4.2 Discriminative self-supervised representation learning
166
+
167
+ We therefore next turn to a discriminative approach, i.e., directly learning an encoder function g which leads to a similar embedding across $( { \bf x } , \tilde { { \bf x } } )$ . As discussed in $\ S 2$ , this is much more common for SSL with data augmentations. First, we show that if an invertible encoder $\mathbf { g }$ is used, then learning a representation which is aligned in the first $n _ { c }$ dimensions is sufficient to block-identify content.
168
+
169
+ Theorem 4.3 (Identifying content with an invertible encoder). Assume the same data generating process $( \ S \_ )$ and conditions $( i ) – ( i \nu )$ as in Thm. 4.2. Let $\mathbf { g } : \mathcal { X } \mathcal { Z }$ be any smooth and invertible function which minimises the following functional:
170
+
171
+ $$
172
+ \mathcal { L } _ { \mathrm { A l i g n } } ( \mathbf { g } ) : = \mathbb { E } _ { ( \mathbf { x } , \tilde { \mathbf { x } } ) \sim p _ { \mathbf { x } , \tilde { \mathbf { x } } } } [ | \Bigl | \mathbf { g } ( \mathbf { x } ) _ { 1 : n _ { c } } - \mathbf { g } ( \tilde { \mathbf { x } } ) _ { 1 : n _ { c } } | | _ { 2 } ^ { 2 } ]
173
+ $$
174
+
175
+ Then g block-identifies the true content variables in the sense of Definition 4.1.
176
+
177
+ Proof sketch. First, we show that the global minimum of (4) is reached by the smooth invertible function $\mathbf { f } ^ { - 1 }$ . Thus, any other minimiser $\mathbf { g }$ must satisfy the same invariance across $( { \bf x } , \tilde { { \bf x } } )$ used in step 1 of the proof of Thm. 4.2. The second step uses the same argument by contradiction as in Thm. 4.2.
178
+
179
+ Intuition. Thm. 4.3 states that if—under the same assumptions on the generative process as in Thm. 4.2—we directly learn a representation with an invertible encoder, then enforcing alignment between the first $n _ { c }$ latents is sufficient to isolate the invariant content partition. Intuitively, invertibility guarantees that all information is preserved, thus avoiding a collapsed representation.
180
+
181
+ Discussion. According to Thm. 4.3, content can be isolated if, e.g., a flow-based architecture [32, 33, 67, 92, 93] is used, or invertibility is enforced otherwise during training [8, 60]. However, the applicability of this approach is limited as it places strong constraints on the encoder architecture which makes it hard to scale these methods up to high-dimensional settings. As discussed in $\ S$ , state-of-the-art SSL methods such as SimCLR [20], BYOL [41], SimSiam [21], or BarlowTwins [128] do not use invertible encoders, but instead avoid collapsed representations—which would result from naively optimising (4) for arbitrary, non-invertible g—using different forms of regularisation.
182
+
183
+ To close this gap between theory and practice, finally, we investigate how to block-identify content without assuming an invertible encoder. We show that, if we add a regularisation term to (4) that encourages maximum entropy of the learnt representation, the invertibility assumption can be dropped. Theorem 4.4 (Identifying content with discriminative learning and a non-invertible encoder). Assume the same data generating process $( \ S \ 3 )$ and conditions (i)-(iv) as in Thm. 4.2. Let $\mathbf { g } : \mathcal { X } ( 0 , 1 ) ^ { n _ { c } }$ be any smooth function which minimises the following functional:
184
+
185
+ $$
186
+ \mathcal { L } _ { \mathrm { A l i g n M a x E n t } } ( \mathbf { g } ) : = \mathbb { E } _ { ( \mathbf { x } , \tilde { \mathbf { x } } ) \sim p _ { \mathbf { x } , \tilde { \mathbf { x } } } } \left[ \left| \left| \mathbf { g } ( \mathbf { x } ) - \mathbf { g } ( \tilde { \mathbf { x } } ) \right| \right| _ { 2 } ^ { 2 } \right] - H \left( \mathbf { g } ( \mathbf { x } ) \right)
187
+ $$
188
+
189
+ where $H ( \cdot )$ denotes the differential entropy of the random variable ${ \bf g } ( { \bf x } )$ taking values in $( 0 , 1 ) ^ { n _ { c } }$ .
190
+ Then g block-identifies the true content variables in the sense of Defn. 4.1.
191
+
192
+ Proof skmapping he Darmois construction [29, 57] to to a uniform random variable. Then $\mathbf { d } : \mathcal { C } ( 0 , 1 ) ^ { n _ { c } }$ $\mathbf { c } = \mathbf { f } ^ { - 1 } ( \mathbf { x } ) _ { 1 : n _ { c } }$ $\mathbf { g } ^ { \star } = \mathbf { d } \circ \mathbf { f } _ { 1 : n _ { c } } ^ { - 1 }$ minimum of (5) because $\mathbf { c }$ and the uniform distribution is the maximum entropy distribution on $( 0 , 1 ) ^ { n _ { c } }$ . Thus, any other minimiser $\mathbf { g }$ of (5) must satisfy invariance across $( { \bf x } , \tilde { { \bf x } } )$ and map to a uniform r.v. Then, use the same step 2 as in Thms. 4.2 and 4.3 to show that $\mathbf { h } = \mathbf { g } \circ \mathbf { f } : \mathcal { Z } ( 0 , 1 ) ^ { n _ { c } }$ cannot depend on style, i.e., it is a function from $\mathcal { C }$ to $( 0 , 1 ) ^ { n _ { c } }$ . Finally, we show that h must be invertible since it maps $p _ { \mathbf { c } }$ to a uniform distribution, using a result from [129].
193
+
194
+ Intuition. Thm. 4.4 states that if we do not explicitly enforce invertibility of $\mathbf { g }$ as in Thm. 4.3, additionally maximising the entropy of the learnt representation (i.e., optimising alignment and uniformity [124]) avoids a collapsed representation and recovers the invariant content block. Intuitively, this is because any function that only depends on c will be invariant across $( { \bf x } , \tilde { { \bf x } } )$ , so it is beneficial to preserve all content information to maximise entropy.
195
+
196
+ Discussion. Of our theoretical results, Thm. 4.4 requires the weakest set of assumptions, and is most closely aligned with common SSL practice. As discussed in $\ S$ , contrastive SSL with negative samples using InfoNCE (1) as an objective can asymptotically be understood as alignment with entropy regularisation [124], i.e., objective (5). Thm. 4.4 thus provides a theoretical justification for the empirically observed effectiveness of CL with InfoNCE: subject to our assumptions, CL with InfoNCE asymptotically isolates content, i.e., the part of the representation that is always left invariant by augmentation. For example, the strong image classification performance based on representations learned by SimCLR [20], which uses color distortion and random crops as augmentations, can be explained in that object class is a content variable in this case. We extensively evaluate the effect of various augmentation techniques on different ground-truth latent factors in our experiments in $\ S$ . There is also an interesting connection between Thm. 4.4 and BarlowTwins [128], which only uses positive pairs and combines alignment with a redundancy reduction regulariser that enforces decorrelation between the inferred latents. Intuitively, redundancy reduction is related to increased entropy: $\mathbf { g } ^ { \star }$ constructed in the proof of Thm. 4.4—and thus also any other minimiser of (5)—attains the global optimum of the BarlowTwins objective, though the reverse implication may not hold.
197
+
198
+ # 5 Experiments
199
+
200
+ We perform two main experiments. First, we numerically test our main result, Thm. 4.4, in a fullycontrolled, finite sample setting $( \ S \quad )$ , using CL to estimate the entropy term in (5). Second, we seek to better understand the effect of data augmentations used in practice $\mathrm { ~ ( ~ \ S ~ } \mathrm { ~ ) ~ }$ . To this end, we introduce a new dataset of 3D objects with dependencies between a number of known ground-truth factors, and use it to evaluate the effect of different augmentation techniques on what is identified as content. Additional experiments are summarised in $\ S 5 . 3$ and described in more detail in Appendix C.
201
+
202
+ # 5.1 Numerical data
203
+
204
+ Experimental setup. We generate synthetic data as described in $\ S \ O 3$ . We consider $n _ { c } = n _ { s } = 5$ with content and style latents distributed as $\mathbf { c } \sim \mathcal { N } ( 0 , \Sigma _ { c } )$ and $\mathbf { s } | \mathbf { c } \sim \mathcal { N } ( \mathbf { a } + B \mathbf { c } , \Sigma _ { s } )$ , thus allowing for statistical dependence within the two blocks (via $\Sigma _ { c }$ and $\Sigma _ { s }$ ) and causal dependence between content and style (via $B$ ). For f, we use a 3-layer MLP with LeakyReLU activation functions.10 The distribution $p _ { A }$ over subsets of changing style variables is obtained by independently flipping the same biased coin for each $s _ { i }$ . The conditional style distribution is taken as $p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { \bar { s } } _ { A } } = \mathcal { N } ( \mathbf { s } _ { A } , \mathbf { \bar { \Sigma } } _ { A } ) ^ { \top }$ . We train an encoder $\mathbf { g }$ on pairs $( { \bf x } , \tilde { { \bf x } } )$ with InfoNCE using the negative L2 loss as the similarity measure, i.e., we approximate (5) using empirical averages and negative samples. For evaluation, we use kernel ridge regression [88] to predict the ground truth c and s from the learnt representation $\hat { \mathbf { c } } = \mathbf { g } ( \mathbf { x } )$ and report the $R ^ { 2 }$ coefficient of determination. For a more detailed account, we refer to Appendix D.
205
+
206
+ ![](images/77af6dbd61790d34daf60772bc5b64d29a717fb77b1f8fe11cad8b6703475181.jpg)
207
+ Figure 2: (Left) Causal graph for the Causal3DIdent dataset. (Right) Two samples from each object class.
208
+
209
+ Results. In the inset table, we report mean $\pm$ std. dev. over 3 random seeds across four generative processes of increasing complexity covered by Thm. 4.4: “p(chg.)”, “Stat.”, and “Cau.” denote respectively the change probability for each $s _ { i }$ , statistical dependence within blocks $( \Sigma _ { c } \neq I \neq \Sigma _ { s } )$ , and causal dependence of style on content $B \neq 0 .$ ). An $R ^ { 2 }$ close to one indicates that almost all variation is explained by cˆ, i.e., that there is a 1-1 mapping, as required by Defn. 4.1. As can be seen, across all settings, content is block-identified. Regarding style, we observe an increased score with the introduction of dependencies, which we explain in an extended discussion in Appendix C.1. Finally, we show in Appendix C.1 that a high $R ^ { 2 }$ score can be obtained even if we use linear regression to predict c from cˆ $\dot { \phantom { 0 } } R ^ { 2 } = 0 . 9 8 \pm 0 . 0 1$ , for the last row).
210
+
211
+ <table><tr><td colspan="3">Generative process</td><td colspan="2">R² (nonlinear)</td></tr><tr><td>p(chg.)</td><td>Stat.</td><td>Cau.</td><td>Content c</td><td>Style s</td></tr><tr><td>1.0</td><td>X</td><td>X</td><td>1.00± 0.00</td><td>0.07±0.00</td></tr><tr><td>0.75</td><td>×</td><td>X</td><td>1.00 ± 0.00</td><td>0.06 ± 0.05</td></tr><tr><td>0.75</td><td>√</td><td>X</td><td>0.98 ± 0.03</td><td>0.37± 0.05</td></tr><tr><td>0.75</td><td>√</td><td>√</td><td>0.99 ± 0.01</td><td>0.80±0.08</td></tr></table>
212
+
213
+ # 5.2 High-dimensional images: Causal3DIdent
214
+
215
+ Causal3DIdent dataset. 3DIdent [129] is a benchmark for evaluating identifiability with rendered $2 2 4 \times 2 2 4$ images which contains hallmarks of natural environments (e.g. shadows, different lighting conditions, a 3D object). For influence of the latent factors on the renderings, see Fig. 2 of [129]. In 3DIdent, there is a single object class (Teapot [89]), and all 10 latents are sampled independently. For Causal3DIdent, we introduce six additional classes: Hare [121], Dragon [110], Cow [62], Armadillo [70], Horse [98], and Head [111]; and impose a causal graph over the latent variables, see Fig. 2. While object class and all environment variables (spotlight position & hue, background hue) are sampled independently, all object latents are dependent,11 see Appendix B for details.12
216
+
217
+ Experimental setup. For g, we train a convolutional encoder composed of a ResNet18 [46] and an additional fully-connected layer, with LeakyReLU activation. As in SimCLR [20], we use InfoNCE with cosine similarity, and train on pairs of augmented examples $( \tilde { \mathbf { x } } , \tilde { \mathbf { x } } ^ { \prime } )$ . As $n _ { c }$ is unknown and variable depending on the augmentation, we fix $\mathrm { d i m } ( \hat { \mathbf { c } } ) = 8$ throughout. Note that we find the results to be, for the most part, robust to the choice of $\mathrm { d i m } ( \hat { \mathbf { c } } )$ , see inset figure. We consider the following data augmentations (DA): crop, resize & flip; colour distortion (jitter & drop);
218
+
219
+ and rotation $\in \{ 9 0 ^ { \circ } , 1 8 0 ^ { \circ } , 2 7 0 ^ { \circ } \}$ . For comparison, we also consider directly imposing a content-style partition by performing a latent transformation (LT) to generate views. For evaluation, we use linear logistic regression to predict object class, and kernel ridge to predict the other latents from cˆ. 13
220
+
221
+ ![](images/87984e07de8da2c719bbda0fc5121e39737f0057b00d307efe999c28e4999887.jpg)
222
+
223
+ Table 1: Causal3DIdent results: $R ^ { 2 }$ mean $\pm$ std. dev. over 3 random seeds. DA: data augmentation, LT: latent transformation, bold: $R ^ { 2 } \geq 0 . 5$ , red: $R ^ { 2 } < 0 . 2 5$ . Results for individual axes of object position & rotation are aggregated, see Appendix C for the full table.
224
+
225
+ <table><tr><td rowspan="2">Views generated by</td><td rowspan="2">Class</td><td colspan="2">Positions</td><td colspan="3">Hues</td><td rowspan="2">Rotations</td></tr><tr><td>object</td><td>spotlight</td><td>object</td><td>spotlight</td><td>background</td></tr><tr><td>DA: colour distortion</td><td>0.42 ± 0.01</td><td>0.61 ± 0.10</td><td>0.17 ± 0.00</td><td>0.10 ± 0.01</td><td>0.01 ± 0.00</td><td>0.01 ± 0.00</td><td>0.33 ± 0.02</td></tr><tr><td>LT: change hues</td><td>1.00 ± 0.00</td><td>0.59 ± 0.33</td><td>0.91 ± 0.00</td><td>0.30 ± 0.00</td><td>0.00 ± 0.00</td><td>0.00 ± 0.00</td><td>0.30 ± 0.01</td></tr><tr><td>DA: crop (large)</td><td>0.28± 0.04</td><td>0.09± 0.08</td><td>0.21 ± 0.13</td><td>0.87 ± 0.00</td><td>0.09 ± 0.02</td><td>1.00 ± 0.00</td><td>0.02 ± 0.02</td></tr><tr><td>DA: crop (small)</td><td>0.14 ± 0.00</td><td>0.00 ± 0.01</td><td>0.00 ± 0.01</td><td>0.00± 0.00</td><td>0.00 ±0.00</td><td>1.00 ± 0.00</td><td>0.00 ±0.00</td></tr><tr><td>LT: change positions</td><td>1.00 ± 0.00</td><td>0.16 ± 0.23</td><td>0.00 ± 0.01</td><td>0.46 ± 0.02</td><td>0.00 ± 0.00</td><td>0.97 ± 0.00</td><td>0.29 ± 0.01</td></tr><tr><td>DA: crop (large) + colour distortion</td><td>0.97± 0.00</td><td>0.59 ± 0.07</td><td>0.59± 0.05</td><td>0.28± 0.00</td><td>0.01 ± 0.01</td><td>0.01 ± 0.00</td><td>0.74± 0.03</td></tr><tr><td>DA: crop (small) + colour distortion</td><td>1.00 ± 0.00</td><td>0.69± 0.04</td><td>0.93±0.00</td><td>0.30 ± 0.01</td><td>0.00 ± 0.00</td><td>0.02 ± 0.03</td><td>0.56± 0.03</td></tr><tr><td>LT: change positions + hues</td><td>1.00 ± 0.00</td><td>0.22 ± 0.22</td><td>0.07 ± 0.08</td><td>0.32 ± 0.02</td><td>0.00 ± 0.01</td><td>0.02 ± 0.03</td><td>0.34± 0.06</td></tr><tr><td>DA: rotation</td><td>0.33 ± 0.06</td><td>0.17±0.09</td><td>0.23 ± 0.12</td><td>0.83 ± 0.01</td><td>0.30 ± 0.12</td><td>0.99± 0.00</td><td>0.05 ± 0.03</td></tr><tr><td>LT: change rotations</td><td>1.00 ± 0.00</td><td>0.53 ± 0.33</td><td>0.90 ± 0.00</td><td>0.41 ± 0.00</td><td>0.00 ± 0.00</td><td>0.97 ± 0.00</td><td>0.28 ± 0.00</td></tr><tr><td>DA: rotation + colour distortion</td><td>0.59± 0.01</td><td>0.58 ± 0.06</td><td>0.21 ± 0.01</td><td>0.12 ± 0.02</td><td>0.01 ± 0.00</td><td>0.01 ± 0.00</td><td>0.33 ± 0.04</td></tr><tr><td>LT: change rotations + hues</td><td>1.00 ± 0.00</td><td>0.57 ± 0.34</td><td>0.91 ± 0.00</td><td>0.30 ± 0.00</td><td>0.00 ± 0.00</td><td>0.00 ± 0.00</td><td>0.28 ± 0.00</td></tr></table>
226
+
227
+ Results. The results are presented in Tab. 1. Overall, our main findings can be summarised as:
228
+
229
+ (i) it can be difficult to design image-level augmentations that leave specific latent factors invariant;
230
+ (ii) augmentations & latent transformations generally have a similar effect on groups of latents;
231
+ (iii) augmentations that yield good classification performance induce variation in all other latents.
232
+
233
+ We observe that, similar to directly varying the hue latents, colour distortion leads to a discarding of hue information as style, and a preservation of (object) position as content. Crops, similar to varying the position latents, lead to a discarding of position as style, and a preservation of background and object hue as content, the latter assuming crops are sufficiently large. In contrast, image-level rotation affects both the object rotation and position, and thus deviates from only varying the rotation latents.
234
+
235
+ Whereas class is always preserved as content when generating views with latent transformations, when using data augmentations, we can only reliably decode class when crops & colour distortion are used in conjunction—a result which mirrors evaluation on ImageNet [20]. As can be seen by our evaluation of crops $\&$ colour distortion in isolation, while colour distortion leads to a discarding of hues as style, crops lead to a discarding of position $\&$ rotation as style. Thus, when used in conjunction, class is isolated as the sole content variable. See Appendix C.2 for additional analysis.
236
+
237
+ # 5.3 Additional experiments and ablations
238
+
239
+ We also perform an ablation on $\mathrm { d i m } ( \hat { \mathbf { c } } )$ for the synthetic setting from $\ S$ , see Appendix C.1 for details. Generally, we find that if $\mathrm { d i m } ( \hat { \mathbf { c } } ) < n _ { c }$ , there is insufficient capacity to encode all content, so a lower-dimensional mixture of content is learnt. Conversely, if $\mathrm { d i m } ( \hat { \mathbf { c } } ) > n _ { c }$ , the excess capacity is used to encode some style information (as that increases entropy). Further, we repeat our analysis from $\ S 5 . 2$ using BarlowTwins [128] (instead of SimCLR) which, as discussed at the end of $\ S 4 . 2$ , is also loosely related to Thm. 4.4. The results mostly mirror those obtained for SimCLR and presented in Tab. 1, see Appendix C.2 for details. Finally, we ran the same experimental setup as in $\ S$ also on the MPI3D-real dataset [38] containing $> 1$ million real images with ground-truth annotations of 3D objects being moved by a robotic arm. Subject to some caveats, the results show a similar trend as those on Causal3DIdent, see Appendix C.3 for details.
240
+
241
+ # 6 Discussion
242
+
243
+ Theory vs practice. We have made an effort to tailor our problem formulation $^ { ( \ S ) }$ to the setting of data augmentation with content-preserving transformations. However, some of our more technical assumptions, which are necessary to prove block-identifiability of the invariant content partition, may not hold exactly in practice. This is apparent, e.g., from our second experiment $( \ S 5 . 2 )$ , where we observe that—while class should, in principle, always be invariant across views (i.e., content)—when using only crops, colour distortion, or rotation, g appears to encode shortcuts [37, 96].14 Data augmentation, unlike latent transformations, generates views $\tilde { \bf x }$ which are not restricted to the 11-dim. image manifold $\mathcal { X }$ corresponding to the generative process of Causal3DIdent, but may introduce additional variation: e.g., colour distortion leads to a rich combination of colours, typically a 3-dim. feature, whereas Causal3DIdent only contains one degree of freedom (hue). With additional factors, any introduced invariances may be encoded as content in place of class. Image-level augmentations also tend to change multiple latent factors in a correlated way, which may violate assumption (iii) of our theorems, i.e., that $p _ { \tilde { \mathbf { s } } _ { A } | \mathbf { s } _ { A } }$ is fully-supported locally. We also assume that $\mathbf { z }$ is continuous, even though Causal3DIdent and most disentanglement datasets also contain discrete latents. This is a very common assumption in the related literature [39, 54, 57, 58, 63, 69, 82, 83, 129] that may be relaxed in future work. Moreover, our theory holds asymptotically and at the global optimum, whereas in practice we solve a non-convex optimisation problem with a finite sample and need to approximate the entropy term in (5), e.g., using a finite number of negative pairs. The resulting challenges for optimisation may be further accentuated by the higher dimensionality of $\mathcal { X }$ induced by image-level augmentations. Finally, we remark that while, for simplicity, we have presented our theory for pairs $( { \bf x } , \bar { \bf x } )$ of original and augmented examples, in practice, using pairs $( \tilde { \mathbf { x } } , \tilde { \mathbf { x } } ^ { \prime } )$ of two augmented views typically yields better performance. All of our assumptions (content invariance, changing style, etc) and theoretical results still apply to the latter case. We believe that using two augmented views helps because it leads to increased variability across the pair: for if $\tilde { \mathbf { x } }$ and $\tilde { \mathbf { x } } ^ { \prime }$ differ from $\mathbf { x }$ in style subsets $A$ and $A ^ { \prime }$ , respectively, then $( \tilde { \mathbf { x } } , \tilde { \mathbf { x } } ^ { \prime } )$ differ from each other (a.s.) in the union $A \cup A ^ { \prime }$ .
244
+
245
+ Beyond entropy regularisation. We have shown a clear link between an identifiable maximum entropy approach to SSL (Thm. 4.4) and SimCLR [20] based on the analysis of [124], and have discussed an intuitive connection to the notion of redundancy reduction used in BarlowTwins [128]. Whether other types of regularisation such as the architectural approach pursued in BYOL [41] and SimSiam [21] can also be linked to entropy maximisation, remains an open question. Deriving similar results to Thm. 4.4 with other regularisers is a promising direction for future research, c.f. [116].
246
+
247
+ The choice of augmentation technique implicitly defines content and style. As we have defined content as the part of the representation which is always left invariant across views, the choice of augmentation implicitly determines the content-style partition. This is particularly important to keep in mind when applying SSL with data augmentation to safety-critical domains, such as medical imaging. We also advise caution when using data augmentation to identify specific latent properties, since, as observed in $\ S$ , image-level transformations may affect the underlying ground-truth factors in unanticipated ways. Also note that, for a given downstream task, we may not want to discard all style information since style variables may still be correlated with the task of interest and may thus help improve predictive performance. For arbitrary downstream tasks, however, where style may change in an adversarial way, it can be shown that only using content is optimal [103].
248
+
249
+ What vs how information is encoded. We focus on what information is learnt by SSL with data augmentations by specifying a generative process and studying identifiability of the latent representation. Orthogonal to this, a different line of work instead studies how information is encoded by analysing the sample complexity needed to solve a given downstream task using a linear predictor [3, 74, 116– 119]. Provided that downstream tasks only involve content, we can draw some comparisons. Whereas our results recover content only up to arbitrary invertible nonlinear functions (see Defn. 4.1), our problem setting is more general: [3, 74] assume (approximate) independence of views $( { \bf x } , \tilde { { \bf x } } )$ given the task (content), while [118, 119] assume (approximate) independence between one view and the task (content) given the other view, neither of which hold in our setting.
250
+
251
+ Conclusion. Existing representation learning approaches typically assume mutually independent latents, though dependencies clearly exist in nature [106]. We demonstrate that in a non-i.i.d. scenario, e.g., by constructing multiple views of the same example with data augmentation, we can learn useful representations in the presence of this neglected phenomenon. More specifically, the present work contributes, to the best of our knowledge, the first: (i) identifiability result under arbitrary dependence between latents; and (ii) empirical study that evaluates the effect of data augmentations not only on classification, but also on other continuous ground-truth latents. Unlike existing identifiability results which rely on change as a learning signal, our approach aims to identify what is always shared across views, i.e., also using invariance as a learning signal. We hope that this change in perspective will be helpful for applications such as optimal style transfer or disentangling shape from pose in vision, and inspire other types of counterfactual training to recover a more fine-grained causal representation.
252
+
253
+ # Acknowledgements
254
+
255
+ We thank: the anonymous reviewers for several helpful suggestions that triggered improvements in theory and additional experiments; Cian Eastwood, Ilyes Khemakem, Michael Lohaus, Osama Makansi, Ricardo Pio Monti, Roland Zimmermann, Weiyang Liu, and the MPI Tübingen causality group for helpful discussions and comments; Hugo Yèche for pointing out a mistake in $\ S 2$ of an earlier version of the manuscript; github user TangTangFei for catching a bug in the implementation of the experiments from $\ S 5 . 1$ (that has been corrected in this version); and the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting YS.
256
+
257
+ # Funding Transparency Statement
258
+
259
+ WB acknowledges support via his Emmy Noether Research Group funded by the German Science Foundation (DFG) under grant no. BR 6382/1-1 as well as support by Open Philantropy and the Good Ventures Foundation. This work was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039A, 01IS18039B; and by the Machine Learning Cluster of Excellence, EXC number 2064/1 – Project number 390727645.
260
+
261
+ # References
262
+
263
+ [1] Pulkit Agrawal, Joao Carreira, and Jitendra Malik. Learning to see by moving. In Proceedings of the IEEE International Conference on Computer Vision, pages 37–45, 2015.
264
+ [2] Arctic Wildlife. Churchill Polar Bears . https://churchillpolarbears.org/churchill/, 2021. [3] Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. In 36th International Conference on Machine Learning, pages 9904–9923. International Machine Learning Society (IMLS), 2019.
265
+ [4] Philip Bachman, R. Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In Advances in Neural Information Processing Systems 32, pages 15509–15519, 2019.
266
+ [5] Alexei Baevski, Steffen Schneider, and Michael Auli. vq-wav2vec: Self-supervised learning of discrete speech representations. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
267
+ [6] Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. In Advances in Neural Information Processing Systems 33, 2020.
268
+ [7] Suzanna Becker and Geoffrey E Hinton. Self-organizing neural network that discovers surfaces in random-dot stereograms. Nature, 355(6356):161–163, 1992.
269
+ [8] Jens Behrmann, Will Grathwohl, Ricky TQ Chen, David Duvenaud, and Jörn-Henrik Jacobsen. Invertible residual networks. In International Conference on Machine Learning, pages 573–582. PMLR, 2019.
270
+ [9] Anthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural computation, 7(6):1129–1159, 1995.
271
+ [10] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013.
272
+ [11] Blender Online Community. Blender - a 3D modelling and rendering package. Blender Foundation, Blender Institute, Amsterdam, 2021.
273
+ [12] Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a “siamese” time delay neural network. Advances in Neural Information Processing Systems, 6: 737–744, 1993.
274
+ [13] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877–1901, 2020.
275
+ [14] Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -VAE. arXiv preprint arXiv:1804.03599, 2018.
276
+ [15] J-F Cardoso. Infomax and maximum likelihood for blind source separation. IEEE Signal processing letters, 4(4):112–114, 1997.
277
+ [16] Michael A Casey and Alex Westner. Separation of mixed audio sources by independent subspace analysis. In ICMC, pages 154–161, 2000.
278
+ [17] Olivier Chapelle and Bernhard Schölkopf. Incorporating invariances in nonlinear SVMs. In Advances in Neural Information Processing Systems 14, pages 609–616, Cambridge, MA, USA, 2002. MIT Press.
279
+ [18] Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in vaes. In Advances in Neural Information Processing Systems, pages 2615–2625, 2018.
280
+ [19] Shuxiao Chen, Edgar Dobriban, and Jane H Lee. A group-theoretic framework for data augmentation. Journal of Machine Learning Research, 21(245):1–71, 2020.
281
+ [20] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning, pages 1597–1607. PMLR, 2020.
282
+ [21] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In IEEE Conference on Computer Vision and Pattern Recognition, pages 15750–15758, 2021.
283
+ [22] S. Chopra, R. Hadsell, and Y. LeCun. Learning a similarity metric discriminatively, with application to face verification. In IEEE Conference on Computer Vision and Pattern Recognition, volume 1, pages 539–546, 2005.
284
+ [23] Ronan Collobert, Jason Weston, Léon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12:2461– 2505, 2011.
285
+ [24] Pierre Comon. Independent component analysis, a new concept? Signal processing, 36(3):287–314, 1994.
286
+ [25] Thomas M Cover and Joy A Thomas. Elements of Information Theory. John Wiley & Sons, 2012.
287
+ [26] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In IEEE Conference on Computer Vision and Pattern Recognition, pages 113–123, 2019.
288
+ [27] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020.
289
+ [28] Tri Dao, Albert Gu, Alexander Ratner, Virginia Smith, Chris De Sa, and Christopher Ré. A kernel theory of modern data augmentation. In International Conference on Machine Learning, pages 1528–1537. PMLR, 2019.
290
+ [29] G Darmois. Analyse des liaisons de probabilité. In Proc. Int. Stat. Conferences 1947, page 231, 1951.
291
+ [30] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4171–4186, 2019.
292
+ [31] Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
293
+ [32] Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
294
+ [33] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In 5th International Conference on Learning Representations, 2017.
295
+ [34] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In IEEE International Conference on Computer Vision, pages 1422–1430, 2015.
296
+ [35] Frederick Eberhardt and Richard Scheines. Interventions and causal inference. Philosophy of science, 74 (5):981–995, 2007.
297
+ [36] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. International Conference on Learning Representations (ICLR), 2019.
298
+ [37] Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A. Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, Nov 2020.
299
+ [38] Muhammad Waleed Gondal, Manuel Wuthrich, Djordje Miladinovic, Francesco Locatello, Martin Breidt, Valentin Volchkov, Joel Akpo, Olivier Bachem, Bernhard Schölkopf, and Stefan Bauer. On the transfer of inductive bias from simulation to the real world: a new disentanglement dataset. Advances in Neural Information Processing Systems, 32:15740–15751, 2019.
300
+ [39] Luigi Gresele, Paul K. Rubenstein, Arash Mehrjou, Francesco Locatello, and Bernhard Schölkopf. The Incomplete Rosetta Stone problem: Identifiability results for multi-view nonlinear ICA. In Proceedings of the Thirty-Fifth Conference on Uncertainty in Artificial Intelligence, UAI, 2019.
301
+ [40] Luigi Gresele, Julius von Kügelgen, Vincent Stimper, Bernhard Schölkopf, and Michel Besserve. Independent mechanism analysis, a new concept? In Advances in Neural Information Processing Systems, 2021.
302
+ [41] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Ávila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent - A new approach to self-supervised learning. In Advances in Neural Information Processing Systems 33, 2020.
303
+ [42] Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010.
304
+ [43] Michael Gutmann and Aapo Hyvärinen. Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. The Journal of Machine Learning Research, 13:307–361, 2012.
305
+ [44] R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In IEEE Conference on Computer Vision and Pattern Recognition, volume 2, pages 1735–1742, 2006.
306
+ [45] Hermanni Hälvä and Aapo Hyvarinen. Hidden markov nonlinear ica: Unsupervised learning from nonstationary time series. In Conference on Uncertainty in Artificial Intelligence, pages 939–948. PMLR, 2020.
307
+ [46] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
308
+ [47] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conference on Computer Vision and Pattern Recognition, pages 9726–9735, 2020.
309
+ [48] Olivier J. Hénaff. Data-efficient image recognition with contrastive predictive coding. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 4182–4192. PMLR, 2020.
310
+ [49] Irina Higgins, Loïc Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In 5th International Conference on Learning Representations, 2017.
311
+ [50] R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In 7th International Conference on Learning Representations, 2019.
312
+ [51] Haruo Hosoya. Group-based learning of disentangled representations with generalizability for novel contents. In IJCAI, pages 2506–2513, 2019.
313
+ [52] Andrew G. Howard. Some improvements on deep convolutional neural network based image classification, 2013.
314
+ [53] Aapo Hyvärinen and Patrik Hoyer. Emergence of phase-and shift-invariant features by decomposition of natural images into independent feature subspaces. Neural computation, 12(7):1705–1720, 2000.
315
+ [54] Aapo Hyvarinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ICA. In Advances in Neural Information Processing Systems, pages 3765–3773, 2016.
316
+ [55] Aapo Hyvarinen and Hiroshi Morioka. Nonlinear ica of temporally dependent stationary sources. In Artificial Intelligence and Statistics, pages 460–469. PMLR, 2017.
317
+ [56] Aapo Hyvärinen and Erkki Oja. Independent component analysis: algorithms and applications. Neural networks, 13(4-5):411–430, 2000.
318
+ [57] Aapo Hyvärinen and Petteri Pajunen. Nonlinear independent component analysis: Existence and uniqueness results. Neural Networks, 12(3):429–439, 1999.
319
+ [58] Aapo Hyvarinen, Hiroaki Sasaki, and Richard Turner. Nonlinear ica using auxiliary variables and generalized contrastive learning. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 859–868. PMLR, 2019.
320
+ [59] Maximilian Ilse, Jakub M Tomczak, and Patrick Forré. Selecting data augmentation for simulating interventions. In International Conference on Machine Learning, pages 4555–4562. PMLR, 2021.
321
+ [60] Jörn-Henrik Jacobsen, Arnold Smeulders, and Edouard Oyallon. i-RevNet: Deep invertible networks. In International Conference on Learning Representations, 2018.
322
+ [61] Edwin T Jaynes. On the rationale of maximum-entropy methods. Proceedings of the IEEE, 70(9): 939–952, 1982.
323
+ [62] Keenan’s 3D Model Repository. Keenan’s 3D Model Repository https://www.cs.cmu.edu/ kmcrane/Projects/ModelRepository/, 2021.
324
+ [63] Ilyes Khemakhem, Diederik P. Kingma, Ricardo Pio Monti, and Aapo Hyvärinen. Variational autoencoders and nonlinear ICA: A unifying framework. In The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS, volume 108, pages 2207–2217, 2020.
325
+ [64] Ilyes Khemakhem, Ricardo Pio Monti, Diederik P. Kingma, and Aapo Hyvärinen. Ice-beem: Identifiable conditional energy-based deep models based on nonlinear ICA. In Advances in Neural Information Processing Systems 33, 2020.
326
+ [65] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pages 2649–2658. PMLR, 2018.
327
+ [66] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, 2015.
328
+ [67] Diederik P Kingma and Prafulla Dhariwal. Glow: generative flow with invertible $1 \times 1$ convolutions. In Advances in Neural Information Processing Systems, pages 10236–10245, 2018.
329
+ [68] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations (ICLR), 2014.
330
+ [69] David Klindt, Lukas Schott, Yash Sharma, Ivan Ustyuzhaninov, Wieland Brendel, Matthias Bethge, and Dylan Paiton. Towards nonlinear disentanglement in natural data with temporal sparse coding. International Conference on Learning Representations (ICLR), 2021.
331
+ [70] Venkat Krishnamurthy and Marc Levoy. Fitting smooth surfaces to dense polygon meshes. In John Fujii, editor, Proceedings of the 23rd Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 1996, New Orleans, LA, USA, August 4-9, 1996, pages 313–324. ACM, 1996.
332
+ [71] Abhishek Kumar, Prasanna Sattigeri, and Avinash Balakrishnan. Variational inference of disentangled latent concepts from unlabeled observations. In International Conference on Learning Representations, 2018.
333
+ [72] Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and brain sciences, 40, 2017.
334
+ [73] Quoc V Le, Will Y Zou, Serena Y Yeung, and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Learning hierarchical invariant spatiotemporal features for action recognition with independent subspace analysis. In CVPR 2011, pages 3361–3368. IEEE, 2011.
335
+ [74] Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. arXiv preprint arXiv:2008.01064, 2020.
336
+ [75] Te-Won Lee, Mark Girolami, and Terrence J Sejnowski. Independent component analysis using an extended infomax algorithm for mixed subgaussian and supergaussian sources. Neural computation, 11 (2):417–441, 1999.
337
+ [76] Felix Leeb, Yashas Annadani, Stefan Bauer, and Bernhard Schölkopf. Structural autoencoders improve representations for generation and transfer. arXiv preprint arXiv:2006.07796, 2020.
338
+ [77] Erich L Lehmann and George Casella. Theory of point estimation. Springer Science & Business Media, 2006.
339
+ [78] Lepus Othus. Animal Diversity Web . https://animaldiversity.org/accounts/Lepus_othus/, 2021.
340
+ [79] Ralph Linsker. Self-organization in a perceptual network. Computer, 21(3):105–117, 1988.
341
+ [80] Ralph Linsker. An application of the principle of maximum information preservation to linear systems. In Advances in Neural Information Processing Systems, pages 186–194, 1989.
342
+ [81] 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.
343
+ [82] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In International Conference on Machine Learning, pages 4114–4124, 2019.
344
+ [83] Francesco Locatello, Ben Poole, Gunnar Rätsch, Bernhard Schölkopf, Olivier Bachem, and Michael Tschannen. Weakly-supervised disentanglement without compromises. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pages 6348–6359. PMLR, 2020.
345
+ [84] Lajanugen Logeswaran and Honglak Lee. An efficient framework for learning sentence representations. In 6th International Conference on Learning Representations, 2018.
346
+ [85] Chaochao Lu, Yuhuai Wu, Jose Miguel Hernández-Lobato, and Bernhard Schölkopf. Nonlinear invariant ´ risk minimization: A causal approach. arXiv preprint arXiv:2102.12353, 2021.
347
+ [86] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems, pages 3111–3119, 2013.
348
+ [87] Jovana Mitrovic, Brian McWilliams, Jacob C. Walker, Lars Holger Buesing, and Charles Blundell. Representation learning via invariant causal mechanisms. In 9th International Conference on Learning Representations, 2021.
349
+ [88] Kevin P Murphy. Machine learning: a probabilistic perspective. MIT Press, Cambridge, MA, 2012.
350
+ [89] Martin Edward Newell. The Utilization of Procedure Models in Digital Image Synthesis. PhD thesis, The University of Utah, 1975. AAI7529894.
351
+ [90] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European conference on computer vision, pages 69–84. Springer, 2016.
352
+ [91] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
353
+ [92] George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pages 2338–2347, 2017.
354
+ [93] George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64, 2021.
355
+ [94] Judea Pearl. Causality. Cambridge university press, 2009.
356
+ [95] Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014.
357
+ [96] Mohammad Pezeshki, Sékou-Oumar Kaba, Yoshua Bengio, Aaron Courville, Doina Precup, and Guillaume Lajoie. Gradient starvation: A learning proclivity in neural networks. arXiv preprint arXiv:2011.09468, 2020.
358
+ [97] Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In International Conference on Machine Learning, pages 5171–5180. PMLR, 2019.
359
+ [98] Emil Praun, Adam Finkelstein, and Hugues Hoppe. Lapped textures. In Judith R. Brown and Kurt Akeley, editors, Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 2000, New Orleans, LA, USA, July 23-28, 2000, pages 465–470. ACM, 2000.
360
+ [99] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. Technical report, OpenAI, 2018.
361
+ [100] Mirco Ravanelli, Jianyuan Zhong, Santiago Pascual, Pawel Swietojanski, Joao Monteiro, Jan Trmal, and Yoshua Bengio. Multi-task self-supervised learning for robust speech recognition. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6989–6993, 2020.
362
+ [101] H. Richard, L. Gresele, A. Hyvarinen, B. Thirion, A. Gramfort, and P. Ablin. Modeling shared responses in neuroimaging studies through multiview ica. In Advances in Neural Information Processing Systems 33, pages 19149–19162. Curran Associates, Inc., December 2020.
363
+ [102] Geoffrey Roeder, Luke Metz, and Durk Kingma. On linear identifiability of learned representations. In International Conference on Machine Learning, pages 9030–9039. PMLR, 2021.
364
+ [103] Mateo Rojas-Carulla, Bernhard Schölkopf, Richard Turner, and Jonas Peters. Invariant models for causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342, 2018.
365
+ [104] Steffen Schneider, Alexei Baevski, Ronan Collobert, and Michael Auli. wav2vec: Unsupervised pretraining for speech recognition. In Interspeech 2019, 20th Annual Conference of the International Speech Communication Association, pages 3465–3469, 2019.
366
+ [105] Bernhard Schölkopf. Causality for machine learning. arXiv preprint arXiv:1911.10500, 2019.
367
+ [106] Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. Toward causal representation learning. Proceedings of the IEEE, 2021.
368
+ [107] Xinwei Shen, Furui Liu, Hanze Dong, Qing Lian, Zhitang Chen, and Tong Zhang. Disentangled generative causal representation learning. arXiv preprint arXiv:2010.02637, 2020.
369
+ [108] Rui Shu, Yining Chen, Abhishek Kumar, Stefano Ermon, and Ben Poole. Weakly supervised disentanglement with guarantees. In 8th International Conference on Learning Representations, 2020.
370
+ [109] Peter Sorrenson, Carsten Rother, and Ullrich Köthe. Disentanglement by nonlinear ica with general incompressible-flow networks (gin). In International Conference on Learning Representations, 2020.
371
+ [110] Stanford Scanning Repository. The Stanford 3D Scanning Repository. http://graphics.stanford.edu/data/3Dscanrep/, 2021.
372
+ [111] Suggestive Contour Gallery. Suggestive Contour Gallery https://gfx.cs.princeton.edu/proj/sugcon/models/, 2021.
373
+ [112] Raphael Suter, Djordje Miladinovic, Bernhard Schölkopf, and Stefan Bauer. Robustly disentangled causal mechanisms: Validating deep representations for interventional robustness. In International Conference on Machine Learning, pages 6056–6065. PMLR, 2019.
374
+ [113] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition (CVPR), 2015.
375
+ [114] Fabian Theis. Towards a general independent subspace analysis. Advances in Neural Information Processing Systems, 19:1361–1368, 2006.
376
+ [115] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Computer Vision - ECCV 2020, volume 12356, pages 776–794. Springer, 2020.
377
+ [116] Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning,, volume 139, pages 10268–10278, 2021.
378
+ [117] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive estimation reveals topic posterior information to linear models. arXiv preprint arXiv:2003.02234, 2020.
379
+ [118] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. In Algorithmic Learning Theory, pages 1179–1206. PMLR, 2021.
380
+ [119] Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Self-supervised learning from a multi-view perspective. In International Conference on Learning Representations, 2020.
381
+ [120] Michael Tschannen, Josip Djolonga, Paul K. Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
382
+ [121] Greg Turk and Marc Levoy. Zippered polygon meshes from range images. In Dino Schweitzer, Andrew S. Glassner, and Mike Keeler, editors, Proceedings of the 21th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 1994, Orlando, FL, USA, July 24-29, 1994, pages 311–318. ACM, 1994.
383
+ [122] Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th International Conference on Machine Learning, pages 1096–1103, 2008.
384
+ [123] Julius von Kügelgen, Ivan Ustyuzhaninov, Peter Gehler, Matthias Bethge, and Bernhard Schölkopf. Towards causal generative scene models via competition of experts. In ICLR Workshop on “Causal Learning for Decision Making”, 2020.
385
+ [124] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 9929–9939. PMLR, 2020.
386
+ [125] Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In Proceedings of the IEEE International Conference on Computer Vision, pages 2794–2802, 2015.
387
+ [126] Zhirong Wu, Yuanjun Xiong, Stella X. Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Conference on Computer Vision and Pattern Recognition, CVPR, pages 3733–3742. IEEE Computer Society, 2018.
388
+ [127] Mengyue Yang, Furui Liu, Zhitang Chen, Xinwei Shen, Jianye Hao, and Jun Wang. Causalvae: Structured causal disentanglement in variational autoencoder. arXiv preprint arXiv:2004.08697, 2020.
389
+ [128] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139, pages 12310–12320, 2021.
390
+ [129] Roland S. Zimmermann, Yash Sharma, Steffen Schneider, Matthias Bethge, and Wieland Brendel. Contrastive learning inverts the data generating process. In Proceedings of the 38th International Conference on Machine Learning, volume 139, pages 12979–12990, 2021.
391
+
392
+ # Checklist
393
+
394
+ 1. For all authors...
395
+
396
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
397
+ (b) Did you describe the limitations of your work? [Yes] See the “Theory vs practice” paragraph, as well as lines 409–411 in $\ S$ .
398
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] While our work is theoretical in nature, we discuss some potential negative impacts in lines 405–409 where we caution against a naive use of data-augmentation in safety-critical domains without extensive prior study.
399
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
400
+
401
+ 2. If you are including theoretical results...
402
+
403
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] Our problem formulation is formally described in detail in $\ S \ O 3$ . All our theoretical results are accompanied by a clear and complete account of all necessary assumptions.
404
+ (b) Did you include complete proofs of all theoretical results? [Yes] Due to space constraints, and since our proofs introduce novel techniques and are nontrivial, we only sketch the high-level ideas behind our proofs in the main paper. The full proofs with detailed explanations are included in Appendix A.
405
+
406
+ 3. If you ran experiments...
407
+
408
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The Causal3DIdent dataset is included as a public URL, see the hyperlink in footnote 12. Code to reproduce our experiments is publicly available on github.
409
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Provided in Appendix D
410
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] All results presented in $\ S 5$ report the mean and standard deviation over 3 random seeds as also stated in the main paper.
411
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Provided in Appendix D
412
+
413
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
414
+
415
+ (a) If your work uses existing assets, did you cite the creators? [Yes] The 3DIdent dataset, as well as the 3D models used to extend it are cited in $\ S$ .
416
+ (b) Did you mention the license of the assets? [Yes] Provided in Appendix B
417
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] See question 3 (a): the newly-introduced Causal3DIdent dataset has been publicly released.
418
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] We did not use/curate any data from other people, see Appendix B for discussion of this point.
419
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] The data does not contain any personally identifiable information or offensive content, see Appendix B for discussion of this point.
420
+
421
+ 5. If you used crowdsourcing or conducted research with human subjects...
422
+
423
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
424
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
425
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/train/4pf_pOo0Dt/4pf_pOo0Dt_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/4pf_pOo0Dt/4pf_pOo0Dt_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/4pf_pOo0Dt/4pf_pOo0Dt_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkgEQnRqYQ/HkgEQnRqYQ.md ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ROTATE: KNOWLEDGE GRAPH EMBEDDING BY RELATIONAL ROTATION IN COMPLEX SPACE
2
+
3
+ Zhiqing Sun 1∗, Zhi-Hong Deng1, Jian-Yun Nie3, Jian Tang2,4,5
4
+
5
+ 1Peking University, China
6
+ 2Mila-Quebec Institute for Learning Algorithms, Canada
7
+ 3Universite de Montr ´ eal, Canada ´
8
+ 4HEC Montreal, Canada ´
9
+ 5CIFAR AI Research Chair
10
+ {1500012783, zhdeng}@pku.edu.cn
11
+ nie@iro.umontreal.ca
12
+ jian.tang@hec.ca
13
+
14
+ # ABSTRACT
15
+
16
+ We study the problem of learning representations of entities and relations in knowledge graphs for predicting missing links. The success of such a task heavily relies on the ability of modeling and inferring the patterns of (or between) the relations. In this paper, we present a new approach for knowledge graph embedding called RotatE, which is able to model and infer various relation patterns including: symmetry/antisymmetry, inversion, and composition. Specifically, the RotatE model defines each relation as a rotation from the source entity to the target entity in the complex vector space. In addition, we propose a novel self-adversarial negative sampling technique for efficiently and effectively training the RotatE model. Experimental results on multiple benchmark knowledge graphs show that the proposed RotatE model is not only scalable, but also able to infer and model various relation patterns and significantly outperform existing state-of-the-art models for link prediction.
17
+
18
+ # 1 INTRODUCTION
19
+
20
+ Knowledge graphs are collections of factual triplets, where each triplet $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ represents a relation r between a head entity h and a tail entity t. Examples of real-world knowledge graphs include Freebase (Bollacker et al., 2008), Yago (Suchanek et al., 2007), and WordNet (Miller, 1995). Knowledge graphs are potentially useful to a variety of applications such as question-answering (Hao et al., 2017), information retrieval (Xiong et al., 2017), recommender systems (Zhang et al., 2016), and natural language processing (Yang & Mitchell, 2017). Research on knowledge graphs is attracting growing interests in both academia and industry communities.
21
+
22
+ Since knowledge graphs are usually incomplete, a fundamental problem for knowledge graph is predicting the missing links. Recently, extensive studies have been done on learning low-dimensional representations of entities and relations for missing link prediction (a.k.a., knowledge graph embedding) (Bordes et al., 2013; Trouillon et al., 2016; Dettmers et al., 2017). These methods have been shown to be scalable and effective. The general intuition of these methods is to model and infer the connectivity patterns in knowledge graphs according to the observed knowledge facts. For example, some relations are symmetric (e.g., marriage) while others are antisymmetric (e.g., filiation); some relations are the inverse of other relations (e.g., hypernym and hyponym); and some relations may be composed by others (e.g., my mother’s husband is my father). It is critical to find ways to model and infer these patterns, i.e., symmetry/antisymmetry, inversion, and composition, from the observed facts in order to predict missing links.
23
+
24
+ Indeed, many existing approaches have been trying to either implicitly or explicitly model one or a few of the above relation patterns (Bordes et al., 2013; Wang et al., 2014; Lin et al., 2015b;
25
+
26
+ Table 1: The score functions $f _ { r } ( \mathbf { h } , \mathbf { t } )$ of several knowledge graph embedding models, where $\langle \cdot \rangle$ denotes the generalized dot product, $\circ$ denotes the Hadamard product, $\otimes$ denotes circular correlation, $\sigma$ denotes activation function and $^ *$ denotes 2D convolution. $\overline { { \cdot } }$ denotes conjugate for complex vectors, and 2D reshaping for real vectors in ConvE model. TransX represents a wide range of TransE’s variants, such as TransH (Wang et al., 2014), TransR (Lin et al., 2015b), and STransE (Nguyen et al., 2016), where $g _ { r , i } ( \cdot )$ denotes a matrix multiplication with respect to relation $\mathbf { r }$ .
27
+
28
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=2>Score Function</td></tr><tr><td rowspan=1 colspan=1>SE(Bordes et al.,2011)</td><td rowspan=1 colspan=1>-||Wr,1h-Wr,2tll</td><td rowspan=1 colspan=1>h,t ∈ R,Wr.∈ Rkxk</td></tr><tr><td rowspan=1 colspan=1>TransE (Bordes et al.,2013)</td><td rowspan=1 colspan=1>-|h+r-t|l</td><td rowspan=1 colspan=1>h,r,t∈R</td></tr><tr><td rowspan=1 colspan=1>TransX</td><td rowspan=1 colspan=1>-|lgr,1(h)+r-gr,2(t)l</td><td rowspan=1 colspan=1>h,r,t∈R</td></tr><tr><td rowspan=1 colspan=1>DistMult (Yang et al.,2014)</td><td rowspan=1 colspan=1>(r,h,t)</td><td rowspan=1 colspan=1>h,r,t∈R</td></tr><tr><td rowspan=1 colspan=1>ComplEx (Trouillon et al., 2016)</td><td rowspan=1 colspan=1>Re((r,h,t))</td><td rowspan=1 colspan=1>h,r,t∈ Ck</td></tr><tr><td rowspan=1 colspan=1>HolE (Nickel et al., 2016)</td><td rowspan=1 colspan=1>{r,ht)</td><td rowspan=1 colspan=1>h,r,t∈R</td></tr><tr><td rowspan=1 colspan=1>ConvE (Dettmers et al.,2017)</td><td rowspan=1 colspan=1>{(vec(σ([r,h] *))W),t)</td><td rowspan=1 colspan=1>h,r,t∈R</td></tr><tr><td rowspan=1 colspan=1>RotatE</td><td rowspan=1 colspan=1>-|hor-t²2</td><td rowspan=1 colspan=1>h,r,t ∈ C,ri=1</td></tr></table>
29
+
30
+ Yang et al., 2014; Trouillon et al., 2016). For example, the TransE model (Bordes et al., 2011), which represents relations as translations, aims to model the inversion and composition patterns; the DisMult model (Yang et al., 2014), which models the three-way interactions between head entities, relations, and tail entities, aims to model the symmetry pattern. However, none of existing models is capable of modeling and inferring all the above patterns. Therefore, we are looking for an approach that is able to model and infer all the three types of relation patterns.
31
+
32
+ In this paper, we propose such an approach called RotatE for knowledge graph embedding. Our motivation is from Euler’s identity $\dot { e } ^ { i \dot { \theta } } = \cos \theta + i \sin \theta$ , which indicates that a unitary complex number can be regarded as a rotation in the complex plane. Specifically, the RotatE model maps the entities and relations to the complex vector space and defines each relation as a rotation from the source entity to the target entity. Given a triplet $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ , we expect that $\mathbf { t } = \mathbf { h } \circ \mathbf { r }$ , where $\mathbf { h } , \mathbf { r } , \mathbf { t } \in \mathbb { C } ^ { k }$ are the embeddings, the modulus $| r _ { i } | = 1$ and $\circ$ denotes the Hadamard (element-wise) product. Specifically, for each dimension in the complex space, we expect that:
33
+
34
+ $$
35
+ t _ { i } = h _ { i } r _ { i } , \mathrm { ~ w h e r e ~ } h _ { i } , r _ { i } , t _ { i } \in \mathbb { C } \mathrm { ~ a n d ~ } | r _ { i } | = 1 .
36
+ $$
37
+
38
+ It turns out that such a simple operation can effectively model all the three relation patterns: symmetric/antisymmetric, inversion, and composition. For example, a relation $\mathbf { r }$ is symmetric if and only if each element of its embedding r, i.e. $r _ { i }$ , satisfies $r _ { i } = \stackrel { \textstyle - } { e } ^ { 0 / i \pi } = \pm 1$ ; two relations $\mathbf { r } _ { 1 }$ and $\mathbf { r } _ { 2 }$ are inverse if and only if their embeddings are conjugates: ${ \bf r } _ { 2 } = \bar { \bf r } _ { 1 }$ ; a relation $\mathbf { r } _ { 3 } = e ^ { i \pmb { \theta } _ { 3 } }$ is a combination of other two relations $\mathbf { r } _ { 1 } = e ^ { i \pmb { \theta } _ { 1 } }$ and $\mathbf { r } _ { 2 } = e ^ { \bar { i } \theta _ { 2 } }$ if and only if $\mathbf { r } _ { 3 } = \mathbf { r } _ { 1 } \circ \mathbf { r } _ { 2 }$ (i.e. $\pmb { \theta _ { 3 } } = \pmb { \theta _ { 1 } } + \pmb { \theta _ { 2 } } )$ . Moreover, the RotatE model is scalable to large knowledge graphs as it remains linear in both time and memory.
39
+
40
+ To effectively optimizing the RotatE, we further propose a novel self-adversarial negative sampling technique, which generates negative samples according to the current entity and relation embeddings. The proposed technique is very general and can be applied to many existing knowledge graph embedding models. We evaluate the RotatE on four large knowledge graph benchmark datasets including FB15k (Bordes et al., 2013), WN18 (Bordes et al., 2013), FB15k-237 (Toutanova & Chen, 2015) and WN18RR (Dettmers et al., 2017). Experimental results show that the RotatE model significantly outperforms existing state-of-the-art approaches. In addition, RotatE also outperforms state-of-the-art models on Countries (Bouchard et al., 2015), a benchmark explicitly designed for composition pattern inference and modeling. To the best of our knowledge, RotatE is the first model that achieves state-of-the-art performance on all the benchmarks.1
41
+
42
+ # 2 RELATED WORK
43
+
44
+ Table 2: The pattern modeling and inference abilities of several models.
45
+
46
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Score Function</td><td rowspan=1 colspan=1>Symmetry</td><td rowspan=1 colspan=1>Antisymmetry</td><td rowspan=1 colspan=1>Inversion</td><td rowspan=1 colspan=1>Composition</td></tr><tr><td rowspan=1 colspan=1>SE</td><td rowspan=1 colspan=1>1[|Wr,1h-Wr,2t|]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>-|h+r-t</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>TransX</td><td rowspan=1 colspan=1>-lgr,1(h)+r-gr,2(t)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>DistMult</td><td rowspan=1 colspan=1>(h,r,t)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>ComplEx</td><td rowspan=1 colspan=1>Re(h,r,t))</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>RotatE</td><td rowspan=1 colspan=1>-|hor-t|</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr></table>
47
+
48
+ Predicting missing links with knowledge graph embedding (KGE) methods has been extensively investigated in recent years. The general methodology is to define a score function for the triplets. Formally, let $\mathcal { E }$ denote the set of entities and $\mathcal { R }$ denote the set of relations, then a knowledge graph is a collection of factual triplets $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ , where $\mathtt { h } , \mathtt { t } \in { \mathcal { E } }$ and $\mathbf { r } \in \mathcal { R }$ . Since entity embeddings are usually represented as vectors, the score function usually takes the form $f _ { r } ( \mathbf { h } , \mathbf { t } )$ , where $\mathbf { h }$ and t are head and tail entity embeddings. The score function $f _ { r } ( \mathbf { h } , \mathbf { t } )$ measures the salience of a candidate triplet $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ . The goal of the optimization is usually to score true triplet $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ higher than the corrupted false triplets $( \mathbf { h } ^ { \prime } , \mathbf { r } , \mathtt { t } )$ or $( \mathtt { h } , \mathtt { r } , \mathtt { t } ^ { \prime } )$ . Table 1 summarizes different score functions $f _ { r } ( \mathbf { h } , \mathbf { t } )$ in previous state-of-the-art methods as well as the model proposed in this paper. These models generally capture only a portion of the relation patterns. For example, TransE represents each relation as a bijection between source entities and target entities, and thus implicitly models inversion and composition of relations, but it cannot model symmetric relations; ComplEx extends DistMult by introducing complex embeddings so as to better model asymmetric relations, but it cannot infer the composition pattern. The proposed RotatE model leverages the advantages of both.
49
+
50
+ A relevant and concurrent work to our work is the TorusE (Ebisu & Ichise, 2018) model, which defines knowledge graph embedding as translations on a compact Lie group. The TorusE model can be regarded as a special case of RotatE, where the modulus of embeddings are set fixed; our RotatE is defined on the entire complex space, which has much more representation capacity. Our experiments show that this is very critical for modeling and inferring the composition patterns. Moreover, TorusE focuses on the problem of regularization in TransE while this paper focuses on modeling and inferring multiple types of relation patterns.
51
+
52
+ There are also a large body of relational approaches for modeling the relational patterns on knowledge graphs (Lao et al., 2011; Neelakantan et al., 2015; Das et al., 2016; Rocktaschel & Riedel, ¨ 2017; Yang et al., 2017). However, these approaches mainly focus on explicitly modeling the relational paths while our proposed RotatE model implicitly learns the relation patterns, which is not only much more scalable but also provides meaningful embeddings for both entities and relations.
53
+
54
+ Another related problem is how to effectively draw negative samples for training knowledge graph embeddings. This problem has been explicitly studied by Cai & Wang (2017), which proposed a generative adversarial learning framework to draw negative samples. However, such a framework requires simultaneously training the embedding model and a discrete negative sample generator, which are difficult to optimize and also computationally expensive. We propose a self-adversarial sampling scheme which only relies on the current model. It does require any additional optimization component, which make it much more efficient.
55
+
56
+ # 3 ROTATE: RELATIONAL ROTATION IN COMPLEX VECTOR SPACE
57
+
58
+ In this section, we introduce our proposed RotatE model. We first introduce three important relation patterns that are widely studied in the literature of link prediction on knowledge graphs. Afterwards, we introduce our proposed RotatE model, which defines relations as rotations in complex vector space. We also show that the RotatE model is able to model and infer all three relation patterns.
59
+
60
+ # 3.1 MODELING AND INFERRING RELATION PATTERNS
61
+
62
+ The key of link prediction in knowledge graph is to infer the connection patterns, e.g., relation patterns, with observed facts. According to the existing literature (Trouillon et al., 2016; Toutanova & Chen, 2015; Guu et al., 2015; Lin et al., 2015a), three types of relation patterns are very important
63
+
64
+ ![](images/36f9e667c0e62fc2dfe3c15c04ce5e6c7d507abe20263f8b9fa2c24389db0139.jpg)
65
+ Figure 1: Illustrations of TransE and RotatE with only 1 dimension of embedding.
66
+
67
+ and widely spread in knowledge graphs: symmetry, inversion and composition. We give their formal definition here:
68
+
69
+ Definition 1. A relation $\mathbf { r }$ is symmetric (antisymmetric) $i f \forall \mathbf { x }$ , y
70
+
71
+ $$
72
+ \mathbf { r ( x , y ) } \Rightarrow \mathbf { r ( y , x ) } \ ( \ \mathbf { r ( x , y ) } \Rightarrow \mathbf { \lnot r ( y , x ) } \ )
73
+ $$
74
+
75
+ A clause with such form is a symmetry (antisymmetry) pattern.
76
+
77
+ Definition 2. Relation $\mathbf { r } _ { 1 }$ is inverse to relation $\mathbf { r } _ { 2 } ~ i f \forall \mathbf { x }$ , y
78
+
79
+ $$
80
+ \mathbf { r } _ { 2 } ( \mathbf { x } , \mathbf { y } ) \Rightarrow \mathbf { r } _ { 1 } ( \mathbf { y } , \mathbf { x } )
81
+ $$
82
+
83
+ A clause with such form is a inversion pattern.
84
+
85
+ Definition 3. Relation $\mathbf { r } _ { 1 }$ is composed of relation $\mathtt { r } _ { 2 }$ and relation $\mathbf { r } _ { 3 } i f \forall \mathbf { x } , \mathbf { y } , \mathbf { z }$
86
+
87
+ $$
88
+ \mathbf { r } _ { 2 } ( \mathbf { x } , \mathbf { y } ) \wedge \mathbf { r } _ { 3 } ( \mathbf { y } , z ) \Rightarrow \mathbf { r } _ { 1 } ( \mathbf { x } , z )
89
+ $$
90
+
91
+ A clause with such form is a composition pattern.
92
+
93
+ According to the definition of the above three types of relation patterns, we provide an analysis of existing models on their abilities in inferring and modeling these patterns. Specifically, we provide an analysis on TransE, TransX, DistMult, and ComplEx.3 We did not include the analysis on HolE and ConvE since HolE is equivalent to ComplEx (Hayashi & Shimbo, 2017), and ConvE is a black box that involves two-layer neural networks and convolution operations, which are hard to analyze. The results are summarized into Table 2. We can see that no existing approaches are capable of modeling all the three relation patterns.
94
+
95
+ # 3.2 MODELING RELATIONS AS ROTATIONS IN COMPLEX VECTOR SPACE
96
+
97
+ In this part, we introduce our proposed model that is able to model and infer all the three types of relation patterns. Inspired by Euler’s identity, we map the head and tail entities ${ \mathtt { h } } , { \mathtt { t } }$ to the complex embeddings, i.e., $\mathbf { h } , \bar { \mathbf { t } } \in \mathbb { C } ^ { k }$ ; then we define the functional mapping induced by each relation $\mathbf { r }$ as an element-wise rotation from the head entity $\mathbf { h }$ to the tail entity $\mathbf { t }$ . In other words, given a triple $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ , we expect that:
98
+
99
+ $$
100
+ \mathbf { t } = \mathbf { h } \circ \mathbf { r } , ~ \mathrm { w h e r e } ~ | r _ { i } | = 1 ,
101
+ $$
102
+
103
+ and $\circ$ is the Hadmard (or element-wise) product. Specifically, for each element in the embeddings, we have $t _ { i } ~ = ~ h _ { i } r _ { i }$ . Here, we constrain the modulus of each element of $\mathbf { r } \in \mathbb { C } ^ { k }$ , i.e., $r _ { i } ~ \in \ \mathbb { C }$ , to be $| r _ { i } | = 1$ . By doing this, $r _ { i }$ is of the form $e ^ { i \theta _ { r , i } }$ , which corresponds to a counterclockwise rotation by $\theta _ { r , i }$ radians about the origin of the complex plane, and only affects the phases of the entity embeddings in the complex vector space. We refer to the proposed model as RotatE due to its rotational nature. According to the above definition, for each triple $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ , we define the distance function of RotatE as:
104
+
105
+ $$
106
+ d _ { r } ( \mathbf { h , t } ) = \| \mathbf { h } \circ \mathbf { r - t } \|
107
+ $$
108
+
109
+ By defining each relation as a rotation in the complex vector spaces, RotatE can model and infer all the three types of relation patterns introduced above. Formally, we have following results4:
110
+
111
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>#entity</td><td rowspan=1 colspan=1>#relation</td><td rowspan=1 colspan=1>#training</td><td rowspan=1 colspan=1>#validation</td><td rowspan=1 colspan=1>#test</td></tr><tr><td rowspan=1 colspan=1>FB15k</td><td rowspan=1 colspan=1>14,951</td><td rowspan=1 colspan=1>1,345</td><td rowspan=1 colspan=1>483,142</td><td rowspan=1 colspan=1>50,000</td><td rowspan=1 colspan=1>59,071</td></tr><tr><td rowspan=1 colspan=1>WN18</td><td rowspan=1 colspan=1>40,943</td><td rowspan=1 colspan=1>18</td><td rowspan=1 colspan=1>141,442</td><td rowspan=1 colspan=1>5,000</td><td rowspan=1 colspan=1>5,000</td></tr><tr><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>14,541</td><td rowspan=1 colspan=1>237</td><td rowspan=1 colspan=1>272,115</td><td rowspan=1 colspan=1>17,535</td><td rowspan=1 colspan=1>20,466</td></tr><tr><td rowspan=1 colspan=1>WN18RR</td><td rowspan=1 colspan=1>40,943</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>86.835</td><td rowspan=1 colspan=1>3,034</td><td rowspan=1 colspan=1>3,134</td></tr></table>
112
+
113
+ Table 3: Number of entities, relations, and observed triples in each split for four benchmarks.
114
+
115
+ Lemma 1. RotatE can infer the symmetry/antisymmetry pattern. (See proof in Appendix B)
116
+
117
+ Lemma 2. RotatE can infer the inversion pattern. (See proof in Appendix C)
118
+
119
+ Lemma 3. RotatE can infer the composition pattern. (See proof in Appendix D)
120
+
121
+ These results are also summarized into Table 2. We can see that the RotatE model is the only model that can model and infer all the three types of relation patterns.
122
+
123
+ Connection to TransE. From Table 2, we can see that TransE is able to infer and model all the other relation patterns except the symmetry pattern. The reason is that in TransE, any symmetric relation will be represented by a 0 translation vector. As a result, this will push the entities with symmetric relations to be close to each other in the embedding space. RotatE solves this problem and is a able to model and infer the symmetry pattern. An arbitrary vector r that satisfies $r _ { i } = \pm 1$ can be used for representing a symmetric relation in RotatE, and thus the entities having symmetric relations can be distinguished. Different symmetric relations can be also represented with different embedding vectors. Figure 1 provides illustrations of TransE and RotatE with only 1-dimensional embedding and shows how RotatE models a symmetric relation.
124
+
125
+ # 3.3 OPTIMIZATION
126
+
127
+ Negative sampling has been proved quite effective for both learning knowledge graph embedding (Trouillon et al., 2016) and word embedding (Mikolov et al., 2013). Here we use a loss function similar to the negative sampling loss (Mikolov et al., 2013) for effectively optimizing distance-based models:
128
+
129
+ $$
130
+ L = - \log \sigma ( \gamma - d _ { r } ( { \bf h , t } ) ) - \sum _ { i = 1 } ^ { n } \frac { 1 } { k } \log \sigma ( d _ { r } ( { \bf h } _ { i } ^ { \prime } , { \bf t } _ { i } ^ { \prime } ) - \gamma ) ,
131
+ $$
132
+
133
+ where $\gamma$ is a fixed margin, $\sigma$ is the sigmoid function, and $( \mathtt { h } _ { i } ^ { \prime } , \mathtt { r } , \mathtt { t } _ { i } ^ { \prime } )$ is the $i$ -th negative triplet.
134
+
135
+ We also propose a new approach for drawing negative samples. The negative sampling loss samples the negative triplets in a uniform way. Such a uniform negative sampling suffers the problem of inefficiency since many samples are obviously false as training goes on, which does not provide any meaningful information. Therefore, we propose an approach called self-adversarial negative sampling, which samples negative triples according to the current embedding model. Specifically, we sample negative triples from the following distribution:
136
+
137
+ $$
138
+ p ( h _ { j } ^ { \prime } , r , t _ { j } ^ { \prime } | \{ ( h _ { i } , r _ { i } , t _ { i } ) \} ) = \frac { \exp { \alpha f _ { r } ( \mathbf { h } _ { j } ^ { \prime } , \mathbf { t } _ { j } ^ { \prime } ) } } { \sum _ { i } \exp { \alpha f _ { r } ( \mathbf { h } _ { i } ^ { \prime } , \mathbf { t } _ { i } ^ { \prime } ) } }
139
+ $$
140
+
141
+ where $\alpha$ is the temperature of sampling. Moreover, since the sampling procedure may be costly, we treat the above probability as the weight of the negative sample. Therefore, the final negative sampling loss with self-adversarial training takes the following form:
142
+
143
+ $$
144
+ L = - \log \sigma ( \gamma - d _ { r } ( { \bf h , t } ) ) - \sum _ { i = 1 } ^ { n } p ( h _ { i } ^ { \prime } , r , t _ { i } ^ { \prime } ) \log \sigma ( d _ { r } ( { \bf h } _ { i } ^ { \prime } , { \bf t } _ { i } ^ { \prime } ) - \gamma )
145
+ $$
146
+
147
+ In the experiments, we will compare different approaches for negative sampling.
148
+
149
+ # 4 EXPERIMENTS
150
+
151
+ # 4.1 EXPERIMENTAL SETTING
152
+
153
+ We evaluate our proposed model on four widely used knowledge graphs. The statistics of these knowledge graphs are summarized into Table 3.
154
+
155
+ • FB15k (Bordes et al., 2013) is a subset of Freebase (Bollacker et al., 2008), a large-scale knowledge graph containing general knowledge facts. Toutanova & Chen (2015) showed that almost $8 1 \%$ of the test triplets $\left( \mathbf { x } , \mathbf { r } , \mathbf { y } \right)$ can be inferred via a directly linked triplet $( \mathbf { x } , \mathbf { r } ^ { \prime } , \mathbf { y } )$ or $\bigl ( \boldsymbol { \mathbf { y } } , \boldsymbol { \mathbf { r } } ^ { \prime } , \boldsymbol { \mathbf { x } } \bigr )$ . Therefore, the key of link prediction on FB15k is to model and infer the symmetry/antisymmetry and inversion patterns. WN18 (Bordes et al., 2013) is a subset of WordNet (Miller, 1995), a database featuring lexical relations between words. This dataset also has many inverse relations. So the main relation patterns in WN18 are also symmetry/antisymmetry and inversion.
156
+ FB15k-237 (Toutanova & Chen, 2015) is a subset of FB15k, where inverse relations are deleted. Therefore, the key of link prediction on FB15k-237 boils down to model and infer the symmetry/antisymmetry and composition patterns. WN18RR (Dettmers et al., 2017) is a subset of WN18. The inverse relations are deleted, and the main relation patterns are symmetry/antisymmetry and composition.
157
+
158
+ Hyperparameter Settings. We use Adam (Kingma & Ba, 2014) as the optimizer and fine-tune the hyperparameters on the validation dataset. The ranges of the hyperparameters for the grid search are set as follows: embedding dimension5 $k \in \{ 1 2 5 , 2 5 0 , 5 0 0 , 1 0 0 0 \}$ , batch size $b \in \{ 5 1 2 , 1 0 2 4 , 2 0 4 8 \}$ , self-adversarial sampling temperature $\alpha \in \{ 0 . 5 , 1 . 0 \}$ , and fixed margin $\gamma \in \{ 3 , 6 , 9 , 1 2 , 1 8 , 2 4 , 3 0 \}$ . Both the real and imaginary parts of the entity embeddings are uniformly initialized, and the phases of the relation embeddings are uniformly initialized between 0 and $2 \pi$ . No regularization is used since we find that the fixed margin $\gamma$ could prevent our model from over-fitting.
159
+
160
+ Evaluation Settings. We evaluate the performance of link prediction in the filtered setting: we rank test triples against all other candidate triples not appearing in the training, validation, or test set, where candidates are generated by corrupting subjects or objects: $( \mathbf { h } ^ { \prime } , \mathbf { r } , \mathtt { t } ) \bar { }$ or $( \mathbf { h } , \mathbf { r } , \mathbf { t } ^ { \prime } )$ . Mean Rank (MR), Mean Reciprocal Rank (MRR) and Hits at $\mathrm { ~ N ~ } ( \mathrm { H } @ \mathrm { N } )$ are standard evaluation measures for these datasets and are evaluated in our experiments.
161
+
162
+ Baseline. Apart from RotatE, we propose a variant of RotatE as baseline, where the modulus of the entity embeddings are also constrained: $| h _ { i } | = | t _ { i } | = C$ , and the distance function is thus $\begin{array} { r } { 2 C \left| \left| \sin \frac { \cdot } { } \frac { \cdot } { 2 } \cdot \mathbf { \sigma } \right| \right| } \end{array}$ (See Equation 17 at Appendix F for a detailed derivation). In this way, we can investigate how RotatE works without modulus information and with only phase information. We refer to the baseline as pRotatE. It is obvious to see that pRotatE can also model and infer all the three relation patterns.
163
+
164
+ # 4.2 MAIN RESULTS
165
+
166
+ We compare RotatE to several state-of-the-art models, including TransE (Bordes et al., 2013), DistMult (Yang et al., 2014), ComplEx (Trouillon et al., 2016), HolE (Nickel et al., 2016), and ConvE (Dettmers et al., 2017), as well as our baseline model pRotatE, to empirically show the importance of modeling and inferring the relation patterns for the task of predicting missing links.
167
+
168
+ Table 4 summarizes our results on $\mathrm { F B } 1 5 \mathrm { k }$ and WN18. We can see that RotatE outperforms all the state-of-the-art models. The performance of pRotatE and RotatE are similar on these two datasets. Table 5 summarizes our results on FB15k-237 and WN18RR, where the improvement is much more significant. The difference between RotatE and pRotatE is much larger on FB15k-237 and
169
+
170
+ <table><tr><td rowspan="2"></td><td colspan="5">FB15k</td><td colspan="5">WN18</td></tr><tr><td>MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>TransE[]</td><td>-</td><td>.463</td><td>.297</td><td>.578</td><td>.749</td><td>-</td><td>.495</td><td>.113</td><td>.888</td><td>.943</td></tr><tr><td>DistMult []</td><td>42</td><td>.798</td><td>-</td><td>-</td><td>.893</td><td>655</td><td>.797</td><td>-</td><td>-</td><td>.946</td></tr><tr><td>HolE</td><td>-</td><td>.524</td><td>.402</td><td>.613</td><td>.739</td><td>-</td><td>.938</td><td>.930</td><td>.945</td><td>.949</td></tr><tr><td>ComplEx</td><td>-</td><td>.692</td><td>.599</td><td>.759</td><td>.840</td><td>-</td><td>.941</td><td>.936</td><td>.945</td><td>.947</td></tr><tr><td>ConvE</td><td>51</td><td>.657</td><td>.558</td><td>.723</td><td>.831</td><td>374</td><td>.943</td><td>.935</td><td>.946</td><td>.956</td></tr><tr><td>pRotatE</td><td>43</td><td>.799</td><td>.750</td><td>.829</td><td>.884</td><td>254</td><td>.947</td><td>.942</td><td>.950</td><td>.957</td></tr><tr><td>RotatE</td><td>40</td><td>.797</td><td>.746</td><td>.830</td><td>.884</td><td>309</td><td>.949</td><td>.944</td><td>.952</td><td>.959</td></tr></table>
171
+
172
+ Table 4: Results of several models evaluated on the FB15K and WN18 datasets. Results of $[ \pmb { \big \langle } \pmb { \big \rangle } ]$ are taken from (Nickel et al., 2016) and results of $[ \bullet ]$ are taken from (Kadlec et al., 2017). Other results are taken from the corresponding original papers.
173
+
174
+ Table 5: Results of several models evaluated on the FB15k-237 and WN18RR datasets. Results of $[ \pmb { \big \vert } \pmb { \big \vert } \pmb { \big \vert } ]$ are taken from (Nguyen et al., 2017). Other results are taken from (Dettmers et al., 2017).
175
+
176
+ <table><tr><td rowspan="2"></td><td colspan="4">FB15k-237</td><td rowspan="2">WN18RR</td><td colspan="5"></td></tr><tr><td>MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10 MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>TransE[]</td><td>357</td><td>.294</td><td>-</td><td>-</td><td>.465</td><td>3384</td><td>.226</td><td>-</td><td>-</td><td>.501</td></tr><tr><td>DistMult</td><td>254</td><td>.241</td><td>.155</td><td>.263</td><td>.419</td><td>5110</td><td>.43</td><td>.39</td><td>.44</td><td>.49</td></tr><tr><td>ComplEx</td><td>339</td><td>.247</td><td>.158</td><td>.275</td><td>.428</td><td>5261</td><td>.44</td><td>.41</td><td>.46</td><td>.51</td></tr><tr><td>ConvE</td><td>244</td><td>.325</td><td>.237</td><td>.356</td><td>.501</td><td>4187</td><td>.43</td><td>.40</td><td>.44</td><td>.52</td></tr><tr><td>pRotatE</td><td>178</td><td>.328</td><td>.230</td><td>.365</td><td>.524</td><td>2923</td><td>.462</td><td>.417</td><td>.479</td><td>.552</td></tr><tr><td>RotatE</td><td>177</td><td>.338</td><td>.241</td><td>.375</td><td>.533</td><td>3340</td><td>.476</td><td>.428</td><td>.492</td><td>.571</td></tr></table>
177
+
178
+ WN18RR, where there are a lot of composition patterns. This indicates that modulus is very important for modeling and inferring the composition pattern.
179
+
180
+ Moreover, the performance of these models on different datasets is consistent with our analysis on the three relation patterns (Table 2):
181
+
182
+ • On FB15K, the main relation patterns are symmetry/antisymmetry and inversion. We can see that ComplEx performs well while TransE does not perform well since ComplEx can infer both symmetry/antisymmetry and inversion patterns while TransE cannot infer symmetry pattern. Surprisingly, DistMult achieves good performance on this dataset although it cannot model the antisymmetry and inversion patterns. The reason is that for most of the relations in FB15K, the types of head entities and tail entities are different. Although DistMult gives the same score to a true triplet $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ and its opposition triplet $( \mathtt { t } , \mathtt { r } , \mathtt { h } )$ , $( \mathtt { t } , \mathtt { r } , \mathtt { h } )$ is usually impossible to be valid since the entity type of $t$ does not match the head entity type of h. For example, DistMult assigns the same score to (Obama, nationality, USA) and (USA, nationality, Obama). But (USA, nationality, Obama) can be simply predicted as false since USA cannot be the head entity of the relation nationality.
183
+
184
+ • On WN18, the main relation patterns are also symmetry/antisymmetry and inversion. As expected, ComplEx still performs very well on this dataset. However, different from the results on FB15K, the performance of DistMult significantly decreases on WN18. The reason is that DistMult cannot model antisymmetry and inversion patterns, and almost all the entities in WN18 are words and belong to the same entity type, which do not have the same problem as FB15K.
185
+
186
+ • On FB15k-237, the main relation pattern is composition. We can see that TransE performs really well while ComplEx does not perform well. The reason is that, as discussed before, TransE is able to infer the composition pattern while ComplEx cannot infer the composition pattern.
187
+
188
+ • On WN18RR, one of the main relation patterns is the symmetry pattern since almost each word has a symmetric relation in WN18RR, e.g., also see and similar to. TransE does not well on this dataset since it is not able to model the symmetric relations.
189
+
190
+ Table 6: Results on the Countries datasets. Other results are taken from (Dettmers et al., 2017).
191
+
192
+ <table><tr><td rowspan="2"></td><td colspan="4">Countries (AUC-PR)</td></tr><tr><td>DistMult</td><td>ComplEx</td><td>ConvE</td><td>RotatE</td></tr><tr><td>S1</td><td>1.00±0.00</td><td>0.97±0.02</td><td>1.00±0.00</td><td>1.00±0.00</td></tr><tr><td></td><td>0.72 ± 0.12</td><td>0.57±0.10</td><td>0.99 ± 0.01</td><td>1.00 ± 0.00</td></tr><tr><td>S3</td><td>0.52 ± 0.07</td><td>0.43± 0.07</td><td>0.86 ± 0.05</td><td>0.95 ± 0.00</td></tr></table>
193
+
194
+ ![](images/a29a8dbb9c8ab66948e42cf38f38b32b476c4453af1302e451604e159c739ff6.jpg)
195
+ Figure 2: Histograms of relation embedding phases $\{ \theta _ { r , i } \}$ $( r _ { i } = e ^ { i \theta _ { r , i } }$ ), where $\mathbf { f } \circ \mathbf { r } _ { 1 }$ represents relation award nominee/award nominations./award/award nomination/nominated for, winner represents relation award category/winners./award/award honor/award winner and $\tt f o r _ { 2 }$ represents award category/nominees./award/award nomination/nominated for. The symmetry, inversion and composition pattern is represented in Figure 2a, 2c and $2 \mathrm { g } .$ , respectively.
196
+
197
+ # 4.3 INFERRING RELATION PATTERNS ON COUNTRIES DATASET
198
+
199
+ We also evaluate our model on the Countries dataset (Bouchard et al., 2015; Nickel et al., 2016), which is carefully designed to explicitly test the capabilities of the link prediction models for composition pattern modeling and inferring. It contains 2 relations and 272 entities (244 countries, 5 regions and 23 subregions). Unlike link prediction on general knowledge graphs, the queries in Countries are of the form locatedIn $( \mathsf { c } , ? )$ , and the answer is one of the five regions. The Countries dataset has 3 tasks, each requiring inferring a composition pattern with increasing length and difficulty. For example, task S2 requires inferring a relatively simpler composition pattern:
200
+
201
+ $$
202
+ \mathtt { n e i g h b o r 0 f } ( \mathtt { c } _ { 1 } , \mathtt { c } _ { 2 } ) \wedge \mathtt { l o c a t e d I n } ( \mathtt { c } _ { 2 } , \mathtt { r } ) \Rightarrow \mathtt { l o c a t e d I n } ( \mathtt { c } _ { 1 } , \mathtt { r } ) ,
203
+ $$
204
+
205
+ while task S3 requires inferring the most complex composition pattern:
206
+
207
+ $$
208
+ \mathbf { n e i g h b o r 0 f } ( \mathbf { c } _ { 1 } , \mathbf { c } _ { 2 } ) \wedge \mathbf { l o c a t e d I n } ( \mathbf { c } _ { 2 } , \mathbf { s } ) \wedge \mathbf { l o c a t e d I n } ( \mathbf { s } , \mathbf { r } ) \Rightarrow \mathbf { l o c a t e d I n } ( \mathbf { c } _ { 1 } , \mathbf { r } ) .
209
+ $$
210
+
211
+ In Table 6, we report the results with respect to the AUC-PR metric, which is commonly used in the literature. We can see that RotatE outperforms all the previous models. The performance of RotatE is significantly better than other methods on S3, which is the most difficult task.
212
+
213
+ # 4.4 IMPLICIT RELATION PATTERN INFERENCE
214
+
215
+ In this section, we verify whether the relation patterns are implicitly represented by RotatE relation embeddings. We ignore the specific positions in the relation embedding $\theta _ { r }$ and plot the histogram of the phase of each element in the relation embedding, i.e., $\{ \theta _ { r , i } \}$ .
216
+
217
+ Symmetry pattern requires the symmetric relations to have property $\mathbf r \circ \mathbf r = 1$ , and the solution is $r _ { i } = \pm 1$ . We investigate the relation embeddings from a 500-dimensional RotatE trained on WN18. Figure 2a gives the histogram of the embedding phases of a symmetric relation similar to. We can find that the embedding phases are either $\pi$ $\ r _ { i } = - 1 $ ) or $0 , 2 \pi$ $( r _ { i } = 1 )$ ). It indicates that the RotatE
218
+
219
+ Table 7: TransE with different negative sampling techniques. The results in first 2 rows are taken from (Cai & Wang, 2017), where KBGAN uses a ComplEx negative sample generator.
220
+
221
+ <table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>WN18RR</td><td rowspan=1 colspan=1>WN18</td></tr><tr><td rowspan=1 colspan=1>MRR H@10</td><td rowspan=1 colspan=1>MRR H@10</td><td rowspan=1 colspan=1>MRR H@10</td></tr><tr><td rowspan=1 colspan=1>uniform</td><td rowspan=1 colspan=1>.242 .422</td><td rowspan=1 colspan=1>.186 .459</td><td rowspan=1 colspan=1>.433 .915</td></tr><tr><td rowspan=1 colspan=1>KBGAN (Cai &amp; Wang,2017)</td><td rowspan=1 colspan=1>.278 .453</td><td rowspan=1 colspan=1>.210 .479</td><td rowspan=1 colspan=1>.705 .949</td></tr><tr><td rowspan=1 colspan=1>self-adversarial</td><td rowspan=1 colspan=1>.298 .475</td><td rowspan=1 colspan=1>.223 .510</td><td rowspan=1 colspan=1>.736 .947</td></tr></table>
222
+
223
+ <table><tr><td rowspan="2"></td><td colspan="2">FB15k</td><td colspan="2">FB15k-237</td><td colspan="2">Countries (AUC-ROC)</td></tr><tr><td>MRR</td><td>H@10</td><td>MRR H@10</td><td>S1</td><td>S2</td><td>S3</td></tr><tr><td>TransE</td><td>.735</td><td>.871</td><td>.332 .531</td><td>1.00 ± 0.00</td><td>1.00 ± 0.00</td><td>0.96 ± 0.00</td></tr><tr><td>ComplEx</td><td>.780</td><td>.890</td><td>.319 .509</td><td>1.00 ± 0.00</td><td>0.98 ±0.00</td><td>0.88 ±0.01</td></tr><tr><td>RotatE</td><td>.797</td><td>.884</td><td>.338 .533</td><td>1.00 ± 0.00</td><td>1.00 ± 0.00</td><td>0.95 ± 0.00</td></tr></table>
224
+
225
+ Table 8: Results of TransE and ComplEx with self-adversarial sampling and negative sampling loss on FB15k, FB15k-237 and Countries datasets.
226
+
227
+ model does infer and model the symmetry pattern. Figure 2b is the histogram of relation hypernym, which shows that the embedding of a general relation does not have such a $\pm 1$ pattern.
228
+
229
+ Inversion pattern requires the embeddings of a pair of inverse relations to be conjugate. We use the same RotatE model trained on WN18 for an analysis. Figure 2c illustrates the element-wise addition of the embedding phases from relation $\mathbf { r } _ { 1 } =$ hypernym and its inversed relation $\mathbf { r } _ { 2 } =$ hyponym. All the additive embedding phases are 0 or $2 \pi$ , which represents that $\mathbf { r } _ { 1 } = \mathbf { r } _ { 2 } ^ { - 1 }$ . This case shows that the inversion pattern is also inferred and modeled in the RotatE model.
230
+
231
+ Composition pattern requires the embedding phases of the composed relation to be the addition of the other two relations. Since there is no significant composition pattern in WN18, we study the inference of the composition patterns on FB15k-237, where a 1000-dimensional RotatE is trained. Figure $2 \mathrm { d } - 2 \mathrm { g }$ illustrate such a $\mathbf { r } _ { 1 } = \mathbf { r } _ { 2 } \circ \mathbf { r } _ { 3 }$ case, where $\theta _ { 2 , i } + \theta _ { 3 , i } = \theta _ { 1 , i }$ or $\theta _ { 2 , i } + \theta _ { 3 , i } = \theta _ { 1 , i } + 2 \pi$ .
232
+
233
+ More results of implicitly inferring basic patterns are presented in the appendix.
234
+
235
+ # 4.5 COMPARING DIFFERENT NEGATIVE SAMPLING TECHNIQUES
236
+
237
+ In this part, we compare different negative sampling techniques including uniform sampling, our proposed self-adversarial technique, and the KBGAN model (Cai & Wang, 2017), which aims to optimize a generative adversarial network to generate the negative samples. We re-implement a 50- dimension TransE model with the margin-based ranking criterion that was used in (Cai & Wang, 2017), and evaluate its performance on FB15k-237, WN18RR and WN18 with self-adversarial negative sampling. Table 7 summarizes our results. We can see that self-adversarial sampling is the most effective negative sampling technique.
238
+
239
+ # 4.6 FURTHER EXPERIMENTS ON TRANSE AND COMPLEX
240
+
241
+ One may argue that the contribution of RotatE comes from the self-adversarial negative sampling technique. In this part, we conduct further experiments on TransE and ComplEx in the same setting as RotatE to make a fair comparison among the three models. Table 8 shows the results of TransE and ComplEx trained with the self-adversarial negative sampling technique on $\mathrm { F B } 1 5 \mathrm { k }$ and $\operatorname { F B } 1 5 \mathrm { k } .$ - 237 datasets, where a large number of relations are available. In addition, we evaluate these three models on the Countries dataset, which explicitly requires inferring the composition pattern. We also provide a detailed ablation study on TransE and RotatE in the appendix.
242
+
243
+ From Table 8, we can see that similar results are observed as Table 4 and 5. The RotatE model achieves the best performance on both FB15k and FB15k-237, as it is able to model all the three relation patterns. The TransE model does not work well on the FB15k datasets, which requires modeling the symmetric pattern; the ComplEx model does not work well on $\mathrm { F B } 1 5 \mathrm { k } { - } 2 3 7$ , which requires modeling the composition pattern. The results on the Countries dataset are a little bit different, where the TransE model slightly outperforms RoateE on the S3 task. The reason is that the Countries datasets do not have the symmetric relation between different regions, and all the three tasks in the Countries datasets only require inferring the region for a given city. Therefore, the TransE model does not suffer from its inability of modeling symmetric relations. For ComplEx, we can see that it does not perform well on Countries since it cannot infer the composition pattern.
244
+
245
+ Table 9: Experimental results on FB15k by relation category. The first three rows are taken from (He et al., 2015). The rest of the results are from RotatE trained with the self-adversarial negative sampling technique.
246
+
247
+ <table><tr><td rowspan=1 colspan=1>Relation Category</td><td rowspan=1 colspan=1>1-to-1</td><td rowspan=1 colspan=1>1-to-N</td><td rowspan=1 colspan=1>N-to-1</td><td rowspan=1 colspan=1>N-to-N</td><td rowspan=1 colspan=1>1-to-1</td><td rowspan=1 colspan=1>1-to-N</td><td rowspan=1 colspan=1>N-to-1</td><td rowspan=1 colspan=1>N-to-N</td></tr><tr><td rowspan=1 colspan=1>Tasks</td><td rowspan=1 colspan=4>Prediction Head (Hits@10)</td><td rowspan=1 colspan=2>Prediction</td><td rowspan=1 colspan=2>Tail (Hits@10)</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>.437</td><td rowspan=1 colspan=1>.657</td><td rowspan=1 colspan=1>.182</td><td rowspan=1 colspan=1>.472</td><td rowspan=1 colspan=1>.437</td><td rowspan=1 colspan=1>.197</td><td rowspan=1 colspan=1>.667</td><td rowspan=1 colspan=1>.500</td></tr><tr><td rowspan=1 colspan=1>TransH (bern)</td><td rowspan=1 colspan=1>.668</td><td rowspan=1 colspan=1>.876</td><td rowspan=1 colspan=1>.287</td><td rowspan=1 colspan=1>.645</td><td rowspan=1 colspan=1>.655</td><td rowspan=1 colspan=1>.398</td><td rowspan=1 colspan=1>.833</td><td rowspan=1 colspan=1>.672</td></tr><tr><td rowspan=1 colspan=1>KG2E_KL (bern)</td><td rowspan=1 colspan=1>.923</td><td rowspan=1 colspan=1>.946</td><td rowspan=1 colspan=1>.660</td><td rowspan=1 colspan=1>.696</td><td rowspan=1 colspan=1>.926</td><td rowspan=1 colspan=1>.679</td><td rowspan=1 colspan=1>.944</td><td rowspan=1 colspan=1>.734</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>.894</td><td rowspan=1 colspan=1>.972</td><td rowspan=1 colspan=1>.567</td><td rowspan=1 colspan=1>.880</td><td rowspan=1 colspan=1>.879</td><td rowspan=1 colspan=1>.671</td><td rowspan=1 colspan=1>.964</td><td rowspan=1 colspan=1>.910</td></tr><tr><td rowspan=1 colspan=1>ComplEx</td><td rowspan=1 colspan=1>.939</td><td rowspan=1 colspan=1>.969</td><td rowspan=1 colspan=1>.692</td><td rowspan=1 colspan=1>.893</td><td rowspan=1 colspan=1>.938</td><td rowspan=1 colspan=1>.823</td><td rowspan=1 colspan=1>.952</td><td rowspan=1 colspan=1>.910</td></tr><tr><td rowspan=1 colspan=1>RotatE</td><td rowspan=1 colspan=1>.922</td><td rowspan=1 colspan=1>.967</td><td rowspan=1 colspan=1>.602</td><td rowspan=1 colspan=1>.893</td><td rowspan=1 colspan=1>.923</td><td rowspan=1 colspan=1>.713</td><td rowspan=1 colspan=1>.961</td><td rowspan=1 colspan=1>.922</td></tr><tr><td rowspan=1 colspan=1>Tasks</td><td rowspan=1 colspan=2>Prediction]</td><td rowspan=1 colspan=2>Head(MRR)</td><td rowspan=1 colspan=4>Prediction Tail (MRR)</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>.701</td><td rowspan=1 colspan=1>.912</td><td rowspan=1 colspan=1>.424</td><td rowspan=1 colspan=1>.737</td><td rowspan=1 colspan=1>.701</td><td rowspan=1 colspan=1>.561</td><td rowspan=1 colspan=1>.894</td><td rowspan=1 colspan=1>.761</td></tr><tr><td rowspan=1 colspan=1>ComplEx</td><td rowspan=1 colspan=1>.832</td><td rowspan=1 colspan=1>.914</td><td rowspan=1 colspan=1>.543</td><td rowspan=1 colspan=1>.787</td><td rowspan=1 colspan=1>.826</td><td rowspan=1 colspan=1>.661</td><td rowspan=1 colspan=1>.869</td><td rowspan=1 colspan=1>.800</td></tr><tr><td rowspan=1 colspan=1>RotatE</td><td rowspan=1 colspan=1>.878</td><td rowspan=1 colspan=1>.934</td><td rowspan=1 colspan=1>.465</td><td rowspan=1 colspan=1>.803</td><td rowspan=1 colspan=1>.872</td><td rowspan=1 colspan=1>.611</td><td rowspan=1 colspan=1>.909</td><td rowspan=1 colspan=1>.832</td></tr></table>
248
+
249
+ # 4.7 EXPERIMENTAL RESULTS ON FB15K BY RELATION CATEGORY
250
+
251
+ We also did some further investigation on the performance of RotatE on different relation categories: one-to-many, many-to-one, and many-to-many relations6. The results of RotatE on different relation categories on the data set FB15k are summarized into Table 9. We also compare an additional approach KG2E KL (He et al., 2015), which is a probabilistic framework for knowledge graph embedding methods and aims to model the uncertainties of the entities and relations in knowledge graphs with the TransE model. We also summarize the statistics of different relation categories into Table 10 in the appendix.
252
+
253
+ We can see that besides the one-to-one relation, the RotatE model also performs quite well on the non-injective relations, especially on many-to-many relations. We also notice that the probabilistic framework KG2E KL(bern) (He et al., 2015) is quite powerful, which consistently outperforms its corresponding knowledge graph embedding model, showing the importance of modeling the uncertainties in knowledge graphs. We leave the work of modeling the uncertainties in knowledge graphs with RotatE as our future work.
254
+
255
+ # 5 CONCLUSION
256
+
257
+ We have proposed a new knowledge graph embedding method called RotatE, which represents entities as complex vectors and relations as rotations in complex vector space. In addition, we propose a novel self-adversarial negative sampling technique for efficiently and effectively training the RotatE model. Our experimental results show that the RotatE model outperforms all existing state-of-theart models on four large-scale benchmarks. Moreover, RotatE also achieves state-of-the-art results on a benchmark that is explicitly designed for composition pattern inference and modeling. A deep investigation into RotatE relation embeddings shows that the three relation patterns are implicitly represented in the relation embeddings. In the future, we plan to evaluate the RotatE model on more datasets and leverage a probabilistic framework to model the uncertainties of entities and relations.
258
+
259
+ # REFERENCES
260
+
261
+ Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pp. 1247–1250. AcM, 2008.
262
+
263
+ Antoine Bordes, Jason Weston, Ronan Collobert, Yoshua Bengio, et al. Learning structured embeddings of knowledge bases. In AAAI, volume 6, pp. 6, 2011.
264
+
265
+ Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
266
+
267
+ Guillaume Bouchard, Sameer Singh, and Theo Trouillon. On approximate reasoning capabilities of low-rank vector spaces. AAAI Spring Syposium on Knowledge Representation and Reasoning (KRR): Integrating Symbolic and Neural Approaches, 2015.
268
+
269
+ Liwei Cai and William Yang Wang. Kbgan: Adversarial learning for knowledge graph embeddings. arXiv preprint arXiv:1711.04071, 2017.
270
+
271
+ Rajarshi Das, Arvind Neelakantan, David Belanger, and Andrew McCallum. Chains of reasoning over entities, relations, and text using recurrent neural networks. arXiv preprint arXiv:1607.01426, 2016.
272
+
273
+ Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. arXiv preprint arXiv:1707.01476, 2017.
274
+
275
+ Takuma Ebisu and Ryutaro Ichise. Toruse: Knowledge graph embedding on a lie group. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, pp. 1819–1826. AAAI Press, 2018.
276
+
277
+ Kelvin Guu, John Miller, and Percy Liang. Traversing knowledge graphs in vector space. arXiv preprint arXiv:1506.01094, 2015.
278
+
279
+ Yanchao Hao, Yuanzhe Zhang, Kang Liu, Shizhu He, Zhanyi Liu, Hua Wu, and Jun Zhao. An endto-end model for question answering over knowledge base with cross-attention combining global knowledge. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 221–231, 2017.
280
+
281
+ Katsuhiko Hayashi and Masashi Shimbo. On the equivalence of holographic and complex embeddings for link prediction. arXiv preprint arXiv:1702.05563, 2017.
282
+
283
+ Shizhu He, Kang Liu, Guoliang Ji, and Jun Zhao. Learning to represent knowledge graphs with gaussian embedding. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 623–632. ACM, 2015.
284
+
285
+ Rudolf Kadlec, Ondrej Bajgar, and Jan Kleindienst. Knowledge base completion: Baselines strike back. arXiv preprint arXiv:1705.10744, 2017.
286
+
287
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
288
+
289
+ Ni Lao, Tom Mitchell, and William W Cohen. Random walk inference and learning in a large scale knowledge base. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp. 529–539. Association for Computational Linguistics, 2011.
290
+
291
+ Yankai Lin, Zhiyuan Liu, Huanbo Luan, Maosong Sun, Siwei Rao, and Song Liu. Modeling relation paths for representation learning of knowledge bases. arXiv preprint arXiv:1506.00379, 2015a.
292
+
293
+ Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI, volume 15, pp. 2181–2187, 2015b.
294
+
295
+ Farzaneh Mahdisoltani, Joanna Biega, and Fabian M Suchanek. Yago3: A knowledge base from multilingual wikipedias. In CIDR, 2013.
296
+
297
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
298
+
299
+ George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39–41, 1995.
300
+
301
+ Arvind Neelakantan, Benjamin Roth, and Andrew McCallum. Compositional vector space models for knowledge base completion. arXiv preprint arXiv:1504.06662, 2015.
302
+
303
+ Dai Quoc Nguyen, Tu Dinh Nguyen, Dat Quoc Nguyen, and Dinh Phung. A novel embedding model for knowledge base completion based on convolutional neural network. arXiv preprint arXiv:1712.02121, 2017.
304
+
305
+ Dat Quoc Nguyen, Kairit Sirts, Lizhen Qu, and Mark Johnson. Stranse: a novel embedding model of entities and relationships in knowledge bases. arXiv preprint arXiv:1606.08140, 2016.
306
+
307
+ Maximilian Nickel, Lorenzo Rosasco, Tomaso A Poggio, et al. Holographic embeddings of knowledge graphs. In AAAI, volume 2, pp. 3–2, 2016.
308
+
309
+ Tim Rocktaschel and Sebastian Riedel. End-to-end differentiable proving. In ¨ Advances in Neural Information Processing Systems, pp. 3788–3800, 2017.
310
+
311
+ Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. Yago: a core of semantic knowledge. In Proceedings of the 16th international conference on World Wide Web, pp. 697–706. ACM, 2007.
312
+
313
+ Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, pp. 57–66, 2015.
314
+
315
+ Theo Trouillon, Johannes Welbl, Sebastian Riedel, ´ Eric Gaussier, and Guillaume Bouchard. Com- ´ plex embeddings for simple link prediction. In International Conference on Machine Learning, pp. 2071–2080, 2016.
316
+
317
+ Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI, volume 14, pp. 1112–1119, 2014.
318
+
319
+ Chenyan Xiong, Russell Power, and Jamie Callan. Explicit semantic ranking for academic search via knowledge graph embedding. In Proceedings of the 26th international conference on world wide web, pp. 1271–1279. International World Wide Web Conferences Steering Committee, 2017.
320
+
321
+ Bishan Yang and Tom Mitchell. Leveraging knowledge bases in lstms for improving machine reading. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1436–1446, 2017.
322
+
323
+ Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint arXiv:1412.6575, 2014.
324
+
325
+ Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base completion. CoRR, abs/1702.08367, 2017.
326
+
327
+ Fuzheng Zhang, Nicholas Jing Yuan, Defu Lian, Xing Xie, and Wei-Ying Ma. Collaborative knowledge base embedding for recommender systems. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 353–362. ACM, 2016.
328
+
329
+ # APPENDIX
330
+
331
+ # A DISCUSSION ON THE ABILITY OF PATTERN MODELING AND INFERENCE
332
+
333
+ No existing models are capable of modeling all the three relation patterns. For example, TransE cannot model the symmetry pattern because it would yield $\mathbf { r } = \mathbf { 0 }$ for symmetric relations; TransX can infer and model the symmetry/antisymmetry pattern when $g _ { r , 1 } = g _ { r , 2 }$ , e.g. in TransH (Wang et al., 2014), but cannot infer inversion and composition as $g _ { r , 1 }$ and $g _ { r , 2 }$ are invertible matrix multiplications; due to its symmetric nature, DistMult is difficult to model the asymmetric and inversion pattern; ComplEx addresses the problem of DisMult and is able to infer both the symmetry and asymmetric patterns with complex embeddings. Moreover, it can infer inversion rules because the complex conjugate of the solution to arg maxr $\operatorname { R e } ( \langle \mathbf { x } , \mathbf { r } , { \overline { { \mathbf { y } } } } \rangle )$ is exactly the solution to arg max $\operatorname { R e } ( \langle \mathbf { y } , \mathbf { r } , { \overline { { \mathbf { x } } } } \rangle )$ . However, ComplEx cannot infer composition rules, since it does not model a bijection mapping from $\mathbf { h }$ to $\mathbf { t }$ via relation $\mathbf { r }$ . These concerns are summarized in Table 2.
334
+
335
+ # B PROOF OF LEMMA 1
336
+
337
+ Proof. if $\mathbf { r } ( \mathbf { x } , \mathbf { y } )$ and $\mathbf { r } ( \mathbf { y } , \mathbf { x } )$ hold, we have
338
+
339
+ $$
340
+ \mathbf { y } = \mathbf { r } \circ \mathbf { x } \wedge \mathbf { x } = \mathbf { r } \circ \mathbf { y } \Rightarrow \mathbf { r } \circ \mathbf { r } = \mathbf { 1 }
341
+ $$
342
+
343
+ Otherwise, if $\mathbf { r } ( \mathbf { x } , \mathbf { y } )$ and $\neg \mathbf { r } ( \mathbf { y } , \mathbf { x } )$ hold, we have
344
+
345
+ $$
346
+ \mathbf { y } = \mathbf { r } \circ \mathbf { x } \wedge \mathbf { x } \neq \mathbf { r } \circ \mathbf { y } \Rightarrow \mathbf { r } \circ \mathbf { r } \neq \mathbf { 1 }
347
+ $$
348
+
349
+ # C PROOF OF LEMMA 2
350
+
351
+ Proof. if $\mathbf { r } _ { 1 } ( \mathbf { x } , \mathbf { y } )$ and ${ \bf r } _ { 2 } ( { \bf y } , { \bf x } )$ hold, we have
352
+
353
+ $$
354
+ \mathbf { y } = \mathbf { r } _ { 1 } \circ \mathbf { x } \wedge \mathbf { x } = \mathbf { r } _ { 2 } \circ \mathbf { y } \Rightarrow \mathbf { r } _ { 1 } = \mathbf { r } _ { 2 } ^ { - 1 }
355
+ $$
356
+
357
+ # D PROOF OF LEMMA 3
358
+
359
+ Proof. if ${ \bf r } _ { 1 } ( { \bf x } , z )$ , ${ \bf r } _ { 2 } ( { \bf x } , { \bf y } )$ and ${ \bf r } _ { 3 } ( { \bf y } , z )$ hold, we have
360
+
361
+ $$
362
+ \mathbf { z } = \mathbf { r } _ { 1 } \circ \mathbf { x } \wedge \mathbf { y } = \mathbf { r } _ { 2 } \circ \mathbf { x } \wedge \mathbf { z } = \mathbf { r } _ { 3 } \circ \mathbf { y } \Rightarrow \mathbf { r } _ { 1 } = \mathbf { r } _ { 2 } \circ \mathbf { r } _ { 3 }
363
+ $$
364
+
365
+ # E PROPERTIES OF ROTATE
366
+
367
+ A useful property for RotatE is that the inverse of a relation can be easily acquired by complex conjugate. In this way, the RotatE model treats head and tail entities in a uniform way, which is potentially useful for efficient 1-N scoring (Dettmers et al., 2017):
368
+
369
+ $$
370
+ \| \mathbf { h } \circ \mathbf { r } - \mathbf { t } \| = \| ( \mathbf { h } \circ \mathbf { r } - \mathbf { t } ) \circ { \overline { { \mathbf { r } } } } \| = \| \mathbf { t } \circ { \overline { { \mathbf { r } } } } - \mathbf { h } \|
371
+ $$
372
+
373
+ Moreover, considering the embeddings in the polar form, i.e., $h _ { i } = m _ { h , i } e ^ { i \theta _ { h , i } } , r _ { i } = e ^ { i \theta _ { r , i } } , t _ { i } =$ $m _ { t , i } e ^ { i \theta _ { t , i } }$ , we can rewrite the RotatE distance function as:
374
+
375
+ $$
376
+ \| \mathbf { h } \circ \mathbf { r } - \mathbf { t } \| = \sum _ { i = 1 } ^ { k } { \sqrt { ( m _ { h , i } - m _ { t , i } ) ^ { 2 } + 4 m _ { h , i } m _ { t , i } \sin ^ { 2 } { \frac { \theta _ { h , i } + \theta _ { r , i } - \theta _ { t , i } } { 2 } } } }
377
+ $$
378
+
379
+ This equation provides two interesting views of the model:
380
+
381
+ (1) When we constrain the modulus $m _ { h , i } ~ = ~ m _ { t , i } ~ = ~ C$ , the distance function is reduced to $\begin{array} { r } { 2 C \left. \sin \frac { \theta _ { h } + \theta _ { r } - \theta _ { t } } { 2 } \right. } \end{array}$ . We can see that this is very similar to the distance function of TransE: $\left\| \mathbf { h } + \mathbf { r } - \mathbf { t } \right\|$ . Based on this intuition, we can show that:
382
+
383
+ Theorem 4. RotatE can degenerate into TransE. (See proof at Appendix $F$ )
384
+
385
+ which indicates that RotatE is able to simulate TransE.
386
+
387
+ (2) The modulus provides the lower bound of the distance function, which is $\| \mathbf { m } _ { h } - \mathbf { m } _ { t } \|$
388
+
389
+ Table 10: Statistics of FB15k by mapping properties of relations.
390
+
391
+ <table><tr><td rowspan=1 colspan=1>Relation Category</td><td rowspan=1 colspan=1>1-to-1</td><td rowspan=1 colspan=1>1-to-N</td><td rowspan=1 colspan=1>N-to-1</td><td rowspan=1 colspan=1>N-to-N</td></tr><tr><td rowspan=1 colspan=1>#relation</td><td rowspan=1 colspan=1>326</td><td rowspan=1 colspan=1>308</td><td rowspan=1 colspan=1>388</td><td rowspan=1 colspan=1>323</td></tr><tr><td rowspan=1 colspan=1>#triplet (train)</td><td rowspan=1 colspan=1>6827</td><td rowspan=1 colspan=1>42509</td><td rowspan=1 colspan=1>70727</td><td rowspan=1 colspan=1>363079</td></tr><tr><td rowspan=1 colspan=1>#triplet (test)</td><td rowspan=1 colspan=1>832</td><td rowspan=1 colspan=1>5259</td><td rowspan=1 colspan=1>8637</td><td rowspan=1 colspan=1>44343</td></tr></table>
392
+
393
+ <table><tr><td rowspan="2"></td><td colspan="4">YAGO3-10</td></tr><tr><td>MR</td><td>MRR H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>DistMult</td><td>5926</td><td>.34 .24</td><td>.38</td><td>.54</td></tr><tr><td>ComplEx</td><td>6351</td><td>.36 .26</td><td>.40</td><td>.55</td></tr><tr><td>ConvE</td><td>1671</td><td>.44 .35</td><td>.49</td><td>.62</td></tr><tr><td>RotatE</td><td>1767</td><td>.495 .402</td><td>.550</td><td>.670</td></tr></table>
394
+
395
+ Table 11: Results of several models evaluated on the YAGO3-10 datasets. Other results are taken from (Dettmers et al., 2017).
396
+
397
+ # F PROOF OF THEOREM 4
398
+
399
+ Proof. By further restricting $| h _ { i } | = | t _ { i } | = C$ , we can rewrite $\mathbf { h } , \mathbf { r } , \mathbf { t }$ by
400
+
401
+ $$
402
+ \begin{array} { r l } & { \mathbf { h } = C e ^ { i \pmb { \theta } _ { h } } = C \cos \pmb { \theta } _ { h } + i C \sin \pmb { \theta } _ { h } } \\ & { \mathbf { r } = e ^ { i \pmb { \theta } _ { r } } = \cos \pmb { \theta } _ { r } + i \sin \pmb { \theta } _ { r } } \\ & { \mathbf { t } = C e ^ { i \pmb { \theta } _ { t } } = C \cos \pmb { \theta } _ { t } + i C \sin \pmb { \theta } _ { t } } \end{array}
403
+ $$
404
+
405
+ Therefore, we have
406
+
407
+ $$
408
+ \begin{array} { r l } & { \left\| \mathbf { h } \circ \mathbf { r } - \mathbf { t } \right\| = C \left\| e ^ { i ( \theta _ { h } + \theta _ { r } ) } - e ^ { i \theta _ { t } } \right\| = C \left\| e ^ { i ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) } - \mathbf { 1 } \right\| } \\ & { \qquad = C \left\| \cos ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) - \mathbf { 1 } + i \sin ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) \right\| } \\ & { \qquad = C \left\| \sqrt { ( \cos ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) - \mathbf { 1 } ) ^ { 2 } + \sin ^ { 2 } ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) } \right\| } \\ & { \qquad = C \left\| \sqrt { 2 - 2 \cos ( \theta _ { h } + \theta _ { r } - \theta _ { t } ) } \right\| } \\ & { \qquad = 2 C \left\| \sin \frac { \theta _ { h } + \theta _ { r } - \theta _ { t } } { 2 } \right\| } \end{array}
409
+ $$
410
+
411
+ If the embedding of $( \mathtt { h } , \mathtt { r } , \mathtt { t } )$ in TransE is $\mathbf { h } ^ { \prime } , \mathbf { r } ^ { \prime } , \mathbf { t } ^ { \prime }$ , let $\pmb { \theta } _ { h } = c \mathbf { h } ^ { \prime } , \pmb { \theta } _ { r } = c \mathbf { r } ^ { \prime } , \pmb { \theta } _ { t } = c \mathbf { t } ^ { \prime }$ and $C = 1 / c$ , we have
412
+
413
+ $$
414
+ \operatorname* { l i m } _ { c \to 0 } \| \mathbf { h } \circ \mathbf { r } - \mathbf { t } \| = \| \mathbf { h } ^ { \prime } + \mathbf { r } ^ { \prime } - \mathbf { t } ^ { \prime } \|
415
+ $$
416
+
417
+ # G LINK PREDICTION ON YAGO3-10
418
+
419
+ YAGO3-10 is a subset of YAGO3 (Mahdisoltani et al., 2013), which consists of entities that have a minimum of 10 relations each. It has 123,182 entities and 37 relations. Most of the triples deal with descriptive attributes of people, such as citizenship, gender, profession and marital status.
420
+
421
+ Table 11 shows that the RotatE model also outperforms state-of-the-art models on YAGO3-10.
422
+
423
+ # H HYPERPARAMETERS
424
+
425
+ We list the best hyperparameter setting of RotatE w.r.t the validation dataset on several benchmarks in Table 12.
426
+
427
+ Table 12: The best hyperparameter setting of RotatE on several benchmarks.
428
+
429
+ <table><tr><td>Benchmark</td><td>embedding dimension k</td><td>batch sizeb 0</td><td>negative samples n</td><td>a</td><td>2</td></tr><tr><td>FB15k</td><td>1000</td><td>2048</td><td>128</td><td>1.0</td><td>24</td></tr><tr><td>WN18</td><td>500</td><td>512</td><td>1024</td><td>0.5</td><td>12</td></tr><tr><td>FB15k-237</td><td>1000</td><td>1024</td><td>256</td><td>1.0</td><td>9</td></tr><tr><td>WN18RR</td><td>500</td><td>512</td><td>1024</td><td>0.5</td><td>6</td></tr><tr><td>Countries S1</td><td>500</td><td>512</td><td>64</td><td>1.0</td><td>0.1</td></tr><tr><td>Countries S2</td><td>500</td><td>512</td><td>64</td><td>1.0</td><td>0.1</td></tr><tr><td>Countries S3</td><td>500</td><td>512</td><td>64</td><td>1.0</td><td>0.1</td></tr><tr><td>YAGO3-10</td><td>500</td><td>1024</td><td>400</td><td>1.0</td><td>24</td></tr></table>
430
+
431
+ <table><tr><td rowspan="2"></td><td colspan="5">RotatE</td><td colspan="5">TransE</td></tr><tr><td>MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MR</td><td>MRR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td colspan="10">negative sampling loss</td></tr><tr><td>w/adv</td><td>177</td><td>.338</td><td>.241</td><td>.375</td><td>.533</td><td>170</td><td>.332</td><td>.233</td><td>.372</td><td>.531</td></tr><tr><td>w/o adv</td><td>185</td><td>.297</td><td>.205</td><td>.328</td><td>.480</td><td>175</td><td>.297</td><td>.202</td><td>.331</td><td>.486</td></tr><tr><td colspan="10">margin-based ranking criterion</td></tr><tr><td>w/adv</td><td>225</td><td>.322</td><td>.225</td><td>.358</td><td>.516</td><td>167</td><td>.333</td><td>.237</td><td>.370</td><td>.522</td></tr><tr><td>w/o adv</td><td>199</td><td>.293</td><td>.202</td><td>.324</td><td>.476</td><td>164</td><td>.306</td><td>.212</td><td>.340</td><td>.493</td></tr></table>
432
+
433
+ Table 13: Results of ablation study on FB15k-237, where “adv” represents “self-adversarial”.
434
+
435
+ # I ABLATION STUDY
436
+
437
+ Table 13 shows our ablation study of self-adversarial sampling and negative sampling loss on FB15k-237. We also re-implement a 1000-dimension TransE and do ablation study on it. From the table, We can find that self-adversarial sampling boosts the performance for both models, while negative sampling loss is only effective on RotatE; in addition, our re-implementation of TransE also outperforms all the state-of-the-art models on FB15k-237.
438
+
439
+ # J VARIANCE OF THE RESULTS
440
+
441
+ In Table 14, We provide the average and variance of the MRR results on FB15k, WN18, FB15k237 and WN18RR. Both the average and the variance is calculated by three runs of RotatE with difference random seeds. We can find that the performance of RotatE is quite stable for different random initialization.
442
+
443
+ # K MORE RESULTS OF IMPLICIT BASIC PATTERN INFERENCE
444
+
445
+ We provide more histograms of embedding phases in Figure 3 - 5.
446
+
447
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>FB15k</td><td rowspan=1 colspan=1>WN18</td><td rowspan=1 colspan=1>FB15k-237</td><td rowspan=1 colspan=1>WN18RR</td></tr><tr><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>.797± .001</td><td rowspan=1 colspan=1>.949±.000</td><td rowspan=1 colspan=1>.337±.001</td><td rowspan=1 colspan=1>.477±.001</td></tr></table>
448
+
449
+ Table 14: The average and variance of the MRR results of RotatE on FB15k, WN18, FB15k-237 and WN18RR.
450
+
451
+ ![](images/1264505046fcbc0eb2ab1b43340873eba3ce2d7db08e7604c2d745f1843048b3.jpg)
452
+ Figure 3: Histograms of embedding phases from two general relations and four symmetric relations on WN18. ( $k = 5 0 0$ )
453
+
454
+ ![](images/aaae7fd203c57134d0f63b7dc8258422f1b82964ac42816e000343ee0fc99069.jpg)
455
+ Figure 4: Histograms of embedding phases from six symmetric relations on FB15k-237. $k = 1 0 0 0 ,$ )
456
+
457
+ ![](images/178369d73cddc040ed41f064792d88b910927857cf97e697ca897e069c3c7e22.jpg)
458
+ Figure 5: Histograms of element-wise additions of inversed relation embedding phases on WN18. $k = 5 0 0$ )
parse/train/HkgEQnRqYQ/HkgEQnRqYQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkgEQnRqYQ/HkgEQnRqYQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkgEQnRqYQ/HkgEQnRqYQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkldyTNYwH/HkldyTNYwH.md ADDED
Binary file (69.2 kB). View file
 
parse/train/HkldyTNYwH/HkldyTNYwH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkldyTNYwH/HkldyTNYwH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HkldyTNYwH/HkldyTNYwH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SJvYgH9xe/SJvYgH9xe.md ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOMATIC RULE EXTRACTION FROM LONG SHORTTERM MEMORY NETWORKS
2
+
3
+ W. James Murdoch ∗ Department of Statistics UC Berkeley Berkeley, CA 94709, USA jmurdoch@berkeley.edu
4
+
5
+ Arthur Szlam
6
+ Facebook AI Research
7
+ New York City, NY, 10003
8
+ aszlam $@$ fb.com
9
+
10
+ # ABSTRACT
11
+
12
+ Although deep learning models have proven effective at solving problems in natural language processing, the mechanism by which they come to their conclusions is often unclear. As a result, these models are generally treated as black boxes, yielding no insight of the underlying learned patterns. In this paper we consider Long Short Term Memory networks (LSTMs) and demonstrate a new approach for tracking the importance of a given input to the LSTM for a given output. By identifying consistently important patterns of words, we are able to distill state of the art LSTMs on sentiment analysis and question answering into a set of representative phrases. This representation is then quantitatively validated by using the extracted phrases to construct a simple, rule-based classifier which approximates the output of the LSTM.
13
+
14
+ # 1 INTRODUCTION
15
+
16
+ Neural network language models, especially recurrent neural networks (RNN), are now standard tools for natural language processing. Amongst other things, they are used for translation Sutskever et al. (2014), language modelling Jozefowicz et al. (2016), and question answering Hewlett et al. (2016). In particular, the Long Short Term Memory (LSTM) Hochreiter & Schmidhuber (1997) architecture has become a basic building block of neural NLP. Although LSTM’s are regularly used in state of the art systems, their operation is not well understood. Besides the basic desire from a scientific viewpoint to clarify their workings, it is often the case that it is important to understand why a machine learning algorithm made a particular choice. Moreover, LSTM’s are computationally intensive compared to discrete models with lookup tables and pattern matching.
17
+
18
+ In this work, we describe a novel method for visualizing the importance of specific inputs for determining the output of an LSTM. We then demonstrate that, by searching for phrases which are consistently important, the importance scores can be used to extract simple phrase patterns consisting of one to five words from a trained LSTM. The phrase extraction is first done in a general document classification framework on two different sentiment analysis datasets. We then demonstrate that it can also be specialized to more complex models by applying it to WikiMovies, a recently introduced question answer dataset. To concretely validate the extracted patterns, we use them as input to a rules-based classifier which approximates the performance of the original LSTM.
19
+
20
+ # 2 RELATED WORK
21
+
22
+ There are two lines of related work on visualizing LSTMs. First, Hendrik et al. (2016) and Karpathy et al. (2016) analyse the movement of the raw gate activations over a sequence. Karpathy et al. (2016) is able to identify co-ordinates of $c _ { t }$ that correspond to semantically meaningful attributes such as whether the text is in quotes and how far along the sentence a word is. However, most of the cell co-ordinates are harder to interpret, and in particular, it is often not obvious from their activations which inputs are important for specific outputs.
23
+
24
+ Another approach that has emerged in the literature Alikaniotis et al. (2016) Denil et al. (2015) Bansal et al. (2016) is for each word in the document, looking at the norm of the derivative of the loss function with respect to the embedding parameters for that word. This bridges the gap between high-dimensional cell state and low-dimensional outputs. These techniques are general- they are applicable to visualizing the importance of sets of input coordinates to output coordinates of any differentiable function. In this work, we describe techniques that are designed around the structure of LSTM’s, and show that they can give better results in that setting.
25
+
26
+ A recent line of work Li et al. (2016) Hewlett et al. (2016) Rajpurkar et al. (2016) Miller et al. (2016) has focused on neural network techniques for extracting answers directly from documents. Previous work had focused on Knowledge Bases (KBs), and techniques to map questions to logical forms suitable for querying them. Although they are effective within their domain, KBs are inevitably incomplete, and are thus an unsatisfactory solution to the general problem of question-answering. Wikipedia, in contrast, has enough information to answer a far broader array of questions, but is not as easy to query. Originally introduced in Miller et al. (2016), the WikiMovies dataset consists of questions about movies paired with Wikipedia articles.
27
+
28
+ # 3 WORD IMPORTANCE SCORES IN LSTMS
29
+
30
+ We present a novel decomposition of the output of an LSTM into a product of factors, where each term in the product can be interpreted as the contribution of a particular word. Thus, we can assign importance scores to words according to their contribution to the LSTM’s prediction
31
+
32
+ # 3.1 LONG SHORT TERM MEMORY NETWORKS
33
+
34
+ Over the past few years, LSTMs have become an important part of neural NLP systems. Given a sequence of word embeddings $x _ { 1 } , . . . , x _ { T } \in \mathbb { R } ^ { d }$ , an LSTM processes one word at a time, keeping track of cell and state vectors $( c _ { 1 } , h _ { 1 } ) , . . . , ( c _ { T } , h _ { T } )$ which contain information in the sentence up to word $i$ . $h _ { t }$ and $c _ { t }$ are computed as a function of $x _ { t } , c _ { t - 1 }$ using the below updates
35
+
36
+ $$
37
+ \begin{array} { r l } & { f _ { t } = \sigma \big ( W _ { f } x _ { t } + V _ { f } h _ { t - 1 } + b _ { f } \big ) } \\ & { i _ { t } = \sigma \big ( W _ { i } x _ { t } + V _ { i } h _ { t - 1 } + b _ { i } \big ) } \\ & { o _ { t } = \sigma \big ( W _ { o } x _ { t } + V _ { o } h _ { t - 1 } + b _ { o } \big ) } \\ & { \tilde { c } _ { t } = \operatorname { t a n h } \big ( W _ { c } x _ { t } + V _ { c } h _ { t - 1 } + b _ { c } \big ) } \\ & { c _ { t } = f _ { t } c _ { t - 1 } + i _ { t } \tilde { c } _ { t } } \\ & { h _ { t } = o _ { t } \odot \operatorname { t a n h } \big ( c _ { t } \big ) } \end{array}
38
+ $$
39
+
40
+ As initial values, we define $c _ { 0 } = h _ { 0 } = 0$ . After processing the full sequence, a probability distribution over $C$ classes is specified by $p$ , with
41
+
42
+ $$
43
+ p _ { i } = \mathrm { S o f t M a x } ( W h _ { T } ) = \frac { e ^ { W _ { i } h _ { T } } } { \sum _ { j = 1 } ^ { C } e ^ { W _ { j } h _ { t } } }
44
+ $$
45
+
46
+ where $W _ { i }$ is the $\Ddot { \iota }$ ’th row of the matrix $W$
47
+
48
+ # 3.2 DECOMPOSING THE OUTPUT OF A LSTM
49
+
50
+ We now show that we can decompose the numerator of $p _ { i }$ in Equation 7 into a product of factors, and interpret those factors as the contribution of individual words to the predicted probability of class $i$ . Define
51
+
52
+ $$
53
+ \beta _ { i , j } = \exp \left( W _ { i } ( o _ { T } \odot ( \operatorname { t a n h } ( c _ { j } ) - \operatorname { t a n h } ( c _ { j - 1 } ) ) ) \right) ,
54
+ $$
55
+
56
+ so that
57
+
58
+ $$
59
+ \exp ( W _ { i } h _ { T } ) = \exp \left( \sum _ { j = 1 } ^ { T } W _ { i } \big ( o _ { T } \odot ( \operatorname { t a n h } ( c _ { j } ) - \operatorname { t a n h } ( c _ { j - 1 } ) ) \bigg ) \right) = \prod _ { j = 1 } ^ { T } \beta _ { i , j } .
60
+ $$
61
+
62
+ As $\operatorname { t a n h } ( c _ { j } ) - \operatorname { t a n h } ( c _ { j - 1 } )$ can be viewed as the update resulting from word $j$ , so $\beta _ { i , j }$ can be interpreted as the multiplicative contribution to $p _ { i }$ by word $j$ .
63
+
64
+ # 3.3 AN ADDITIVE DECOMPOSITION OF THE LSTM CELL
65
+
66
+ We will show below that the $\beta _ { i , j }$ capture some notion of the importance of a word to the LSTM’s output. However, these terms fail to account for how the information contributed by word $j$ is affected by the LSTM’s forget gates between words $j$ and $T$ . Consequently, we empirically found that the importance scores from this approach often yield a considerable amount of false positives. A more nuanced approach is obtained by considering the additive decomposition of $c _ { T }$ in equation (9), where each term $e _ { j }$ can be interpreted as the contribution to the cell state $c _ { T }$ by word $j$ . By iterating the equation $\dot { c _ { t } } = f _ { t } c _ { t - 1 } + i _ { t } \tilde { c } _ { t }$ , we get that
67
+
68
+ $$
69
+ c _ { T } = \sum _ { i = 1 } ^ { T } ( \prod _ { j = i + 1 } ^ { T } f _ { j } ) i _ { i } \tilde { c } _ { i } = \sum _ { i = 1 } ^ { T } e _ { i , T }
70
+ $$
71
+
72
+ This suggests a natural definition of an alternative score to the $\beta _ { i , j }$ , corresponding to augmenting the $c _ { j }$ terms with products of forget gates to reflect the upstream changes made to $c _ { j }$ after initially processing word $j$ .
73
+
74
+ $$
75
+ \begin{array} { l } { { \displaystyle \exp ( W _ { i } h _ { T } ) = \prod _ { j = 1 } ^ { T } \exp ( W _ { i } \big ( o _ { T } \odot \big ( \operatorname { t a n h } \bigl ( \underset { k = 1 } { \overset { j } { \sum } } e _ { k , T } \big ) - \operatorname { t a n h } \bigl ( \underset { k = 1 } { \overset { j - 1 } { \sum } } e _ { k , T } \big ) \big ) ) ) } } \\ { { \displaystyle \qquad = \prod _ { j = 1 } ^ { T } \exp ( W _ { i } \big ( o _ { T } \odot \big ( \operatorname { t a n h } \bigl ( \underset { k = j + 1 } { \overset { k } { \prod } } f _ { k } \big ) c _ { j } \big ) - \operatorname { t a n h } \bigl ( \underset { k = j } { \overset { k } { \prod } } f _ { k } \big ) c _ { j - 1 } \big ) ) ) } } \\ { { \displaystyle \qquad = \prod _ { j = 1 } ^ { T } \gamma _ { i , j } } } \end{array}
76
+ $$
77
+
78
+ # 4 PHRASE EXTRACTION FOR DOCUMENT CLASSIFICATION
79
+
80
+ We now introduce a technique for using our variable importance scores to extract phrases from a trained LSTM. To do so, we search for phrases which consistently provide a large contribution to the prediction of a particular class relative to other classes. The utility of these patterns is validated by using them as input for a rules based classifier. For simplicity, we focus on the binary classification case.
81
+
82
+ # 4.1 PHRASE EXTRACTION
83
+
84
+ A phrase can be reasonably described as predictive if, whenever it occurs, it causes a document to both be labelled as a particular class, and not be labelled as any other. As our importance scores introduced above correspond to the contribution of particular words to class predictions, they can be used to score potential patterns by looking at a pattern’s average contribution to the prediction of a given class relative to other classes. More precisely, given a collection of $D$ documents $\{ \{ x _ { i , j } \} _ { i = 1 } ^ { N _ { d } } \} _ { j = 1 } ^ { D }$ , for a given phrase $w _ { 1 } , . . . , w _ { k }$ we can compute scores $S _ { 1 } , S _ { 2 }$ for classes 1 and 2, as well as a combined score $S$ and class $C$ as
85
+
86
+ $$
87
+ \begin{array} { l } { { S _ { 1 } ( w _ { 1 } , . . . , w _ { k } ) = { \displaystyle { \frac { \mathrm { A v e r a g e } _ { j , b } \left\{ \prod _ { l = 1 } ^ { k } \beta _ { 1 , b + l , j } | x _ { b + i , j } = w _ { i } , i = 1 , . . . , k \right\} } } } } } \\ { { \mathrm { A v e r a g e } _ { j , b } \left\{ \prod _ { l = 1 } ^ { k } \beta _ { 2 , b + l , j } | x _ { b + i , j } = w _ { i } , i = 1 , . . . , k \right\} } } \\ { { S _ { 2 } ( w _ { 1 } , . . , w _ { k } ) = { \displaystyle { \frac { 1 } { S _ { 1 } ( w _ { 1 } , . . . , w _ { k } ) } } } } } \\ { { S ( w _ { 1 } , . . . , w _ { k } ) = { \displaystyle { \operatorname* { m a x } _ { i } } } ( S _ { i } ( w _ { 1 } , . . . , w _ { k } ) ) } } \\ { { C ( w _ { 1 } , . . . , w _ { k } ) = \mathrm { a r g m a x } _ { i } ( S _ { i } ( w _ { 1 } , . . . , w _ { k } ) ) } } \end{array}
88
+ $$
89
+
90
+ where $\beta _ { i , j , k }$ denotes $\beta _ { i , j }$ applied to document $k$
91
+
92
+ The numerator of $S _ { 1 }$ denotes the average contribution of the phrase to the prediction of class 1 across all occurrences of the phrase. The denominator denotes the same statistic, but for class 2. Thus, if
93
+
94
+ $S _ { 1 }$ is high, then $w _ { 1 } , . . . , w _ { k }$ is a strong signal for class 1, and likewise for $S _ { 2 }$ . We propose to use $S$ as a score function in order to search for high scoring, representative, phrases which provide insight into the trained LSTM, and $C$ to denote the class corresponding to a phrase.
95
+
96
+ In practice, the number of phrases is too large to feasibly compute the score of them all. Thus, we approximate a brute force search through a two step procedure. First, we construct a list of candidate phrases by searching for strings of consecutive words $j$ with importance scores $\beta _ { i , j } > c$ for any $i$ and some threshold $c$ ; in the experiments below we use $c = 1 . 1$ . Then, we score and rank the set of candidate phrases, which is much smaller than the set of all phrases.
97
+
98
+ # 4.2 RULES BASED CLASSIFIER
99
+
100
+ The extracted patterns from Section 4.1 can be used to construct a simple, rules-based classifier which approximates the output of the original LSTM. Given a document and a list of patterns sorted by descending score given by $S$ , the classifier sequentially searches for each pattern within the document using simple string matching. Once it finds a pattern, the classifier returns the associated class given by $C$ , ignoring the lower ranked patterns. The resulting classifier is interpretable, and despite its simplicity, retains much of the accuracy of the LSTM used to build it.
101
+
102
+ # 5 EXPERIMENTS
103
+
104
+ We now present the results of our experiments.
105
+
106
+ # 5.1 TRAINING DETAILS
107
+
108
+ We implemented all models in Torch using default hyperparameters for weight initializations. For WikiMovies, all documents and questions were pre-processed so that multiple word entities were concatenated into a single word. For a given question, relevant articles were found by first extracting from the question the rarest entity, then returning a list of Wikipedia articles containing any of those words. We use the pre-defined splits into train, validation and test sets, containing 96k, 10k and $1 0 \mathrm { k }$ questions, respectively. The word and hidden representations of the LSTM were both set to dimension 200 for WikiMovies, 300 and 512 for Yelp, and 300 and 150 for Stanford Sentiment Treebank. All models were optimized using Adam Kingma & Ba (2015) with the default learning rate of 0.001 using early stopping on the validation set. For rule extraction using gradient scores, the product in the reward function is replaced by a sum. In both datasets, we found that normalizing the gradient scores by the largest gradient improved results.
109
+
110
+ # 5.2 SENTIMENT ANALYSIS
111
+
112
+ We first applied the document classification framework to two different sentiment analysis datasets. Originally introduced in Zhang et al. (2015), the Yelp review polarity dataset was obtained from the Yelp Dataset Challenge and has train and test sets of size 560,000 and 38,000. The task is binary prediction for whether the review is positive (four or five stars) or negative (one or two stars). The reviews are relatively long, with an average length of 160.1 words. We also used the binary classification task from the Stanford Sentiment Treebank (SST) Socher et al. (2013), which has less data with train/dev/test sizes of 6920/872/1821, and is done at a sentence level, so has much shorter document lengths.
113
+
114
+ We report results in Table 1 for seven different models. We report state of the art results from prior work using convolutional neural networks; Kim (2014) for SST and Zhang et al. (2015) for Yelp. We also report our LSTM baselines, which are competitive with state of the art, along with the three different pattern matching models described above. For SST, we also report prior results using bag of words features with Naive Bayes.
115
+
116
+ The additive cell decomposition pattern equals or outperforms the cell-difference patterns, which handily beat the gradient results. This coincides with our empirical observations regarding the information contained within the importance measures, and validates our introduced measure. The differences between measures become more pronounced in Yelp, as the longer document sizes provide more opportunities for false positives.
117
+
118
+ Table 1: Test accuracy on sentiment analysis. See section 5.2 for further descriptions of the models.
119
+
120
+ <table><tr><td>Model</td><td>Yelp Polarity</td><td>Stanford Sentiment Treebank</td></tr><tr><td>Large word2vec CNN Zhang et al. (2015)</td><td>95.4</td><td></td></tr><tr><td>CNN-multichannel Kim (2014)</td><td></td><td>88.1</td></tr><tr><td>Naive Bayes Socher et al. (2013)</td><td></td><td>82.6</td></tr><tr><td>LSTM</td><td>95.3</td><td>87.3</td></tr><tr><td>Cell Decomposition Pattern Matching</td><td>86.5</td><td>76.2</td></tr><tr><td>Cell-Difference Pat- tern Matching</td><td>81.2</td><td>77.4</td></tr><tr><td>Gradient Pattern Matching</td><td>65.0</td><td>68.0</td></tr></table>
121
+
122
+ Although our pattern matching algorithms underperform other methods, we emphasize that pure performance is not our goal, nor would we expect more from such a simple model. Rather, the fact that our method provides reasonable accuracy is one piece of evidence, in addition to the qualitative evidence given later, that our word importance scores and extracted patterns contain useful information for understanding the actions of a LSTM.
123
+
124
+ # 5.3 WIKIMOVIES
125
+
126
+ Although document classification comprises a sizeable portion of current research in natural language processing, much recent work focuses on more complex problems and models. In this section, we examine WikiMovies, a recently introduced question answer dataset, and show that with some simple modifications our approach can be adapted to this problem.
127
+
128
+ # 5.3.1 DATASET
129
+
130
+ WikiMovies is a dataset consisting of more than 100,000 questions about movies, paired with relevant Wikipedia articles. It was constructed using the pre-existing dataset MovieLens, paired with templates extracted from the SimpleQuestions dataset Bordes et al. (2015), a open-domain question answering dataset based on Freebase. They then selected a set of Wikipedia articles about movies by identifying a set of movies from OMDb that had an associated article by title match, and kept the title and first section for each article.
131
+
132
+ For a given question, the task is to read through the relevant articles and extract the answer, which is contained somewhere within the text. The dataset also provides a list of $4 3 \mathrm { k }$ entities containing all possible answers.
133
+
134
+ # 5.3.2 LSTMS FOR WIKIMOVIES
135
+
136
+ We propose a simplified version of recent work Li et al. (2016). Given a pair of question $x _ { 1 } ^ { q } , . . . , x _ { N } ^ { q }$ and document $x _ { 1 } ^ { d } , . . . , x _ { T } ^ { d }$ , we first compute an embedding for the question using a LSTM. Then, for each word $t$ in the document, we augment the word embedding $x _ { t }$ with the computed question embedding. This is equivalent to adding an additional term which is linear in the question embedding into the gate equations 3-6, allowing the patterns an LSTM absorbs to be directly conditioned upon the question at hand.
137
+
138
+ $$
139
+ \begin{array} { r l } & { h _ { t } ^ { q } = \mathrm { L S T M } ( x _ { t } ^ { q } ) } \\ & { h _ { t } = \mathrm { L S T M } ( x _ { t } ^ { d } \| h _ { N } ^ { q } ) } \end{array}
140
+ $$
141
+
142
+ Having run the above model over the document while conditioning on a question, we are given contextual representations $h _ { 1 } , . . . , h _ { T }$ of the words in the document. For each entity $t$ in the document
143
+
144
+ Table 2: Test results on WikiMovies, measured in $\%$ hits $@ 1$ . See Section 5.3.4 for further descriptions of the models.
145
+
146
+ <table><tr><td>Model</td><td>Test accuracy</td></tr><tr><td>KV-MemNN IE</td><td>68.3</td></tr><tr><td>KV-MemNN Doc</td><td>76.2</td></tr><tr><td>LSTM</td><td>80.1</td></tr><tr><td>Cell Decomposition Pattern Matching</td><td>74.3</td></tr><tr><td>Cell-Difference Pattern Matching</td><td>69.4</td></tr><tr><td>Gradient Pattern Matching</td><td>57.4</td></tr></table>
147
+
148
+ we use $p _ { t }$ to conduct a binary prediction for whether or not the entity is the answer. At test time, we return the entity with the highest probability as the answer.
149
+
150
+ $$
151
+ p _ { t } = \mathbf { S o f t M a x } ( W h _ { t } )
152
+ $$
153
+
154
+ # 5.3.3 PHRASE EXTRACTION
155
+
156
+ We now introduce some simple modifications that were useful in adapting our pattern extraction framework to this specific task. First, in order to define the set of classifications problems to search over, we treat each entity $t$ within each document as a separate binary classification task with corresponding predictor $p _ { t }$ . Given this set of classification problems, rather than search over the space of all possible phrases, we restrict ourselves to those ending at the entity in question. We also distinguish patterns starting at the beginning of the document with those that do not and introduce an entity character into our pattern vocabulary, which can be matched by any entity. Template examples can be seen below, in Table 4. Once we have extracted a list of patterns, in the rules-based classifier we only search for positive examples, and return as the answer the entity matched to the highest ranked positive pattern.
157
+
158
+ # 5.3.4 RESULTS
159
+
160
+ We report results on six different models in Tables 2 and 3. We show the results from Miller et al. (2016), which fit a key-value memory network (KV-MemNN) on representations from information extraction (IE) and raw text (Doc). Next, we report the results of the LSTM described in Section 5.3.2. Finally, we show the results of using three variants of the pattern matching algorithm described in Section 5.3.3: using patterns extracted using the additive decomposition (cell decomposition), difference in cells approaches (cell-difference) and gradient importance scores (gradient), as discussed in Section 2. Performance is reported using the accuracy of the top hit over all possible answers (all entities), i.e. the hits $@ 1$ metric.
161
+
162
+ As shown in Table 2, our LSTM model surpasses the prior state of the art by nearly $4 \%$ . Moreover, our automatic pattern matching model approximates the LSTM with less than $6 \%$ error, which is surprisingly small for such a simple model, and falls within $2 \%$ of the prior state of the art. Similarly to sentiment analysis, we observe a clear ordering of the results across question categories, with our cell decomposition scores providing the best performance, followed by the cell difference and gradient scores.
163
+
164
+ # 6 DISCUSSION
165
+
166
+ # 6.1 LEARNED PATTERNS
167
+
168
+ We present extracted patterns for both sentiment tasks, and some WikiMovies question categories in Table 4. These patterns are qualitatively sensible, providing further validation of our approach. The increased size of the Yelp dataset allowed for longer phrases to be extracted relative to SST.
169
+
170
+ Table 3: Results broken down by question category. See section 5.3.4 for further descriptions of the models.
171
+
172
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>KV-MemNNIE</td><td rowspan=1 colspan=1>KV-MemNNDoc</td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>Cell DecompRE</td><td rowspan=1 colspan=1>Cell DiffRE</td><td rowspan=1 colspan=1>GradientRE</td></tr><tr><td rowspan=1 colspan=1>Actor to Movie</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>83</td><td rowspan=1 colspan=1>82</td><td rowspan=1 colspan=1>78</td><td rowspan=1 colspan=1>77</td><td rowspan=1 colspan=1>78</td></tr><tr><td rowspan=1 colspan=1>Director to Movie</td><td rowspan=1 colspan=1>78</td><td rowspan=1 colspan=1>91</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>82</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>83</td></tr><tr><td rowspan=1 colspan=1>Writer to Movie</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>91</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>88</td></tr><tr><td rowspan=1 colspan=1>Tag to Movie</td><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>49</td><td rowspan=1 colspan=1>49</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>38</td></tr><tr><td rowspan=1 colspan=1>Movie to Year</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>84</td></tr><tr><td rowspan=1 colspan=1>Movie to Writer</td><td rowspan=1 colspan=1>61</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>63</td></tr><tr><td rowspan=1 colspan=1>Movie to Actor</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>67</td></tr><tr><td rowspan=1 colspan=1>Movie to Director</td><td rowspan=1 colspan=1>76</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>85</td><td rowspan=1 colspan=1>45</td></tr><tr><td rowspan=1 colspan=1>Movie to Genre</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>65</td><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>21</td></tr><tr><td rowspan=1 colspan=1>Movie to Votes</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td></tr><tr><td rowspan=1 colspan=1>Movie to Rating</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>25</td></tr><tr><td rowspan=1 colspan=1>Movie to Language</td><td rowspan=1 colspan=1>62</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>44</td></tr><tr><td rowspan=1 colspan=1>Movie to Tags</td><td rowspan=1 colspan=1>47</td><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>6</td></tr></table>
173
+
174
+ <table><tr><td>Category</td><td>Top Patterns</td></tr><tr><td>Yelp Polarity Positive</td><td>definitely come back again.,love love love this place, great food and great service., highly rec- ommended!,will definitely be coming back, overall great experience,love everything about,</td></tr><tr><td>Yelp Polarity Negative</td><td>hidden gem. worst customer service ever, horrible horri- ble horrible, won&#x27;t be back, disappointed in this place, never go back there, not worth the money, not recommend this place</td></tr><tr><td>SST Positive</td><td>riveting documentary, is a real charmer, funny and touching, well worth your time, journey of the heart, emotional wallop, pleasure to watch, the whole family, cast is uniformly superb, comes from the heart, best films of the year, surprisingly funny, deeply satisfying</td></tr><tr><td>SST Negative</td><td>pretentious mess ., plain bad, worst film of the year, disappointingly generic, fart jokes, ba- nal dialogue, poorly executed, waste of time, a weak script,dullard,how bad it is,platitudes, never catches fire,tries too hard to be,bad act- ing,untalented artistes, derivative horror film,</td></tr><tr><td>WikiMovies movie to writer</td><td>lackluster film adaptation of Charles Dickens&#x27;, film adapted from ENT,by journalist ENT,written by ENT</td></tr><tr><td>WikiMovies movie to actor</td><td>western film starring ENT, starring Ben Af- fleck,.The movie stars ENT, that stars ENT is a 2014 french,icelandic,finnish,russian,</td></tr><tr><td>WikiMovies movie to language</td><td>danish, bengali, dutch,original german, zulu,czech,estonian,mandarin, filipino,hun- garian</td></tr></table>
175
+
176
+ Table 4: Selected top patterns using cell decomposition scores, ENT denotes an entity placeholder
177
+
178
+ Table 5: Examples from Stanford sentiment treebank which are correctly labelled by our LSTM and incorrectly labelled by our rules-based classifier. The matched pattern is highlighted
179
+
180
+ <table><tr><td>Sentiment</td><td>Pattern</td><td>Sentence</td></tr><tr><td>Negative</td><td>gets the job done</td><td>Still, it gets the job done - a sleepy afternoon rental</td></tr><tr><td>Negative</td><td>is a great</td><td>This is a great subject fora movie,but Hollywood has squandered the opportunity, using is as a prop for a warmed-over melodrama and the kind of choreographed mayhem that director John Woo has</td></tr><tr><td>Negative</td><td>happy end- ing</td><td>built his career on. The story loses its bite in a last-minute happy ending that’s even less plausible than the rest of the picture.</td></tr><tr><td>Negative</td><td>witty dialogue</td><td>An often-deadly boring,strange reading of a classic whose witty dialogue is treated with a baffling casual approach.</td></tr><tr><td>Positive</td><td>mess</td><td>The film is just a big, gorgeous, mind-blowing, breath-taking mess</td></tr></table>
181
+
182
+ # 6.2 APPROXIMATION ERROR BETWEEN LSTM AND PATTERN MATCHING
183
+
184
+ Although our approach is able to extract sensible patterns and achieve reasonable performance, there is still an approximation gap between our algorithm and the LSTM. In Table 5 we present some examples of instances where the LSTM was able to correctly classify a sentence, and our algorithm was not, along with the pattern used by our algorithm. At first glance, the extracted patterns are sensible, as ”gets the job done” or ”witty dialogue” are phrases you’d expect to see in a positive review of a movie. However, when placed in the broader context of these particular reviews, they cease to be predictive. This demonstrates that, although our work is useful as a firstorder approximation, there are still additional relationships that an LSTM is able to learn from data.
185
+
186
+ # 6.3 COMPARISON BETWEEN WORD IMPORTANCE MEASURES
187
+
188
+ While the prediction accuracy of our rules-based classifier provides quantitative validation of the relative merits of our visualizations, the qualitative differences are also insightful. In Table 6, we provide a side-by-side comparison between the different measures. As discussed before, the difference in cells technique fails to account for how the updates resulting from word $j$ are affected by the LSTM’s forget gates between when the word is initially processed and the answer. Consequently, we empirically found that without the interluding forget gates to dampen cell movements, the variable importance scores were far noisier than in additive cell decomposition approach. Under the additive cell decomposition, it identifies the phrase ’it stars’, as well as the actor’s name Aqib Khan as being important, a sensible conclusion. Moreover, the vast majority of words are labelled with an importance score of 1, corresponding to irrelevant. On the other hand, the difference in cells approach yields widely changing importance scores, which are challenging to interpret. In terms of noise, the gradient measures seem to lie somewhere in the middle. These patterns are broadly consistent with what we have observed, and provide qualitative validation of our metrics.
189
+
190
+ # 7 CONCLUSION
191
+
192
+ In this paper, we introduced a novel method for visualizing the importance of specific inputs in determining the output of an LSTM. By searching for phrases which consistently provide large contributions, we are able to distill trained, state of the art, LSTMs into an ordered set of representative phrases. We quantitatively validate the extracted phrases through their performance in a simple, rules-based classifier. Results are shown in a general document classification framework, then specialized to a more complex, recently introduced, question answer dataset. Our introduced measures provide superior predictive ability and cleaner visualizations relative to prior work. We believe that this represents an exciting new paradigm for analysing the behaviour of LSTM’s.
193
+
194
+ ![](images/c07f9565b62e4a9995ea7e3b320ff9282edbb052375fb982ed31a0f87a383fc3.jpg)
195
+ Table 6: Comparison of importance scores acquired by three different approaches, conditioning on the question ”the film west is west starred which actors?”. Bigger and darker means more important.
196
+
197
+ # ACKNOWLEDGEMENTS
198
+
199
+ This research was partially funded by Air Force grant FA9550-14-1-0016. It was also supported by the Center for Science of Information (CSoI), an US NSF Science and Technology Center, under grant agreement CCF-0939370.
200
+
201
+ # REFERENCES
202
+
203
+ Dimitrios Alikaniotis, Helen Yannakoudakis, and Marek Rei. Automatic text scoring using neural networks. In Assocation for Computational Lingustics, 2016.
204
+
205
+ Trapit Bansal, David Belanger, and Andrew McCallum. Ask the gru: Multi-task learning for deep text recommendations. In ACM international conference on Recommender Systems (RecSys), 2016.
206
+
207
+ Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075, 2015.
208
+
209
+ Misha Denil, Alban Demiraj, and Nando de Freitas. Extraction of salient sentences from labelled documents. In arXiv preprint: https://arxiv.org/abs/1412.6815, 2015.
210
+
211
+ Strobelt Hendrik, Sebastian Gehrmann, Bernd Huber, Hanspeter Pfister, and Alexander M. Rush. Visual analysis of hidden state dynamics in recurrent neural networks. In arXiv, 2016.
212
+
213
+ Daniel Hewlett, Alexandre Lacoste, Llion Jones, Illia Polosukhin, Andrew Fandrianto, Jay Han, Matthew Kelcey, and David Berthelot. Wikireading: A novel large-scale language understanding task over wikipedia. In Association for Computational Linguistics, 2016.
214
+
215
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
216
+
217
+ Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
218
+
219
+ Andrej Karpathy, Justin Johnson, and Fei-Fei Li. Visualizing and understanding recurrent neural networks. In ICLR Workshop, 2016.
220
+
221
+ Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014.
222
+
223
+ Diederick P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In International Conference for Learning Representations, 2015.
224
+
225
+ Peng Li, Wei Li, Zhengyan He, Xuguang Wang, Ying Cao, Jie Zhou, and Wei Xu. Dataset and neural recurrent sequence labeling model for open-domain factoid question answering. In arXiv, 2016.
226
+
227
+ Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. In Empirical Methods for Natural Language Processing, 2016.
228
+
229
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Empirical Methods for Natural Language Processing, 2016.
230
+
231
+ Richard Socher, Alex Perelygin, Jean Y Wu, Jason Chuang, Christopher D Manning, Andrew Y $\mathrm { N g }$ , and Christopher Potts Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013.
232
+
233
+ Ilya Sutskever, Oriol Vinyals, and Quoc Le. Sequence to sequence learning with neural networks. In Neural Information Processing Systems, 2014.
234
+
235
+ Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, pp. 649–657, 2015.
236
+
237
+ # 8 APPENDIX - HEAT MAPS
238
+
239
+ We provide an example heat map using the cell decomposition metric for each class in both sentiment analysis datasets, and selected WikiMovie question categories
240
+
241
+ <table><tr><td>Dataset Yelp</td><td>t Category</td><td>Heat Map</td></tr><tr><td>Polar- ity</td><td>Positive</td><td>we went here twice for breakfast . had the ba- nanas foster waffles with fresh whipped cream , they were amaZing ! perfect seat out side on</td></tr><tr><td>Yelp Polar- ity</td><td>Negative</td><td>the terrace call me spoiled 1...thissushiis grOSS and the orange chicken , well it was so thini don 'tthink it had chicken in it. go Somewhereelse</td></tr><tr><td>Stanford Positive Senti- ment</td><td></td><td>Whether or not you 're enlightened by any of Derrida's lectures on“ the other" and“ the self, " Deridais an undeniably fasci- natingandplayfulfel-</td></tr><tr><td>Stanford Negative Senti- ment</td><td>low plot</td><td>... begins with promise , but runs aground after being snared in its own tangled</td></tr><tr><td>Pattern Question</td><td></td><td>Heat Map</td></tr><tr><td>Movie to Year</td><td>What was the re- lease year of an- other 48 hours?</td><td>another 48 hrs iS a 1990</td></tr><tr><td>Movie to Writer</td><td>Which per- sonwrote the movie last of the dogmen?</td><td>last of the dogmen iS a 1995 western ad- venture film written and directed by tab murphy</td></tr><tr><td>Movie to Actor</td><td>Who acted in the movie thunder- bolt?</td><td>thunderbolt ()(" piklik foh") is a 1995 hong kong action film starring jackie chan bloody bloody bible cam p is a 2012 ameri-</td></tr><tr><td>Movie to Di- rector</td><td>Who directed bloodybloody bible camp?</td><td>can horror - comedy /s platter flm .the film directed by vito tra- was bucco</td></tr><tr><td>Movie to Genre</td><td>What genre is trespass in?</td><td>trespass iS a 992 aoton</td></tr><tr><td>Movie to Votes</td><td>How would people rate the pool?</td><td>though filmed in hindi ,a language smith didn 't know the film earned * good</td></tr><tr><td>Movie to Rating</td><td>How popu- lar was les miserables?</td><td>les mis rables is a 1935 american drama film starring fredric march and charles laughton based upon te famous</td></tr><tr><td>Movie to Tags</td><td>Describe rough magic?</td><td>rough magic is a 1995 comedy film di- rected by clare peploe and starring bridget fonda, russell crowe</td></tr><tr><td>Movie to Lan- guage</td><td>Whatisthe mainlanguage in fate?</td><td>fate( is a 200 turkish</td></tr></table>
parse/train/SJvYgH9xe/SJvYgH9xe_content_list.json ADDED
@@ -0,0 +1,1238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "AUTOMATIC RULE EXTRACTION FROM LONG SHORTTERM MEMORY NETWORKS",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 99,
9
+ 821,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "W. James Murdoch ∗ Department of Statistics UC Berkeley Berkeley, CA 94709, USA jmurdoch@berkeley.edu ",
17
+ "bbox": [
18
+ 183,
19
+ 170,
20
+ 359,
21
+ 239
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Arthur Szlam \nFacebook AI Research \nNew York City, NY, 10003 \naszlam $@$ fb.com ",
28
+ "bbox": [
29
+ 506,
30
+ 170,
31
+ 684,
32
+ 226
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "ABSTRACT ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 454,
42
+ 276,
43
+ 544,
44
+ 291
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Although deep learning models have proven effective at solving problems in natural language processing, the mechanism by which they come to their conclusions is often unclear. As a result, these models are generally treated as black boxes, yielding no insight of the underlying learned patterns. In this paper we consider Long Short Term Memory networks (LSTMs) and demonstrate a new approach for tracking the importance of a given input to the LSTM for a given output. By identifying consistently important patterns of words, we are able to distill state of the art LSTMs on sentiment analysis and question answering into a set of representative phrases. This representation is then quantitatively validated by using the extracted phrases to construct a simple, rule-based classifier which approximates the output of the LSTM. ",
51
+ "bbox": [
52
+ 233,
53
+ 309,
54
+ 764,
55
+ 460
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 178,
65
+ 489,
66
+ 336,
67
+ 505
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Neural network language models, especially recurrent neural networks (RNN), are now standard tools for natural language processing. Amongst other things, they are used for translation Sutskever et al. (2014), language modelling Jozefowicz et al. (2016), and question answering Hewlett et al. (2016). In particular, the Long Short Term Memory (LSTM) Hochreiter & Schmidhuber (1997) architecture has become a basic building block of neural NLP. Although LSTM’s are regularly used in state of the art systems, their operation is not well understood. Besides the basic desire from a scientific viewpoint to clarify their workings, it is often the case that it is important to understand why a machine learning algorithm made a particular choice. Moreover, LSTM’s are computationally intensive compared to discrete models with lookup tables and pattern matching. ",
74
+ "bbox": [
75
+ 174,
76
+ 520,
77
+ 825,
78
+ 645
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In this work, we describe a novel method for visualizing the importance of specific inputs for determining the output of an LSTM. We then demonstrate that, by searching for phrases which are consistently important, the importance scores can be used to extract simple phrase patterns consisting of one to five words from a trained LSTM. The phrase extraction is first done in a general document classification framework on two different sentiment analysis datasets. We then demonstrate that it can also be specialized to more complex models by applying it to WikiMovies, a recently introduced question answer dataset. To concretely validate the extracted patterns, we use them as input to a rules-based classifier which approximates the performance of the original LSTM. ",
85
+ "bbox": [
86
+ 174,
87
+ 652,
88
+ 825,
89
+ 763
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "2 RELATED WORK ",
96
+ "text_level": 1,
97
+ "bbox": [
98
+ 176,
99
+ 785,
100
+ 344,
101
+ 801
102
+ ],
103
+ "page_idx": 0
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "There are two lines of related work on visualizing LSTMs. First, Hendrik et al. (2016) and Karpathy et al. (2016) analyse the movement of the raw gate activations over a sequence. Karpathy et al. (2016) is able to identify co-ordinates of $c _ { t }$ that correspond to semantically meaningful attributes such as whether the text is in quotes and how far along the sentence a word is. However, most of the cell co-ordinates are harder to interpret, and in particular, it is often not obvious from their activations which inputs are important for specific outputs. ",
108
+ "bbox": [
109
+ 174,
110
+ 816,
111
+ 825,
112
+ 900
113
+ ],
114
+ "page_idx": 0
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "Another approach that has emerged in the literature Alikaniotis et al. (2016) Denil et al. (2015) Bansal et al. (2016) is for each word in the document, looking at the norm of the derivative of the loss function with respect to the embedding parameters for that word. This bridges the gap between high-dimensional cell state and low-dimensional outputs. These techniques are general- they are applicable to visualizing the importance of sets of input coordinates to output coordinates of any differentiable function. In this work, we describe techniques that are designed around the structure of LSTM’s, and show that they can give better results in that setting. ",
119
+ "bbox": [
120
+ 174,
121
+ 103,
122
+ 825,
123
+ 202
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "A recent line of work Li et al. (2016) Hewlett et al. (2016) Rajpurkar et al. (2016) Miller et al. (2016) has focused on neural network techniques for extracting answers directly from documents. Previous work had focused on Knowledge Bases (KBs), and techniques to map questions to logical forms suitable for querying them. Although they are effective within their domain, KBs are inevitably incomplete, and are thus an unsatisfactory solution to the general problem of question-answering. Wikipedia, in contrast, has enough information to answer a far broader array of questions, but is not as easy to query. Originally introduced in Miller et al. (2016), the WikiMovies dataset consists of questions about movies paired with Wikipedia articles. ",
130
+ "bbox": [
131
+ 174,
132
+ 207,
133
+ 825,
134
+ 319
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "3 WORD IMPORTANCE SCORES IN LSTMS ",
141
+ "text_level": 1,
142
+ "bbox": [
143
+ 174,
144
+ 338,
145
+ 542,
146
+ 356
147
+ ],
148
+ "page_idx": 1
149
+ },
150
+ {
151
+ "type": "text",
152
+ "text": "We present a novel decomposition of the output of an LSTM into a product of factors, where each term in the product can be interpreted as the contribution of a particular word. Thus, we can assign importance scores to words according to their contribution to the LSTM’s prediction ",
153
+ "bbox": [
154
+ 174,
155
+ 369,
156
+ 825,
157
+ 412
158
+ ],
159
+ "page_idx": 1
160
+ },
161
+ {
162
+ "type": "text",
163
+ "text": "3.1 LONG SHORT TERM MEMORY NETWORKS",
164
+ "text_level": 1,
165
+ "bbox": [
166
+ 176,
167
+ 429,
168
+ 508,
169
+ 444
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "Over the past few years, LSTMs have become an important part of neural NLP systems. Given a sequence of word embeddings $x _ { 1 } , . . . , x _ { T } \\in \\mathbb { R } ^ { d }$ , an LSTM processes one word at a time, keeping track of cell and state vectors $( c _ { 1 } , h _ { 1 } ) , . . . , ( c _ { T } , h _ { T } )$ which contain information in the sentence up to word $i$ . $h _ { t }$ and $c _ { t }$ are computed as a function of $x _ { t } , c _ { t - 1 }$ using the below updates ",
176
+ "bbox": [
177
+ 174,
178
+ 455,
179
+ 825,
180
+ 511
181
+ ],
182
+ "page_idx": 1
183
+ },
184
+ {
185
+ "type": "equation",
186
+ "img_path": "images/6bd5f9e428b6319861f84aec8504d559cba40b874024e585347ea23215a62a01.jpg",
187
+ "text": "$$\n\\begin{array} { r l } & { f _ { t } = \\sigma \\big ( W _ { f } x _ { t } + V _ { f } h _ { t - 1 } + b _ { f } \\big ) } \\\\ & { i _ { t } = \\sigma \\big ( W _ { i } x _ { t } + V _ { i } h _ { t - 1 } + b _ { i } \\big ) } \\\\ & { o _ { t } = \\sigma \\big ( W _ { o } x _ { t } + V _ { o } h _ { t - 1 } + b _ { o } \\big ) } \\\\ & { \\tilde { c } _ { t } = \\operatorname { t a n h } \\big ( W _ { c } x _ { t } + V _ { c } h _ { t - 1 } + b _ { c } \\big ) } \\\\ & { c _ { t } = f _ { t } c _ { t - 1 } + i _ { t } \\tilde { c } _ { t } } \\\\ & { h _ { t } = o _ { t } \\odot \\operatorname { t a n h } \\big ( c _ { t } \\big ) } \\end{array}\n$$",
188
+ "text_format": "latex",
189
+ "bbox": [
190
+ 387,
191
+ 515,
192
+ 611,
193
+ 623
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "As initial values, we define $c _ { 0 } = h _ { 0 } = 0$ . After processing the full sequence, a probability distribution over $C$ classes is specified by $p$ , with ",
200
+ "bbox": [
201
+ 174,
202
+ 633,
203
+ 821,
204
+ 661
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "equation",
210
+ "img_path": "images/6eb36bac044cc6cb994e730fd87b76daa0c7c10bc66509d8f23d322357bc495e.jpg",
211
+ "text": "$$\np _ { i } = \\mathrm { S o f t M a x } ( W h _ { T } ) = \\frac { e ^ { W _ { i } h _ { T } } } { \\sum _ { j = 1 } ^ { C } e ^ { W _ { j } h _ { t } } }\n$$",
212
+ "text_format": "latex",
213
+ "bbox": [
214
+ 370,
215
+ 665,
216
+ 627,
217
+ 707
218
+ ],
219
+ "page_idx": 1
220
+ },
221
+ {
222
+ "type": "text",
223
+ "text": "where $W _ { i }$ is the $\\Ddot { \\iota }$ ’th row of the matrix $W$ ",
224
+ "bbox": [
225
+ 176,
226
+ 710,
227
+ 446,
228
+ 724
229
+ ],
230
+ "page_idx": 1
231
+ },
232
+ {
233
+ "type": "text",
234
+ "text": "3.2 DECOMPOSING THE OUTPUT OF A LSTM ",
235
+ "text_level": 1,
236
+ "bbox": [
237
+ 176,
238
+ 741,
239
+ 503,
240
+ 756
241
+ ],
242
+ "page_idx": 1
243
+ },
244
+ {
245
+ "type": "text",
246
+ "text": "We now show that we can decompose the numerator of $p _ { i }$ in Equation 7 into a product of factors, and interpret those factors as the contribution of individual words to the predicted probability of class $i$ . Define ",
247
+ "bbox": [
248
+ 176,
249
+ 767,
250
+ 825,
251
+ 809
252
+ ],
253
+ "page_idx": 1
254
+ },
255
+ {
256
+ "type": "equation",
257
+ "img_path": "images/072f57028414a453a940acef20d1225594e8793438dcdd795534c6008d6a6998.jpg",
258
+ "text": "$$\n\\beta _ { i , j } = \\exp \\left( W _ { i } ( o _ { T } \\odot ( \\operatorname { t a n h } ( c _ { j } ) - \\operatorname { t a n h } ( c _ { j - 1 } ) ) ) \\right) ,\n$$",
259
+ "text_format": "latex",
260
+ "bbox": [
261
+ 331,
262
+ 808,
263
+ 663,
264
+ 827
265
+ ],
266
+ "page_idx": 1
267
+ },
268
+ {
269
+ "type": "text",
270
+ "text": "so that ",
271
+ "bbox": [
272
+ 173,
273
+ 828,
274
+ 220,
275
+ 840
276
+ ],
277
+ "page_idx": 1
278
+ },
279
+ {
280
+ "type": "equation",
281
+ "img_path": "images/39eedae5290927b8e26ad349e9435db94c29e9a73de2afd3659c6682f2391474.jpg",
282
+ "text": "$$\n\\exp ( W _ { i } h _ { T } ) = \\exp \\left( \\sum _ { j = 1 } ^ { T } W _ { i } \\big ( o _ { T } \\odot ( \\operatorname { t a n h } ( c _ { j } ) - \\operatorname { t a n h } ( c _ { j - 1 } ) ) \\bigg ) \\right) = \\prod _ { j = 1 } ^ { T } \\beta _ { i , j } .\n$$",
283
+ "text_format": "latex",
284
+ "bbox": [
285
+ 250,
286
+ 835,
287
+ 745,
288
+ 887
289
+ ],
290
+ "page_idx": 1
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "As $\\operatorname { t a n h } ( c _ { j } ) - \\operatorname { t a n h } ( c _ { j - 1 } )$ can be viewed as the update resulting from word $j$ , so $\\beta _ { i , j }$ can be interpreted as the multiplicative contribution to $p _ { i }$ by word $j$ . ",
295
+ "bbox": [
296
+ 174,
297
+ 895,
298
+ 821,
299
+ 924
300
+ ],
301
+ "page_idx": 1
302
+ },
303
+ {
304
+ "type": "text",
305
+ "text": "3.3 AN ADDITIVE DECOMPOSITION OF THE LSTM CELL ",
306
+ "text_level": 1,
307
+ "bbox": [
308
+ 173,
309
+ 103,
310
+ 580,
311
+ 118
312
+ ],
313
+ "page_idx": 2
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "We will show below that the $\\beta _ { i , j }$ capture some notion of the importance of a word to the LSTM’s output. However, these terms fail to account for how the information contributed by word $j$ is affected by the LSTM’s forget gates between words $j$ and $T$ . Consequently, we empirically found that the importance scores from this approach often yield a considerable amount of false positives. A more nuanced approach is obtained by considering the additive decomposition of $c _ { T }$ in equation (9), where each term $e _ { j }$ can be interpreted as the contribution to the cell state $c _ { T }$ by word $j$ . By iterating the equation $\\dot { c _ { t } } = f _ { t } c _ { t - 1 } + i _ { t } \\tilde { c } _ { t }$ , we get that ",
318
+ "bbox": [
319
+ 173,
320
+ 128,
321
+ 825,
322
+ 228
323
+ ],
324
+ "page_idx": 2
325
+ },
326
+ {
327
+ "type": "equation",
328
+ "img_path": "images/1f533ec771f231879f79940deba58d099924a541ef77c1087a50118e4bd36979.jpg",
329
+ "text": "$$\nc _ { T } = \\sum _ { i = 1 } ^ { T } ( \\prod _ { j = i + 1 } ^ { T } f _ { j } ) i _ { i } \\tilde { c } _ { i } = \\sum _ { i = 1 } ^ { T } e _ { i , T }\n$$",
330
+ "text_format": "latex",
331
+ "bbox": [
332
+ 382,
333
+ 233,
334
+ 614,
335
+ 279
336
+ ],
337
+ "page_idx": 2
338
+ },
339
+ {
340
+ "type": "text",
341
+ "text": "This suggests a natural definition of an alternative score to the $\\beta _ { i , j }$ , corresponding to augmenting the $c _ { j }$ terms with products of forget gates to reflect the upstream changes made to $c _ { j }$ after initially processing word $j$ . ",
342
+ "bbox": [
343
+ 174,
344
+ 285,
345
+ 823,
346
+ 328
347
+ ],
348
+ "page_idx": 2
349
+ },
350
+ {
351
+ "type": "equation",
352
+ "img_path": "images/2014d63b543bf20b6045008279016a3e02e5c4797382fa456e5a479f867ac317.jpg",
353
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle \\exp ( W _ { i } h _ { T } ) = \\prod _ { j = 1 } ^ { T } \\exp ( W _ { i } \\big ( o _ { T } \\odot \\big ( \\operatorname { t a n h } \\bigl ( \\underset { k = 1 } { \\overset { j } { \\sum } } e _ { k , T } \\big ) - \\operatorname { t a n h } \\bigl ( \\underset { k = 1 } { \\overset { j - 1 } { \\sum } } e _ { k , T } \\big ) \\big ) ) ) } } \\\\ { { \\displaystyle \\qquad = \\prod _ { j = 1 } ^ { T } \\exp ( W _ { i } \\big ( o _ { T } \\odot \\big ( \\operatorname { t a n h } \\bigl ( \\underset { k = j + 1 } { \\overset { k } { \\prod } } f _ { k } \\big ) c _ { j } \\big ) - \\operatorname { t a n h } \\bigl ( \\underset { k = j } { \\overset { k } { \\prod } } f _ { k } \\big ) c _ { j - 1 } \\big ) ) ) } } \\\\ { { \\displaystyle \\qquad = \\prod _ { j = 1 } ^ { T } \\gamma _ { i , j } } } \\end{array}\n$$",
354
+ "text_format": "latex",
355
+ "bbox": [
356
+ 209,
357
+ 333,
358
+ 759,
359
+ 478
360
+ ],
361
+ "page_idx": 2
362
+ },
363
+ {
364
+ "type": "text",
365
+ "text": "4 PHRASE EXTRACTION FOR DOCUMENT CLASSIFICATION ",
366
+ "text_level": 1,
367
+ "bbox": [
368
+ 174,
369
+ 491,
370
+ 678,
371
+ 508
372
+ ],
373
+ "page_idx": 2
374
+ },
375
+ {
376
+ "type": "text",
377
+ "text": "We now introduce a technique for using our variable importance scores to extract phrases from a trained LSTM. To do so, we search for phrases which consistently provide a large contribution to the prediction of a particular class relative to other classes. The utility of these patterns is validated by using them as input for a rules based classifier. For simplicity, we focus on the binary classification case. ",
378
+ "bbox": [
379
+ 174,
380
+ 522,
381
+ 825,
382
+ 593
383
+ ],
384
+ "page_idx": 2
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "4.1 PHRASE EXTRACTION ",
389
+ "text_level": 1,
390
+ "bbox": [
391
+ 176,
392
+ 609,
393
+ 367,
394
+ 625
395
+ ],
396
+ "page_idx": 2
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "A phrase can be reasonably described as predictive if, whenever it occurs, it causes a document to both be labelled as a particular class, and not be labelled as any other. As our importance scores introduced above correspond to the contribution of particular words to class predictions, they can be used to score potential patterns by looking at a pattern’s average contribution to the prediction of a given class relative to other classes. More precisely, given a collection of $D$ documents $\\{ \\{ x _ { i , j } \\} _ { i = 1 } ^ { N _ { d } } \\} _ { j = 1 } ^ { D }$ , for a given phrase $w _ { 1 } , . . . , w _ { k }$ we can compute scores $S _ { 1 } , S _ { 2 }$ for classes 1 and 2, as well as a combined score $S$ and class $C$ as ",
401
+ "bbox": [
402
+ 173,
403
+ 635,
404
+ 825,
405
+ 734
406
+ ],
407
+ "page_idx": 2
408
+ },
409
+ {
410
+ "type": "equation",
411
+ "img_path": "images/76cdc0dc286da5af407032df9e794caab8a3bd56b7797936385010de55323614.jpg",
412
+ "text": "$$\n\\begin{array} { l } { { S _ { 1 } ( w _ { 1 } , . . . , w _ { k } ) = { \\displaystyle { \\frac { \\mathrm { A v e r a g e } _ { j , b } \\left\\{ \\prod _ { l = 1 } ^ { k } \\beta _ { 1 , b + l , j } | x _ { b + i , j } = w _ { i } , i = 1 , . . . , k \\right\\} } } } } } \\\\ { { \\mathrm { A v e r a g e } _ { j , b } \\left\\{ \\prod _ { l = 1 } ^ { k } \\beta _ { 2 , b + l , j } | x _ { b + i , j } = w _ { i } , i = 1 , . . . , k \\right\\} } } \\\\ { { S _ { 2 } ( w _ { 1 } , . . , w _ { k } ) = { \\displaystyle { \\frac { 1 } { S _ { 1 } ( w _ { 1 } , . . . , w _ { k } ) } } } } } \\\\ { { S ( w _ { 1 } , . . . , w _ { k } ) = { \\displaystyle { \\operatorname* { m a x } _ { i } } } ( S _ { i } ( w _ { 1 } , . . . , w _ { k } ) ) } } \\\\ { { C ( w _ { 1 } , . . . , w _ { k } ) = \\mathrm { a r g m a x } _ { i } ( S _ { i } ( w _ { 1 } , . . . , w _ { k } ) ) } } \\end{array}\n$$",
413
+ "text_format": "latex",
414
+ "bbox": [
415
+ 261,
416
+ 739,
417
+ 736,
418
+ 869
419
+ ],
420
+ "page_idx": 2
421
+ },
422
+ {
423
+ "type": "text",
424
+ "text": "where $\\beta _ { i , j , k }$ denotes $\\beta _ { i , j }$ applied to document $k$ ",
425
+ "bbox": [
426
+ 174,
427
+ 875,
428
+ 490,
429
+ 890
430
+ ],
431
+ "page_idx": 2
432
+ },
433
+ {
434
+ "type": "text",
435
+ "text": "The numerator of $S _ { 1 }$ denotes the average contribution of the phrase to the prediction of class 1 across all occurrences of the phrase. The denominator denotes the same statistic, but for class 2. Thus, if ",
436
+ "bbox": [
437
+ 176,
438
+ 895,
439
+ 825,
440
+ 924
441
+ ],
442
+ "page_idx": 2
443
+ },
444
+ {
445
+ "type": "text",
446
+ "text": "$S _ { 1 }$ is high, then $w _ { 1 } , . . . , w _ { k }$ is a strong signal for class 1, and likewise for $S _ { 2 }$ . We propose to use $S$ as a score function in order to search for high scoring, representative, phrases which provide insight into the trained LSTM, and $C$ to denote the class corresponding to a phrase. ",
447
+ "bbox": [
448
+ 174,
449
+ 103,
450
+ 823,
451
+ 146
452
+ ],
453
+ "page_idx": 3
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "In practice, the number of phrases is too large to feasibly compute the score of them all. Thus, we approximate a brute force search through a two step procedure. First, we construct a list of candidate phrases by searching for strings of consecutive words $j$ with importance scores $\\beta _ { i , j } > c$ for any $i$ and some threshold $c$ ; in the experiments below we use $c = 1 . 1$ . Then, we score and rank the set of candidate phrases, which is much smaller than the set of all phrases. ",
458
+ "bbox": [
459
+ 174,
460
+ 152,
461
+ 825,
462
+ 222
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "4.2 RULES BASED CLASSIFIER ",
469
+ "text_level": 1,
470
+ "bbox": [
471
+ 176,
472
+ 241,
473
+ 395,
474
+ 253
475
+ ],
476
+ "page_idx": 3
477
+ },
478
+ {
479
+ "type": "text",
480
+ "text": "The extracted patterns from Section 4.1 can be used to construct a simple, rules-based classifier which approximates the output of the original LSTM. Given a document and a list of patterns sorted by descending score given by $S$ , the classifier sequentially searches for each pattern within the document using simple string matching. Once it finds a pattern, the classifier returns the associated class given by $C$ , ignoring the lower ranked patterns. The resulting classifier is interpretable, and despite its simplicity, retains much of the accuracy of the LSTM used to build it. ",
481
+ "bbox": [
482
+ 174,
483
+ 267,
484
+ 825,
485
+ 349
486
+ ],
487
+ "page_idx": 3
488
+ },
489
+ {
490
+ "type": "text",
491
+ "text": "5 EXPERIMENTS ",
492
+ "text_level": 1,
493
+ "bbox": [
494
+ 176,
495
+ 371,
496
+ 326,
497
+ 387
498
+ ],
499
+ "page_idx": 3
500
+ },
501
+ {
502
+ "type": "text",
503
+ "text": "We now present the results of our experiments. ",
504
+ "bbox": [
505
+ 176,
506
+ 404,
507
+ 480,
508
+ 417
509
+ ],
510
+ "page_idx": 3
511
+ },
512
+ {
513
+ "type": "text",
514
+ "text": "5.1 TRAINING DETAILS ",
515
+ "text_level": 1,
516
+ "bbox": [
517
+ 176,
518
+ 435,
519
+ 351,
520
+ 450
521
+ ],
522
+ "page_idx": 3
523
+ },
524
+ {
525
+ "type": "text",
526
+ "text": "We implemented all models in Torch using default hyperparameters for weight initializations. For WikiMovies, all documents and questions were pre-processed so that multiple word entities were concatenated into a single word. For a given question, relevant articles were found by first extracting from the question the rarest entity, then returning a list of Wikipedia articles containing any of those words. We use the pre-defined splits into train, validation and test sets, containing 96k, 10k and $1 0 \\mathrm { k }$ questions, respectively. The word and hidden representations of the LSTM were both set to dimension 200 for WikiMovies, 300 and 512 for Yelp, and 300 and 150 for Stanford Sentiment Treebank. All models were optimized using Adam Kingma & Ba (2015) with the default learning rate of 0.001 using early stopping on the validation set. For rule extraction using gradient scores, the product in the reward function is replaced by a sum. In both datasets, we found that normalizing the gradient scores by the largest gradient improved results. ",
527
+ "bbox": [
528
+ 174,
529
+ 462,
530
+ 825,
531
+ 614
532
+ ],
533
+ "page_idx": 3
534
+ },
535
+ {
536
+ "type": "text",
537
+ "text": "5.2 SENTIMENT ANALYSIS ",
538
+ "text_level": 1,
539
+ "bbox": [
540
+ 176,
541
+ 632,
542
+ 372,
543
+ 647
544
+ ],
545
+ "page_idx": 3
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "We first applied the document classification framework to two different sentiment analysis datasets. Originally introduced in Zhang et al. (2015), the Yelp review polarity dataset was obtained from the Yelp Dataset Challenge and has train and test sets of size 560,000 and 38,000. The task is binary prediction for whether the review is positive (four or five stars) or negative (one or two stars). The reviews are relatively long, with an average length of 160.1 words. We also used the binary classification task from the Stanford Sentiment Treebank (SST) Socher et al. (2013), which has less data with train/dev/test sizes of 6920/872/1821, and is done at a sentence level, so has much shorter document lengths. ",
550
+ "bbox": [
551
+ 174,
552
+ 659,
553
+ 825,
554
+ 770
555
+ ],
556
+ "page_idx": 3
557
+ },
558
+ {
559
+ "type": "text",
560
+ "text": "We report results in Table 1 for seven different models. We report state of the art results from prior work using convolutional neural networks; Kim (2014) for SST and Zhang et al. (2015) for Yelp. We also report our LSTM baselines, which are competitive with state of the art, along with the three different pattern matching models described above. For SST, we also report prior results using bag of words features with Naive Bayes. ",
561
+ "bbox": [
562
+ 174,
563
+ 776,
564
+ 825,
565
+ 847
566
+ ],
567
+ "page_idx": 3
568
+ },
569
+ {
570
+ "type": "text",
571
+ "text": "The additive cell decomposition pattern equals or outperforms the cell-difference patterns, which handily beat the gradient results. This coincides with our empirical observations regarding the information contained within the importance measures, and validates our introduced measure. The differences between measures become more pronounced in Yelp, as the longer document sizes provide more opportunities for false positives. ",
572
+ "bbox": [
573
+ 176,
574
+ 854,
575
+ 823,
576
+ 924
577
+ ],
578
+ "page_idx": 3
579
+ },
580
+ {
581
+ "type": "table",
582
+ "img_path": "images/9ff5a1043dd6732c40c048aa83bfa6600afa1e9a63d13bdc543f245cd77a1959.jpg",
583
+ "table_caption": [
584
+ "Table 1: Test accuracy on sentiment analysis. See section 5.2 for further descriptions of the models. "
585
+ ],
586
+ "table_footnote": [],
587
+ "table_body": "<table><tr><td>Model</td><td>Yelp Polarity</td><td>Stanford Sentiment Treebank</td></tr><tr><td>Large word2vec CNN Zhang et al. (2015)</td><td>95.4</td><td></td></tr><tr><td>CNN-multichannel Kim (2014)</td><td></td><td>88.1</td></tr><tr><td>Naive Bayes Socher et al. (2013)</td><td></td><td>82.6</td></tr><tr><td>LSTM</td><td>95.3</td><td>87.3</td></tr><tr><td>Cell Decomposition Pattern Matching</td><td>86.5</td><td>76.2</td></tr><tr><td>Cell-Difference Pat- tern Matching</td><td>81.2</td><td>77.4</td></tr><tr><td>Gradient Pattern Matching</td><td>65.0</td><td>68.0</td></tr></table>",
588
+ "bbox": [
589
+ 253,
590
+ 99,
591
+ 745,
592
+ 315
593
+ ],
594
+ "page_idx": 4
595
+ },
596
+ {
597
+ "type": "text",
598
+ "text": "Although our pattern matching algorithms underperform other methods, we emphasize that pure performance is not our goal, nor would we expect more from such a simple model. Rather, the fact that our method provides reasonable accuracy is one piece of evidence, in addition to the qualitative evidence given later, that our word importance scores and extracted patterns contain useful information for understanding the actions of a LSTM. ",
599
+ "bbox": [
600
+ 174,
601
+ 366,
602
+ 825,
603
+ 436
604
+ ],
605
+ "page_idx": 4
606
+ },
607
+ {
608
+ "type": "text",
609
+ "text": "5.3 WIKIMOVIES ",
610
+ "text_level": 1,
611
+ "bbox": [
612
+ 174,
613
+ 459,
614
+ 308,
615
+ 474
616
+ ],
617
+ "page_idx": 4
618
+ },
619
+ {
620
+ "type": "text",
621
+ "text": "Although document classification comprises a sizeable portion of current research in natural language processing, much recent work focuses on more complex problems and models. In this section, we examine WikiMovies, a recently introduced question answer dataset, and show that with some simple modifications our approach can be adapted to this problem. ",
622
+ "bbox": [
623
+ 176,
624
+ 486,
625
+ 825,
626
+ 542
627
+ ],
628
+ "page_idx": 4
629
+ },
630
+ {
631
+ "type": "text",
632
+ "text": "5.3.1 DATASET ",
633
+ "text_level": 1,
634
+ "bbox": [
635
+ 174,
636
+ 558,
637
+ 292,
638
+ 573
639
+ ],
640
+ "page_idx": 4
641
+ },
642
+ {
643
+ "type": "text",
644
+ "text": "WikiMovies is a dataset consisting of more than 100,000 questions about movies, paired with relevant Wikipedia articles. It was constructed using the pre-existing dataset MovieLens, paired with templates extracted from the SimpleQuestions dataset Bordes et al. (2015), a open-domain question answering dataset based on Freebase. They then selected a set of Wikipedia articles about movies by identifying a set of movies from OMDb that had an associated article by title match, and kept the title and first section for each article. ",
645
+ "bbox": [
646
+ 174,
647
+ 583,
648
+ 825,
649
+ 666
650
+ ],
651
+ "page_idx": 4
652
+ },
653
+ {
654
+ "type": "text",
655
+ "text": "For a given question, the task is to read through the relevant articles and extract the answer, which is contained somewhere within the text. The dataset also provides a list of $4 3 \\mathrm { k }$ entities containing all possible answers. ",
656
+ "bbox": [
657
+ 174,
658
+ 674,
659
+ 825,
660
+ 715
661
+ ],
662
+ "page_idx": 4
663
+ },
664
+ {
665
+ "type": "text",
666
+ "text": "5.3.2 LSTMS FOR WIKIMOVIES ",
667
+ "text_level": 1,
668
+ "bbox": [
669
+ 176,
670
+ 731,
671
+ 413,
672
+ 746
673
+ ],
674
+ "page_idx": 4
675
+ },
676
+ {
677
+ "type": "text",
678
+ "text": "We propose a simplified version of recent work Li et al. (2016). Given a pair of question $x _ { 1 } ^ { q } , . . . , x _ { N } ^ { q }$ and document $x _ { 1 } ^ { d } , . . . , x _ { T } ^ { d }$ , we first compute an embedding for the question using a LSTM. Then, for each word $t$ in the document, we augment the word embedding $x _ { t }$ with the computed question embedding. This is equivalent to adding an additional term which is linear in the question embedding into the gate equations 3-6, allowing the patterns an LSTM absorbs to be directly conditioned upon the question at hand. ",
679
+ "bbox": [
680
+ 174,
681
+ 756,
682
+ 825,
683
+ 842
684
+ ],
685
+ "page_idx": 4
686
+ },
687
+ {
688
+ "type": "equation",
689
+ "img_path": "images/819086f037f236bda6a037c5efbd7d85fb09a67c48bbe49ea11160ffd0133cfc.jpg",
690
+ "text": "$$\n\\begin{array} { r l } & { h _ { t } ^ { q } = \\mathrm { L S T M } ( x _ { t } ^ { q } ) } \\\\ & { h _ { t } = \\mathrm { L S T M } ( x _ { t } ^ { d } \\| h _ { N } ^ { q } ) } \\end{array}\n$$",
691
+ "text_format": "latex",
692
+ "bbox": [
693
+ 426,
694
+ 848,
695
+ 571,
696
+ 891
697
+ ],
698
+ "page_idx": 4
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "Having run the above model over the document while conditioning on a question, we are given contextual representations $h _ { 1 } , . . . , h _ { T }$ of the words in the document. For each entity $t$ in the document ",
703
+ "bbox": [
704
+ 173,
705
+ 895,
706
+ 823,
707
+ 924
708
+ ],
709
+ "page_idx": 4
710
+ },
711
+ {
712
+ "type": "table",
713
+ "img_path": "images/3667a64d7707451bdd56b57b93df7219fd699adf496d944cbed03b433933b987.jpg",
714
+ "table_caption": [
715
+ "Table 2: Test results on WikiMovies, measured in $\\%$ hits $@ 1$ . See Section 5.3.4 for further descriptions of the models. "
716
+ ],
717
+ "table_footnote": [],
718
+ "table_body": "<table><tr><td>Model</td><td>Test accuracy</td></tr><tr><td>KV-MemNN IE</td><td>68.3</td></tr><tr><td>KV-MemNN Doc</td><td>76.2</td></tr><tr><td>LSTM</td><td>80.1</td></tr><tr><td>Cell Decomposition Pattern Matching</td><td>74.3</td></tr><tr><td>Cell-Difference Pattern Matching</td><td>69.4</td></tr><tr><td>Gradient Pattern Matching</td><td>57.4</td></tr></table>",
719
+ "bbox": [
720
+ 334,
721
+ 99,
722
+ 663,
723
+ 246
724
+ ],
725
+ "page_idx": 5
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "we use $p _ { t }$ to conduct a binary prediction for whether or not the entity is the answer. At test time, we return the entity with the highest probability as the answer. ",
730
+ "bbox": [
731
+ 173,
732
+ 309,
733
+ 820,
734
+ 337
735
+ ],
736
+ "page_idx": 5
737
+ },
738
+ {
739
+ "type": "equation",
740
+ "img_path": "images/cacbd8ecb7136e9b25c5505fd65915cf0c27b21f539e489e323bc1a06c5be4d7.jpg",
741
+ "text": "$$\np _ { t } = \\mathbf { S o f t M a x } ( W h _ { t } )\n$$",
742
+ "text_format": "latex",
743
+ "bbox": [
744
+ 426,
745
+ 347,
746
+ 570,
747
+ 363
748
+ ],
749
+ "page_idx": 5
750
+ },
751
+ {
752
+ "type": "text",
753
+ "text": "5.3.3 PHRASE EXTRACTION ",
754
+ "text_level": 1,
755
+ "bbox": [
756
+ 174,
757
+ 378,
758
+ 382,
759
+ 393
760
+ ],
761
+ "page_idx": 5
762
+ },
763
+ {
764
+ "type": "text",
765
+ "text": "We now introduce some simple modifications that were useful in adapting our pattern extraction framework to this specific task. First, in order to define the set of classifications problems to search over, we treat each entity $t$ within each document as a separate binary classification task with corresponding predictor $p _ { t }$ . Given this set of classification problems, rather than search over the space of all possible phrases, we restrict ourselves to those ending at the entity in question. We also distinguish patterns starting at the beginning of the document with those that do not and introduce an entity character into our pattern vocabulary, which can be matched by any entity. Template examples can be seen below, in Table 4. Once we have extracted a list of patterns, in the rules-based classifier we only search for positive examples, and return as the answer the entity matched to the highest ranked positive pattern. ",
766
+ "bbox": [
767
+ 173,
768
+ 404,
769
+ 825,
770
+ 544
771
+ ],
772
+ "page_idx": 5
773
+ },
774
+ {
775
+ "type": "text",
776
+ "text": "5.3.4 RESULTS ",
777
+ "text_level": 1,
778
+ "bbox": [
779
+ 174,
780
+ 560,
781
+ 292,
782
+ 575
783
+ ],
784
+ "page_idx": 5
785
+ },
786
+ {
787
+ "type": "text",
788
+ "text": "We report results on six different models in Tables 2 and 3. We show the results from Miller et al. (2016), which fit a key-value memory network (KV-MemNN) on representations from information extraction (IE) and raw text (Doc). Next, we report the results of the LSTM described in Section 5.3.2. Finally, we show the results of using three variants of the pattern matching algorithm described in Section 5.3.3: using patterns extracted using the additive decomposition (cell decomposition), difference in cells approaches (cell-difference) and gradient importance scores (gradient), as discussed in Section 2. Performance is reported using the accuracy of the top hit over all possible answers (all entities), i.e. the hits $@ 1$ metric. ",
789
+ "bbox": [
790
+ 173,
791
+ 585,
792
+ 825,
793
+ 696
794
+ ],
795
+ "page_idx": 5
796
+ },
797
+ {
798
+ "type": "text",
799
+ "text": "As shown in Table 2, our LSTM model surpasses the prior state of the art by nearly $4 \\%$ . Moreover, our automatic pattern matching model approximates the LSTM with less than $6 \\%$ error, which is surprisingly small for such a simple model, and falls within $2 \\%$ of the prior state of the art. Similarly to sentiment analysis, we observe a clear ordering of the results across question categories, with our cell decomposition scores providing the best performance, followed by the cell difference and gradient scores. ",
800
+ "bbox": [
801
+ 174,
802
+ 704,
803
+ 825,
804
+ 787
805
+ ],
806
+ "page_idx": 5
807
+ },
808
+ {
809
+ "type": "text",
810
+ "text": "6 DISCUSSION ",
811
+ "text_level": 1,
812
+ "bbox": [
813
+ 174,
814
+ 821,
815
+ 310,
816
+ 838
817
+ ],
818
+ "page_idx": 5
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "6.1 LEARNED PATTERNS ",
823
+ "text_level": 1,
824
+ "bbox": [
825
+ 176,
826
+ 854,
827
+ 356,
828
+ 869
829
+ ],
830
+ "page_idx": 5
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "We present extracted patterns for both sentiment tasks, and some WikiMovies question categories in Table 4. These patterns are qualitatively sensible, providing further validation of our approach. The increased size of the Yelp dataset allowed for longer phrases to be extracted relative to SST. ",
835
+ "bbox": [
836
+ 176,
837
+ 882,
838
+ 823,
839
+ 924
840
+ ],
841
+ "page_idx": 5
842
+ },
843
+ {
844
+ "type": "table",
845
+ "img_path": "images/f75702dc3afbc3abfcb80dd1613649e895301de60aa67d41181257187a5aea9a.jpg",
846
+ "table_caption": [
847
+ "Table 3: Results broken down by question category. See section 5.3.4 for further descriptions of the models. "
848
+ ],
849
+ "table_footnote": [],
850
+ "table_body": "<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>KV-MemNNIE</td><td rowspan=1 colspan=1>KV-MemNNDoc</td><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>Cell DecompRE</td><td rowspan=1 colspan=1>Cell DiffRE</td><td rowspan=1 colspan=1>GradientRE</td></tr><tr><td rowspan=1 colspan=1>Actor to Movie</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>83</td><td rowspan=1 colspan=1>82</td><td rowspan=1 colspan=1>78</td><td rowspan=1 colspan=1>77</td><td rowspan=1 colspan=1>78</td></tr><tr><td rowspan=1 colspan=1>Director to Movie</td><td rowspan=1 colspan=1>78</td><td rowspan=1 colspan=1>91</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>82</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>83</td></tr><tr><td rowspan=1 colspan=1>Writer to Movie</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>91</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>88</td></tr><tr><td rowspan=1 colspan=1>Tag to Movie</td><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>49</td><td rowspan=1 colspan=1>49</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>38</td><td rowspan=1 colspan=1>38</td></tr><tr><td rowspan=1 colspan=1>Movie to Year</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>89</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>84</td></tr><tr><td rowspan=1 colspan=1>Movie to Writer</td><td rowspan=1 colspan=1>61</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>63</td></tr><tr><td rowspan=1 colspan=1>Movie to Actor</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>67</td></tr><tr><td rowspan=1 colspan=1>Movie to Director</td><td rowspan=1 colspan=1>76</td><td rowspan=1 colspan=1>79</td><td rowspan=1 colspan=1>88</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>85</td><td rowspan=1 colspan=1>45</td></tr><tr><td rowspan=1 colspan=1>Movie to Genre</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>86</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>65</td><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>21</td></tr><tr><td rowspan=1 colspan=1>Movie to Votes</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>67</td></tr><tr><td rowspan=1 colspan=1>Movie to Rating</td><td rowspan=1 colspan=1>75</td><td rowspan=1 colspan=1>92</td><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>25</td></tr><tr><td rowspan=1 colspan=1>Movie to Language</td><td rowspan=1 colspan=1>62</td><td rowspan=1 colspan=1>84</td><td rowspan=1 colspan=1>72</td><td rowspan=1 colspan=1>67</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>44</td></tr><tr><td rowspan=1 colspan=1>Movie to Tags</td><td rowspan=1 colspan=1>47</td><td rowspan=1 colspan=1>48</td><td rowspan=1 colspan=1>58</td><td rowspan=1 colspan=1>44</td><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>6</td></tr></table>",
851
+ "bbox": [
852
+ 173,
853
+ 119,
854
+ 861,
855
+ 337
856
+ ],
857
+ "page_idx": 6
858
+ },
859
+ {
860
+ "type": "table",
861
+ "img_path": "images/62b251fa8594b2f1984fe5075fff8fc0ec9e1e839c090d631d44ad8397dd5879.jpg",
862
+ "table_caption": [],
863
+ "table_footnote": [
864
+ "Table 4: Selected top patterns using cell decomposition scores, ENT denotes an entity placeholder "
865
+ ],
866
+ "table_body": "<table><tr><td>Category</td><td>Top Patterns</td></tr><tr><td>Yelp Polarity Positive</td><td>definitely come back again.,love love love this place, great food and great service., highly rec- ommended!,will definitely be coming back, overall great experience,love everything about,</td></tr><tr><td>Yelp Polarity Negative</td><td>hidden gem. worst customer service ever, horrible horri- ble horrible, won&#x27;t be back, disappointed in this place, never go back there, not worth the money, not recommend this place</td></tr><tr><td>SST Positive</td><td>riveting documentary, is a real charmer, funny and touching, well worth your time, journey of the heart, emotional wallop, pleasure to watch, the whole family, cast is uniformly superb, comes from the heart, best films of the year, surprisingly funny, deeply satisfying</td></tr><tr><td>SST Negative</td><td>pretentious mess ., plain bad, worst film of the year, disappointingly generic, fart jokes, ba- nal dialogue, poorly executed, waste of time, a weak script,dullard,how bad it is,platitudes, never catches fire,tries too hard to be,bad act- ing,untalented artistes, derivative horror film,</td></tr><tr><td>WikiMovies movie to writer</td><td>lackluster film adaptation of Charles Dickens&#x27;, film adapted from ENT,by journalist ENT,written by ENT</td></tr><tr><td>WikiMovies movie to actor</td><td>western film starring ENT, starring Ben Af- fleck,.The movie stars ENT, that stars ENT is a 2014 french,icelandic,finnish,russian,</td></tr><tr><td>WikiMovies movie to language</td><td>danish, bengali, dutch,original german, zulu,czech,estonian,mandarin, filipino,hun- garian</td></tr></table>",
867
+ "bbox": [
868
+ 169,
869
+ 416,
870
+ 823,
871
+ 877
872
+ ],
873
+ "page_idx": 6
874
+ },
875
+ {
876
+ "type": "table",
877
+ "img_path": "images/8b521c75640326810640e799554509273f6851ce32110e08f72ccd20421c7cf7.jpg",
878
+ "table_caption": [
879
+ "Table 5: Examples from Stanford sentiment treebank which are correctly labelled by our LSTM and incorrectly labelled by our rules-based classifier. The matched pattern is highlighted "
880
+ ],
881
+ "table_footnote": [],
882
+ "table_body": "<table><tr><td>Sentiment</td><td>Pattern</td><td>Sentence</td></tr><tr><td>Negative</td><td>gets the job done</td><td>Still, it gets the job done - a sleepy afternoon rental</td></tr><tr><td>Negative</td><td>is a great</td><td>This is a great subject fora movie,but Hollywood has squandered the opportunity, using is as a prop for a warmed-over melodrama and the kind of choreographed mayhem that director John Woo has</td></tr><tr><td>Negative</td><td>happy end- ing</td><td>built his career on. The story loses its bite in a last-minute happy ending that’s even less plausible than the rest of the picture.</td></tr><tr><td>Negative</td><td>witty dialogue</td><td>An often-deadly boring,strange reading of a classic whose witty dialogue is treated with a baffling casual approach.</td></tr><tr><td>Positive</td><td>mess</td><td>The film is just a big, gorgeous, mind-blowing, breath-taking mess</td></tr></table>",
883
+ "bbox": [
884
+ 171,
885
+ 101,
886
+ 820,
887
+ 286
888
+ ],
889
+ "page_idx": 7
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "6.2 APPROXIMATION ERROR BETWEEN LSTM AND PATTERN MATCHING ",
894
+ "text_level": 1,
895
+ "bbox": [
896
+ 176,
897
+ 361,
898
+ 686,
899
+ 376
900
+ ],
901
+ "page_idx": 7
902
+ },
903
+ {
904
+ "type": "text",
905
+ "text": "Although our approach is able to extract sensible patterns and achieve reasonable performance, there is still an approximation gap between our algorithm and the LSTM. In Table 5 we present some examples of instances where the LSTM was able to correctly classify a sentence, and our algorithm was not, along with the pattern used by our algorithm. At first glance, the extracted patterns are sensible, as ”gets the job done” or ”witty dialogue” are phrases you’d expect to see in a positive review of a movie. However, when placed in the broader context of these particular reviews, they cease to be predictive. This demonstrates that, although our work is useful as a firstorder approximation, there are still additional relationships that an LSTM is able to learn from data. ",
906
+ "bbox": [
907
+ 174,
908
+ 391,
909
+ 825,
910
+ 502
911
+ ],
912
+ "page_idx": 7
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "6.3 COMPARISON BETWEEN WORD IMPORTANCE MEASURES ",
917
+ "text_level": 1,
918
+ "bbox": [
919
+ 174,
920
+ 532,
921
+ 602,
922
+ 545
923
+ ],
924
+ "page_idx": 7
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "While the prediction accuracy of our rules-based classifier provides quantitative validation of the relative merits of our visualizations, the qualitative differences are also insightful. In Table 6, we provide a side-by-side comparison between the different measures. As discussed before, the difference in cells technique fails to account for how the updates resulting from word $j$ are affected by the LSTM’s forget gates between when the word is initially processed and the answer. Consequently, we empirically found that without the interluding forget gates to dampen cell movements, the variable importance scores were far noisier than in additive cell decomposition approach. Under the additive cell decomposition, it identifies the phrase ’it stars’, as well as the actor’s name Aqib Khan as being important, a sensible conclusion. Moreover, the vast majority of words are labelled with an importance score of 1, corresponding to irrelevant. On the other hand, the difference in cells approach yields widely changing importance scores, which are challenging to interpret. In terms of noise, the gradient measures seem to lie somewhere in the middle. These patterns are broadly consistent with what we have observed, and provide qualitative validation of our metrics. ",
929
+ "bbox": [
930
+ 174,
931
+ 563,
932
+ 825,
933
+ 742
934
+ ],
935
+ "page_idx": 7
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "7 CONCLUSION ",
940
+ "text_level": 1,
941
+ "bbox": [
942
+ 176,
943
+ 773,
944
+ 318,
945
+ 790
946
+ ],
947
+ "page_idx": 7
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "In this paper, we introduced a novel method for visualizing the importance of specific inputs in determining the output of an LSTM. By searching for phrases which consistently provide large contributions, we are able to distill trained, state of the art, LSTMs into an ordered set of representative phrases. We quantitatively validate the extracted phrases through their performance in a simple, rules-based classifier. Results are shown in a general document classification framework, then specialized to a more complex, recently introduced, question answer dataset. Our introduced measures provide superior predictive ability and cleaner visualizations relative to prior work. We believe that this represents an exciting new paradigm for analysing the behaviour of LSTM’s. ",
952
+ "bbox": [
953
+ 174,
954
+ 811,
955
+ 823,
956
+ 924
957
+ ],
958
+ "page_idx": 7
959
+ },
960
+ {
961
+ "type": "image",
962
+ "img_path": "images/c07f9565b62e4a9995ea7e3b320ff9282edbb052375fb982ed31a0f87a383fc3.jpg",
963
+ "image_caption": [
964
+ "Table 6: Comparison of importance scores acquired by three different approaches, conditioning on the question ”the film west is west starred which actors?”. Bigger and darker means more important. "
965
+ ],
966
+ "image_footnote": [],
967
+ "bbox": [
968
+ 171,
969
+ 305,
970
+ 826,
971
+ 675
972
+ ],
973
+ "page_idx": 8
974
+ },
975
+ {
976
+ "type": "text",
977
+ "text": "ACKNOWLEDGEMENTS ",
978
+ "text_level": 1,
979
+ "bbox": [
980
+ 176,
981
+ 103,
982
+ 367,
983
+ 117
984
+ ],
985
+ "page_idx": 9
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "This research was partially funded by Air Force grant FA9550-14-1-0016. It was also supported by the Center for Science of Information (CSoI), an US NSF Science and Technology Center, under grant agreement CCF-0939370. ",
990
+ "bbox": [
991
+ 174,
992
+ 133,
993
+ 825,
994
+ 175
995
+ ],
996
+ "page_idx": 9
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "REFERENCES ",
1001
+ "text_level": 1,
1002
+ "bbox": [
1003
+ 174,
1004
+ 196,
1005
+ 287,
1006
+ 212
1007
+ ],
1008
+ "page_idx": 9
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "Dimitrios Alikaniotis, Helen Yannakoudakis, and Marek Rei. Automatic text scoring using neural networks. In Assocation for Computational Lingustics, 2016. ",
1013
+ "bbox": [
1014
+ 174,
1015
+ 219,
1016
+ 823,
1017
+ 248
1018
+ ],
1019
+ "page_idx": 9
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "Trapit Bansal, David Belanger, and Andrew McCallum. Ask the gru: Multi-task learning for deep text recommendations. In ACM international conference on Recommender Systems (RecSys), 2016. ",
1024
+ "bbox": [
1025
+ 174,
1026
+ 256,
1027
+ 825,
1028
+ 299
1029
+ ],
1030
+ "page_idx": 9
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075, 2015. ",
1035
+ "bbox": [
1036
+ 173,
1037
+ 308,
1038
+ 821,
1039
+ 337
1040
+ ],
1041
+ "page_idx": 9
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "Misha Denil, Alban Demiraj, and Nando de Freitas. Extraction of salient sentences from labelled documents. In arXiv preprint: https://arxiv.org/abs/1412.6815, 2015. ",
1046
+ "bbox": [
1047
+ 174,
1048
+ 345,
1049
+ 823,
1050
+ 375
1051
+ ],
1052
+ "page_idx": 9
1053
+ },
1054
+ {
1055
+ "type": "text",
1056
+ "text": "Strobelt Hendrik, Sebastian Gehrmann, Bernd Huber, Hanspeter Pfister, and Alexander M. Rush. Visual analysis of hidden state dynamics in recurrent neural networks. In arXiv, 2016. ",
1057
+ "bbox": [
1058
+ 176,
1059
+ 382,
1060
+ 823,
1061
+ 412
1062
+ ],
1063
+ "page_idx": 9
1064
+ },
1065
+ {
1066
+ "type": "text",
1067
+ "text": "Daniel Hewlett, Alexandre Lacoste, Llion Jones, Illia Polosukhin, Andrew Fandrianto, Jay Han, Matthew Kelcey, and David Berthelot. Wikireading: A novel large-scale language understanding task over wikipedia. In Association for Computational Linguistics, 2016. ",
1068
+ "bbox": [
1069
+ 176,
1070
+ 420,
1071
+ 825,
1072
+ 464
1073
+ ],
1074
+ "page_idx": 9
1075
+ },
1076
+ {
1077
+ "type": "text",
1078
+ "text": "Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997. ",
1079
+ "bbox": [
1080
+ 174,
1081
+ 472,
1082
+ 823,
1083
+ 501
1084
+ ],
1085
+ "page_idx": 9
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. ",
1090
+ "bbox": [
1091
+ 174,
1092
+ 508,
1093
+ 823,
1094
+ 539
1095
+ ],
1096
+ "page_idx": 9
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "Andrej Karpathy, Justin Johnson, and Fei-Fei Li. Visualizing and understanding recurrent neural networks. In ICLR Workshop, 2016. ",
1101
+ "bbox": [
1102
+ 173,
1103
+ 546,
1104
+ 823,
1105
+ 577
1106
+ ],
1107
+ "page_idx": 9
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014. ",
1112
+ "bbox": [
1113
+ 174,
1114
+ 584,
1115
+ 823,
1116
+ 614
1117
+ ],
1118
+ "page_idx": 9
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "Diederick P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In International Conference for Learning Representations, 2015. ",
1123
+ "bbox": [
1124
+ 173,
1125
+ 622,
1126
+ 823,
1127
+ 651
1128
+ ],
1129
+ "page_idx": 9
1130
+ },
1131
+ {
1132
+ "type": "text",
1133
+ "text": "Peng Li, Wei Li, Zhengyan He, Xuguang Wang, Ying Cao, Jie Zhou, and Wei Xu. Dataset and neural recurrent sequence labeling model for open-domain factoid question answering. In arXiv, 2016. ",
1134
+ "bbox": [
1135
+ 174,
1136
+ 660,
1137
+ 825,
1138
+ 702
1139
+ ],
1140
+ "page_idx": 9
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. In Empirical Methods for Natural Language Processing, 2016. ",
1145
+ "bbox": [
1146
+ 173,
1147
+ 710,
1148
+ 826,
1149
+ 753
1150
+ ],
1151
+ "page_idx": 9
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Empirical Methods for Natural Language Processing, 2016. ",
1156
+ "bbox": [
1157
+ 173,
1158
+ 762,
1159
+ 825,
1160
+ 792
1161
+ ],
1162
+ "page_idx": 9
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Richard Socher, Alex Perelygin, Jean Y Wu, Jason Chuang, Christopher D Manning, Andrew Y $\\mathrm { N g }$ , and Christopher Potts Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, 2013. ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 799,
1170
+ 823,
1171
+ 843
1172
+ ],
1173
+ "page_idx": 9
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Ilya Sutskever, Oriol Vinyals, and Quoc Le. Sequence to sequence learning with neural networks. In Neural Information Processing Systems, 2014. ",
1178
+ "bbox": [
1179
+ 171,
1180
+ 852,
1181
+ 823,
1182
+ 881
1183
+ ],
1184
+ "page_idx": 9
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, pp. 649–657, 2015. ",
1189
+ "bbox": [
1190
+ 173,
1191
+ 888,
1192
+ 823,
1193
+ 917
1194
+ ],
1195
+ "page_idx": 9
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "8 APPENDIX - HEAT MAPS ",
1200
+ "text_level": 1,
1201
+ "bbox": [
1202
+ 176,
1203
+ 102,
1204
+ 413,
1205
+ 118
1206
+ ],
1207
+ "page_idx": 10
1208
+ },
1209
+ {
1210
+ "type": "table",
1211
+ "img_path": "images/1b8414fe962f57e995c07b21ede52009d2b16e1484470a3f1d326b9a324f8a44.jpg",
1212
+ "table_caption": [
1213
+ "We provide an example heat map using the cell decomposition metric for each class in both sentiment analysis datasets, and selected WikiMovie question categories "
1214
+ ],
1215
+ "table_footnote": [],
1216
+ "table_body": "<table><tr><td>Dataset Yelp</td><td>t Category</td><td>Heat Map</td></tr><tr><td>Polar- ity</td><td>Positive</td><td>we went here twice for breakfast . had the ba- nanas foster waffles with fresh whipped cream , they were amaZing ! perfect seat out side on</td></tr><tr><td>Yelp Polar- ity</td><td>Negative</td><td>the terrace call me spoiled 1...thissushiis grOSS and the orange chicken , well it was so thini don 'tthink it had chicken in it. go Somewhereelse</td></tr><tr><td>Stanford Positive Senti- ment</td><td></td><td>Whether or not you 're enlightened by any of Derrida's lectures on“ the other\" and“ the self, \" Deridais an undeniably fasci- natingandplayfulfel-</td></tr><tr><td>Stanford Negative Senti- ment</td><td>low plot</td><td>... begins with promise , but runs aground after being snared in its own tangled</td></tr><tr><td>Pattern Question</td><td></td><td>Heat Map</td></tr><tr><td>Movie to Year</td><td>What was the re- lease year of an- other 48 hours?</td><td>another 48 hrs iS a 1990</td></tr><tr><td>Movie to Writer</td><td>Which per- sonwrote the movie last of the dogmen?</td><td>last of the dogmen iS a 1995 western ad- venture film written and directed by tab murphy</td></tr><tr><td>Movie to Actor</td><td>Who acted in the movie thunder- bolt?</td><td>thunderbolt ()(\" piklik foh\") is a 1995 hong kong action film starring jackie chan bloody bloody bible cam p is a 2012 ameri-</td></tr><tr><td>Movie to Di- rector</td><td>Who directed bloodybloody bible camp?</td><td>can horror - comedy /s platter flm .the film directed by vito tra- was bucco</td></tr><tr><td>Movie to Genre</td><td>What genre is trespass in?</td><td>trespass iS a 992 aoton</td></tr><tr><td>Movie to Votes</td><td>How would people rate the pool?</td><td>though filmed in hindi ,a language smith didn 't know the film earned * good</td></tr><tr><td>Movie to Rating</td><td>How popu- lar was les miserables?</td><td>les mis rables is a 1935 american drama film starring fredric march and charles laughton based upon te famous</td></tr><tr><td>Movie to Tags</td><td>Describe rough magic?</td><td>rough magic is a 1995 comedy film di- rected by clare peploe and starring bridget fonda, russell crowe</td></tr><tr><td>Movie to Lan- guage</td><td>Whatisthe mainlanguage in fate?</td><td>fate( is a 200 turkish</td></tr></table>",
1217
+ "bbox": [
1218
+ 171,
1219
+ 170,
1220
+ 823,
1221
+ 761
1222
+ ],
1223
+ "page_idx": 10
1224
+ },
1225
+ {
1226
+ "type": "table",
1227
+ "img_path": "",
1228
+ "table_caption": [],
1229
+ "table_footnote": [],
1230
+ "bbox": [
1231
+ 171,
1232
+ 87,
1233
+ 826,
1234
+ 939
1235
+ ],
1236
+ "page_idx": 11
1237
+ }
1238
+ ]
parse/train/SJvYgH9xe/SJvYgH9xe_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SJvYgH9xe/SJvYgH9xe_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ryGkSo0qYm/ryGkSo0qYm.md ADDED
@@ -0,0 +1,511 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LARGE SCALE GRAPH LEARNING FROM SMOOTH SIGNALS
2
+
3
+ # Nathanaël Perraudin
4
+
5
+ Vassilis Kalofolias Signal Processing Laboratory 2, EPFL Station 11, 1015 Lausanne, Switzerland v.kalofolias@gmail.com
6
+
7
+ Swiss Data Science Center, ETH Zürich Universitätstrasse 25, 8006 Zürich, Switzerland nperraud@ethz.ch
8
+
9
+ # ABSTRACT
10
+
11
+ Graphs are a prevalent tool in data science, as they model the inherent structure of the data. Typically they are constructed either by connecting nearest samples, or by learning them from data, solving an optimization problem. While graph learning does achieve a better quality, it also comes with a higher computational cost. In particular, the current state-of-the-art model cost is $\mathcal { O } \overline { { ( n ^ { 2 } ) } }$ for $n$ samples. In this paper, we show how to scale it, obtaining an approximation with leading cost of ${ \bar { \mathcal { O } } } \left( n \log ( n ) \right)$ , with quality that approaches the exact graph learning model. Our algorithm uses known approximate nearest neighbor techniques to reduce the number of variables, and automatically selects the correct parameters of the model, requiring a single intuitive input: the desired edge density.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Graphs are an invaluable tool in data science, as they can capture complex structures inherent in seemingly irregular high-dimensional data. While classical applications of graphs include data embedding, manifold learning, clustering and semi-supervised learning (Zhu et al., 2003; Belkin et al., 2006; Von Luxburg, 2007), they were later used for regularizing various machine learning models, for example for classification, sparse coding, matrix completion, or PCA (Zhang et al., 2006; Zheng et al., 2011; Kalofolias et al., 2014; Shahid et al., 2016).
16
+
17
+ More recently, graphs drew the attention of the deep learning community. While convolutional neural networks (CNNs) were highly successful for learning image representations, it was not obvious how to generalize them for irregular high dimensional domains, were standard convolution is not applicable. Graphs bridge the gap between irregular data and CNNs through the generalization of convolutions on graphs (Defferrard et al., 2016; Kipf & Welling, 2016; Monti et al., 2016; Li et al., 2015). While clearly graph quality is important in such applications (Henaff et al., 2015; Defferrard et al., 2016), the question of how to optimally construct a graph remains an open problem.
18
+
19
+ The first applications mostly used weighted $k$ -nearest neighbors graphs ( $k$ -NN) (Zhu et al., 2003; Belkin et al., 2006; Von Luxburg, 2007), but the last few years more sophisticated methods of learning graphs from data were proposed. Today, graph learning, or network inference, has become an important problem itself (Wang & Zhang, 2008; Daitch et al., 2009; Jebara et al., 2009; Lake & Tenenbaum, 2010; Hu et al., 2013; Dong et al., 2015; Kalofolias, 2016).
20
+
21
+ Hoever, graph learning is computationally too costly for large-scale applications that need graphs between millions of samples. Current state of the art models for learning weighted undirected graphs (Dong et al., 2015; Kalofolias, 2016) cost $\mathcal { O } \left( n ^ { 2 } \right)$ per iteration for $n$ nodes, while previous solutions are even more expensive. Furthermore, they need parameter tuning to control sparsity, and this adds an extra burden making them prohibitive for applications with more than a few thousands of nodes.
22
+
23
+ Large-scale applications can only resort to approximate nearest neighbors (A-NN), e.g. (Dong et al., 2011; Muja & Lowe, 2014; Malkov & Yashunin, 2016), that run with a cost of $\mathcal { O } \left( n \log ( n ) \right)$ . This is low compared to computing a simple $k$ -NN graph, as even the pairwise distance matrix between all samples needs $\mathcal { O } \left( n ^ { 2 } \right) $ computations. However, the quality of A-NN is worse than the $k$ -NN, that is already not as good as if we would learn the graph from data.
24
+
25
+ In this paper, we propose the first scalable graph learning method, with the same leading cost as A-NN, and with quality that approaches state-of-the-art graph learning. Our method leverages A-NN graphs to effectively reduce the number of variables, and the state-of-the-art graph learning model by Kalofolias (2016) in order to achieve the best of both worlds: low cost and good quality. In Figure 1 we illustrate the advantage of our solution compared to the current state-of-the-art. Note that while the standard model costs the same regardless of the graph density (average node degree) $k$ , our solution benefits from the desired graph sparsity to reduce computation.
26
+
27
+ ![](images/a857849167b11f4c2811d1148db666c73b2ee8406c244608bfca3089c87bd34f.jpg)
28
+ Figure 1: Time comparison of different ways to compute a graph. Left: Graph between 10,000 most frequent English words using a word2vec representation. Right: Graph between 1,000,000 nodes from 68 features (US Census 1990). Scalable algorithms benefit from a small average node degree $k$ .
29
+
30
+ One of our key contributions is to provide a method to automatically select the parameters of the model by Kalofolias (2016) given a desired graph sparsity level. Like in $k$ -NN, the user can choose the number of neighbors $k$ , without performing grid search over two parameters. Using our scheme, we can learn a 1-million-nodes graph with a desired sparsity level on a desktop computer in 16 minutes, with a simple Matlab implementation.
31
+
32
+ # 2 GRAPH LEARNING FROM SMOOTH SIGNALS
33
+
34
+ A widely used assumption for data residing on graphs is that values change smoothly across adjacent nodes. The smoothness of a set of vectors $\mathbf { \bar { \phi } } _ { ( 1 , \dots , \bar { x } _ { n } } \in \mathbb { R } ^ { d }$ on a given weighted undirected graph is usually quantified by the Dirichlet energy (Belkin & Niyogi, 2001)
35
+
36
+ $$
37
+ \frac 1 2 \sum _ { i , j } W _ { i j } \| x _ { i } - x _ { j } \| ^ { 2 } = \operatorname { t r } \left( X ^ { \top } L X \right) ,
38
+ $$
39
+
40
+ where $W _ { i j } \in \mathbb { R } _ { + }$ denotes the weight of the edge between nodes $i$ and $j$ $, L = D - W$ is the graph Laplacian, and $\begin{array} { r } { D _ { i i } = \sum _ { j } W _ { i j } } \end{array}$ is the diagonal weighted degree matrix.
41
+
42
+ The first works for graph learning focused on learning the weights of a fixed $\mathbf { k }$ -nearest neighbor pattern (Wang & Zhang, 2008), learning a binary pattern (Jebara et al., 2009) or the whole adjacency matrix (Daitch et al., 2009). A more recent family of models is based on minimizing the Dirichlet energy on a graph (Lake & Tenenbaum, 2010; Hu et al., 2013; Dong et al., 2015; Kalofolias, 2016). In the latter, Kalofolias (2016) proposed a unified model for learning a graph from smooth signals, that reads as follows:
43
+
44
+ $$
45
+ \operatorname* { m i n } _ { W \in \mathcal { W } } \| W \circ Z \| _ { 1 , 1 } + f ( W ) .
46
+ $$
47
+
48
+ Here, $Z _ { i j } = \| x _ { i } - x _ { j } \| ^ { 2 }$ , $\circ$ denotes the Hadamard product, and the first term is equal to $\operatorname { t r } \left( X ^ { \top } L X \right)$ . The optimization is over the set $\mathcal { W }$ of valid adjacency matrices (non-negative, symmetric, with zero diagonal).
49
+
50
+ The role of matrix function $f ( W )$ is to prevent $W$ from obtaining a trivial zero value, control sparsity, and impose further structure, depending on the data and the application. Kalofolias obtained state-of-the-art results using
51
+
52
+ $$
53
+ f ( W ) = - \alpha \mathbf { 1 } ^ { \top } \log ( W \mathbf { 1 } ) + \frac { \beta } { 2 } \| W \| _ { F } ^ { 2 } ,
54
+ $$
55
+
56
+ where $\mathbf { 1 } = [ 1 , \ldots 1 ] ^ { \top }$ . We will call this the log model. The previous state of the art was proposed by Hu et al. (2013) and by Dong et al. (2015), using
57
+
58
+ $$
59
+ f ( W ) = \alpha \| W \mathbf { 1 } \| ^ { 2 } + \alpha \| W \| _ { F } ^ { 2 } + \mathbb { 1 } \left\{ \| W \| _ { 1 , 1 } = n \right\} ,
60
+ $$
61
+
62
+ where $\mathbb { 1 } \left\{ { \mathrm { c o n d i t i o n } } \right\} = 0$ if condition holds, $\infty$ otherwise. In the sequel we call this the $\ell _ { 2 }$ model. Since $W \mathbf { 1 }$ is the node degrees’ vector, the log model (3) prevents the formation of disconnected nodes due to the logarithmic barrier, while the $\ell _ { 2 }$ model (4) controls sparsity by penalizing large degrees due to the first term.
63
+
64
+ # 3 CONSTRAINED EDGE PATTERN
65
+
66
+ In traditional graph learning, all $\binom { n } { 2 }$ possible edges between $n$ nodes are considered, that results in a cost of at least $\mathcal { O } \left( n ^ { 2 } \right)$ computations per iteration. Often, however, we need graphs with a roughly fixed number of edges per node, like in $k$ -NN graphs. It is natural to then ask ourselves whether the cost of graph learning can be reduced, reflecting the final desired graph sparsity.
67
+
68
+ In fact, the original problem (2) for the log model (3) can be solved efficiently when a constrained set $\mathcal { E } ^ { \mathrm { a l l o w e d } } \subseteq \{ ( i , j ) : i < j \}$ of allowed edges is known a priori. In that case, it suffices to solve the modified problem
69
+
70
+ $$
71
+ \operatorname* { m i n i m i z e } _ { W \in \widetilde { \mathcal { W } } } \| W \circ Z \| _ { 1 , 1 } - \alpha \mathbf { 1 } ^ { \top } \log ( W \mathbf { 1 } ) + \frac { \beta } { 2 } \| W \| _ { F } ^ { 2 } ,
72
+ $$
73
+
74
+ where we optimize in the constrained set of adjacency matrices $W \in \widetilde { \mathcal { W } }$ . After reducing the set of edges to $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ f, it suffices to solve the modified problem (5) Following Kalofolias (2016), we can rewrite the problem as
75
+
76
+ $$
77
+ \operatorname* { m i n i m i z e } _ { \widetilde { w } } f _ { 1 } ( \widetilde { w } ) + f _ { 2 } ( K \widetilde { w } ) + f _ { 3 } ( \widetilde { w } ) ,
78
+ $$
79
+
80
+ with
81
+
82
+ $$
83
+ \begin{array} { r l } & { f _ { 1 } ( \widetilde { \boldsymbol { w } } ) = 1 \left\{ \widetilde { \boldsymbol { w } } \ge 0 \right\} + 2 \widetilde { \boldsymbol { w } } ^ { \top } \widetilde { \boldsymbol { z } } , } \\ & { f _ { 2 } ( \boldsymbol { v } ) = - \alpha \mathbf { 1 } ^ { \top } \log ( \boldsymbol { v } ) , } \\ & { f _ { 3 } ( \widetilde { \boldsymbol { w } } ) = \beta \| \widetilde { \boldsymbol { w } } \| ^ { 2 } , \mathrm { ~ w i t h ~ } \zeta = 2 \beta , } \end{array}
84
+ $$
85
+
86
+ where $\zeta$ is the Lipschitz constant of $f _ { 3 }$ . Note that we gather all free parameters of the adjacency matrix $\widetilde { W } \in \widetilde { \mathcal { W } } _ { m }$ in a vector $\widetilde { w } \in \widetilde { \mathcal { W } } _ { v }$ of size only $| \mathcal { E } ^ { \mathrm { a l l o w e d } } |$ , that is, the number of allowed edges, eeach counted only once. Accordingly, in $\tilde { z } = z ( \mathcal { E } ^ { \mathrm { a l l o w e d } } )$ we only keep the corresponding pairwise distances from matrix $Z$ . The linear operator $K = \widetilde { S } = S ( : , \mathcal { E } ^ { \mathrm { a l l o w e d } } )$ is also modified, keeping only the columns corresponding to the edges in $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ .
87
+
88
+ In this form, the problem can be solved by the primal dual techniques by Komodakis & Pesquet (2015). The cost of the dual step, operating on the dual variable $v$ (degrees vector) remains ${ \mathcal { O } } \left( n \right)$ . However, the cost of the primal step, as well as the cost of applying the modified operator $\widetilde { S }$ in order to exchange between the primal and dual spaces is $\mathcal { O } \left( \mathcal { E } ^ { \mathrm { a l l o w e d } } \right)$ instead of $O \left( n ^ { 2 } \right)$ e of the initial algorithm 1 by Kalofolias (2016), reducing the overall complexity.
89
+
90
+ In some cases, a pattern of allowed edges $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ can be induced by constraints of the model, for example sensor networks only assume connections between geographically nearby sensors. In most applications, however, a constrained set is not known beforehand, and we need to approximate the edge support of the final learned graph in order to reduce the number of variables. To this end, we propose using approximate nearest neighbors graphs to obtain a good approximation. While computing a $k$ -NN graph needs $\mathcal { O } \left( n ^ { 2 } d \right)$ computations, approximate nearest neighbors (A-NN) algorithms (Muja & Lowe, 2009; Dong et al., 2011; Muja & Lowe, 2012; 2014; Malkov & Yashunin, 2016) offer a good compromise between accuracy and speed. Specifically, A-NN methods scale gracefully with the number of nodes $n$ , the fastest ones having an overall complexity of $\mathcal { O } \left( n \log ( n ) d \right)$ for $d$ -dimensional data.
91
+
92
+ When approximating the support of the final edges of a graph, we prefer to have false positives than false negatives. We thus start with an initial support with a larger cardinality than that of the desired final graph, and let the weight learning step automatically select which edges to set to zero. We select a set $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ with cardinality $| { \mathcal { E } } ^ { \mathrm { a l l o w e d } } | = { \mathcal { O } } \left( n k r \right)$ , where $k$ is the desired number of neighbors per node and $r$ a small multiplicative factor. By setting the sparsity parameters correctly, the graph learning step will only keep the final $\mathcal { O } \left( n k \right)$ edges, setting the less important or wrong edges to zero. The bigger the factor $r$ , the more freedom the learning algorithm has to select the right edges.
93
+
94
+ # 3.1 OVERALL THEORETICAL COMPLEXITY
95
+
96
+ The cost of learning a $k r$ -A-NN graph is $\mathcal { O } \left( n \log ( n ) d \right)$ for $n$ nodes and data in $\mathbb { R } ^ { d }$ , while additionally learning the edge weights costs $\mathcal { O } \left( k r n \right)$ per iteration. The overall complexity is therefore $\mathcal { O } \left( n \log ( n ) d \right) \bar { + } \mathcal { O } \left( n \bar { k r } I \right)$ for $I$ iterations. For large $n$ , the dominating cost is asymptotically the one of computing the A-NN and not the cost of learning the weights on the reduced set.
97
+
98
+ # 4 AUTOMATIC PARAMETER SELECTION
99
+
100
+ A major problem of models (3) and (4) is the choice of meaningful parameters $\alpha , \beta$ , as grid search increases computation significantly. We show how this burden can be completely avoided for model (3). First, we show that sparsity depends effectively on a single parameter, and then we propose a method to set it automatically for any $k$ . Our method is based on predicting the number of edges of any node for a given parameter value, if we relax the symmetricity constraint of $W$ .
101
+
102
+ # 4.1 REDUCTION TO A SINGLE OPTIMIZATION PARAMETER
103
+
104
+ In (Kalofolias, 2016, Proposition 2), it is argued that model (3) effectively has one parameter changing the shape of the edges, the other changing the magnitude. We reformulate this claim as follows:
105
+
106
+ Proposition 1. Let $W ^ { * } ( Z , \alpha , \beta )$ denote the solution of model (3) for input distances $Z$ and parameters $\mathbf { \hat { \alpha } } _ { } , \beta > 0$ . Then the same solution can be obtained with fixed parameters $\alpha = 1$ and $\beta ^ { - } = 1$ , by multiplying the input distances by $\begin{array} { r } { \theta = \frac { 1 } { \sqrt { \alpha \beta } } } \end{array}$ and the resulting edges by $\begin{array} { r } { \delta = \sqrt { \frac { \alpha } { \beta } } } \end{array}$ :
107
+
108
+ $$
109
+ \boldsymbol { W } ^ { * } \left( Z , \alpha , \beta \right) = \sqrt { \frac { \alpha } { \beta } } \boldsymbol { W } ^ { * } \left( \frac { 1 } { \sqrt { \alpha \beta } } Z , 1 , 1 \right) = \delta \boldsymbol { W } ^ { * } \left( \theta Z , 1 , 1 \right) .
110
+ $$
111
+
112
+ Proof. Apply (Kalofolias, 2016, Prop. 2), with $\begin{array} { r } { \gamma = \sqrt { \frac { \alpha } { \beta } } } \end{array}$ and divide all operands by $\sqrt { \alpha \beta }$
113
+
114
+ Proposition 1 shows that the parameter spaces $( \alpha , \beta )$ and $( \theta , \delta )$ are equivalent. While the first one is convenient to define (3), the second one allows independent tuning of sparsity and scale of the solution. For some applications the scale of the graph is less important, and multiplying all edges by the same constant does not change its functionality. In other cases, we want to explicitly normalize the graph to a specific size, for example setting $\| \dot { W } \| _ { 1 , 1 } = n$ as in ( $\mathrm { H u }$ et al., 2013), or making sure that $\lambda _ { \operatorname* { m a x } } = 1$ . Nevertheless, for applications where scale shall be set automatically, we provide the following Theorem that characterizes the connection between $\delta$ and the scale of the weights.
115
+
116
+ Theorem 1. All edges of the solution $W ^ { * } ( Z , \alpha , \beta ) = \delta W ^ { * } ( \theta Z , 1 , 1 )$ with $\begin{array} { r } { \theta = \frac { 1 } { \sqrt { \alpha \beta } } } \end{array}$ , $\delta = \textstyle { \sqrt { \frac { \alpha } { \beta } } }$ of model (3) are upper bounded by δ $\begin{array} { r } { \colon W ^ { * } ( Z , \alpha , \beta ) \leq \sqrt { \frac { \alpha } { \beta } } = \delta } \end{array}$ .
117
+
118
+ Proof. See supplementary material $A$
119
+
120
+ # 4.2 SETTING THE REMAINING REGULARIZATION PARAMETER
121
+
122
+ The last step for automatizing parameter selection is to find a relation between $\theta$ and the desired sparsity (the average number of neighbors per node). We first analyze the sparsity level with respect to $\theta$ for each node independently. Once the independent problems are well characterized, we propose an empirical solution to obtain a global value of $\theta$ providing approximately the desired sparsity level.
123
+
124
+ # 4.2.1 SPARSITY ANALYSIS FOR ONE NODE
125
+
126
+ In order to analyze the sparsity of the graphs obtained by the model (3), we take one step back and drop the symmetricity constraint. The problem becomes separable and we can focus on only one node. Keeping only one column $w$ of matrix $W$ , we arrive to the simpler optimization problem
127
+
128
+ $$
129
+ \operatorname* { m i n } _ { \boldsymbol { w } \in \mathbb { R } _ { + } ^ { n } } \quad \theta \boldsymbol { w } ^ { \top } \boldsymbol { z } - \log ( \boldsymbol { w } ^ { \top } \mathbf { 1 } ) + \frac { 1 } { 2 } \| \boldsymbol { w } \| _ { 2 } ^ { 2 } .
130
+ $$
131
+
132
+ The above problem also has only one parameter $\theta$ that controls sparsity, so that larger values of $\theta$ yield sparser solutions $w ^ { * }$ . Furthermore, it enjoys an analytic solution if we sort the elements of $z$ , as we prove with the next theorem.
133
+
134
+ Theorem 2. Suppose that the input vector $z$ is sorted in ascending order. Then the solution of problem (8) has the form
135
+
136
+ $$
137
+ \boldsymbol { w } ^ { * } = \operatorname* { m a x } \left( 0 , \lambda ^ { * } - \theta z \right) = [ \lambda ^ { * } - \theta z _ { \mathcal { T } } ; \mathbf { 0 } ] ,
138
+ $$
139
+
140
+ with
141
+
142
+ $$
143
+ \lambda ^ { * } = \frac { \theta b _ { k } + \sqrt { \theta ^ { 2 } b _ { k } ^ { 2 } + 4 k } } { 2 k } .
144
+ $$
145
+
146
+ cumulative sum of the smallest The set $\mathcal { T } = \{ 1 , \ldots , k \}$ corresponds to the indices of the $k$ distances in $z$ , $\begin{array} { r } { b _ { k } = \sum _ { i = 1 } ^ { k } z _ { i } } \end{array}$ $k$ . smallest distances $z _ { i }$ and $b _ { k }$ is the
147
+
148
+ We provide the proof of Theorem 1 after presenting certain intermediate results. In order to solve Problem (8) we first introduce a slack variable $l$ for the inequality constraint, so that the KKT optimality conditions are
149
+
150
+ $$
151
+ \begin{array} { r } { \displaystyle \theta z - \frac { 1 } { w ^ { \top } \mathbf { 1 } } + w - l = 0 , } \\ { \displaystyle w \geq 0 , } \\ { l \geq 0 , } \\ { l _ { i } w _ { i } = 0 , \forall i . } \end{array}
152
+ $$
153
+
154
+ the optimum of $w$ can be revealed by introducing the term $\begin{array} { r } { \lambda ^ { * } = \frac { 1 } { w ^ { * } \dag \bf { 1 } } } \end{array}$ and rewrite (10) as
155
+
156
+ $$
157
+ w ^ { * } = \lambda ^ { * } - \theta z + l .
158
+ $$
159
+
160
+ Then, we split the elements of $w$ in two sets, $\mathcal { A }$ and $\mathcal { T }$ according to the activity of the inequality constraint (11), so that $w _ { \mathcal { T } } > \mathbf { 0 }$ (inactive) and $w _ { \mathcal { A } } = \mathbf { 0 }$ (active). Note that at the minimum, the elements of $w$ will also be sorted in a descending order so that $w ^ { * } = [ w _ { \mathcal { T } } ^ { * } ; \mathbf { 0 } ]$ , according to Theorem 2. We first need a condition for an element of $w ^ { * }$ to be positive, as expressed in the following lemma:
161
+
162
+ Lemma 1. An element $\boldsymbol { w } _ { i } ^ { * }$ of the solution $w ^ { * }$ of problem (8) is in the active set $\mathcal { A }$ if and only if it corresponds to an element of $z _ { i }$ for which $\theta z _ { i } \geq \lambda ^ { * }$ .
163
+
164
+ Proof. $( \Rightarrow )$ : If $w _ { i }$ is in the active set we have $w _ { i } = 0$ and $l _ { i } \geq 0$ , therefore from $( I 4 )$ we have $\theta z _ { i } - \lambda ^ { * } \geq 0$ . $( \Leftarrow )$ : Suppose that there exists $i \in \mathcal { T }$ for which $\theta z _ { i } \geq \lambda ^ { * }$ . The constraint being inactive means that $w _ { i } ^ { * } > 0$ . From (13) we have that $l _ { i } = 0$ and (14) gives $w _ { i } ^ { * } = \lambda ^ { * } - \theta z _ { i } \leq 0$ , $a$ contradiction.
165
+
166
+ We are now ready to proceed to the proof of Theorem 2.
167
+
168
+ Proof (Theorem 2). As elements of $\theta z$ are sorted in an ascending order, the elements of $\lambda ^ { * } - \theta z$ will be in a descending order. Furthermore, we know from Lemma $I$ that all positive $w _ { i } ^ { * }$ will correspond to $\theta z _ { i } < \lambda ^ { * }$ . Then, supposing that $| \mathcal { T } | = k$ we have the following ordering:
169
+
170
+ $$
171
+ \begin{array} { c } { { - \theta z _ { 1 } \geq \cdot \cdot \cdot \geq - \theta z _ { k } > - \lambda ^ { * } \geq - \theta z _ { k + 1 } \geq \cdot \cdot \cdot \geq - \theta z _ { n } \Rightarrow } } \\ { { \lambda ^ { * } - \theta z _ { 1 } \geq \cdot \cdot \cdot \geq \lambda ^ { * } - \theta z _ { k } > 0 \geq \lambda ^ { * } - \theta z _ { k + 1 } \geq \cdot \cdot \cdot \geq \lambda ^ { * } - \theta z _ { n } . } } \end{array}
172
+ $$
173
+
174
+ In words, the vector $\lambda ^ { * } - \theta z$ will have sorted elements so that the first $k$ are positive and the rest are non-positive. Furthermore, we know that the elements of $l$ in the optimal have to be 0 for all inactive variables $w _ { \mathcal { I } } ^ { \ast }$ , therefore $w _ { \mathscr I } ^ { * } = \lambda ^ { * } - \theta z _ { \mathscr I }$ . The remaining elements of w will be 0 by definition of the active set:
175
+
176
+ $$
177
+ \boldsymbol { w } ^ { * } = [ \underbrace { \lambda ^ { * } - \theta z _ { 1 } , \cdot \cdot \cdot , \lambda ^ { * } - \theta z _ { k } } _ { w _ { \bar { x } } ^ { * } } , \underbrace { 0 , \cdot \cdot \cdot , 0 } _ { w _ { \bar { x } } ^ { * } } ] .
178
+ $$
179
+
180
+ What remains is to find an expression to compute $\lambda ^ { * }$ for any given $z$ . Keeping $z$ ordered in ascending order, let the cumulative sum of $z _ { i }$ be $\textstyle b _ { k } = \sum _ { i = 1 } ^ { k } z _ { i }$ . Then, from the definition of $\begin{array} { r } { \lambda ^ { * } = \frac { 1 } { w ^ { * } \dag } } \end{array}$ w∗>1 and using the structure of $w ^ { * }$ we have
181
+
182
+ $$
183
+ \begin{array} { r l r l r l r } { w ^ { * } ^ { \top } \mathbf { 1 } \lambda ^ { * } = 1 } & { { } } & { \Rightarrow } & { } & { \left( k \lambda ^ { * } - \theta z _ { T } ^ { \top } \mathbf { 1 } \right) \lambda ^ { * } = 1 } & { { } } & { \Rightarrow } & { } & { k ( \lambda ^ { * } ) ^ { 2 } - \theta b _ { k } \lambda ^ { * } - 1 = 0 , } \end{array}
184
+ $$
185
+
186
+ which has only one positive solution,
187
+
188
+ $$
189
+ \lambda ^ { * } = \frac { \theta b _ { k } + \sqrt { \theta ^ { 2 } b _ { k } ^ { 2 } + 4 k } } { 2 k } .
190
+ $$
191
+
192
+ # 4.2.2 PARAMETER SELECTION FOR THE NON-SYMMETRIC CASE
193
+
194
+ While Theorem 2 gives the form of the solution for a known $k$ , the latter cannot be known a priori, as it is also a function of $z$ . For this, we propose Algorithm 1 that solves this problem, simultaneously finding $k$ and $\lambda ^ { * }$ in ${ \mathcal { O } } \left( k \right)$ iterations. This algorithm will be needed for automatically setting the parameters for the symmetric case of graph learning.
195
+
196
+ As $k$ is the number of non-zero edges per node, we can assume it to be small, like for $k$ -NN. It is thus cheap to incrementally try all values of $k$ from $k = 1$ until we find the correct one, as Algorithm 1 does. Once we try a value that satisfies $\lambda \in \left( \theta z _ { k } , \theta z _ { k + 1 } \right]$ , all KKT conditions hold and we have found the solution to our problem. A similar algorithm was proposed in (Duchi et al., 2008)
197
+
198
+ for projecting vectors on the probability simplex, that could be used for a similar analysis for the $\ell _ { 2 }$ -degree constraints model (4).
199
+
200
+ Most interestingly, using the form of the solution given by Theorem 2 we can solve the reverse problem: If we know the distances vector $z$ and we want a solution $w ^ { * }$ with exactly $k$ non-zero elements, what should the parameter $\theta$ be? The following theorem answers this question, giving intervals for $\theta$ as a function of $k$ , $z$ and its cumulative sum $b$ .
201
+
202
+ Theorem 3. Let $\begin{array} { r } { \theta \in \left( \frac { 1 } { \sqrt { k z _ { k + 1 } ^ { 2 } - b _ { k } z _ { k + 1 } } } , \frac { 1 } { \sqrt { k z _ { k } ^ { 2 } - b _ { k } z _ { k } } } \right] } \end{array}$ , the solution of eq. (8) has exactly $k$ non-zeros.
203
+
204
+ Proof. See supplementary material $B$ .
205
+
206
+ The idea of Theorem 3 is illustrated in the left part of Figure 2. For this figure we have used the distances between one image of MNIST and 999 other images. For any given sparsity level $k$ we know what are the intervals of the valid values of $\theta$ by looking at the pairwise distances.
207
+
208
+ # Algorithm 1 Solver of the one-node problem, (8).
209
+
210
+ 1: Input: $z \in \mathbb { R } _ { * + } ^ { n }$ in ascending order, $\theta \in \mathbb { R } _ { * + }$
211
+ 2: 3: $b _ { 0 } 0 \{$ e cumulative sum}do for $i = 1 , \ldots , n$
212
+ 4: $b _ { i } b _ { i - 1 } + z _ { i }$ {Cumulative sum of $\mathbf { Z }$ }
213
+ 5: $\begin{array} { r } { \lambda _ { i } \frac { \sqrt { \theta ^ { 2 } b _ { i } ^ { 2 } + 4 i } + \theta b _ { i } } { 2 i } } \end{array}$
214
+ 6: 7: 8: if $\lambda _ { i } > \theta z _ { i }$ then k ← i − 1 λ ∗ ← λ k w∗ ← max{0, λ∗ − θz}{k-sparse output}
215
+ 10: break
216
+ 11: end if
217
+ 12: end for
218
+
219
+ ![](images/dfacd3b3a2115b0a7d147a27df875064f41b514b8441e7cb580ba56a30ef10c3.jpg)
220
+ Figure 2: Theoretical bounds of $\theta$ for a given sparsity level on 1000 images from MNIST. Left: Solving (8) for only one column of $Z$ . Theorem 3 applies and for each $k$ gives the bounds of $\theta$ (blue). Middle: Solving (3) for the whole pairwise distance matrix $Z$ of the same dataset. The bounds of (17) (blue dashed line) are used to approximate the sparsity of the solution. The red line is the measured sparsity of the learned graphs from model (3). Right: Same for USPS dataset.
221
+
222
+ # 4.2.3 PARAMETER SELECTION FOR THE SYMMETRIC CASE
223
+
224
+ In order to approximate the parameter $\theta$ that gives the desired sparsity of $W$ , we use the above analysis for each row or column separately, omitting the symmetricity constraint. Then, using the arithmetic mean of the bounds of $\bar { \theta }$ we obtain a good approximation of the behaviour of the full symmetric problem. In other words, to obtain a graph with approximately $k$ edges per node, we propose to use the following intervals:
225
+
226
+ $$
227
+ \theta _ { k } \in \left( \frac { 1 } { n } \sum _ { j = 1 } ^ { n } \theta _ { k , j } ^ { l o w e r } , \frac { 1 } { n } \sum _ { j = 1 } ^ { n } \theta _ { k , j } ^ { u p p e r } \right] = \left( \sum _ { j = 1 } ^ { n } \frac { 1 } { n \sqrt { k \hat { Z } _ { k + 1 , j } ^ { 2 } - B _ { k , j } \hat { Z } _ { k + 1 , i } } } , \sum _ { j = 1 } ^ { n } \frac { 1 } { n \sqrt { k \hat { Z } _ { k , j } ^ { 2 } - B _ { k , j } \hat { Z } _ { k , j } } } \right] ,
228
+ $$
229
+
230
+ where The ab $\hat { Z }$ is obtained by sorting each column of e expression is the arithmetic mean over $Z$ in increasing order, and l minimum and maximum $\begin{array} { r } { B _ { k , j } = \sum _ { i = 1 } ^ { k } \hat { Z } _ { i , j } } \end{array}$ $\theta _ { k , j }$ would give a $k$ -sparse result $W _ { : , j }$ if we were to solve problem (8) for each of columns separately, according to Theorem 3. Even though the above approach does not take into account the symmetricity constraints, it gives surprisingly good results in the vast majority of the cases. For the final value of $\theta$ for a given $k$ , we use the middle of this interval in a logarithmic scale, that is, the geometric mean of the upper and lower limits.
231
+
232
+ ![](images/a8fc760c17c2fbf074fb564079b3a410d1748b1431510c5c7b9ff32eb4b8c67e.jpg)
233
+ Figure 5: Connectivity across classes of MNIST. Left: A-NN graph. Middle: $\ell _ { 2 }$ model (4) neglects digits with larger distance. Right: log model (5) does not neglect to connect any cluster.
234
+
235
+ # 5 EXPERIMENTS
236
+
237
+ In our experiments we wish to answer questions regarding (1) the approximation quality of our model, (2) the quality of our automatic parameter selection, (3) the benefit from learning versus A-NN for large scale applications and (4) the scalability of the model. As this contribution is the first to scale a graph learning algorithm to a large amount of nodes, it is difficult to compare with other methods without trying to scale them first. While this paper focuses on the scaled log model, we also scaled the $\ell _ { 2 }$ -model and the "hard" and "soft" models proposed by (Daitch et al., 2009). We refer the reader to the supplementary material C for further details, and D for details about the datasets we use.
238
+
239
+ # 5.1 APPROXIMATION QUALITY OF LARGE SCALE MODEL
240
+
241
+ When computing $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ , we use an A-NN graph from the publicly available FLANN library1 that implements the work of Muja & Lowe (2014). To learn a graph with on average $k$ neighbors per node ( $k$ -NN), we first compute an $r k$ -A-NN graph and use its edges as $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ . The graph is then learned on this subset. The size of $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ does not only affect the time needed to learn the graph, but also its quality. A too restrictive choice might prevent the final graph from learning useful edges. In Figure 3, we study the effect of this restriction on the final result. The vertical axis is the relative $\ell _ { 1 }$ error between our approximate log model and the actual log model by Kalofolias (2016) when learning a graph between 1000 images of MNIST, averaged over 10 runs. Note that the result will depend on the A-NN algorithm used, while a comparison between different types of A-NN is beyond the scope of this paper.
242
+
243
+ ![](images/d31b4c71e52910ffceb1579d7a0b2d1ee4404325b3e762fd7c1957bdd2b44b9d.jpg)
244
+ Figure 3: Approximation error between our large scale log model and the exact log model by Kalofolias (2016).
245
+
246
+ # 5.2 EFFECTIVENESS OF AUTOMATIC PARAMETER SELECTION
247
+
248
+ As we saw in the middle and right plots of Figure 2, the approximate bounds of $\theta$ (red line) given by eq. (17) are very effective at predicting sparsity. The same experiment is repeated for more datasets is in the supplementary material. In Figure 4 we see this also in large scale, between 262K nodes from our "spherical" dataset. Please note, that in the rare cases that the actual sparsity is outside the predicted bounds, we already have a good starting point for finding a good $\theta$ . Note also that small fluctuations in the density are tolerated, for example in $k$ -NN or A-NN graphs we always obtain results with slightly more than nk edges due to the fact that $W$ is symmetric. Finally, as we see in Figure 11, the bounds are very robust to outliers, as well as duplicates in the data. The curious reader can find details in Section D.3.1 of the supplementary materia
249
+
250
+ ![](images/419b478ad8e0d52881d2efc5ae2b098baa8c4f7e6deff0b5b8efba54ba1cbbdb.jpg)
251
+ Figure 4: Effectiveness of $\theta$ bounds eq. (17). Requested versus obtained degree, "spherical" data (262, 000 nodes).
252
+
253
+ # 5.3 EDGE QUALITY
254
+
255
+ We first compare scalable models of graphs between 60, 000 images of MNIST. MNIST has a relatively uniform sampling between numbers of different labels, except for the digits “1” that are more densely sampled. That is, the average intra-class distance between digits “1” is smaller than for other digits (supplementary material D.2). As we see, this affects the results of graph learning.
256
+
257
+ In Figure 5, we plot the histograms of connectivity between images of each label. We normalize all graphs to $\| W \| _ { 1 , 1 } = 1$ . The last bar is the connectivity wasted on wrong edges (pairs of different labels). The A-NN graph does not take into account the different sampling rates of different digits, while it has many wrong edges. The $\ell _ { 2 }$ model (4) assigns most of its connectivity to the label “1” and neglects digits with larger distance (“2”, “8”) even for 30 edges per node. The log model does not suffer from this problem even for sparse graphs of degree 5 and gives consistent connectivities for all digits. The scaled versions of models in (Daitch et al., 2009) perform worse than our large scale log model, but often better than A-NN or $_ { \ell - 2 }$ , as plotted in Figure 13 of the supplementary material.
258
+
259
+ Figure 6 (left) summarizes the number of wrong edges with respect to $k$ . Models $\ell _ { 2 }$ and log that minimize $\operatorname { t r } ( X ^ { \top } L X ) = \| Z \circ W \| _ { 1 , 1 }$ have a large advantage compared to models by Daitch et al. (2009) that minimize $\| L X \| _ { F } ^ { 2 }$ a quadratic function of $W$ . The first induces sparsity of $W$ , while the latter favors small edges. This explains the existence of many wrong edges for models "hard" and "soft", while creates problems in controlling sparsity. Note that A-NN is more accurate than "hard" and "soft" graphs. It seems that $\ell _ { 2 }$ is more accurate than the log model, but as shown in Figure 5, the majority of its edges connect digit "1" without connecting sufficiently digits such as $2 , 3 , 8$ .
260
+
261
+ ![](images/95115c496656ce0a9c7b05d27d28fd01cee20ca87334806aff363038b0452fd0.jpg)
262
+ Figure 6: Left: Edge accuracy of large scale models for MNIST. Right: Digit classification error with $1 \%$ labels. Dashed lines represent nodes in components without known labels (non-classifiable).
263
+
264
+ # 5.4 SEMI-SUPERVISED LEARNING
265
+
266
+ On the same graphs, we perform label propagation (Zhu et al., 2003) on MNIST, with $1 \%$ known labels. The results are plotted in Figure 6 (right). Note that in label propagation, knowledge is not shared between disconnected components, making it impossible to classify nodes in components without known labels. The dashed lines of Figure 6 represent the number of nodes in such components, that occur much less in the log graph. Again, the log model performs best. To have a fair comparison with A-NN, we weighted its edges with standard exponential decay $W _ { i , j } = \mathrm { e x p } ( - Z _ { i , j } / \dot { \sigma } ^ { 2 } )$ and chose every time the best performing $\sigma$ . Note that it is very difficult for the "soft" and "hard" models to control sparsity (hard graphs have no parameter at all). Hence they are less adaptable to a particular problem and in this particular case perform poorly.
267
+
268
+ # 5.5 MANIFOLD RECOVERY QUALITY
269
+
270
+ Graphs can be used to recover a low dimensional manifold from data. We evaluate the performance of our large scale model for this application on three datasets: "spherical data" $n = 2 6 2$ , 144) and "spherical data small" $( n = 4 , 0 9 6 )$ from a known 2-D manifold, and "word2vec" $( n = 1 0 , 0 0 0 )$ ).
271
+
272
+ # 5.5.1 LARGE SPHERICAL DATA
273
+
274
+ Using 1920 signals from a known spherical manifold (Perraudin et al., 2018) we learn graphs of 262, 144 nodes and recover a 2D manifold using the first 2 non-trivial eigenvectors of their Laplacians. The data is sampled on a $5 1 2 \times 5 1 2$ grid on the sphere, so we use graphs of degree close to $k = 4$ We try to recover it using scalable models: $\ell _ { 2 }$ $k = 4 . 7 0$ ), log $k = 4 . 7 3 ,$ ) and A-NN $k = 4 . 3 1$ ).
275
+
276
+ While the A-NN graph performs very poorly, the representations recovered by both $\ell _ { 2 }$ and log graphs are almost perfectly square (Figure 15). However, as shown in Figure 7, the log graph gives the best representation. We plot subgraphs of the two models with only the nodes that correspond to 2D grids in the middle or the corner of the the original manifold. While the $\ell _ { 2 }$ graph does not connect all central nodes (green), the log graph is closer to a 2D grid. Furthermore, while the $\ell _ { 2 }$ model had 46 disconnected nodes that we discarded before computing eigenvectors, the log graph was connected.
277
+
278
+ ![](images/126fb4cd9f8d56b7974a9be55477d7fa7be4a80c0b4136cfc997300035f72013.jpg)
279
+ Figure 7: Detail from the manifolds recovered by $\ell _ { 2 }$ and log models from "spherical data" (262, 144 nodes, 1920 signals). Corner (blue) and middle (green) parts of the manifold. Left: $\ell _ { 2 }$ model, $k = 4 . 7 0$ . Right: log model, $k = 4 . 7 3$ . See Figure 15 for the big picture.
280
+
281
+ # 5.5.2 SMALL SPHERICAL DATA
282
+
283
+ We then learn graphs from the “small spherical data” so as to be able to compute graph diameters. This operation has a complexity above ${ \mathrm { \dot { ~ } } } O ( n ^ { 2 } )$ and is not possible for large graphs. Manifold-like graphs are known to have larger diameter compared to small world graphs (Watts & Strogatz, 1998) for the same average degree.
284
+
285
+ In Figure 8 (left and middle) we plot the diameter of scalable graph models. The data has 4096 nodes organized as a $6 4 \times 6 4$ grid, therefore a ground-truth 4-NN has exactly diameter $1 2 7 = 2 \cdot 6 4 - 1$ , and a ground-truth 8-NN diameter 63. The learned graphs, given enough information (1920 signals) reach the ideal diameter around degrees 4 or 8, with a phase transition from diameter 127 to diameter 63 between degrees 6 to 7. When the information is not enough to recover the exact manifold (using only 40 signals, middle plot of Figure 8), the learned graphs have a higher diameter than the A-NN graph.
286
+
287
+ ![](images/bd8659608099e042f758373973b6df7386fb94e22865629866a56c43172bb327.jpg)
288
+ Figure 8: Graph diameter measures manifold recovery quality. Left: small spherical data: 4096 nodes, 1920 signals. Middle: Same data, 40 signals. Right: word2vec: 10,000 nodes, 300 features.
289
+
290
+ # 5.5.3 GRAPH BETWEEN WORDS USING WORD2VEC REPRESENTATIONS
291
+
292
+ Finally we learn a graph between $1 0 , 0 0 0$ words using 300 word2vec features, like the ones used for graph convolutional neural networks (Defferrard et al., 2016). In this application, connectivity of all nodes is important, and $\ell _ { 2 }$ graphs failed, always giving many disconnected nodes.
293
+
294
+ In Figure 8 we compare the diameter of our large scale log graphs against A-NN and the $k$ -NN graphs used by (Defferrard et al., 2016). The large scale log graph has significantly larger diameter than both $k$ -NN and A-NN graphs. This indicates that our learned graph is closer to a manifold-like structure, unlike the other two types that are closer to a small-world graph. Manifold-like graphs reveal better the structure of data, while small world graphs are related to randomness (Watts & Strogatz, 1998).
295
+
296
+ In Figure 9, we plot nodes within two hops from the word "use" in the three types of graphs of degree around $k = 5$ . We see that the NN graphs span a larger part of the entire graph just with 2 hops, the A-NN being closer to small-world. While the $k$ -NN graph does better in terms of quality, it is significantly worse than our large scale log graph, that is actually cheaper to compute. Additionally, graph learning seems to assign more meaningful weights as we show in Table 1 of the supplementary material D.4.
297
+
298
+ # 5.6 COMPUTATION TIME
299
+
300
+ In Figure 1 we compare our scaled model to other graph learning models in terms of time as a function of $n$ . For all iterative algorithms, except A-NN, we perform a maximum of 500 iterations. The scaled $\ell _ { 2 }$ needs time per iteration identical to the scaled log model, but typically needs more iterations (more than 5, 000 compared to 500) till convergence. As we fix the number of iterations, they overlap and we only plot the log model.
301
+
302
+ ![](images/4421158bbbe5811981b922f08789c0cd2e2e37eaf7d52c4d028ecad5a7a89a5e.jpg)
303
+ Figure 9: A 2-hop sub-graph of the word ”use”. Left: A-NN ( $k = 5 . 4$ ). Center: $k$ -NN graph $k = 5 . 0$ ). Right: Large scale log $k = 5 . 7$ ) being manifold-like only reaches relevant terms.
304
+
305
+ In Figure 1 (left) we learn graphs between words, using 300 features (word2vec). The cost is almost linear for our method, but quadratic for the original log model of Kalofolias (2016). The "hard" model corresponds to a close implementation of the original work of (Daitch et al., 2009). The most expensive part of the computation comes from the quadratic program solver. For the "soft" model, we used the forward backward scheme of (Beck & Teboulle, 2009) and the cost is governed by evaluating the KKT conditions to find the optimal support $( \mathcal { O } ( n ^ { 2 } ) )$ , that is faster than their original algorithm.
306
+
307
+ We also compare to our scaled versions of the "hard" and "soft" models, where we fix the support in the same way as explained in Section 3 (cf. supplementary material C). The bottleneck of the computation comes from the term $\| L X \| _ { F } ^ { 2 }$ that requires $\mathcal { O } \left( k n d \right)$ operations as opposed to our $\mathcal { O } \left( k n \right)$ for $\operatorname { t r } \left( X ^ { \top } L X \right)$ . To reduce this cost, we randomly projected the original $d = 3 0 0$ input features to a subspace of size $d = 2 0$ . While the cost per iteration of the "soft" method is slower than for the "hard" method, the latter typically needs more iterations to reach convergence.
308
+
309
+ In Figure1 (right), we show the scalability of our model to graphs of up to 1M samples2 of US census. Setting $k = 5$ , it used 16 minutes to perform 500 iterations of graph learning on a desktop computer running Matlab. While this is a proof of scalability, for really large data one will have to consider implementation details like memory management, and using a faster programming language (like $\mathrm { C } { + + }$ ). Note that the A-NN implementation we used was compiled C code and thus much faster. In Figure 14 we illustrate the linear scalability of our model w.r.t. the size of the set of allowed edges.
310
+
311
+ # 6 CONCLUSIONS
312
+
313
+ We propose the first scalable solution to learn a weighted undirected graph from data, based on A-NN and the current state-of-the-art graph learning model. While it costs roughly as much as A-NN, it achieves quality very close to state-of-the-art. Its ability to scale is based on reducing the variables used for learning, while out automatica parameter selection eliminates the need for grid-search in order to achieve a sought graph sparsity. We assess its quality and scalability by providing an extensive set of experiments on many real datasets. The new large scale graphs perform best in various machine learning cases. They give better manifolds, are better for semi-supervised learning, and select the right amount of edges without allowing disconnected nodes. Learning a graph of 1 million nodes only takes 16 minutes using our simple Matlab implementation on a desktop computer.
314
+
315
+ # THANKS
316
+
317
+ The authors would like to especially thank Pierre Vandergheynst for his helpful comments during the preparation of this work at LTS2. We thank also the ETHZ Cosmology Research Group for allowing us to use their "Spherical convergence maps dataset" in the manifold recovery experiment.
318
+
319
+ # REFERENCES
320
+
321
+ Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009.
322
+
323
+ Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In NIPS, volume 14, pp. 585–591, 2001.
324
+
325
+ Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. The Journal of Machine Learning Research, 7:2399–2434, 2006.
326
+
327
+ Samuel I Daitch, Jonathan A Kelner, and Daniel A Spielman. Fitting a graph to vector data. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 201–208. ACM, 2009.
328
+
329
+ Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pp. 3837–3845, 2016.
330
+
331
+ Wei Dong, Charikar Moses, and Kai Li. Efficient k-nearest neighbor graph construction for generic similarity measures. In Proceedings of the 20th international conference on World wide web, pp. 577–586. ACM, 2011.
332
+
333
+ Xiaowen Dong, Dorina Thanou, Pascal Frossard, and Pierre Vandergheynst. Learning laplacian matrix in smooth graph signal representations. arXiv preprint arXiv:1406.7842v2, 2015.
334
+
335
+ John Duchi, Shai Shalev-Shwartz, Yoram Singer, and Tushar Chandra. Efficient projections onto the l 1-ball for learning in high dimensions. In Proceedings of the 25th international conference on Machine learning, pp. 272–279. ACM, 2008.
336
+
337
+ Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
338
+
339
+ Chenhui Hu, Lin Cheng, Jorge Sepulcre, Georges El Fakhri, Yue M Lu, and Quanzheng Li. A graph theoretical regression model for brain connectivity learning of alzheimer’s disease. In 2013 IEEE 10th International Symposium on Biomedical Imaging, pp. 616–619. IEEE, 2013.
340
+
341
+ Tony Jebara, Jun Wang, and Shih-Fu Chang. Graph construction and b-matching for semi-supervised learning. In Proceedings of the 26th Annual International Conference on Machine Learning, pp. 441–448. ACM, 2009.
342
+
343
+ Vassilis Kalofolias. How to learn a graph from smooth signals. In The 19th International Conference on Artificial Intelligence and Statistics (AISTATS 2016). Journal of Machine Learning Research (JMLR), 2016.
344
+
345
+ Vassilis Kalofolias, Xavier Bresson, Michael Bronstein, and Pierre Vandergheynst. Matrix completion on graphs. arXiv preprint arXiv:1408.1717, 2014.
346
+
347
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
348
+
349
+ Nikos Komodakis and Jean-Christophe Pesquet. Playing with duality: An overview of recent primal? dual approaches for solving large-scale optimization problems. IEEE Signal Processing Magazine, 32(6):31–54, 2015.
350
+
351
+ Brenden Lake and Joshua Tenenbaum. Discovering structure by learning sparse graph. In Proceedings of the 33rd Annual Cognitive Science Conference. Citeseer, 2010.
352
+
353
+ Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
354
+
355
+ Yu A Malkov and DA Yashunin. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. arXiv preprint arXiv:1603.09320, 2016.
356
+
357
+ Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. arXiv preprint arXiv:1611.08402, 2016.
358
+
359
+ Marius Muja and David G Lowe. Fast approximate nearest neighbors with automatic algorithm configuration. VISAPP (1), 2(331-340):2, 2009.
360
+
361
+ Marius Muja and David G Lowe. Fast matching of binary features. In Computer and Robot Vision (CRV), 2012 Ninth Conference on, pp. 404–410. IEEE, 2012.
362
+
363
+ Marius Muja and David G Lowe. Scalable nearest neighbor algorithms for high dimensional data. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(11):2227–2240, 2014.
364
+
365
+ Nathanaël Perraudin, Johan Paratte, David Shuman, Vassilis Kalofolias, Pierre Vandergheynst, and David K. Hammond. GSPBOX: A toolbox for signal processing on graphs. ArXiv e-prints, August 2014.
366
+
367
+ Nathanaël Perraudin, Michaël Defferrard, Tomasz Kacprzak, and Raphael Sgier. Deepsphere: Efficient spherical convolutional neural network with healpix sampling for cosmological applications. arXiv preprint arXiv:1810.12186, 2018.
368
+
369
+ Raphael Sgier, Tomasz Kacprzak, Nathanaël Perraudin, and Michaël Defferrard. Spherical convergence maps dataset, July 2018. URL https://doi.org/10.5281/zenodo.1303272.
370
+
371
+ Nauman Shahid, Nathanael Perraudin, Vassilis Kalofolias, Gilles Puy, and Pierre Vandergheynst. Fast robust pca on graphs. IEEE Journal of Selected Topics in Signal Processing, 10(4):740–756, 2016.
372
+
373
+ Reha H Tütüncü, Kim-Chuan Toh, and Michael J Todd. Solving semidefinite-quadratic-linear programs using sdpt3. Mathematical programming, 95(2):189–217, 2003.
374
+
375
+ Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007.
376
+
377
+ Fei Wang and Changshui Zhang. Label propagation through linear neighborhoods. Knowledge and Data Engineering, IEEE Transactions on, 20(1):55–67, 2008.
378
+
379
+ Duncan J Watts and Steven H Strogatz. Collective dynamics of ‘small-world’networks. nature, 393 (6684):440–442, 1998.
380
+
381
+ Tong Zhang, Alexandrin Popescul, and Byron Dom. Linear prediction models with graph regularization for web-page categorization. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 821–826. ACM, 2006.
382
+
383
+ Miao Zheng, Jiajun Bu, Chun Chen, Can Wang, Lijun Zhang, Guang Qiu, and Deng Cai. Graph regularized sparse coding for image representation. Image Processing, IEEE Transactions on, 20 (5):1327–1336, 2011.
384
+
385
+ Xiaojin Zhu, Zoubin Ghahramani, John Lafferty, et al. Semi-supervised learning using gaussian fields and harmonic functions. In ICML, volume 3, pp. 912–919, 2003.
386
+
387
+ # LARGE SCALE GRAPH LEARNING FROM SMOOTH SIGNALS: SUPPLEMENTARY MATERIAL
388
+
389
+ A PROOF OF THEOREM 1
390
+
391
+ Proof. For any edge $i , j$ the optimality conditions are:
392
+
393
+ $$
394
+ 2 \theta Z _ { i , j } + 2 W _ { i , j } ^ { * } - \frac { 1 } { \sum _ { k \neq i } W _ { i , k } ^ { * } } - \frac { 1 } { \sum _ { k \neq j } W _ { k , j } ^ { * } } = 0 .
395
+ $$
396
+
397
+ Let us select any $i , j$ such that $W _ { i , j } > 0$ . Define $\eta _ { i , j }$ so that
398
+
399
+ $$
400
+ 2 \eta _ { i , j } = \frac { 2 } { W _ { i , j } ^ { * } } - \frac { 1 } { \sum _ { k \neq i } W _ { i , k } ^ { * } } - \frac { 1 } { \sum _ { k \neq j } W _ { k , j } ^ { * } } ,
401
+ $$
402
+
403
+ and note that $\eta _ { i , j } \geq 0$ , because all elements of $W ^ { * }$ are non-negative and $\begin{array} { r } { \frac { 1 } { W _ { i , j } ^ { * } } \geq \frac { 1 } { W _ { i , j } ^ { * } + \sum _ { k \neq i , j } W _ { i , k } ^ { * } } } \end{array}$ Then we can rewrite the optimality conditions so that they can be solved analytically as a function of the unknown ηi,j:
404
+
405
+ $$
406
+ 2 \theta Z _ { i , j } + 2 W _ { i , j } ^ { * } - \frac { 2 } { W _ { i , j } ^ { * } } + 2 \eta _ { i , j } = 0 \Rightarrow
407
+ $$
408
+
409
+ $$
410
+ W _ { i , j } ^ { * } = \frac { \sqrt { { ( \theta Z _ { i , j } + \eta _ { i , j } ) } ^ { 2 } + 4 } - ( \theta Z _ { i , j } + \eta _ { i , j } ) } { 2 } \le 1 ,
411
+ $$
412
+
413
+ since $\sqrt { 4 + x ^ { 2 } } - x \leq 2 , \forall x \geq 0$ . This inequality holds for any edge $i , j$ of the learned graph such that $W _ { i , j } ^ { * } > 0$ , therefore we can write
414
+
415
+ $$
416
+ \operatorname* { m a x } _ { i , j } W _ { i , j } ^ { * } ( \theta Z , 1 , 1 ) \le 1 .
417
+ $$
418
+
419
+ Hence using proposition $I$ , we conclude the proof.
420
+
421
+ Note that for sparsely connected regions, $\eta _ { i , j }$ becomes smaller, and therefore the edges of the graph come closer to the upper limit. We can deduct from equation 19 that the limit is actually reached only in case of duplicate nodes, i.e when $Z _ { i , j } = 0$ , and if the rest of the nodes are sufficiently far so that the edge $i , j$ is the only edge for both nodes (so that $\eta _ { i , j } = 0$ ).
422
+
423
+ # B PROOF OF THEOREM 3
424
+
425
+ Proof. From the proof of Theorem 2, we know that $\| w ^ { * } \| _ { 0 } = k$ if and only if $\lambda ^ { * } \in [ \theta z _ { k } , \theta z _ { k + 1 } )$ . We can rewrite this condition as
426
+
427
+ $$
428
+ \begin{array} { c } { { \theta z _ { k } \leq \displaystyle \frac { \theta b _ { k } + \sqrt { \theta ^ { 2 } b _ { k } ^ { 2 } + 4 k } } { 2 k } < \theta z _ { k + 1 } \Leftrightarrow } } \\ { { 2 k \theta z _ { k } - \theta b _ { k } \leq \sqrt { \theta ^ { 2 } b _ { k } ^ { 2 } + 4 k } < 2 k \theta z _ { k + 1 } - \theta b _ { k } \Leftrightarrow } } \\ { { 4 k ^ { 2 } \theta ^ { 2 } z _ { k } ^ { 2 } - 4 k \theta ^ { 2 } b _ { k } z _ { k } \leq 4 k < 4 k ^ { 2 } \theta ^ { 2 } z _ { k + 1 } ^ { 2 } - 4 k \theta ^ { 2 } b _ { k } z _ { k + 1 } \Leftrightarrow } } \\ { { \theta ^ { 2 } ( k z _ { k } ^ { 2 } - b _ { k } z _ { k } ) \leq 1 < \theta ^ { 2 } ( k z _ { k + 1 } ^ { 2 } - b _ { k } z _ { k + 1 } ) . } } \end{array}
429
+ $$
430
+
431
+ As $\theta$ is constrained to be positive, the only values that satisfy the above inequalities are the ones proposed in the theorem.
432
+
433
+ # C SCALING ALGORITHM OF (DAITCH ET AL., 2009)
434
+
435
+ (Daitch et al., 2009) proposes two convex optimization problems in order to learn graph from smooth signals. The prior used is $\| L X \| _ { F } ^ { 2 }$ , which is a quadratic function of the weight $W$ . For the first problem, corresponding to the "hard" model, each node is constraint to have a degree of at least 1:
436
+
437
+ $$
438
+ \operatorname* { m i n i m i z e } _ { w } \left\| M w \right\| _ { 2 } ^ { 2 } \qquad { \mathrm { s . t . ~ } } w \geq \mathbf { 0 } , S w \geq \mathbf { 1 } ,
439
+ $$
440
+
441
+ where $M$ is a linear operator such that $\| L X \| _ { F } ^ { 2 } = \| M w \| _ { 2 } ^ { 2 }$ . We refer to the original paper for the construction of $M$ . The second problem, corresponding to the "soft" problem, is a relaxed version of the "hard" one where each every degree below 1 is penalized quadratically. It reads:
442
+
443
+ $$
444
+ \operatorname* { m i n i m i z e } _ { \boldsymbol { w } } \| M \boldsymbol { w } \| _ { 2 } ^ { 2 } + \mu \| \operatorname* { m a x } ( \mathbf { 1 } - S \boldsymbol { w } , 0 ) \| _ { 2 } ^ { 2 } \qquad \mathrm { s . t . ~ } \boldsymbol { w } \geq \mathbf { 0 } ,
445
+ $$
446
+
447
+ where $\mu$ is a parameter weighting the importance of the constraint. In comparizon to the log and the $\ell _ { 2 }$ models where changing the regularization parameters has an important effect on the final average node degree, we note that $\mu$ has little effect on the final average node degree. In their original paper, Daitch etal solve their optimization problems using SDPT3 (Tütüncü et al., 2003), which has a complexity significantly higher than $\mathcal { O } \left( v ^ { 2 } \right)$ for $v$ variables. So even when the number of edges scales with the number of nodes, i.e. $v = \mathcal { O } \left( n \right)$ , the complexity is not better than $O \left( n ^ { 2 } \right)$ . To minimize this issue, one of the important contribution of (Daitch et al., 2009) is to solve the problem on subset $v$ of edges. Nevertheless, instead of keeping the support fixed (as we do), they propose to check the KKT conditions of the dual variable, they can assess if the some edges should be added to the support at end optimization scheme. If so, the optimization is run again with the new edges. The process is repeated until all KKT conditions are satisfied. This technique allows for finding the global solution of larger problems, (particularly if SDPT3 is used). We note however that the search of the next relevant support costs $O ( n ^ { 2 } )$ again, since they have to compute the KKT conditions for all possible edges.
448
+
449
+ We started by implementing the original "hard" and "soft" algorithms and obtained similar speed that were comparable as the results reported in the original paper. Unfortunately, we were not able to run theses implementations for more than a few thousands of nodes. Hence, in order to compare with our algorithm, we had to cope with their scalability issues first. Essentially, we derived new algorithms thanks to two modifications. First, we used FISTA ((Beck & Teboulle, 2009)) and forwardbackward-based primal-dual (Komodakis & Pesquet, 2015, Algorithm 2) optimization schemes respectively for the soft and hard graph optimization instead of SDPT3. Second, we removed the support optimization using the KKT conditions and use the same A-NN support as our algorithm. After those modification, our implementation scaled to approximately a $1 0 0 ^ { \prime } 0 0 0$ nodes. While the theoretical complexity is about the same as for our optimization problem, the running time are significantly longer than our method because the term $\| L X \| _ { F } ^ { 2 } = \| M w \| _ { 2 } ^ { 2 }$ requires $d$ times more computation than $\operatorname { t r } \left( X ^ { T } L X \right) = \| Z w \| _ { 1 }$ , where $d$ is the number of signals. In order to be able to compare to these algorithm in Figure 1, we randomly projected the original $d = 3 0 0$ input features to a subspace of size $d = 2 0$ (this does not change significantly the computation time of our model). While the cost per iteration of the "soft" method is slower than for the "hard" method, the latter typically needs more iterations to reach convergence. The reason is that our accelerated algorithm uses FISTA that has a global rate of convergence proven to be significantly better than the forward-backward based primal-dual we used (Beck & Teboulle, 2009; Komodakis & Pesquet, 2015).
450
+
451
+ # D EXPERIMENTS
452
+
453
+ # D.1 DATASETS
454
+
455
+ • MNIST: We use the 60000 images of the MNIST training dataset.
456
+ • US Census 1990: Dataset available at the UCI machine learning repository, consists of approximately 2.5 million samples of 68 features. https://archive.ics.uci.edu/ ml/datasets/US $^ +$ Census+Data $^ +$ (1990) word2vec: The $1 0 ^ { \prime } 0 0 0$ most used words in English (https://research. googleblog.com/2006/08/all-our-n-gram-are-belong-to-you. html). It uses the Google word2vec features (https://code.google.com/ archive/p/word2vec/). Spherical data: Simulated cosmological mass maps (i.e. the amount of mass in the universe observed from earth in every direction) from Perraudin et al. (2018); Sgier et al. (2018). The dataset consists of two sets of maps that were created using the standard cosmological model with two sets of cosmological parameters. This data resides on the sphere, which can be considered as its underlying manifold. We used the slightly smoothed maps (Gaussian kernel of radius 3 arcmin), as proposed in the original paper. While the original data consists of 40 maps of size $1 2 \cdot 1 0 2 4 ^ { 2 }$ , we work only a sup-part of the sphere of size. This allow us
457
+
458
+ to build 1920 signals on a sub-part of the sphere $5 1 2 \times 5 1 2$ grid), i.e. between 262, 144 nodes. The actual manifold with the correct coordinates is plotted in Figure $1 5 { \mathrm { ~ u p } }$ left. https://zenodo.org/record/1303272
459
+
460
+ • Small spherical data: A subset of "Spherical data" containing 4096 nodes, (64x64 grid) and the same 1920 signals.
461
+
462
+ • USPS: Handwritten digits from 0 to 9. https://ieeexplore.ieee.org/ document/291440
463
+
464
+ # D.2 MNIST IRREGULAR INTRA-CLASS DISTANCES
465
+
466
+ Figure 10 illustrates one irregularity of the MNIST dataset. One could expect that the average distance between two digits of the same class (intra-class) is more or less independent of the class. Nevertheless, for the MNIST dataset, the distance between the 1 is significantly smaller than the one of the other digits. For this reason, the L2 model connects significantly more the digits 1 than the others.
467
+
468
+ ![](images/03fc7bd0f1215870ffb6a484e361f23911b06d7113dd39d15e5015ce7fe3d600.jpg)
469
+ Figure 10: Label frequency (left) and average squared distribution (right) of MNIST train data (60000 nodes). The distances between digits “1” are significantly smaller than distances between other digits.
470
+
471
+ # D.3 APPROXIMATION ACCURACY AND ROBUSTNESS OF PARAMETER $\theta$
472
+
473
+ We already saw in Figure 2 (middle) that for the MNIST dataset (17) predicts very well the sparsity of the final graph for any choice of $\theta$ . This is further illustrated on the USPS and ATT faces datasets in Figure 12. Note, that in the rare cases that the actual sparsity is outside the predicted bounds, we already have a good starting point for finding a good $\theta$ . For example, in the COIL dataset, if we want a graph with 15 edges per node we will set $\theta = 1 . 2$ , obtaining instead a graph with 12 edges per node. This kind of fluctuations are usually tolerated, while even in $k$ -NN we always obtain graphs with more than nk edges due to the fact that $W$ is symmetric.
474
+
475
+ # D.3.1 ROBUSTNESS TO OUTLIERS AND DUPLICATES
476
+
477
+ We test the robustness of the bounds of $\theta$ by repeating the experiment of Figure 2 (middle) after replacing $1 0 \%$ of the images with outliers or duplicates. For this experiment, we first added outliers by contaminating $1 0 \%$ of the images with Gaussian noise from $\mathcal { N } ( \boldsymbol { \prime } , \infty )$ . Note that this is huge noise since the initial images have intensities in the range $[ 0 , 1 ]$ . The result, plotted in Figure 11 (left), is almost identical to the results without outliers (Figure 2, middle).
478
+
479
+ While this might seem surprising, note that $\theta$ given by eq. (17) are really dependent on the smallest distances in $Z$ , rather than the largest ones: $\hat { Z }$ is sorted, and B as well. Adding outliers induces additional nodes distances larger than usually, that never make it to change the first $k$ rows of matrices $\hat { Z }$ and $B$ , for the columns that correspond to non-outlier nodes. Therefore, eq. (17) is very robust to outliers.
480
+
481
+ To complete the experiment, instead of adding noise, we replaced $1 0 \%$ of the images with copies of other images already in the dataset. In this case, we have $2 0 \%$ of images in pairs of duplicates, with essentially zero distances with each other in matrix $Z$ . As we see in Figure 11 (right), while the intervals of $\theta$ change, they do so following closely the actual measured sparsity.
482
+
483
+ ![](images/371c5f39e164299b9f2cf9e9e357baa61500ae93d59be005e04d213dae2c5e07.jpg)
484
+ Figure 11: Robustness of the theoretical bounds of $\theta$ in the existence of outliers or duplicate nodes. Same dataset as the one used for Figure 2. Even for extreme cases in terms of distance distribution, the bounds give a good approximation. Left: Results when we add Gaussian noise from $\mathcal { N } ( 0 , 1 )$ to $10 \%$ of the images before calculating $Z$ . Note that the noise added is significant given that the initial pixel values are in $[ 0 , 1 ]$ . Right: We replaced $10 \%$ of the images with duplicates of other images already in the dataset.
485
+
486
+ ![](images/3454c8bc92d5f5c8175cb4d4ebacf65c548a0edd6021db639f59019d17efd3ab.jpg)
487
+ Figure 12: Predicted and measured sparsity for different choices of $\theta$ . Note that $\theta$ is plotted in logarithmic scale and decreasing. Up left: 400 ATT face images. Up right: 1440 object images from the COIL dataset. Down left: Graph between 1000 samples from a multivariate uniform distribution. Down right: Graph between 1000 samples from a multivariate Gaussian distribution.
488
+
489
+ # D.4 CONNECTIVITY EXAMPLE OF THE GRAPH OF WORDS
490
+
491
+ In Table 1, we look in more detail at the graph constructed from the word2vec features. We present the connectivity for the word "glucose" and "academy". Looking at different words, we observe that the learned graph is able to associate meaningful edge weights to the different words according to the confidence of their similarity.
492
+
493
+ <table><tr><td rowspan=1 colspan=1>Word</td><td rowspan=1 colspan=1>k-NN</td><td rowspan=1 colspan=1>A-NN</td><td rowspan=1 colspan=1>Learned</td></tr><tr><td rowspan=1 colspan=1>glucose</td><td rowspan=1 colspan=1>0.1226 insulin0.0233 protein0.0210 oxygen0.0148 hormone</td><td rowspan=1 colspan=1>0.0800 insulin0.0337 protein0.0306 oxygen0.0295 cholesterol0.0263calcium0.02251hormone</td><td rowspan=1 colspan=1>0.5742 insulin0.0395 calcium0.0151 metabolism0.0131 cholesterol</td></tr><tr><td rowspan=1 colspan=1>academy</td><td rowspan=1 colspan=1>0.0996 training0.0953 school0.0918 institute</td><td rowspan=1 colspan=1>0.0901 young0.0863 department0.0841 bizrate</td><td rowspan=1 colspan=1>0.3549 training0.2323 institute0.1329 school0.0135 camp.0.0008 vocational</td></tr></table>
494
+
495
+ # D.5 MNIST CONNECTIVITY FOR (DAITCH ET AL., 2009) METHODS
496
+
497
+ In Figure 13, we plot the connectivity across different digits of MNIST for the "hard" and "soft" model. As the degree is constant over the nodes, the hard model perform similarly to the A-NN (see Figure 5). It seems that due to hard constraint, the "hard" model forces many edges with a small weights. On the other hand, in terms of connextivity, the soft model seems to be between the log and the $\ell _ { 2 }$ model.
498
+
499
+ ![](images/1e5530efe01d12d2141c26101d0cd523c76e3809b1a1382886dd07c21c809c9a.jpg)
500
+ Table 1: Weight comparison between $k$ -NN, A-NN and learned graphs. The weights assigned by graph learning correspond much better to the relevance of the terms.
501
+ Figure 13: Connectivity across different classes of MNIST (60000 nodes). The graph is normalized so that $\| W \| _ { 1 , 1 } = 1$ . We measure the percentage of the total weight for connected pairs of each label. The last columns correspond to the total of the wrong edges, between images of different labels. Left: (Daitch et al., 2009) hard model. As the degree is constant over the nodes, the hard model is close the A-NN. Right: (Daitch et al., 2009) soft model. In terms of connextivity, the soft model seems to be between the log and the $\ell _ { 2 }$ model. Note that while it favors connections between "1"s, this effect becomes worse with higher density. Note also that these algorithms fail to give reasonable graphs for densities outside a small range, making it very difficult to control sparsity.
502
+
503
+ # D.6 MNIST COMPUTATIONAL TIME WITH RESPECT TO K
504
+
505
+ The cost of learning a graph with a subset of allowed edges $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ is linear to the size of the set as illustrated in Figure 14. For this experiment, we use the MNIST data set. To learn a graph with approximately 10 edges per node, we needed 20 seconds to compute $\mathcal { E } ^ { \mathrm { a l l o w e d } }$ , and 20 seconds to learn the final graph of 60000 nodes (around 250 iterations). Note that the time necessary to search for the nearest neighbors is in the same order of magnitude than the learning process.
506
+
507
+ ![](images/efcdaaabe99f0a39b64bd097f13c4e8b3b2922cce24ea5bddcc7c595558cee8f.jpg)
508
+ Figure 14: Time needed for learning a graph of 60000 nodes (MNIST images) using the large-scale version of (3). Our algorithm converged after 250 to 450 iterations with a tolerance of $1 e - 4$ . The time needed is linear to the number of variables, that is linear to the average degree of the graph.
509
+
510
+ ![](images/91572976fd5ac65062d0d764e2166e6d7fdf8f73d609dcb7c1a157028d7ba3de.jpg)
511
+ Figure 15: Spherical data, ground truth and recovered manifolds. Up left: The ground truth manifold is on the sphere. We have colored the nodes that correspond to the middle of the 2-D grid and the lower corner so that we track where they are mapped in the recovered manifolds. In Figure 7 we keep only the subgraphs of the green or blue nodes. Up, right: Recovered by A-NN, $k = 4 . 3 1$ . Down, left: Recovered by the $\ell _ { 2 }$ model, $k = 4 . 7 0$ . The middle region is mixed with nodes outside the very center. The corners are much more dense, the blue region is barely visible on the bottom. Note that 46 nodes were disconnected so they are not mapped at all. Down, right: Recovered by the log model, $k = 4 . 7 3$ . The middle region is much better mapped. The corners are still very dense, we have to zoom-in for the blue region (Figure 7).
parse/train/ryGkSo0qYm/ryGkSo0qYm_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ryGkSo0qYm/ryGkSo0qYm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ryGkSo0qYm/ryGkSo0qYm_model.json ADDED
The diff for this file is too large to render. See raw diff