SlowGuess commited on
Commit
2eaf1fa
·
verified ·
1 Parent(s): d33e49b

Add Batch 33327132-603b-42aa-a770-861a98b5f7b4

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_content_list.json +3 -0
  2. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_model.json +3 -0
  3. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_origin.pdf +3 -0
  4. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/full.md +337 -0
  5. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/images.zip +3 -0
  6. infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/layout.json +3 -0
  7. intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_content_list.json +3 -0
  8. intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_model.json +3 -0
  9. intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_origin.pdf +3 -0
  10. intensityfreelearningoftemporalpointprocesses/full.md +632 -0
  11. intensityfreelearningoftemporalpointprocesses/images.zip +3 -0
  12. intensityfreelearningoftemporalpointprocesses/layout.json +3 -0
  13. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_content_list.json +3 -0
  14. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_model.json +3 -0
  15. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_origin.pdf +3 -0
  16. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/full.md +463 -0
  17. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/images.zip +3 -0
  18. isagoodrepresentationsufficientforsampleefficientreinforcementlearning/layout.json +3 -0
  19. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_content_list.json +3 -0
  20. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_model.json +3 -0
  21. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_origin.pdf +3 -0
  22. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/full.md +0 -0
  23. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/images.zip +3 -0
  24. kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/layout.json +3 -0
  25. kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_content_list.json +3 -0
  26. kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_model.json +3 -0
  27. kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_origin.pdf +3 -0
  28. kernelizedwassersteinnaturalgradient/full.md +0 -0
  29. kernelizedwassersteinnaturalgradient/images.zip +3 -0
  30. kernelizedwassersteinnaturalgradient/layout.json +3 -0
  31. learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_content_list.json +3 -0
  32. learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_model.json +3 -0
  33. learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_origin.pdf +3 -0
  34. learningcompositionalkoopmanoperatorsformodelbasedcontrol/full.md +335 -0
  35. learningcompositionalkoopmanoperatorsformodelbasedcontrol/images.zip +3 -0
  36. learningcompositionalkoopmanoperatorsformodelbasedcontrol/layout.json +3 -0
  37. learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_content_list.json +3 -0
  38. learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_model.json +3 -0
  39. learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_origin.pdf +3 -0
  40. learningfromrulesgeneralizinglabeledexemplars/full.md +418 -0
  41. learningfromrulesgeneralizinglabeledexemplars/images.zip +3 -0
  42. learningfromrulesgeneralizinglabeledexemplars/layout.json +3 -0
  43. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_content_list.json +3 -0
  44. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_model.json +3 -0
  45. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_origin.pdf +3 -0
  46. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/full.md +308 -0
  47. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/images.zip +3 -0
  48. learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/layout.json +3 -0
  49. learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_content_list.json +3 -0
  50. learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_model.json +3 -0
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c152b79e644af2ac46debdaf6cdad14dab21d969da2b0d17fec3004f17b6a8b
3
+ size 89116
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9afbe056f9a5ca7a1df31a5e5d018c69f5c4030edb1ff24fc4d9eb0919c59627
3
+ size 113457
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5ae35eefecef32eb4f2a0a10f9587426e04f34cbda25f83e7f8ee235dde682c
3
+ size 438709
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/full.md ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INFOGRAPH: UNSUPERVISED AND SEMI-SUPERVISED GRAPH-LEVEL REPRESENTATION LEARNING VIA MUTUAL INFORMATION MAXIMIZATION
2
+
3
+ Fan-Yun Sun $^{1,2}$ , Jordan Hoffmann $^{2,4}$ , Vikas Verma $^{2,3}$ , Jian Tang $^{2,5,6}$
4
+
5
+ $^{1}$ National Taiwan University,
6
+ $^{2}$ Mila-Quebec Institute for Learning Algorithms, Canada
7
+ $^{3}$ Aalto University, Finland
8
+ $^{4}$ Harvard University, USA
9
+ $^{5}$ HEC Montreal, Canada
10
+ $^{6}$ CIFAR AI Research Chair
11
+
12
+ b04902045@ntu.edu.tw
13
+ jhoffmann@g.harvard.edu
14
+ vikas.verma@aalto.fijiian.tang@hec.ca
15
+
16
+ # ABSTRACT
17
+
18
+ This paper studies learning the representations of whole graphs in both unsupervised and semi-supervised scenarios. Graph-level representations are critical in a variety of real-world applications such as predicting the properties of molecules and community analysis in social networks. Traditional graph kernel based methods are simple, yet effective for obtaining fixed-length representations for graphs but they suffer from poor generalization due to hand-crafted designs. There are also some recent methods based on language models (e.g. graph2vec) but they tend to only consider certain substructures (e.g. subtrees) as graph representatives. Inspired by recent progress of unsupervised representation learning, in this paper we proposed a novel method called InfoGraph for learning graph-level representations. We maximize the mutual information between the graph-level representation and the representations of substructures of different scales (e.g., nodes, edges, triangles). By doing so, the graph-level representations encode aspects of the data that are shared across different scales of substructures. Furthermore, we further propose InfoGraph*, an extension of InfoGraph for semi-supervised scenarios. InfoGraph* maximizes the mutual information between unsupervised graph representations learned by InfoGraph and the representations learned by existing supervised methods. As a result, the supervised encoder learns from unlabeled data while preserving the latent semantic space favored by the current supervised task. Experimental results on the tasks of graph classification and molecular property prediction show that InfoGraph is superior to state-of-the-art baselines and InfoGraph* can achieve performance competitive with state-of-the-art semi-supervised models.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ Graphs have proven to be an effective way to represent very diverse types of data including social networks Newman & Girvan (2004), biological reaction networksPavlopoulos et al. (2011), protein-protein interactions Krogan et al. (2006), the quantum mechanical properties of individual molecules Xie & Grossman (2018); Jin et al. (2018), and many more. Graphs provide explicit information about the coupling between individual units in a larger part along with a well defined framework for assigning properties to the nodes and the edges connecting them. There has been a significant amount of previous work done studying many aspects of graphs including link prediction Gao et al. (2011); Wang et al. (2011) and node prediction Blei et al. (2003). Due to its flexibility, graph-like data structures can capture rich information which is critical in many applications.
23
+
24
+ At the lowest level, much work has been done on learning node representations- low-dimensional vector embeddings of individual nodes Perozzi et al. (2014); Tang et al. (2015); Grover & Leskovec (2016). Another field that has attracted a large amount of attention recently is learning representations of entire graphs. Such a problem is critical in a variety of applications such as predicting the properties of molecular graphs in both drug discovery and material science Chen et al. (2019b;a). There has been some recent progress based on neural message passing algorithms Gilmer et al. (2017); Xie & Grossman (2018), which learn the representations of entire graphs in a supervised way. These methods have been shown achieving state-of-the-art results on a variety of different prediction tasks Kipf et al. (2018); Xie & Grossman (2018); Gilmer et al. (2017); Chen et al. (2019a).
25
+
26
+ However, one of the most difficult obstacles for supervised learning on graphs is that it is often very costly or even impossible to collect annotated labels. For example, in the chemical domain labels are typically produced with a costly Density Functional Theory (DFT) calculation. One option is to use semi-supervised methods which combine a small handful of labels with a larger, unlabeled, dataset. In real-world applications, partially labeled datasets are common, making tools that are able to efficiently utilize the present labels particularly useful.
27
+
28
+ Coming up with methods that are able to learn unsupervised representations of an entire graph, as opposed to nodes, is an important step in working with unlabeled or partially labeled graphs Narayanan et al. (2017); Hu et al. (2019); Nguyen et al. (2017). For example, there exists work that explores pre-training techniques for graphs to improve generalization Hu et al. (2019). Another common approach to unsupervised representation learning on graphs is through graph kernels Pržulj (2007); Kashima et al. (2003); Orsini et al. (2015). However, many of these methods do not provide explicit graph embeddings which many machine learning algorithms operate on. Furthermore, the handcrafted features of graph kernels lead to high dimensional, sparse or non-smooth representations and thus result in poor generalization performance, especially on large datasets Narayanan et al. (2017).
29
+
30
+ Unsupervised learning of latent representations is also an important problem in other domains, such as image generation Kingma & Welling (2013); Kim & Mnih (2018) and natural language processing Mikolov et al. (2013a). A recent work introduced Deep Infomax, a method that maximizes the mutual information content between the input data and the learned representation Hjelm et al. (2018). This method outperforms other methods on many unsupervised learning tasks. Motivated by Deep InfoMax Hjelm et al. (2018), we aim to use mutual information maximization for unsupervised representation learning on the entire graph. Specifically, our objective is to maximize the mutual information between the representations of entire graphs and the representations of substructures of different granularity. We name our model InfoGraph.
31
+
32
+ We also propose a semi-supervised learning model which we name InfoGraph*. We employ a student-teacher framework similar to Mean-Teacher method Tarvainen & Valpola (2017). We maximize the mutual information between intermediate representations of the two models so that the student model learns from the teacher model. The student model is trained on the labeled data using a supervised objective function while the teacher model is trained on unlabeled data with InfoGraph. Using InfoGraph*, we achieve performance competitive with state-of-the-art methods on molecular property prediction.
33
+
34
+ We summarize our contributions as follows:
35
+
36
+ - We propose InfoGraph, an unsupervised graph representation learning method based on Deep InfoMax (DIM) Hjelm et al. (2018).
37
+ - We show that InfoGraph can be extended to semi-supervised prediction tasks on graphs.
38
+ - We empirically show that InfoGraph surpasses state-of-the-art performance on graph classification tasks with unsupervised learning and obtains performance comparable with state-of-art methods on molecular property prediction tasks using semi-supervised learning.
39
+
40
+ # 2 RELATED WORK
41
+
42
+ Representation learning for graphs has mainly dealt with supervised learning tasks. Recently, however, researchers have proposed algorithms that learn graph-level representations in an unsupervised manner Narayanan et al. (2017); Adhikari et al. (2018).
43
+
44
+ Concurrently to this work, information maximizing graph neural networks (IGNN) was introduced which uses mutual information maximization between edge states and transform parameters to achieve state-of-the-art predictions on a variety of supervised molecule property prediction tasks Chen et al. (2019b). In this work, our focus is on unsupervised and semi-supervised scenarios.
45
+
46
+ Graph Kernels. Constructing graph kernels is a common unsupervised task in learning graph representations. These kernels are typically evaluated on node classification tasks. In graph kernels, a graph $G$ is decomposed into (possibly different) $\{G_s\}$ sub-structures. The graph kernel $K(G_1, G_2)$ is defined based on the frequency of each sub-structure appearing in $G_1$ and $G_2$ respectively. Namely, $K(G_1, G_2) = \langle f_{G_{s_1}}, f_{G_{s_2}} \rangle$ , where $f_{G_s}$ is the vector containing frequencies of $\{G_s\}$ sub-structures, and $\langle , \rangle$ is an inner product in an appropriately normalized vector space. Much work has been devoted to deciding which sub-structures are more suitable than others (refer to appendix A.1). Instead of defining hand crafted similarity measures between substructures, InfoGraph adopts a more principled metric - mutual information.
47
+
48
+ Contrastive methods. An important approach for unsupervised representation learning is to train an encoder to be contrastive between representations that capture statistical dependencies of interest and those that do not. For example, a contrastive approach may employ a scoring function, training the encoder to increase the score on "real" input (a.k.a, positive examples) and decrease the score on "fake" input (a.k.a., negative samples). For more detailed discussion, refer to appendix A.2.
49
+
50
+ Deep Graph InfoMax (DGI) Velicković et al. (2018) also belongs to this category, which aims to train a node encoder that maximizes mutual information between node representations and the pooled global graph representation. Although we built upon a similar methodology, our aim is different than theirs as our goal is to obtain embeddings at the whole graph level for unsupervised and semi-supervised learning whereas DGI only evaluates node level embeddings. In order to differentiate our method with Deep Graph Infomax (Velicković et al. (2018)), we term our model InfoGraph.
51
+
52
+ Semi-supervised Learning. A comprehensive overview of semi-supervised learning (SSL) methods is out of the scope of this paper. We refer readers to Appendix B for a short overview or Zhu et al. (2003); Chapelle et al. (2006); Oliver et al. (2018) for more comprehensive discussions. Here, we discuss a state-of-the-art method applicable for regression tasks – Mean Teacher Tarvainen & Valpola (2017). Mean Teacher adds a loss term which encourages the distance between the original network's output and the teacher's output to be small. The teacher's predictions are made using an exponential moving average of parameters from previous training steps. Inspired by the “student-teacher” framework in Mean Teacher model, our semi-supervised model (InfoGraph*) deploys two separate encoders but instead of explicitly encouraging the output of the student model to be similar to the teacher model's output, we enable the student model to learn from the teacher model by maximizing mutual information between intermediate representations learned by two models.
53
+
54
+ # 3 METHODOLOGY
55
+
56
+ Most recent work on graphs focus on supervised learning tasks or learning node representations. However, many graph analytic tasks such as graph classification, regression, and clustering require representing entire graphs as fixed-length feature vectors. Though graph-level representations can be obtained through the node-level representations implicitly, explicitly extracting the graph can be more straightforward and optimal for graph-oriented tasks.
57
+
58
+ Another scenario that is important, yet attracts comparatively less attention in the graph related literature is semi-supervised learning. One of the biggest challenges in prediction tasks in biology Yan et al. (2017); Yang et al. (2014) or molecular machine learning Duvenaud et al. (2015); Gilmer et al. (2017); Jia & Liang (2017) is the extreme scarcity of labeled data. Therefore, semi-supervised learning, in which a large number of unlabeled samples are incorporated with a small number of labeled samples to enhance accuracy of models, will play a key role in these areas.
59
+
60
+ In this section, we first formulate an unsupervised whole graph representation learning problem and a semi-supervised prediction task on graphs. Then, we present our method to learn graph-level representations. Afterwards we present our proposed model for the semi-supervised learning scenario.
61
+
62
+ ![](images/0aba3f04883d2a8e477e41fd62b8f10f53138babbb5fcbfb73d9f6b7b5fc6736.jpg)
63
+ Figure 1: Illustration of InfoGraph. N.A. denotes neighborhood aggregation. An input graph is encoded into a feature map by graph convolutions and jumping concatenation. The discriminator takes a (global representation, patch representation) pair as input and decides whether they are from the same graph. InfoGraph uses a batch-wise fashion to generate all possible positive and negative samples. For example, consider the toy example with 2 input graphs in the batch and 7 nodes (or patch representations) in total. For the global representation of the blue graph, there will be 7 input pairs to the discriminator and same for the red graph. Thus, the discriminator will take 14 (global representation, patch representation) pairs as input in this case.
64
+
65
+ # 3.1 PROBLEM DEFINITION
66
+
67
+ Unsupervised Graph Representation Learning. Given a set of graphs $\mathbb{G} = \{G_1, G_2, \ldots\}$ and a positive integer $\delta$ (the expected embedding size), our goal is to learn a $\delta$ -dimensional distributed representation of every graph $G_i \in \mathbb{G}$ . We denote the number of nodes in $G_i$ as $|G_i|$ . We denote the matrix of representations of all graphs as $\Phi \in \mathbb{R}^{|G| \times \delta}$ .
68
+
69
+ Semi-supervised Graph Prediction Tasks. Given a set of labeled graphs $\mathbb{G}^L = \{G_1,\dots ,G_{|\mathbb{G}^L |}\}$ with corresponding output $\{o_1,\dots ,o_{|\mathbb{G}^L |}\}$ , and a set of unlabeled samples $\mathbb{G}^U = \{G_{|\mathbb{G}^L | + 1},\dots ,G_{|\mathbb{G}^L | + |\mathbb{G}^U |}\}$ , our goal is to learn a model that can make predictions for unseen graphs. Note that in most cases $|\mathbb{G}^U |\gg |\mathbb{G}^L |$
70
+
71
+ # 3.2 INFOGRAPH
72
+
73
+ We focus on graph neural networks (GNNs)—a flexible class of embedding architectures which generate node representations by repeated aggregation over local node neighborhoods. The representations of nodes are learned by aggregating the features of their neighborhood nodes, so we refer to these as patch representations. GNNs utilize a READOUT function to summarize all the obtained patch representations into a fixed length graph-level representation.
74
+
75
+ Formally, the $k$ -th layer of a GNN is
76
+
77
+ $$
78
+ \left. h _ {v} ^ {(k)} = \operatorname {C O M B I N E} ^ {(k)} \left(h _ {v} ^ {(k - 1)}, \operatorname {A G G R E G A T E} ^ {(k)} \left(\left\{\left(h _ {v} ^ {(k - 1)}, h _ {u} ^ {(k - 1)}, e _ {u v}\right): u \in \mathcal {N} (v) \right\}\right)\right), \right. \tag {1}
79
+ $$
80
+
81
+ where $h_v^{(k)}$ is the feature vector of node $v$ at the $k$ -th iteration/layer (or patch representation centered at node $i$ ), $e_{uv}$ is the feature vector of the edge between $u$ and $v$ , and $\mathcal{N}(v)$ are neighborhoods to node $v$ . $h_v^{(0)}$ is often initialized as node features. READOUT can be a simple permutation invariant function such as averaging or a more sophisticated graph-level pooling function Ying et al. (2018); Zhang et al. (2018).
82
+
83
+ We seek to obtain graph representations by maximizing the mutual information between graph-level and patch-level representations. By doing so, the graph representations can learn to encode aspects of the data that are shared across all substructures. Assume that we are given a set of training samples $\mathbf{G} := \{G_j \in \mathbb{G}\}_{j=1}^N$ with empirical probability distribution $\mathbb{P}$ on the input space. Let $\phi$ denote the set of parameters of a $K$ -layer graph neural network. After the first $k$ layers of the graph neural network, the input graph will be encoded into a set of patch representations $\{h_i^{(k)}\}_{i=1}^N$ . Next, we summarize feature vectors at all depths of the graph neural network into a single feature vector that captures patch information at different scales centered at every node. Inspired by Xu et al. (2018b), we use
84
+
85
+ concatenation. That is,
86
+
87
+ $$
88
+ h _ {\phi} ^ {i} = \operatorname {C O N C A T} \left(\left\{h _ {i} ^ {(k)} \right\} _ {k = 1} ^ {K}\right) \tag {2}
89
+ $$
90
+
91
+ $$
92
+ H _ {\phi} (G) = \operatorname {R E A D O U T} \left(\left\{h _ {\phi} ^ {i} \right\} _ {i = 1} ^ {N}\right) \tag {3}
93
+ $$
94
+
95
+ where $h_{\phi}^{i}$ is the summarized patch representation centered at node $i$ and $H_{\phi}(G)$ is the global representation after applying READOUT. Note that here we slightly abuse the notation of $h$ .
96
+
97
+ We define our mutual information (MI) estimator on global/local pairs, maximizing the estimated MI over the given dataset $\mathbf{G} := \{G_{j} \in \mathbb{G}\}_{j=1}^{N}$ :
98
+
99
+ $$
100
+ \hat {\phi}, \hat {\psi} = \underset {\phi , \psi} {\arg \max } \sum_ {G \in \mathbf {G}} \frac {1}{| G |} \sum_ {u \in G} I _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {u}; H _ {\phi} (G)\right). \tag {4}
101
+ $$
102
+
103
+ $I_{\phi, \psi}$ is the mutual information estimator modeled by discriminator $T_{\psi}$ and parameterized by a neural network with parameters $\psi$ . We use the Jensen-Shannon MI estimator (following the formulation of Nowozin et al. (2016)),
104
+
105
+ $$
106
+ I _ {\phi , \psi} (h _ {\phi} ^ {i} (G); H _ {\phi} (G)) :=
107
+ $$
108
+
109
+ $$
110
+ \mathbb {E} _ {\mathbb {P}} \left[ - \operatorname {s p} \left(- T _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {i} (x), H _ {\phi} (x)\right)\right) \right] - \mathbb {E} _ {\mathbb {P} \times \tilde {\mathbb {P}}} \left[ \operatorname {s p} \left(T _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {i} \left(x ^ {\prime}\right), H _ {\phi} (x)\right)\right) \right] \tag {5}
111
+ $$
112
+
113
+ where $x$ is an input sample, $x'$ (negative sample) is an input sampled from $\tilde{\mathbb{P}} = \mathbb{P}$ , a distribution identical to the empirical probability distribution of the input space, and $\mathrm{sp}(z) = \log(1 + e^z)$ is the softplus function. In practice, we generate negative samples using all possible combinations of global and local patch representations across all graph instances in a batch.
114
+
115
+ Since $H_{\phi}(G)$ is encouraged to have high MI with patches that contain information at all scales, this favours encoding aspects of the data that are shared across patches and aspects that are shared across scales. The algorithm is illustrated in Fig. 1.
116
+
117
+ It should be noted that our model is similar to Deep Graph Infomax (DGI) Velicković et al. (2018), a model proposed for learning unsupervised node embeddings. However, there are important design differences due to the different problems that we are focusing on. First, in DGI they use random sampling to obtain negative samples due to the fact that they are mainly focusing on learning node embeddings on a graph. However, contrastive methods require a large number of negative samples to be competitive Hjelm et al. (2018), thus the use of batch-wise generation of negative samples is crucial as we are trying to learn graph embeddings given many graph instances. Second, the choice of graph convolution encoders is also crucial. We use GIN Xu et al. (2018a) while DGI uses GCN Kipf & Welling (2016) as GIN provides a better inductive bias for graph level applications. Graph neural network designs should be considered carefully so that graph representations can be discriminative towards other graph instances. For example, we use sum over mean for READOUT and that can provide important information regarding the size of the graph.
118
+
119
+ # 3.3 SEMI-SUPERVISED INFOGRAPH
120
+
121
+ Based on the previous unsupervised model, a straightforward way to do semi-supervised property prediction on graphs is to combine the purely supervised loss and the unsupervised objective function which acts as a regularization term. In doing so, the model is trained to predict properties for the labeled dataset while keeping a rich discriminative intermediate representation learned from both the labeled and the unlabeled dataset. That is, we try to minimize the following objective function:
122
+
123
+ $$
124
+ L _ {\text {t o t a l}} = \sum_ {i = 1} ^ {| \mathbb {G} ^ {L} |} L _ {\text {s u p e r v i s e d}} \left(y _ {\phi} \left(G _ {i}\right), o _ {i}\right) + \lambda \sum_ {j = 1} ^ {| \mathbb {G} ^ {L} | + | \mathbb {G} ^ {U} |} L _ {\text {u n s u p e r v i s e d}} \left(h _ {\phi} \left(G _ {j}\right); H _ {\phi} \left(G _ {j}\right)\right) \tag {6}
125
+ $$
126
+
127
+ where $L_{\mathrm{supervised}}(y_{\phi}(G_i),o_i)$ is defined as the loss function of graph $G_{i}$ that measures the discrepancy between the classifier output $y_{\phi}(G_{i})$ and the true output $o_{i}$ . $L_{\mathrm{unsupervised}}(h_{\phi}(G_{j});H_{\phi}(G_{j}))$ is the
128
+
129
+ ![](images/1f69a019e67055c17bdd70568499286012a5602c80fc6d4e6453170f4a45b098.jpg)
130
+ Figure 2: Illustration of the semi-supervised version of InfoGraph (InfoGraph*). There are two separate encoders with the same architecture, one for the supervised task and the other trained using both labeled and unlabeled data with an unsupervised objective (eq. equation 4). We encourage the mutual information of the two representations learned by the two encoders to be high by deploying a discriminator that takes a pair of representation as input and determines whether they are from the same input graph.
131
+
132
+ unsupervised InfoGraph loss term as defined in eq. equation 4 that can be optimized using both labeled and unlabeled data. The hyper-parameter $\lambda$ controls the relative weight between the purely supervised and the unsupervised loss. The intuition behind this is that the model will benefit from learning a good representation from the large amount of unlabeled data while learning to predict the corresponding supervised label.
133
+
134
+ However, supervised tasks and unsupervised tasks may favor different information or a different semantic space. Simply combining the two loss functions using the same encoder may lead to "negative transfer" (Pan & Yang, 2009; Rosenstein et al., 2005). We propose a simple way to alleviate this problem: we deploy two encoder models: the encoder on the labelled data (supervised encoder) and the encoder on the unlabelled data (unsupervised encoder). For transferring the learned representations from the unsupervised encoder to the supervised encoder, we define a loss term that encourages the representations learned by the two encoders to have high mutual information, at all levels of representations (third term of Eq. 8). Formally, let $\varphi$ denote the set of parameters of another $K$ -layered graph neural network, identical to the one parameterized by $\phi$ , and let $\lambda$ be a tunable hyper-parameter, $H_{\phi}^{k}(G)$ , $H_{\varphi}^{k}(G)$ be global encoder representations of the graph $G$ at encoder layer $k$ , then total loss function can be defined as follows:
135
+
136
+ $$
137
+ \begin{array}{l} L _ {\text {t o t a l}} = \sum_ {i = 1} ^ {| \mathbb {G} ^ {L} |} L _ {\text {s u p e r v i s e d}} \left(y _ {\phi} \left(G _ {i}\right), o _ {i}\right) + \sum_ {j = 1} ^ {| \mathbb {G} ^ {L} | + | \mathbb {G} ^ {U} |} L _ {\text {u n s u p e r v i s e d}} \left(h _ {\varphi} \left(G _ {j}\right); H _ {\varphi} \left(G _ {j}\right)\right) (7) \\ - \lambda \sum_ {j = 1} ^ {\left| \mathbb {G} ^ {L} \right| + \left| \mathbb {G} ^ {U} \right|} \frac {1}{\left| G _ {j} \right|} \sum_ {k = 1} ^ {K} I \left(H _ {\phi} ^ {k} \left(G _ {j}\right); H _ {\varphi} ^ {k} \left(G _ {j}\right). \right. (8) \\ \end{array}
138
+ $$
139
+
140
+ Notice that this formulation can be seen as a special instance of the student-teacher framework. However, unlike the recent student-teacher methods for semi-supervised learning (Laine & Aila, 2016; Tarvainen & Valpola, 2017; Verma et al., 2019b), which enforce the predictions of the student model to be similar to the teacher model, we enforce the transfer of knowledge from the teacher model to the student model via mutual-information maximization at various levels of representations. In practice, to reduce the computation overhead introduced by the third term of Eq 8, instead of enforcing the mutual-information maximization over all the layers of the encoders, at each training
141
+
142
+ update, we enforce mutual-information maximization on a randomly chosen layer of the encoder (Verma et al., 2019a).
143
+
144
+ In our semi-supervised experiments, we refer to the naive method using the objective function given in eq. equation 6 as InfoGraph. We refer to the method that uses two separate encoders and employ the objective function given in eq. equation 8 as InfoGraph*. InfoGraph* is fully summarized in Figure 3.
145
+
146
+ # 4 EXPERIMENTS
147
+
148
+ We evaluate the effectiveness of the graph-level representation learned by InfoGraph on downstream graph classification tasks and on semi-supervised molecular property prediction tasks.
149
+
150
+ # 4.1 DATASETS
151
+
152
+ For graph classification, we conduct experiments on 6 well-known benchmark datasets: MUTAG, PTC, REDDIT-BINARY, REDDIT-MULTI-5K, IMDB-BINARY, and IMDB-MULTI (Yanardag & Vishwanathan (2015)). For semi-supervised learning tasks, we use the publicly available QM9 dataset Ramakrishnan et al. (2014). Additional details of the datasets can be found in Appendix B.
153
+
154
+ # 4.2 BASELINES
155
+
156
+ For graph classification, we used 6 state-of-the-art graph kernels for comparison: Random Walk (RW) Gartner et al. (2003), Shortest Path Kernel (SP) Borgwardt & Kriegel (2005), Graphlet Kernel (GK) Shervashidze et al. (2009), Weisfeiler-Lehman Sub-tree Kernel (WL) Shervashidze et al. (2011), Deep Graph Kernels (DGK) Yanardag & Vishwanathan (2015), and Multi-Scale Laplacian Kernel (MLG) Kondor & Pan (2016). Aside from graph kernels, we also compare with 3 unsupervised graph-level representation learning methods: node2vec Grover & Leskovec (2016), sub2vec Adhikari et al. (2018), and graph2vec Narayanan et al. (2017). Node2vec is a neural embedding framework that learns feature representations of individual nodes in graphs and we aggregate node embeddings to obtain graph embeddings.
157
+
158
+ For semi-supervised tasks, aside from comparing the results with the fully supervised results, we also compare our results with a state-of-the-art semi-supervised method: Mean Teachers Tarvainen & Valpola (2017).
159
+
160
+ # 4.3 EXPERIMENT CONFIGURATION
161
+
162
+ For graph classification tasks, we adopt the same procedure of previous works Niepert et al. (2016); Verma & Zhang (2017); Yanardag & Vishwanathan (2015); Zhang et al. (2018) to make a fair comparison and used 10-fold cross validation accuracy to report the classification performance. Experiments are repeated 5 times. We report results from previous papers with the same experimental setup if available. If results are not previously reported, we implement them and conduct a hyperparameter search according to the original paper. For node2vec Grover & Leskovec (2016), we took the result from Narayanan et al. (2017) but we did not run it on all datasets as the implementation details are not clear in the paper. For Deep Graph Kernels, we report the best result out of Deep WL Kernels, Deep GK Kernels, and Deep RW Kernels. For sub2vec, we report the best result out of its two variants: sub2vec-N and sub2vec-S. For all methods, the embedding dimension is set to 512 and parameters of downstream classifiers are independently tuned using cross validation on training folds of data. The best average classification accuracy is reported for each method. The classification accuracies are computed using LIBSVM Chang & Lin (2011), and the $C$ parameter was selected from $\{10^{-3}, 10^{-2}, \ldots, 10^{2}, 10^{3}\}$ .
163
+
164
+ The QM9 dataset has 130462 molecules in it. We adopt similar experimental settings as traditional semi-supervised methods Tarvainen & Valpola (2017); Laine & Aila (2016); Miyato et al. (2018). We randomly chose 5000 samples as labeled samples for training and another 10000 as validation samples, 10000 samples for testing, and use the rest as unlabeled training samples. Note that we use the exact same split when running the supervised model and the semi-supervised model. We use the validation set to do model selection and we report scores on the test set. All targets were normalized
165
+
166
+ <table><tr><td>Dataset</td><td>MUTAG</td><td>PTC-MR</td><td>RDT-B</td><td>RDT-M5K</td><td>IMDB-B</td><td>IMDB-M</td></tr><tr><td>(No. Graphs)</td><td>188</td><td>344</td><td>2000</td><td>4999</td><td>1000</td><td>1500</td></tr><tr><td>(No. classes)</td><td>2</td><td>2</td><td>2</td><td>5</td><td>2</td><td>3</td></tr><tr><td>(Avg. Graph Size)</td><td>17.93</td><td>14.29</td><td>429.63</td><td>508.52</td><td>19.77</td><td>13.00</td></tr></table>
167
+
168
+ Graph Kernels
169
+
170
+ <table><tr><td>RW</td><td>83.72 ± 1.50</td><td>57.85 ± 1.30</td><td>OMR</td><td>OMR</td><td>50.68 ± 0.26</td><td>34.65 ± 0.19</td></tr><tr><td>SP</td><td>85.22 ± 2.43</td><td>58.24 ± 2.44</td><td>64.11 ± 0.14</td><td>39.55 ± 0.22</td><td>55.60 ± 0.22</td><td>37.99 ± 0.30</td></tr><tr><td>GK</td><td>81.66 ± 2.11</td><td>57.26 ± 1.41</td><td>77.34 ± 0.18</td><td>41.01 ± 0.17</td><td>65.87 ± 0.98</td><td>43.89 ± 0.38</td></tr><tr><td>WL</td><td>80.72 ± 3.00</td><td>57.97 ± 0.49</td><td>68.82 ± 0.41</td><td>46.06 ± 0.21</td><td>72.30 ± 3.44</td><td>46.95 ± 0.46</td></tr><tr><td>DGK</td><td>87.44 ± 2.72</td><td>60.08 ± 2.55</td><td>78.04 ± 0.39</td><td>41.27 ± 0.18</td><td>66.96 ± 0.56</td><td>44.55 ± 0.52</td></tr><tr><td>MLG</td><td>87.94 ± 1.61</td><td>63.26 ± 1.48</td><td>&gt;1 Day</td><td>&gt;1 Day</td><td>66.55 ± 0.25</td><td>41.17 ± 0.03</td></tr></table>
171
+
172
+ Other Unsupervised Methods
173
+
174
+ <table><tr><td>node2vec</td><td>72.63 ± 10.20</td><td>58.58 ± 8.00</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>sub2vec</td><td>61.05 ± 15.80</td><td>59.99 ± 6.38</td><td>71.48 ± 0.41</td><td>36.68 ± 0.42</td><td>55.26 ± 1.54</td><td>36.67 ± 0.83</td></tr><tr><td>graph2vec</td><td>83.15 ± 9.25</td><td>60.17 ± 6.86</td><td>75.78 ± 1.03</td><td>47.86 ± 0.26</td><td>71.1 ± 0.54</td><td>50.44 ± 0.87</td></tr><tr><td>InfoGraph</td><td>89.01 ± 1.13</td><td>61.65 ± 1.43</td><td>82.50 ± 1.42</td><td>53.46 ± 1.03</td><td>73.03 ± 0.87</td><td>49.69 ± 0.53</td></tr></table>
175
+
176
+ Table 1: Classification accuracy on 6 datasets. The result in **bold** indicates the best reported classification accuracy. The top half of the table compares results with various graph kernel approaches while bottom half compares results with other state-of-the-art unsupervised graph representation learning methods. ‘>1 day’ represents that the computation exceeds 24 hours. ‘OMR’ is out of memory error.
177
+
178
+ <table><tr><td>Target</td><td>Mu (0)</td><td>Alpha (1)</td><td>HOMO (2)</td><td>LUMO (3)</td><td>Gap (4)</td><td>R2 (5)</td><td>ZPVE(6)</td><td>U0 (7)</td><td>U (8)</td><td>H (9)</td><td>G(10)</td><td>Cv (11)</td></tr><tr><td>MAE</td><td>0.3201</td><td>0.5792</td><td>0.0060</td><td>0.0062</td><td>0.0091</td><td>10.0469</td><td>0.0007</td><td>0.3204</td><td>0.2934</td><td>0.2722</td><td>0.2948</td><td>0.2368</td></tr></table>
179
+
180
+ <table><tr><td>Semi-Supervised</td><td colspan="12">Error Ratio</td></tr><tr><td>Mean-Teachers</td><td>1.09</td><td>1.00</td><td>0.99</td><td>1.00</td><td>0.97</td><td>0.52</td><td>0.77</td><td>1.16</td><td>0.93</td><td>0.79</td><td>0.86</td><td>0.86</td></tr><tr><td>InfoGraph</td><td>1.02</td><td>0.97</td><td>1.02</td><td>0.99</td><td>1.01</td><td>0.71</td><td>0.96</td><td>0.85</td><td>0.93</td><td>0.93</td><td>0.99</td><td>1.00</td></tr><tr><td>InfoGraph*</td><td>0.99</td><td>0.94</td><td>0.99</td><td>0.99</td><td>0.98</td><td>0.49</td><td>0.52</td><td>0.44</td><td>0.58</td><td>0.57</td><td>0.54</td><td>0.83</td></tr></table>
181
+
182
+ Table 2: Results of semi-supervised experiments on QM9 dataset. The result in **bold** indicates the best performance. The top half of the table shows the mean absolute error (MAE) of the supervised model. The bottom half shows the error ratio (with respect to supervised result) of the semi-supervised models using the same underlying model. Lower scores are better and values less than 1.0 indicate better performance than the supervised baseline.
183
+
184
+ to have mean 0 and variance 1. We minimize the mean squared error between the model output and the target, although we evaluate mean absolute error.
185
+
186
+ # 4.4 MODEL CONFIGURATION
187
+
188
+ For the unsupervised experiments, we use the Graph Isomorphism Network (GIN) Xu et al. (2018a). For the semi-supervised experiments, we adopt the same model as in Gilmer et al. (2017) (enn-s2s). As recommended in Oliver et al. (2018), we use the exact same underlying model architecture when comparing semi-supervised learning approaches as our goal is not to produce state-of-the-art results, but instead to provide a rigorous comparative analysis in a common framework. In both scenarios, models were trained using SGD with the Adam optimizer. We use Pytorch Paszke et al. (2017) and the Pytorch Geometric Fey & Lenssen (2019) libraries for all our experiments. For detailed hyper-parameter settings and architecture detail of the discriminator, see Appendix C.
189
+
190
+ # 5 RESULTS
191
+
192
+ The results of evaluating unsupervised graph level representations using downstream graph classification tasks are presented in Table 1. We show results from six methods including three state-of-the-art graph kernel methods: WL Shervashidze et al. (2011), DGK Yanardag & Vishwanathan (2015), and MLG Kondor & Pan (2016). While these kernel methods perform well on individual datasets, none of them are competitive across all of the datasets. Additionally, MLG suffers from a long run time and take more than 24 hours to run on the two larger benchmark datasets. We find that InfoGraph
193
+
194
+ outperforms all of these baselines on 4 out of 6 of the datasets. In the other 2 datasets, InfoGraph still has very competitive performance.
195
+
196
+ The results of the semi-supervised learning experiments on the molecular property prediction task are presented in Table 2. We observe that by simply combining the supervised objective with the unsupervised infomax objective (InfoGraph) obtains better performance compared to the purely supervised models on 7 out of 12 of the targets. However, in 1 out of 12 targets it does not obtain better performance and in 4 out of 12 targets, it results in poorer performance. This "negative transfer" effect may be caused by the fact that the supervised objective and the unsupervised objective favor different information or different latent semantic space. This effect is alleviated with InfoGraph*, our modified version of InfoGraph for semi-supervised learning. InfoGraph* improves over the supervised model in all the 12 targets. InfoGraph* obtains the best result on 11 targets while the Mean Teacher method obtains the best results on 2 targets (with one overlap). However, the Mean Teacher model yields worse performance on 2 targets when compared to the supervised result.
197
+
198
+ # 6 CONCLUSION AND FUTURE WORK
199
+
200
+ In this paper, we propose InfoGraph to learn unsupervised graph-level representations and InfoGraph* for semi-supervised learning. We conduct experiments on graph classification and molecular property prediction tasks to evaluate these two methods. Experimental results show that InfoGraph and InfoGraph* are both very competitive with state-of-the-art methods. There are many research works on semi-supervised learning on image data, but few of them focus on semi-supervised learning for graph structured data. In the future, we aim to explore semi-supervised frameworks designed specifically for graphs.
201
+
202
+ # ACKNOWLEDGMENTS
203
+
204
+ We would like to thank Shengchao Liu and Weihua Hu for the extremely helpful discussions and comments.
205
+
206
+ # REFERENCES
207
+
208
+ Bijaya Adhikari, Yao Zhang, Naren Ramakrishnan, and B Aditya Prakash. Sub2vec: Feature learning for subgraphs. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 170–182. Springer, 2018.
209
+ David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993-1022, 2003.
210
+ Karsten M Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In Fifth IEEE international conference on data mining (ICDM'05), pp. 8-pp. IEEE, 2005.
211
+ Chih-Chung Chang and Chih-Jen Lin. Libsvm: A library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3):27, 2011.
212
+ Olivier Chapelle, Bernhard Scholkopf, Alexander Zien, et al. Semi-supervised learning, vol. 2. Cambridge: MIT Press. Cortes, C., & Mohri, M.(2014). Domain adaptation and sample bias correction theory and algorithm for regression. Theoretical Computer Science, 519:103126, 2006.
213
+ Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong. Graph networks as a universal machine learning framework for molecules and crystals. Chemistry of Materials, 31(9):3564-3572, 2019a.
214
+ Pengfei Chen, Weiwen Liu, Chang-Yu Hsieh, Guangyong Chen, and Shengyu Zhang. Utilizing edge features in graph neural networks via variational information maximization. arXiv preprint arXiv:1906.05488, 2019b.
215
+ Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160-167. ACM, 2008.
216
+
217
+ Gerben KD de Vries. A fast approximation of the weisfeiler-lehman graph kernel for rdf data. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 606-621. Springer, 2013.
218
+ David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224-2232, 2015.
219
+ Aasa Feragen, Niklas Kasenburg, Jens Petersen, Marleen de Bruijne, and Karsten Borgwardt. Scalable kernels for graphs with continuous attributes. In Advances in Neural Information Processing Systems, pp. 216-224, 2013.
220
+ Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
221
+ Sheng Gao, Ludovic Denoyer, and Patrick Gallinari. Temporal link prediction by integrating content and structure information. In Proceedings of the 20th ACM international conference on Information and knowledge management, pp. 1169-1174. ACM, 2011.
222
+ Thomas Gartner, Peter Flach, and Stefan Wrobel. On graph kernels: Hardness results and efficient alternatives. In Learning theory and kernel machines, pp. 129-143. Springer, 2003.
223
+ Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263-1272. JMLR.org, 2017.
224
+ Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Advances in neural information processing systems, pp. 529-536, 2005.
225
+ Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855-864. ACM, 2016.
226
+ R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
227
+ Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Pre-training graph neural networks. arXiv preprint arXiv:1905.12265, 2019.
228
+ Sergey Ivanov and Evgeny Burnaev. Anonymous walk embeddings. arXiv preprint arXiv:1805.11921, 2018.
229
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328, 2017.
230
+ Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. arXiv preprint arXiv:1802.04364, 2018.
231
+ Hisashi Kashima, Koji Tsuda, and Akihiro Inokuchi. Marginalized kernels between labeled graphs. In Proceedings of the 20th international conference on machine learning (ICML-03), pp. 321-328, 2003.
232
+ Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018.
233
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
234
+ Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. arXiv preprint arXiv:1802.04687, 2018.
235
+ Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
236
+
237
+ Risi Kondor and Horace Pan. The multiscale laplacian graph kernel. In Advances in Neural Information Processing Systems, pp. 2990-2998, 2016.
238
+ Nils M Kriege, Pierre-Louis Giscard, and Richard Wilson. On valid optimal assignment kernels and applications to graph classification. In Advances in Neural Information Processing Systems, pp. 1623-1631, 2016.
239
+ Nevan J Krogan, Gerard Cagney, Haiyuan Yu, Gouqing Zhong, Xinghua Guo, Alexandr Ignatchenko, Joyce Li, Shuye Pu, Nira Datta, Aaron P Tikuisis, et al. Global landscape of protein complexes in the yeast saccharomyces cerevisiae. Nature, 440(7084):637, 2006.
240
+ Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
241
+ Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In International conference on machine learning, pp. 1188-1196, 2014.
242
+ Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on Challenges in Representation Learning, ICML, volume 3, pp. 2, 2013.
243
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a.
244
+ 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, 2013b.
245
+ Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979-1993, 2018.
246
+ Andriy Mnih and Koray Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estimation. In Advances in neural information processing systems, pp. 2265-2273, 2013.
247
+ Annamalai Narayanan, Mahinthan Chandramohan, Rajasekar Venkatesan, Lihui Chen andvYang Liu, and Shantanu Jaiswal. graph2vec: Learning distributed representations of graphs. CoRR, abs/1707.05005, 2017. URL http://arxiv.org/abs/1707.05005.
248
+ Marion Neumann, Novi Patricia, Roman Garnett, and Kristian Kersting. Efficient graph kernels by randomization. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 378-393. Springer, 2012.
249
+ Mark EJ Newman and Michelle Girvan. Finding and evaluating community structure in networks. Physical review E, 69(2):026113, 2004.
250
+ Hai Nguyen, Shin-ichi Maeda, and Kenta Oono. Semi-supervised learning of hierarchical representations of molecules using neural message passing. arXiv preprint arXiv:1711.10168, 2017.
251
+ Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In International conference on machine learning, pp. 2014-2023, 2016.
252
+ Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in neural information processing systems, pp. 271-279, 2016.
253
+ Avital Oliver, Augustus Odena, Colin A Raffel, Ekin Dogus Cubuk, and Ian Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. In Advances in Neural Information Processing Systems, pp. 3235-3246, 2018.
254
+ Francesco Orsini, Paolo Frasconi, and Luc De Raedt. Graph invariant kernels. In Twenty-Fourth International Joint Conference on Artificial Intelligence, 2015.
255
+ Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345-1359, 2009.
256
+
257
+ Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
258
+ Georgios A Pavlopoulos, Maria Secrier, Charalampos N Moschopoulos, Theodoros G Soldatos, Sophia Kossida, Jan Aerts, Reinhard Schneider, and Pantelis G Bagos. Using graph theory to analyze biological networks. BioData mining, 4(1):10, 2011.
259
+ Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701-710. ACM, 2014.
260
+ Nataša Pržulj. Biological network comparison using graphlet degree distribution. Bioinformatics, 23 (2):e177-e183, 2007.
261
+ Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1:140022, 2014.
262
+ Michael T Rosenstein, Zvika Marx, Leslie Pack Kaelbling, and Thomas G Dietterich. To transfer or not to transfer. In NIPS 2005 workshop on transfer learning, volume 898, pp. 3, 2005.
263
+ Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Mutual exclusivity loss for semi-supervised deep learning. In 2016 IEEE International Conference on Image Processing (ICIP), pp. 1908-1912. IEEE, 2016.
264
+ Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics, pp. 488-495, 2009.
265
+ Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep): 2539-2561, 2011.
266
+ Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th international conference on world wide web, pp. 1067-1077. International World Wide Web Conferences Steering Committee, 2015.
267
+ Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in neural information processing systems, pp. 1195–1204, 2017.
268
+ Petar Velicković, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. arXiv preprint arXiv:1809.10341, 2018.
269
+ Saurabh Verma and Zhi-Li Zhang. Hunt for the unique, stable, sparse and fast feature learning on graphs. In Advances in Neural Information Processing Systems, pp. 88-98, 2017.
270
+ Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitlagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 6438-6447, Long Beach, California, USA, 09-15 Jun 2019a. PMLR. URL http://proceedings.mlr.press/v97/verma19a.html.
271
+ Vikas Verma, Alex Lamb, Kannala Juho, Yoshua Bengio, and David Lopez-Paz. Interpolation consistency training for semi-supervised learning. In Sarit Kraus (ed.), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019. ijcai.org, 2019b. doi: 10.24963/ijcai.2019. URL https://doi.org/10.24963/ijcai.2019.
272
+ Fei Wang, Tao Li, Xin Wang, Shenghuo Zhu, and Chris Ding. Community discovery using nonnegative matrix factorization. Data Mining and Knowledge Discovery, 22(3):493-521, 2011.
273
+
274
+ Boris Weisfeiler and Andrei A Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12-16, 1968.
275
+ Tian Xie and Jeffrey C Grossman. Crystal graph convolutional neural networks for an accurate and interpretable prediction of material properties. Physical review letters, 120(14):145301, 2018.
276
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018a.
277
+ Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. arXiv preprint arXiv:1806.03536, 2018b.
278
+ Yan Yan, Shangzhao Qiu, Zhuxuan Jin, Sihong Gong, Yun Bai, Jianwei Lu, and Tianwei Yu. Detecting subnetwork-level dynamic correlations. Bioinformatics, 33(2):256-265, 2017.
279
+ Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1365-1374. ACM, 2015.
280
+ Rendong Yang, Yun Bai, Zhaohui Qin, and Tianwei Yu. Egonet: identification of human disease ego-network modules. BMC genomics, 15(1):314, 2014.
281
+ Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems, pp. 4800-4810, 2018.
282
+ Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
283
+ Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pp. 912-919, 2003.
284
+
285
+ # A RELATED WORK
286
+
287
+ # A.1 GRAPH KERNELS
288
+
289
+ Popular graph kernels are graphlets Pržulj (2007); Shervashidze et al. (2009), random walk and shortest path kernels Kashima et al. (2003); Borgwardt & Kriegel (2005), and the Weisfeiler-Lehman subtree kernel Shervashidze et al. (2011). Furthermore, deep graph kernels Yanardag & Vishwanathan (2015), graph invariant kernels Orsini et al. (2015), optimal assignment graph kernels Kriege et al. (2016) and multiscale Laplacian graph kernels Kondor & Pan (2016) have been proposed with the goal to redefine kernel functions to appropriately capture sub-structural similarity at different levels. Another line of research in this area focuses on efficiently computing these kernels either through exploiting certain structural dependencies, or via approximations/randomization Feragen et al. (2013); de Vries (2013); Neumann et al. (2012).
290
+
291
+ # A.2 CONTRASTIVE METHODS
292
+
293
+ Contrastive methods are central many popular word-embedding methods Collobert & Weston (2008); Mnih & Kavukcuoglu (2013); Mikolov et al. (2013b). Word2vec Mikolov et al. (2013a) is an unsupervised algorithm which obtains word representations by using the representations to predict context words (the words that surround it). Doc2vec Le & Mikolov (2014) is an extension of the continuous Skip-gram model that predicts representations of words from that of a document containing them. Researchers extended many of these unsupervised language models to learn representations of graph-structured input Adhikari et al. (2018); Narayanan et al. (2017). For example, graph2vec Narayanan et al. (2017) extends Doc2vec to arbitrary graphs. Intuitively, for graph2vec a graph and the rooted subgraphs in it correspond to a document and words in a paragraph vector, respectively. One of the technical contributions of the paper is using the Weisfeiler-Lehman relabelling algorithm. Weisfeiler & Lehman (1968); Shervashidze et al. (2011) to enumerate all rooted subgraphs up to a specified depth. AWE (Anonymous Walk Embeddings) Ivanov & Burnaev (2018) is another method based on CBOW framework. instead of using rooted subgraphs as words like graph2vec, AWE considers anonymous walk embeddings for the same source node as co-occurring words. InfoGraph has the two advantages when compared with these methods. First, InfoGraph learns representations directly from data instead of utilizing hand-crafted procedures (i.e. Weisfeiler-Lehman relabelling algorithm in graph2vec and random walk in AWE). Second, InfoGraph has a clear objective that can be easily combined with other objectives. For example, InfoGraph*, the semi-supervised method that we proposed.
294
+
295
+ # B SEMI-SUPERVISED LEARNING
296
+
297
+ Here we discuss the most common class of SSL methods which involve adding an additional loss term to the training of a neural network as they are pragmatic and are currently the state-of-the-art on image classification datasets.
298
+
299
+ Entropy Minimization (EntMin): EntMin Grandvalet & Bengio (2005) adds a loss term applied that encourages the network to make "confident" (low-entropy) predictions for all unlabeled examples, regardless of their class.
300
+
301
+ Pseudo-Labeling: Pseudo-labeling Lee (2013) proceeds by producing "pseudo-labels" for unlabeled input data points using the prediction function itself over the course of training. Pseudo-labels which have a corresponding class probability that is larger than a predefined threshold are used as targets for a standard supervised loss function.
302
+
303
+ II-Model: Neural networks can produce different outputs for the same input while common regularization techniques such as data augmentation, dropout, and adding noise are applied. II-Model Laine & Aila (2016); Sajjadi et al. (2016) adds a loss term which encourages the distance between a network's output for different passes of unlabeled data through the network to be small.
304
+
305
+ Virtual Adversarial Training: Instead of relying on the built-in stochasticity as in II-Model, Virtual Adversarial Training (VAT) Miyato et al. (2018) directly approximates a tiny perturbation to add to the input which would most significantly affect the output of the prediction function. This perturbation can be approximated with an extra back-propagation for each optimization step.
306
+
307
+ Mean Teacher: A difficulty with the $\Pi$ -model approach is that it relies on a potentially unstable "target" prediction, namely the second stochastic network prediction which can rapidly change over the course of training. As a result, Tarvainen & Valpola (2017) proposed to obtain a more stable target output for unlabeled data by setting the target to predictions made using an exponential moving average of parameters from previous training steps.
308
+
309
+ # C DATASETS
310
+
311
+ # C.1 GRAPH CLASSIFICATION DATASETS
312
+
313
+ MUTAG contains 188 mutagenic aromatic and heteroaromatic nitro compounds with 7 different discrete labels. PTC is a dataset of 344 different chemical compounds that have been tested for carcinogenicity in male and female rats. This dataset has 19 discrete labels. IMDB-BINARY and IMDB-MULTI are movie collaboration datasets. Each graph corresponds to an ego-network for each actor/actress, where nodes correspond to actors/actresses and an edge is drawn between two actors/actresses if they appear in the same movie. Each graph is derived from a pre-specified genre of movies, and the task is to classify the genre graph it is derived from. REDDIT-BINARY and REDDIT-MULTI5K are balanced datasets where each graph corresponds to an online discussion thread and nodes correspond to users. An edge was drawn between two nodes if at least one of them responded to another's comment. The task is to classify each graph to the community or subreddit that it belongs to.
314
+
315
+ # C.2 QM9
316
+
317
+ All molecules in the dataset consist of Hydrogen (H), Carbon (C), Oxygen (O), Nitrogen (N), and Flourine (F) atoms and contain up to 9 non-Hydrogen atoms. In all, this results in about 134,000 drug-like organic molecules that span a wide range of chemical compositions and properties. A total of 12 interesting and fundamental chemical properties are pre-computed for each molecule. For a detailed description of the properties in the QM9 dataset, see section 10.2 of Gilmer et al. (2017).
318
+
319
+ # D MODEL CONFIGURATION
320
+
321
+ For the unsupervised experiments, we use the Graph Isomorphism Network (GIN) Xu et al. (2018a). GNN layers are chosen from $\{4,8,12\}$ . Initial learning rate is chosen from the set $\{10^{-2},10^{-3},10^{-4}\}$ . The number of epochs are chosen from $\{10,20,100\}$ . The batch size is set to 128.
322
+
323
+ For the semi-supervised experiments, the number of set2set computations is set to 3. Model were trained with an initial learning rate 0.001 for 500 epochs with a batch size 20. For the supervised case, the weight decay is chosen from $\{0,10^{-3},10^{-4}\}$ . For InfoGraph and InfoGraph*, $\lambda$ is chosen from $\{10^{-3},10^{-4},10^{-5}\}$ .
324
+
325
+ The discriminator scores global-patch representation pairs by passing two representations to different non-linear transformations and then takes the dot product of the two transformed representations. Both non-linear transformations are parameterized by 3-layered feed-forward neural networks with jumping connections. Following each linear layer is a ReLU activation function.
326
+
327
+ # E CONVERGENCE PLOT
328
+
329
+ To prove that the objective Eq.8 with multiple loss terms can be optimized, we provide a convergence plot of InfoGraph*. We can see that the three loss terms all converge after around 150 epochs of training.
330
+
331
+ ![](images/d428b02d5ffd0a5f25308af58116b60e7bca831cb078d6569cf240043efd0476.jpg)
332
+ InfoGraph* Convergence Plot
333
+
334
+ ![](images/9ef7936653f7c65b36c06cc8f66de1cf54da65ea2e53e8b7111a9b5a4829b808.jpg)
335
+
336
+ ![](images/97a94be81d48af93402c79f864510e2c6a2c80cfa5ddcd0989f06a06a3a838fe.jpg)
337
+ Figure 3: Convergence plot of InfoGraph* on QM9 target 7.
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33ef47982664a351d998b4f5bf4d3529b6a7a214af7fd20bb9e41179b17d31d2
3
+ size 304291
infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a417d02ed259abe20a3078f34aeaed12fad638040958d4352c9c7c24519d09c0
3
+ size 427770
intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d869ca243aa6353a1fc54c5f3be33c9000039806961514a4b45097e8a2ba3fe
3
+ size 145295
intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a74bf20d7e382ad57272449a3c7390e6f76090fb9eaa882be3b9baae78558ff
3
+ size 172604
intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd70d13d258b7bc0e539503d4ee293b12ffa1cbb11767f7769a7452fb2280577
3
+ size 626717
intensityfreelearningoftemporalpointprocesses/full.md ADDED
@@ -0,0 +1,632 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INTENSITY-FREE LEARNING OF TEMPORAL POINT PROCESSES
2
+
3
+ Oleksandr Shchur\* Marin Bilos\* Stephan Gunnemann
4
+
5
+ Technical University of Munich, Germany
6
+
7
+ {shchur,bilos,guennemann}@in.tum.de
8
+
9
+ # ABSTRACT
10
+
11
+ Temporal point processes are the dominant paradigm for modeling sequences of events happening at irregular intervals. The standard way of learning in such models is by estimating the conditional intensity function. However, parameterizing the intensity function usually incurs several trade-offs. We show how to overcome the limitations of intensity-based approaches by directly modeling the conditional distribution of inter-event times. We draw on the literature on normalizing flows to design models that are flexible and efficient. We additionally propose a simple mixture model that matches the flexibility of flow-based models, but also permits sampling and computing moments in closed form. The proposed models achieve state-of-the-art performance in standard prediction tasks and are suitable for novel applications, such as learning sequence embeddings and imputing missing data.
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Visits to hospitals, purchases in e-commerce systems, financial transactions, posts in social media — various forms of human activity can be represented as discrete events happening at irregular intervals. The framework of temporal point processes is a natural choice for modeling such data. By combining temporal point process models with deep learning, we can design algorithms able to learn complex behavior from real-world data.
16
+
17
+ Designing such models, however, usually involves trade-offs along the following dimensions: flexibility (can the model approximate any distribution?), efficiency (can the likelihood function be evaluated in closed form?), and ease of use (is sampling and computing summary statistics easy?). Existing methods (Du et al., 2016; Mei & Eisner, 2017; Omi et al., 2019) that are defined in terms of the conditional intensity function typically fall short in at least one of these categories.
18
+
19
+ Instead of modeling the intensity function, we suggest treating the problem of learning in temporal point processes as an instance of conditional density estimation. By using tools from neural density estimation (Bishop, 1994; Rezende & Mohamed, 2015), we can develop methods that have all of the above properties. To summarize, our contributions are the following:
20
+
21
+ - We connect the fields of temporal point processes and neural density estimation. We show how normalizing flows can be used to define flexible and theoretically sound models for learning in temporal point processes.
22
+ - We propose a simple mixture model that performs on par with the state-of-the-art methods. Thanks to its simplicity, the model permits closed-form sampling and moment computation.
23
+ - We show through a wide range of experiments how the proposed models can be used for prediction, conditional generation, sequence embedding and training with missing data.
24
+
25
+ # 2 BACKGROUND
26
+
27
+ Definition. A temporal point process (TPP) is a random process whose realizations consist of a sequence of strictly increasing arrival times $\mathcal{T} = \{t_1,\dots,t_N\}$ . A TPP can equivalently be represented
28
+
29
+ <table><tr><td></td><td>Exponential intensity</td><td>Neural Hawkes</td><td>Fully NN</td><td>Normalizing Flows</td><td>Mixture Distribution</td></tr><tr><td>Closed-form likelihood</td><td>✓</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Flexible</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Closed-form E[τ]</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td></tr><tr><td>Closed-form sampling</td><td>✓</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td></tr></table>
30
+
31
+ Table 1: Comparison of neural temporal point process models that encode history with an RNN.
32
+
33
+ as a sequence of strictly positive inter-event times $\tau_{i} = t_{i} - t_{i-1} \in \mathbb{R}_{+}$ . Representations in terms of $t_{i}$ and $\tau_{i}$ are isomorphic — we will use them interchangeably throughout the paper. The traditional way of specifying the dependency of the next arrival time $t$ on the history $\mathcal{H}_t = \{t_j \in \mathcal{T} : t_j < t\}$ is using the conditional intensity function $\lambda^*(t) \coloneqq \lambda(t|\mathcal{H}_t)$ . Here, the * symbol reminds us of dependence on $\mathcal{H}_t$ . Given the conditional intensity function, we can obtain the conditional probability density function (PDF) of the time $\tau_{i}$ until the next event by integration (Rasmussen, 2011) as $p^*(\tau_i) \coloneqq p(\tau_i|\mathcal{H}_{t_i}) = \lambda^*(t_{i-1} + \tau_i)\exp\left(-\int_0^{\tau_i}\lambda^*(t_{i-1} + s)ds\right)$ .
34
+
35
+ Learning temporal point processes. Conditional intensity functions provide a convenient way to specify point processes with a simple predefined behavior, such as self-exciting (Hawkes, 1971) and self-correcting (Isham & Westcott, 1979) processes. Intensity parametrization is also commonly used when learning a model from the data: Given a parametric intensity function $\lambda_{\theta}^{*}(t)$ and a sequence of observations $\mathcal{T}$ , the parameters $\pmb{\theta}$ can be estimated by maximizing the log-likelihood: $\pmb{\theta}^{*} = \arg \max_{\pmb{\theta}}\sum_{i}\log p_{\pmb{\theta}}^{*}(\tau_{i}) = \arg \max_{\pmb{\theta}}\left[\sum_{i}\log \lambda_{\pmb{\theta}}^{*}(t_{i}) - \int_{0}^{t_{N}}\lambda_{\pmb{\theta}}^{*}(s)ds\right]$ .
36
+
37
+ The main challenge of such intensity-based approaches lies in choosing a good parametric form for $\lambda_{\theta}^{*}(t)$ . This usually involves the following trade-off: For a "simple" intensity function (Du et al., 2016; Huang et al., 2019), the integral $\Lambda^{*}(\tau_{i}) := \int_{0}^{\tau_{i}} \lambda^{*}(t_{i-1} + s) ds$ has a closed form, which makes the log-likelihood easy to compute. However, such models usually have limited expressiveness. A more sophisticated intensity function (Mei & Eisner, 2017) can better capture the dynamics of the system, but computing log-likelihood will require approximating the integral using Monte Carlo.
38
+
39
+ Recently, Omi et al. (2019) proposed fully neural network intensity function (FullyNN) — a flexible, yet computationally tractable model for TPPs. The key idea of their approach is to model the cumulative conditional intensity function $\Lambda^{*}(\tau_{i})$ using a neural network, which allows to efficiently compute the log-likelihood. Still, in its current state, the model has downsides: it doesn't define a valid PDF, sampling is expensive, and the expectation cannot be computed in closed form<sup>1</sup>.
40
+
41
+ This work. We show that the drawbacks of the existing approaches can be remedied by looking at the problem of learning in TPPs from a different angle. Instead of modeling the conditional intensity $\lambda^{*}(t)$ , we suggest to directly learn the conditional distribution $p^{*}(\tau)$ . Modeling distributions with neural networks is a well-researched topic, that, surprisingly, is not usually discussed in the context of TPPs. By adopting this alternative point of view, we are able to develop new theoretically sound and effective methods (Section 3), as well as better understand the existing approaches (Section 4).
42
+
43
+ # 3 MODELS
44
+
45
+ We develop several approaches for modeling the distribution of inter-event times. First, we assume for simplicity that each inter-event time $\tau_{i}$ is conditionally independent of the history, given the model parameters (that is, $p^{*}(\tau_{i}) = p(\tau_{i})$ ). In Section 3.1, we show how state-of-the-art neural density estimation methods based on normalizing flows can be used to model $p(\tau_{i})$ . Then in Section 3.2, we propose a simple mixture model that can match the performance of the more sophisticated flow-based models, while also addressing some of their shortcomings. Finally, we discuss how to make $p(\tau_{i})$ depend on the history $\mathcal{H}_{t_i}$ in Section 3.3.
46
+
47
+ # 3.1 MODELING $p(\tau)$ WITH NORMALIZING FLOWS
48
+
49
+ The core idea of normalizing flows (Tabak & Turner, 2013; Rezende & Mohamed, 2015) is to define a flexible probability distribution by transforming a simple one. Assume that $z$ has a PDF $q(z)$ . Let $x = g(z)$ for some differentiable invertible transformation $g: \mathcal{Z} \to \mathcal{X}$ (where $\mathcal{Z}, \mathcal{X} \subseteq \mathbb{R}^2$ ). We can obtain the PDF $p(x)$ of $x$ using the change of variables formula as $p(x) = q(g^{-1}(x)) \left| \frac{\partial}{\partial x} g^{-1}(x) \right|$ . By stacking multiple transformations $g_1, \ldots, g_M$ , we obtain an expressive probability distribution $p(x)$ . To draw a sample $x \sim p(x)$ , we need to draw $z \sim q(z)$ and compute the forward transformation $x = (g_M \circ \dots \circ g_1)(z)$ . To get the density of an arbitrary point $x$ , it is necessary to evaluate the inverse transformation $z = (g_1^{-1} \circ \dots \circ g_M^{-1})(x)$ and compute $q(z)$ . Modern normalizing flows architectures parametrize the transformations using extremely flexible functions $f_\theta$ , such as polynomials (Jaini et al., 2019) or neural networks (Krueger et al., 2018). The flexibility of these functions comes at a cost — while the inverse $f_\theta^{-1}$ exists, it typically doesn't have a closed form. That is, if we use such a function to define one direction of the transformation in a flow model, the other direction can only be approximated numerically using iterative root-finding methods (Ho et al., 2019). In this work, we don't consider invertible normalizing flows based on dimension splitting, such as RealNVP (Dinh et al., 2017), since they are not applicable to 1D data.
50
+
51
+ In the context of TPPs, our goal is to model the distribution $p(\tau)$ of inter-event times. In order to be able to learn the parameters of $p(\tau)$ using maximum likelihood, we need to be able to evaluate the density at any point $\tau$ . For this we need to define the inverse transformation $g^{-1} \coloneqq (g_1^{-1} \circ \dots \circ g_M^{-1})$ . First, we set $z_{M} = g_{M}^{-1}(\tau) = \log \tau$ to convert a positive $\tau \in \mathbb{R}_{+}$ into $z_{M} \in \mathbb{R}$ . Then, we stack multiple layers of parametric functions $f_{\theta}: \mathbb{R} \to \mathbb{R}$ that can approximate any transformation. We consider two choices for $f_{\theta}$ : deep sigmoidal flow (DSF) from Krueger et al. (2018) and sum-of-squares (SOS) polynomial flow from Jaini et al. (2019)
52
+
53
+ $$
54
+ f ^ {D S F} (x) = \sigma^ {- 1} \left(\sum_ {k = 1} ^ {K} w _ {k} \sigma \left(\frac {x - \mu_ {k}}{s _ {k}}\right)\right) \quad f ^ {S O S} (x) = a _ {0} + \sum_ {k = 1} ^ {K} \sum_ {p = 0} ^ {R} \sum_ {q = 0} ^ {R} \frac {a _ {p , k} a _ {q , k}}{p + q + 1} x ^ {p + q + 1} \tag {1}
55
+ $$
56
+
57
+ where $\pmb{a}, \pmb{w}, \pmb{s}, \pmb{\mu}$ are the transformation parameters, $K$ is the number of components, $R$ is the polynomial degree, and $\sigma(x) = 1/(1 + e^{-x})$ . We denote the two variants of the model based on $f^{DSF}$ and $f^{SOS}$ building blocks as DSFlow and SOSFlow respectively. Finally, after stacking multiple $g_{m}^{-1} = f_{\theta_{m}}$ , we apply a sigmoid transformation $g_{1}^{-1} = \sigma$ to convert $z_{2}$ into $z_{1} \in (0,1)$ .
58
+
59
+ For both models, we can evaluate the inverse transformations $(g_1^{-1} \circ \dots \circ g_M^{-1})$ , which means the model can be efficiently trained via maximum likelihood. The density $p(\tau)$ defined by either DS-Flow or SOSFlow model is extremely flexible and can approximate any distribution (Section 3.4). However, for some use cases, this is not sufficient. For example, we may be interested in the expected time until the next event, $\mathbb{E}_p[\tau]$ . In this case, flow-based models are not optimal, since for them $\mathbb{E}_p[\tau]$ does not in general have a closed form. Moreover, the forward transformation $(g_M \circ \dots \circ g_1)$ cannot be computed in closed form since the functions $f^{DSF}$ and $f^{SOS}$ cannot be inverted analytically. Therefore, sampling from $p(\tau)$ is also problematic and requires iterative root finding.
60
+
61
+ This raises the question: Can we design a model for $p(\tau)$ that is as expressive as the flow-based models, but in which sampling and computing moments is easy and can be done in closed form?
62
+
63
+ # 3.2 MODELING $p(\tau)$ WITH MIXTURE DISTRIBUTIONS
64
+
65
+ Model definition. While mixture models are commonly used for clustering, they can also be used for density estimation. Mixtures work especially well in low dimensions (McLachlan & Peel, 2004), which is the case in TPPs, where we model the distribution of one-dimensional inter-event times $\tau$ . Since the inter-event times $\tau$ are positive, we choose to use a mixture of log-normal distributions to model $p(\tau)$ . The PDF of a log-normal mixture is defined as
66
+
67
+ $$
68
+ p (\tau | \boldsymbol {w}, \boldsymbol {\mu}, \boldsymbol {s}) = \sum_ {k = 1} ^ {K} w _ {k} \frac {1}{\tau s _ {k} \sqrt {2 \pi}} \exp \left(- \frac {\left(\log \tau - \mu_ {k}\right) ^ {2}}{2 s _ {k} ^ {2}}\right) \tag {2}
69
+ $$
70
+
71
+ ![](images/c25d2ff0c7de8eb3873316d5a4cc238405c1a0c135a7193caae85ad578e11010.jpg)
72
+ Figure 1: Model architecture. Parameters of $p^{*}(\tau_{i}|\pmb{\theta}_{i})$ are generated based on the conditional information $c_{i}$ .
73
+
74
+ ![](images/5882839acbf3bb501b3ca2d921314961a05a0c7f26966783a686e8d7718cd301.jpg)
75
+ Figure 2: Normalizing flows define a flexible distribution via transformations.
76
+
77
+ where $\boldsymbol{w}$ are the mixture weights, $\mu$ are the mixture means, and $s$ are the standard deviations. Because of its simplicity, the log-normal mixture model has a number of attractive properties.
78
+
79
+ Moments. Since each component $k$ has a finite mean, the mean of the entire distribution can be computed as $\mathbb{E}_p[\tau] = \sum_k w_k \exp(\mu_k + s_k^2/2)$ , i.e., a weighted average of component means. Higher moments can be computed based on the moments of each component (Fruhwirth-Schnatter, 2006).
80
+
81
+ Sampling. While flow-based models from Section 3.1 require iterative root-finding algorithms to generate samples, sampling from a mixture model can be done in closed form:
82
+
83
+ $$
84
+ \boldsymbol {z} \sim \operatorname {C a t e g o r i c a l} (\boldsymbol {w}) \quad \varepsilon \sim \operatorname {N o r m a l} (0, 1) \quad \tau = \exp (\boldsymbol {s} ^ {T} \boldsymbol {z} \cdot \varepsilon + \boldsymbol {\mu} ^ {T} \boldsymbol {z})
85
+ $$
86
+
87
+ where $z$ is a one-hot vector of size $K$ . In some applications, such as reinforcement learning (Upadhyay et al., 2018), we might be interested in computing gradients of the samples w.r.t. the model parameters. The samples $\tau$ drawn using the procedure above are differentiable with respect to the means $\mu$ and scales $s$ . By using the Gumbel-softmax trick (Jang et al., 2017) when sampling $z$ , we can obtain gradients w.r.t. all the model parameters (Appendix D.6). Such reparametrization gradients have lower variance and are easier to implement than the score function estimators typically used in other works (Mohamed et al., 2019). Other flexible models (such as multi-layer flow models from Section 3.1) do not permit sampling through reparametrization, and thus are not well-suited for the above-mentioned scenario. In Section 5.4, we show how reparametrization sampling can also be used to train with missing data by performing imputation on the fly.
88
+
89
+ # 3.3 INCORPORATING THE CONDITIONAL INFORMATION
90
+
91
+ History. A crucial feature of temporal point processes is that the time $\tau_{i} = (t_{i} - t_{i - 1})$ until the next event may be influenced by all the events that happened before. A standard way of capturing this dependency is to process the event history $\mathcal{H}_{t_i}$ with a recurrent neural network (RNN) and embed it into a fixed-dimensional vector $h_i\in \mathbb{R}^H$ (Du et al., 2016).
92
+
93
+ Conditioning on additional features. The distribution of the time until the next event might depend on factors other than the history. For instance, distribution of arrival times of customers in a restaurant depends on the day of the week. As another example, if we are modeling user behavior in an online system, we can obtain a different distribution $p^{*}(\tau)$ for each user by conditioning on their metadata. We denote such side information as a vector $\mathbf{y}_i$ . Such information is different from marks (Rasmussen, 2011), since (a) the metadata may be shared for the entire sequence and (b) $\mathbf{y}_i$ only influences the distribution $p^{*}(\tau_i|\mathbf{y}_i)$ , not the objective function.
94
+
95
+ In some scenarios, we might be interested in learning from multiple event sequences. In such case, we can assign each sequence $\mathcal{T}_j$ a learnable sequence embedding vector $e_j$ . By optimizing $e_j$ , the model can learn to distinguish between sequences that come from different distributions. The learned embeddings can then be used for visualization, clustering or other downstream tasks.
96
+
97
+ Obtaining the parameters. We model the conditional dependence of the distribution $p^*(\tau_i)$ on all of the above factors in the following way. The history embedding $\pmb{h}_i$ , metadata $\pmb{y}_i$ and sequence embedding $\pmb{e}_j$ are concatenated into a context vector $\pmb{c}_i = [h_i||\pmb{y}_i||\pmb{e}_j]$ . Then, we obtain the parameters of the distribution $p^*(\tau_i)$ as an affine function of $\pmb{c}_i$ . For example, for the mixture model we have
98
+
99
+ $$
100
+ \boldsymbol {w} _ {i} = \operatorname {s o f t m a x} \left(\boldsymbol {V} _ {\boldsymbol {w}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {w}}\right) \quad \boldsymbol {s} _ {i} = \exp \left(\boldsymbol {V} _ {\boldsymbol {s}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {s}}\right) \quad \boldsymbol {\mu} _ {i} = \boldsymbol {V} _ {\boldsymbol {\mu}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {\mu}} \tag {3}
101
+ $$
102
+
103
+ where the softmax and exp transformations are applied to enforce the constraints on the distribution parameters, and $\{V_w, V_s, V_\mu, b_w, b_s, b_\mu\}$ are learnable parameters. Such model resembles the
104
+
105
+ mixture density network architecture (Bishop, 1994). The whole process is illustrated in Figure 1. We obtain the parameters of the flow-based models in a similar way (see Appendix D).
106
+
107
+ # 3.4 DISCUSSION
108
+
109
+ Universal approximation. The SOSFlow and DSFlow models can approximate any probability density on $\mathbb{R}$ arbitrarily well (Jaini et al., 2019, Theorem 3), (Krueger et al., 2018, Theorem 4). It turns out, a mixture model has the same universal approximation (UA) property.
110
+
111
+ Theorem 1 (DasGupta, 2008, Theorem 33.2). Let $p(x)$ be a continuous density on $\mathbb{R}$ . If $q(x)$ is any density on $\mathbb{R}$ and is also continuous, then, given $\varepsilon > 0$ and a compact set $S \subset \mathbb{R}$ , there exist number of components $K \in \mathbb{N}$ , mixture coefficients $\boldsymbol{w} \in \Delta^{K-1}$ , locations $\boldsymbol{\mu} \in \mathbb{R}^K$ , and scales $s \in \mathbb{R}_+^K$ such that for the mixture distribution $\hat{p}(x) = \sum_{k=1}^{K} w_k \frac{1}{s_k} q\left(\frac{x - \mu_k}{s_k}\right)$ it holds $\sup_{x \in S} |p(x) - \hat{p}(x)| < \varepsilon$ .
112
+
113
+ This results shows that, in principle, the mixture distribution is as expressive as the flow-based models. Since we are modeling the conditional density, we additionally need to assume for all of the above models that the RNN can encode all the relevant information into the history embedding $h_i$ . This can be accomplished by invoking the universal approximation theorems for RNNs (Siegelmann & Sontag, 1992; Schäfer & Zimmermann, 2006).
114
+
115
+ Note that this result, like other UA theorems of this kind (Cybenko, 1989; Daniels & Velikova, 2010), does not provide any practical guarantees on the obtained approximation quality, and doesn't say how to learn the model parameters. Still, UA intuitively seems like a desirable property of a distribution. This intuition is supported by experimental results. In Section 5.1, we show that models with the UA property consistently outperform the less flexible ones.
116
+
117
+ Interestingly, Theorem 1 does not make any assumptions about the form of the base density $q(x)$ . This means we could as well use a mixture of distribution other than log-normal. However, other popular distributions on $\mathbb{R}_+$ have drawbacks: log-logistic does not always have defined moments and gamma distribution doesn't permit straightforward sampling with reparametrization.
118
+
119
+ Intensity function. For both flow-based and mixture models, the conditional cumulative distribution function (CDF) $F^{*}(\tau)$ and the PDF $p^{*}(\tau)$ are readily available. This means we can easily compute the respective intensity functions (see Appendix A). However, we should still ask whether we lose anything by modeling $p^{*}(\tau)$ instead of $\lambda^{*}(t)$ . The main arguments in favor of modeling the intensity function in traditional models (e.g. self-exciting process) are that it's intuitive, easy to specify and reusable (Upadhyay & Rodriguez, 2019).
120
+
121
+ "Intensity function is intuitive, while the conditional density is not." — While it's true that in simple models (e.g. in self-exciting or self-correcting processes) the dependence of $\lambda^{*}(t)$ on the history is intuitive and interpretable, modern RNN-based intensity functions (as in Du et al. (2016); Mei & Eisner (2017); Omi et al. (2019)) cannot be easily understood by humans. In this sense, our proposed models are as intuitive and interpretable as other existing intensity-based neural network models.
122
+
123
+ " $\lambda^{*}(t)$ is easy to specify, since it only has to be positive. On the other hand, $p^* (\tau)$ must integrate to one." — As we saw, by using either normalizing flows or a mixture distribution, we automatically enforce that the PDF integrates to one, without sacrificing the flexibility of our model.
124
+
125
+ "Reusability: If we merge two independent point processes with intensities $\lambda_1^*(t)$ and $\lambda_2^*(t)$ , the merged process has intensity $\lambda^*(t) = \lambda_1^*(t) + \lambda_2^*(t)$ ." — An equivalent result exists for the CDFs $F_1^*(\tau)$ and $F_2^*(\tau)$ of the two independent processes. The CDF of the merged process is obtained as $F^*(\tau) = F_1^*(\tau) + F_2^*(\tau) - F_1^*(\tau)F_2^*(\tau)$ (derivation in Appendix A).
126
+
127
+ As we just showed, modeling $p^*(\tau)$ instead of $\lambda^*(t)$ does not impose any limitation on our approach. Moreover, a mixture distribution is flexible, easy to sample from and has well-defined moments, which favorably compares it to other intensity-based deep learning models.
128
+
129
+ # 4 RELATED WORK
130
+
131
+ Neural temporal point processes. Fitting simple TPP models (e.g. self-exciting (Hawkes, 1971) or self-correcting (Isham & Westcott, 1979) processes) to real-world data may lead to poor results because of model misspecification. Multiple recent works address this issue by proposing more
132
+
133
+ flexible neural-network-based point process models. These neural models are usually defined in terms of the conditional intensity function. For example, Mei & Eisner (2017) propose a novel RNN architecture that can model sophisticated intensity functions. This flexibility comes at the cost of inability to evaluate the likelihood in closed form, and thus requiring Monte Carlo integration.
134
+
135
+ Du et al. (2016) suggest using an RNN to encode the event history into a vector $\pmb{h}_i$ . The history embedding $\pmb{h}_i$ is then used to define the conditional intensity, for example, using the constant intensity model $\lambda^{*}(t_{i}) = \exp (\pmb{v}^{T}\pmb{h}_{i} + b)$ (Li et al., 2018; Huang et al., 2019) or the more flexible exponential intensity model $\lambda^{*}(t_{i}) = \exp (w(t_{i} - t_{i - 1}) + \pmb{v}^{T}\pmb{h}_{i} + b)$ (Du et al., 2016; Upadhyay et al., 2018). By considering the conditional distribution $p^{\ast}(\tau)$ of the two models, we can better understand their properties. Constant intensity corresponds to an exponential distribution, and exponential intensity corresponds to a Gompertz distribution (see Appendix B). Clearly, these unimodal distributions cannot match the flexibility of a mixture model (as can be seen in Figure 8).
136
+
137
+ Omi et al. (2019) introduce a flexible fully neural network (FullyNN) intensity model, where they model the cumulative intensity function $\Lambda^{*}(\tau)$ with a neural net. The function $\Lambda^{*}$ converts $\tau$ into an exponentially distributed random variable with unit rate (Rasmussen, 2011), similarly to how normalizing flows model $p^{*}(\tau)$ by converting $\tau$ into a random variable with a simple distribution. However, due to a suboptimal choice of the network architecture, the PDF of the FullyNN model does not integrate to 1, and the model assigns non-zero probability to negative inter-event times (see Appendix C). In contrast, SOSFlow and DSFlow always define a valid PDF on $\mathbb{R}_{+}$ . Moreover, similar to other flow-based models, sampling from the FullyNN model requires iterative root finding.
138
+
139
+ Several works used mixtures of kernels to parametrize the conditional intensity function (Taddy et al., 2012; Tabibian et al., 2017; Okawa et al., 2019). Such models can only capture self-exciting influence from past events. Moreover, these models do not permit computing expectation and drawing samples in closed form. Recently, Biloš et al. (2019) and Türkmen et al. (2019) proposed neural models for learning marked TPPs. These models focus on event type prediction and share the limitations of other neural intensity-based approaches. Other recent works consider alternatives to the maximum likelihood objective for training TPPs. Examples include noise-contrastive estimation (Guo et al., 2018), Wasserstein distance (Xiao et al., 2017; 2018; Yan et al., 2018), and reinforcement learning (Li et al., 2018; Upadhyay et al., 2018). This line of research is orthogonal to our contribution, and the models proposed in our work can be combined with the above-mentioned training procedures.
140
+
141
+ Neural density estimation. There exist two popular paradigms for learning flexible probability distributions using neural networks: In mixture density networks (Bishop, 1994), a neural net directly produces the distribution parameters; in normalizing flows (Tabak & Turner, 2013; Rezende & Mohamed, 2015), we obtain a complex distribution by transforming a simple one. Both mixture models (Schuster, 2000; Eirola & Lendasse, 2013; Graves, 2013) and normalizing flows (Oord et al., 2016; Ziegler & Rush, 2019) have been applied for modeling sequential data. However, surprisingly, none of the existing works make the connection and consider these approaches in the context of TPPs.
142
+
143
+ # 5 EXPERIMENTS
144
+
145
+ We evaluate the proposed models on the established task of event time prediction (with and without marks) in Sections 5.1 and 5.2. In the remaining experiments, we show how the log-normal mixture model can be used for incorporating extra conditional information, training with missing data and learning sequence embeddings. We use 6 real-world datasets containing event data from various domains: Wikipedia (article edits), MOOC (user interaction with online course system), Reddit (posts in social media) (Kumar et al., 2019), Stack Overflow (badges received by users), LastFM (music playback) (Du et al., 2016), and Yelp (check-ins to restaurants). We also generate 5 synthetic datasets (Poisson, Renewal, Self-correcting, Hawkes1, Hawkes2), as described in Omi et al. (2019). Detailed descriptions and summary statistics of all the datasets are provided in Appendix E.
146
+
147
+ # 5.1 EVENT TIME PREDICTION USING HISTORY
148
+
149
+ Setup. We consider two normalizing flow models, SOSFlow and DSFlow (Equation 1), as well a log-normal mixture model (Equation 2), denoted as LogNormMix. As baselines, we consider RMTPP (i.e. Gompertz distribution / exponential intensity from Du et al. (2016)) and FullyNN
150
+
151
+ ![](images/1a1ada4caa28e5f4a967ee611c8fc8b06670451a884772a3f6b184d9a72779bc.jpg)
152
+ Figure 3: NLL loss for event time prediction without marks (left) and with marks (right). NLL of each model is standardized by subtracting the score of LogNormMix. Lower score is better. Despite its simplicity, LogNormMix consistently achieves excellent loss values.
153
+
154
+ ![](images/0a3b6fc20142feac7107f19ab1143d37654df4e3eaef984a630f39631a7e8d5c.jpg)
155
+
156
+ model by Omi et al. (2019). Additionally, we use a single log-normal distribution (denoted Log-Normal) to highlight the benefits of the mixture model. For all models, an RNN encodes the history into a vector $\pmb{h}_i$ . The parameters of $p^*(\tau)$ are then obtained using $\pmb{h}_i$ (Equation 3). We exclude the NeuralHawkes model from our comparison, since it is known to be inferior to RMTPP in time prediction (Mei & Eisner, 2017), and, unlike other models, doesn't have a closed-form likelihood.
157
+
158
+ Each dataset consists of multiple sequences of event times. The task is to predict the time $\tau_{i}$ until the next event given the history $\mathcal{H}_{t_i}$ . For each dataset, we use $60\%$ of the sequences for training, $20\%$ for validation and $20\%$ for testing. We train all models by minimizing the negative log-likelihood (NLL) of the inter-event times in the training set. To ensure a fair comparison, we try multiple hyperparameter configurations for each model and select the best configuration using the validation set. Finally, we report the NLL loss of each model on the test set. All results are averaged over 10 train/validation/test splits. Details about the implementation, training process and hyperparameter ranges are provided in Appendix D. For each real-world dataset, we report the difference between the NLL loss of each method and the LogNormMix model (Figure 3). We report the differences, since scores of all models can be shifted arbitrarily by scaling the data. Absolute scores (not differences) in a tabular format, as well as results for synthetic datasets are provided in Appendix F.1.
159
+
160
+ Results. Simple unimodal distributions (Gompertz/RMTPP, LogNormal) are always dominated by the more flexible models with the universal approximation property (LogNormMix, DSFlow, SOS-Flow, FullyNN). Among the simple models, LogNormal provides a much better fit to the data than RMTPP/Gompertz. The distribution of inter-event times in real-world data often has heavy tails, and the Gompertz distributions fail to capture this behavior. We observe that the two proposed models, LogNormMix and DSFlow consistently achieve the best loss values.
161
+
162
+ # 5.2 LEARNING WITH MARKS
163
+
164
+ Setup. We apply the models for learning in marked temporal point processes. Marks are known to improve performance of simpler models (Du et al., 2016), we want to establish whether our proposed models work well in this setting. We use the same setup as in the previous section, except for two differences. The RNN takes a tuple $(\tau_i, m_i)$ as input at each time step, where $m_i$ is the mark. Moreover, the loss function now includes a term for predicting the next mark: $\mathcal{L}(\pmb{\theta}) = -\sum_{i} [\log p_{\pmb{\theta}}^{*}(\tau_i) + \log p_{\pmb{\theta}}^{*}(m_i)]$ (implementation details in Appendix F.2).
165
+
166
+ Results. Figure 3 (right) shows the time NLL loss (i.e. $-\sum_{i}\log p^{*}(\tau_{i}))$ for Reddit and MOOC datasets. LogNormMix shows dominant performance in the marked case, just like in the previous experiment. Like before, we provide the results in tabular format, as well as report the marks NLL loss in Appendix F.
167
+
168
+ # 5.3 LEARNING WITH ADDITIONAL CONDITIONAL INFORMATION
169
+
170
+ Setup. We investigate whether the additional conditional information (Section 3.3) can improve performance of the model. In the Yelp dataset, the task is to predict the time $\tau$ until the next check-in for a given restaurant. We postulate that the distribution $p^{*}(\tau)$ is different, depending on whether it's a weekday and whether it's an evening hour, and encode this information as a vector $\mathbf{y}_i$ . We consider 4 variants of the LogNormMix model, that either use or don't use $\mathbf{y}_i$ and the history embedding $h_i$ .
171
+
172
+ ![](images/eedf7b0d14c137dd3daa84ff23ad02ad00ff79f075fc31b0839b7e42d23d6f1c.jpg)
173
+
174
+ ![](images/5af8bd1e2613b6eb047b014a8827eec1a1b610621824181d8ca68ead39e57792.jpg)
175
+ Figure 4: By sampling the missing values from $p^{*}(\tau)$ during training, LogNormMix learns the true underlying data distribution. Other imputation strategies overfit the partially observed sequence.
176
+
177
+ <table><tr><td>Model</td><td>NLL</td></tr><tr><td>No imputation</td><td>1.01 ± 0.20</td></tr><tr><td>Mean imputation</td><td>0.81 ± 0.27</td></tr><tr><td>Sampling with reparametrization</td><td>0.36 ± 0.05</td></tr></table>
178
+
179
+ Results. Figure 5 shows the test set loss for 4 variants of the model. We see that additional conditional information boosts performance of the LogNormMix model, regardless of whether the history embedding is used.
180
+
181
+ # 5.4 MISSING DATA IMPUTATION
182
+
183
+ In practical scenarios, one often has to deal with missing data. For example, we may know that records were not kept for a period of time, or that the data is unusable for some reason. Since TPPs are a generative model, they provide a principled way to handle the missing data through imputation.
184
+
185
+ Setup. We are given several sequences generated by a Hawkes process, where some parts are known to be missing. We consider 3 strategies for learning from such a partially observed sequence: (a) ignore the gaps, maximize log-likelihood of observed inter-event times (b) fill the gaps with the average $\tau$ estimated from observed data, maximize log-likelihood of observed data, and (c) fill the gaps with samples generated by the model, maximize the expected log-likelihood of the observed points. The setup is demonstrated in Figure 4. Note that in case (c) the expected value depends on the parameters of the distribution, hence we need to perform sampling with reparametrization to optimize such loss. A more detailed description of the setup is given in Appendix F.4.
186
+
187
+ Results. The 3 model variants are trained on the partially-observed sequence. Figure 4 shows the NLL of the fully observed sequence (not seen by any model at training time) produced by each strategy. We see that strategies (a) and (b) overfit the partially observed sequence. In contrast, strategy (c) generalizes and learns the true underlying distribution. The ability of the LogNormMix model to draw samples with reparametrization was crucial to enable such training procedure.
188
+
189
+ ![](images/be8ac2d0e56e56085624517b970081412b72034255126927b576676a3301bdd2.jpg)
190
+ Figure 5: Conditional information improves performance.
191
+
192
+ ![](images/5eab2a580e0a5be1d292f4a400c4f77cd713ff68275abf4db48a58eafef77238.jpg)
193
+ Figure 6: Sequences generated based on different embeddings.
194
+
195
+ ![](images/3a949ce1d877f1a33975b223ac21ad1233fdafd21e4263c1eff2175b177e27fb.jpg)
196
+ Figure 7: Sequence embeddings learned by the model.
197
+
198
+ # 5.5 SEQUENCE EMBEDDING
199
+
200
+ Different sequences in the dataset might be generated by different processes, and exhibit different distribution of inter-event times. We can "help" the model distinguish between them by assigning a trainable embedding vector $e_j$ to each sequence $j$ in the dataset. It seems intuitive that embedding vectors learned this way should capture some notion of similarity between sequences.
201
+
202
+ Learned sequence embeddings. We learn a sequence embedding for each of the sequences in the synthetic datasets (along with other model parameters). We visualize the learned embeddings using t-SNE (Maaten & Hinton, 2008) in Figure 7 colored by the true class. As we see, the model learns to differentiate between sequences from different distributions in a completely unsupervised way.
203
+
204
+ Generation. We fit the LogNormMix model to two sequences (from self-correcting and renewal processes), and, respectively, learn two embedding vectors $e_{SC}$ and $e_{RN}$ . After training, we generate 3 sequences from the model, using $e_{SC}$ , $\frac{1}{2}(e_{SC} + e_{RN})$ and $e_{RN}$ as sequence embeddings. Additionally, we plot the learned conditional intensity function of our model for each generated sequence (Figure 6). The model learns to map the sequence embeddings to very different distributions.
205
+
206
+ # 6 CONCLUSIONS
207
+
208
+ We use tools from neural density estimation to design new models for learning in TPPs. We show that a simple mixture model is competitive with state-of-the-art normalizing flows methods, as well as convincingly outperforms other existing approaches. By looking at learning in TPPs from a different perspective, we were able to address the shortcomings of existing intensity-based approaches, such as insufficient flexibility, lack of closed-form likelihoods and inability to generate samples analytically. We hope this alternative viewpoint will inspire new developments in the field of TPPs.
209
+
210
+ # ACKNOWLEDGMENTS
211
+
212
+ This research was supported by the German Federal Ministry of Education and Research (BMBF), grant no. 01IS18036B, and the Software Campus Project Deep-RENT. The authors of this work take full responsibilities for its content.
213
+
214
+ # REFERENCES
215
+
216
+ Marin Bilos, Bertrand Charpentier, and Stephan Gunnemann. Uncertainty on asynchronous time event prediction. In Advances in Neural Information Processing Systems. 2019.
217
+ Eli Bingham, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul Szerlip, Paul Horsfall, and Noah D. Goodman. Pyro: Deep Universal Probabilistic Programming. Journal of Machine Learning Research, 2018.
218
+ Christopher M Bishop. Mixture density networks. 1994.
219
+ Oscar Celma. Music recommendation. In Music recommendation and discovery, pp. 43-85. Springer, 2010.
220
+ George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4), 1989.
221
+ Hennie Daniels and Marina Velikova. Monotone and partially monotone neural networks. IEEE Transactions on Neural Networks, 21(6):906-917, 2010.
222
+ Anirban DasGupta. Asymptotic theory of statistics and probability. Springer Science & Business Media, 2008.
223
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. International Conference on Learning Representations, 2017.
224
+ Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez-Rodriguez, and Le Song. Recurrent marked temporal point processes: Embedding event history to vector. In ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016.
225
+ Emil Eirola and Amaury Lendasse. Gaussian mixture models for time series modelling, forecasting, and interpolation. In International Symposium on Intelligent Data Analysis, pp. 162-173. Springer, 2013.
226
+ Sylvia Fruhwirth-Schnatter. Finite mixture and Markov switching models. Springer Science & Business Media, 2006.
227
+ Will Grathwohl, Dami Choi, Yuhuai Wu, Geoffrey Roeder, and David Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. International Conference on Learning Representations, 2018.
228
+
229
+ Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
230
+ Ruocheng Guo, Jundong Li, and Huan Liu. INITIATOR: Noise-contrastive estimation for marked temporal point process. In International Joint Conference on Artificial Intelligence, 2018.
231
+ Alan G Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83-90, 1971.
232
+ Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow++: Improving flow-based generative models with variational dequantization and architecture design. International Conference on Machine Learning, 2019.
233
+ Hengguang Huang, Hao Wang, and Brian Mak. Recurrentoisson process unit for speech recognition. In AAAI Conference on Artificial Intelligence, 2019.
234
+ Valerie Isham and Mark Westcott. A self-correcting point process. Stochastic Processes and Their Applications, 8(3):335-347, 1979.
235
+ Priyank Jaini, Kira A. Selby, and Yaoliang Yu. Sum-of-squares polynomial flow. In International Conference on Machine Learning, 2019.
236
+ Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. International Conference on Learning Representations, 2017.
237
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. The International Conference on Learning Representations, 2015.
238
+ David Krueger, Chin-Wei Huang, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. In International Conference on Machine Learning, 2018.
239
+ Srijan Kumar, Xikun Zhang, and Jure Leskovec. Predicting dynamic embedding trajectory in temporal interaction networks. In ACM SIGKDD international conference on Knowledge discovery and data mining, 2019.
240
+ Shuang Li, Shuai Xiao, Shixiang Zhu, Nan Du, Yao Xie, and Le Song. Learning temporal point processes via reinforcement learning. In Advances in Neural Information Processing Systems, 2018.
241
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579-2605, 2008.
242
+ Geoffrey McLachlan and David Peel. Finite mixture models. John Wiley & Sons, 2004.
243
+ Hongyuan Mei and Jason M Eisner. The neural hawkes process: A neurally self-modulating multivariate point process. In Advances in Neural Information Processing Systems, 2017.
244
+ Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. Monte carlo gradient estimation in machine learning. arXiv preprint arXiv:1906.10652, 2019.
245
+ Maya Okawa, Tomoharu Iwata, Takeshi Kurashima, Yusuke Tanaka, Hiroyuki Toda, and Naonori Ueda. Deep mixture point processes: Spatio-temporal event prediction with rich contextual information. 2019.
246
+ Takahiro Omi, Naonori Ueda, and Kazuyuki Aihara. Fully neural network based model for general temporal point processes. 2019.
247
+ Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
248
+ Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017.
249
+
250
+ Jakob Gulddahl Rasmussen. Temporal point processes: the conditional intensity function. Lecture Notes, Jan, 2011.
251
+ Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. International Conference on Machine Learning, 2015.
252
+ Anton Maximilian Schafer and Hans Georg Zimmermann. Recurrent neural networks are universal approximators. In International Conference on Artificial Neural Networks, pp. 632-640. Springer, 2006.
253
+ Mike Schuster. Better generative models for sequential data problems: Bidirectional recurrent mixture density networks. In Advances in Neural Information Processing Systems, 2000.
254
+ Hava T Siegelmann and Eduardo D Sontag. On the computational power of neural nets. In Proceedings of the fifth annual workshop on Computational learning theory, pp. 440-449. ACM, 1992.
255
+ Esteban G Tabak and Cristina V Turner. A family of nonparametric density estimation algorithms. Communications on Pure and Applied Mathematics, 66(2):145-164, 2013.
256
+ Behzad Tabibian, Isabel Valera, Mehrdad Farajtabar, Le Song, Bernhard Scholkopf, and Manuel Gomez-Rodriguez. Distilling information reliability and source trustworthiness from digital traces. In International Conference on World Wide Web, pp. 847-855, 2017.
257
+ Matthew A Taddy, Athanasios Kottas, et al. Mixture modeling for marked poisson processes. Bayesian Analysis, 7(2), 2012.
258
+ George Tucker, Andriy Mnih, Chris J Maddison, John Lawson, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. In Advances in Neural Information Processing Systems, 2017.
259
+ Ali Caner Türkmen, Yuyang Wang, and Alexander J Smola. Fastpoint: Scalable deep point processes. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2019.
260
+ Utkarsh Upadhyay and Manuel Gomez Rodriguez. Temporal point processes. Lecture notes for Human-Centered ML, January 2019. URL http://courses.mpi-sws.org/hcml-WS18/lectures/TPP.pdf.
261
+ Utkarsh Upadhyay, Abir De, and Manuel Gomez Rodriguez. Deep reinforcement learning of marked temporal point processes. In Advances in Neural Information Processing Systems, 2018.
262
+ Andreas Wienke. *Frailty models in survival analysis*. Chapman and Hall/CRC, 2010.
263
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992.
264
+ Shuai Xiao, Mehrdad Farajtabar, Xiaojing Ye, Junchi Yan, Le Song, and Hongyuan Zha. Wasserstein learning of deep generative point process models. In Advances in Neural Information Processing Systems, 2017.
265
+ Shuai Xiao, hongteng Xu, Junchi Yan, Mehrdad Farajtabar, Xiaokang Yang, Le Song, and Hongyuan Zha. Learning conditional generative models for temporal point processes. In AAAI Conference on Artificial Intelligence, 2018.
266
+ Junchi Yan, Xin Liu, Liangliang Shi, Changsheng Li, and Hongyuan Zha. Improving maximum likelihood estimation of temporal point process via discriminative and adversarial learning. In International Joint Conference on Artificial Intelligence, 2018.
267
+ Zachary M Ziegler and Alexander M Rush. Latent normalizing flows for discrete sequences. International Conference on Machine Learning, 2019.
268
+
269
+ # A INTENSITY FUNCTION OF FLOW AND MIXTURE MODELS
270
+
271
+ CDF and conditional intensity function of proposed models. The cumulative distribution function (CDF) of a normalizing flow model can be obtained in the following way. If $z$ has a CDF $Q(z)$ and $\tau = g(z)$ , then the CDF $F(\tau)$ of $\tau$ is obtained as
272
+
273
+ $$
274
+ F (\tau) = Q (g ^ {- 1} (\tau))
275
+ $$
276
+
277
+ Since for both SOSFlow and DSFlow we can evaluate $g^{-1}$ in closed form, $F(\tau)$ is easy to compute.
278
+
279
+ For the log-normal mixture model, CDF is by definition equal to
280
+
281
+ $$
282
+ F (\tau) = \sum_ {k = 1} ^ {K} w _ {k} \Phi \left(\frac {\log \tau - \mu_ {k}}{s _ {k}}\right)
283
+ $$
284
+
285
+ where $\Phi (\cdot)$ is the CDF of a standard normal distribution.
286
+
287
+ Given the conditional PDF and CDF, we can compute the conditional intensity $\lambda^{*}(t)$ and the cumulative intensity $\Lambda^{*}(\tau)$ for each model as
288
+
289
+ $$
290
+ \lambda^ {*} (t) = \frac {p ^ {*} (t - t _ {i - 1})}{1 - F ^ {*} (t - t _ {i - 1})} \qquad \Lambda^ {*} (\tau_ {i}) := \int_ {0} ^ {\tau_ {i}} \lambda^ {*} (t _ {i - 1} + s) d s = - \log (1 - F ^ {*} (\tau_ {i}))
291
+ $$
292
+
293
+ where $t_{i-1}$ is the arrival time of most recent event before $t$ (Rasmussen, 2011).
294
+
295
+ Merging two independent processes. We replicate the setup from Upadhyay & Rodriguez (2019) and consider what happens if we merge two independent TPPs with intensity functions $\lambda_1^*(t)$ and $\lambda_2^*(t)$ (and respectively, cumulative intensity functions $\Lambda_1^*(\tau)$ and $\Lambda_2^*(\tau)$ ). According to Upadhyay & Rodriguez (2019), the intensity function of the new process is $\lambda^*(t) = \lambda_1^*(t) + \lambda_2^*(t)$ . Therefore, the cumulative intensity function of the new process is
296
+
297
+ $$
298
+ \begin{array}{l} \Lambda^ {*} (\tau) = \int_ {0} ^ {\tau} \lambda^ {*} (t _ {i - 1} + s) d s \\ = \int_ {0} ^ {\tau} \lambda_ {1} ^ {*} (t _ {i - 1} + s) d s + \int_ {0} ^ {\tau} \lambda_ {2} ^ {*} (t _ {i - 1} + s) d s \\ = \Lambda_ {1} ^ {*} (\tau) + \Lambda_ {2} ^ {*} (\tau) \\ \end{array}
299
+ $$
300
+
301
+ Using the previous result, we can obtain the CDF of the merged process as
302
+
303
+ $$
304
+ \begin{array}{l} F ^ {*} (\tau) = 1 - \exp (- \Lambda^ {*} (\tau)) \\ = 1 - \exp \left(- \Lambda_ {1} ^ {*} (\tau) - \Lambda_ {2} ^ {*} (\tau)\right) \\ = 1 - \exp \left(\log \left(1 - F _ {1} ^ {*} (\tau)\right) + \log \left(1 - F _ {2} ^ {*} (\tau)\right)\right) \\ = 1 - \left(1 + F _ {1} ^ {*} (\tau) F _ {2} ^ {*} (\tau) - F _ {1} ^ {*} (\tau) - F _ {2} ^ {*} (\tau)\right) \\ = F _ {1} ^ {*} (\tau) + F _ {2} ^ {*} (\tau) - F _ {1} ^ {*} (\tau) F _ {2} ^ {*} (\tau) \\ \end{array}
305
+ $$
306
+
307
+ The PDF of the merged process is obtained by simply differentiating the CDF w.r.t. $\tau$ .
308
+
309
+ This means that by using either normalizing flows or mixture distributions, and thus directly modeling PDF / CDF, we are not losing any benefits of the intensity parametrization.
310
+
311
+ # B DISCUSSION OF CONSTANT & EXPONENTIAL INTENSITY MODELS
312
+
313
+ Constant intensity model as exponential distribution. The conditional intensity function of the constant intensity model (Upadhyay et al., 2018) is defined as $\lambda^{*}(t_{i}) = \exp (\pmb{v}^{T}\pmb{h}_{i} + b)$ , where $\pmb{h}_i\in \mathbb{R}^H$ is the history embedding produced by an RNN, and $b\in \mathbb{R}$ is a learnable parameter. By setting $c = \exp (\pmb{v}^T\pmb {h}_i + b)$ , it's easy to see that the PDF of the constant intensity model $p^{\ast}(\tau) = c\exp (-c)$ corresponds to an exponential distribution.
314
+
315
+ Exponential intensity model as Gompertz distribution. PDF of a Gompertz distribution (Wienke, 2010) is defined as
316
+
317
+ $$
318
+ p (\tau | \alpha , \beta) = \alpha \exp \left(\beta \tau - \frac {\alpha}{\beta} \exp (\beta t) + \frac {\alpha}{\beta}\right)
319
+ $$
320
+
321
+ ![](images/ab13277692220d3d7793afe990eac7885e9adbf558f449496167b6e2d83af1de.jpg)
322
+ Figure 8: Different choices for modeling $p(\tau)$ : exponential distribution (left), Gompertz distribution (center), log-normal mixture (right). Mixture distribution can approximate any density while being tractable and easy to sample from.
323
+
324
+ ![](images/34a1126635e095689e50942d4fbfa3ff17eeca12424aa567df03ab39c1d8ad28.jpg)
325
+
326
+ ![](images/2636b446311b873c82dc42fc521eec1fac463bd9e7002906c647a5693f4c2faa.jpg)
327
+
328
+ for $\alpha, \beta > 0$ . The two parameters $\alpha$ and $\beta$ define its shape and rate, respectively. For any choice of its parameters, Gompertz distribution is unimodal and light-tailed. The mean of the Gompertz distribution can be computed as $\mathbb{E}[\tau] = \frac{1}{\beta} \exp \left( \frac{\alpha}{\beta} \right) \mathrm{Ei}(-\frac{\alpha}{\beta})$ , where $\mathrm{Ei}(z) = \int_{-z}^{\infty} \exp(-v) / v \, dv$ is the exponential integral function (that can be approximated numerically).
329
+
330
+ The conditional intensity function of the exponential intensity model (Du et al., 2016) is defined as $\lambda^{*}(t_{i}) = \exp (w(t_{i} - t_{i - 1}) + \pmb{v}^{T}\pmb{h}_{i} + b)$ , where $\pmb{h}_i\in \mathbb{R}^H$ is the history embedding produced by an RNN, and $\pmb {v}\in \mathbb{R}^{H},b\in \mathbb{R},w\in \mathbb{R}_{+}$ are learnable parameters. By defining $d = v^{T}\pmb{h}_{i} + b$ , we obtain the PDF of the exponential intensity model (Du et al., 2016, Equation 12) as
331
+
332
+ $$
333
+ p (\tau | w, d) = \exp \left(w \tau + d - \frac {1}{w} \exp (w \tau + d) + \frac {1}{w} \exp (d)\right)
334
+ $$
335
+
336
+ By setting $\alpha = \exp (d)$ and $\beta = w$ we see that the exponential intensity model is equivalent to a Gompertz distribution.
337
+
338
+ Discussion. Figure 8 shows densities that can be represented by exponential and Gompertz distributions. Even though the history embedding $h_i$ produced by an RNN may capture rich information, the resulting distribution $p^*(\tau_i)$ for both models has very limited flexibility, is unimodal and light-tailed. In contrast, a flow-based or a mixture model is significantly more flexible and can approximate any density.
339
+
340
+ # C DISCUSSION OF THE FULLYNN MODEL
341
+
342
+ Summary The main idea of the approach by Omi et al. (2019) is to model the integrated conditional intensity function
343
+
344
+ $$
345
+ \Lambda^ {*} (\tau) = \int_ {0} ^ {\tau} \lambda^ {*} (t _ {i - 1} + s) d s
346
+ $$
347
+
348
+ using a feedforward neural network with non-negative weights
349
+
350
+ $$
351
+ \Lambda^ {*} (\tau) := f (\tau) = \operatorname {s o f t p l u s} \left(\boldsymbol {W} ^ {(3)} \tanh \left(\boldsymbol {W} ^ {(2)} \tanh \left(\boldsymbol {W} ^ {(1)} \tau + \tilde {\boldsymbol {b}} ^ {(1)}\right) + \boldsymbol {b} ^ {(2)}\right) + \boldsymbol {b} ^ {(3)}\right) \tag {4}
352
+ $$
353
+
354
+ where $\tilde{\pmb{b}}^{(1)} = \pmb {V}\pmb {h} + \pmb{b}^{(0)},\pmb {h}\in \mathbb{R}^H$ is the history embedding, $W^{(1)}\in \mathbb{R}_{+}^{D\times 1}$ $W^{(2)}\in \mathbb{R}_+^{D\times D}$ $W^{(3)}\in \mathbb{R}_+^{1\times D}$ are non-negative weight matrices, and $\pmb {V}\in \mathbb{R}^{D\times H}$ $b^{(0)}\in \mathbb{R}^D$ $b^{(2)}\in \mathbb{R}^D$ $b^{(3)}\in \mathbb{R}$ are the remaining model parameters.
355
+
356
+ FullyNN as a normalizing flow Let $z\sim \mathrm{Exponential}(1)$ , that is
357
+
358
+ $$
359
+ F (z) = 1 - \exp (- z) \quad p (z) = \exp (- z)
360
+ $$
361
+
362
+ We can view $f:\mathbb{R}_{+}\to \mathbb{R}_{+}$ as a transformation that maps $\tau$ to $z$
363
+
364
+ $$
365
+ z = f (\tau) \iff \tau = f ^ {- 1} (z)
366
+ $$
367
+
368
+ We can now use the change of variables formula to obtain the conditional CDF and PDF of $\tau$ .
369
+
370
+ Alternatively, we can obtain the conditional intensity as
371
+
372
+ $$
373
+ \lambda^ {*} (\tau) = \frac {\partial}{\partial \tau} \Lambda^ {*} (\tau) = \frac {\partial}{\partial \tau} f (\tau)
374
+ $$
375
+
376
+ and use the fact that $p^*(\tau_i) = \lambda^*(t_{i-1} + \tau_i) \exp \left( -\int_0^{\tau_i} \lambda^*(t_{i-1} + s) ds \right)$ .
377
+
378
+ Both approaches lead to the same conclusion
379
+
380
+ $$
381
+ F ^ {*} (\tau) = 1 - \exp (- f (\tau)) \quad p ^ {*} (\tau) = \exp (- f (\tau)) \frac {\partial}{\partial \tau} f (\tau)
382
+ $$
383
+
384
+ However, the first approach also provides intuition on how to draw samples $\tilde{\tau}$ from the resulting distribution $p^*(\tau)$ — an approach known as the inverse method (Rasmussen, 2011)
385
+
386
+ 1. Sample $\tilde{z} \sim$ Exponential(1)
387
+ 2. Obtain $\tilde{\tau}$ by solving $f(\tau) - \tilde{z} = 0$ for $\tau$ (using e.g. bisection method)
388
+
389
+ Similarly to other flow-based models, sampling from the FullyNN model cannot be done exactly and requires a numerical approximation.
390
+
391
+ # Shortcomings of the FullyNN model
392
+
393
+ 1. The PDF defined by the FullyNN model doesn't integrate to 1.
394
+
395
+ By definition of the CDF, the condition that the PDF integrates to 1 is equivalent to $\lim_{\tau \to \infty}F^{*}(\tau) = 1$ , which in turn is equivalent to $\lim_{\tau \to \infty}\Lambda^{*}(\tau) = \infty$ . However, because of saturation of tanh activations (i.e. $\sup_{x\in \mathbb{R}}|\tanh (x)| = 1$ ) in Equation 4
396
+
397
+ $$
398
+ \lim _ {\tau \rightarrow \infty} \Lambda^ {*} (\tau) = \lim _ {\tau \rightarrow \infty} f (\tau) < \text {s o f t p l u s} \left(\sum_ {d = 1} ^ {D} | w _ {d} ^ {(3)} | + b ^ {(3)}\right) < \infty
399
+ $$
400
+
401
+ Therefore, the PDF doesn't integrate to 1.
402
+
403
+ 2. The FullyNN model assigns a non-zero amount of probability mass to the $(-\infty, 0)$ interval, which violates the assumption that inter-event times are strictly positive.
404
+
405
+ Since the inter-event times $\tau$ are assumed to be strictly positive almost surely, it must hold that $\mathrm{Prob}(\tau \leq 0) = F^{*}(0) = 0$ , or equivalently $\Lambda^{*}(0) = 0$ . However, we can see that
406
+
407
+ $$
408
+ \Lambda^ {*} (0) = f (0) = \operatorname {s o f t p l u s} \left(\boldsymbol {W} ^ {(3)} \tanh \left(\boldsymbol {W} ^ {(2)} \tanh (\tilde {\boldsymbol {b}} ^ {(1)}) + \boldsymbol {b} ^ {(2)}\right) + \boldsymbol {b} ^ {(3)}\right) > 0
409
+ $$
410
+
411
+ which means that the FullyNN model permits negative inter-event times.
412
+
413
+ # D IMPLEMENTATION DETAILS
414
+
415
+ # D.1 SHARED ARCHITECTURE
416
+
417
+ We implement SOSFlow, DSFlow and LogNormMix, together with baselines: RMTPP (Gompertz distribution), exponential distribution and a FullyNN model. All of them share the same pipeline, from the data preprocessing to the parameter tuning and model selection, differing only in the way we calculate $p^*(\tau)$ . This way we ensure a fair evaluation. Our implementation uses Pytorch.<sup>3</sup>
418
+
419
+ From arival times $t_i$ we calculate the inter-event times $\tau_i = t_i - t_{i-1}$ . Since they can contain very large values, RNN takes log-transformed and centered inter-event time and produces $\pmb{h}_i \in \mathbb{R}^H$ . In case we have marks, we additionally input $m_i$ — the index of the mark class from which we get mark embedding vector $\pmb{m}_i$ . In some experiments we use extra conditional information, such as metadata $\pmb{y}_i$ and sequence embedding $\pmb{e}_j$ , where $j$ is the index of the sequence.
420
+
421
+ As illustrated in Section 3.3 we generate the parameters $\pmb{\theta}$ of the distribution $p^*(\tau_i)$ from $[h_i||y_i||e_j]$ using an affine layer. We apply a transformation of the parameters to enforce the constraints, if necessary.
422
+
423
+ All decoders are implemented using a common framework relying on normalizing flows. By defining the base distribution $q(z)$ and the inverse transformation $(g_1^{-1} \circ \dots \circ g_M^{-1})$ we can evaluate the PDF $p^*(\tau)$ at any $\tau$ , which allows us to train with maximum likelihood (Section 3.1).
424
+
425
+ # D.2 LOG-NORMAL MIXTURE
426
+
427
+ The log-normal mixture distribution is defined in Equation 2. We generate the parameters of the distribution $\pmb{w} \in \mathbb{R}^{K}, \pmb{\mu} \in \mathbb{R}^{K}, \pmb{s} \in \mathbb{R}^{K}$ (subject to $\sum_{k} w_{k} = 1, w_{k} \geq 0$ and $s_{k} > 0$ ), using an affine transformation (Equation 3). The log-normal mixture is equivalent to the following normalizing flow model
428
+
429
+ $$
430
+ z _ {1} \sim \operatorname {G a u s s i a n M i x t u r e} (\boldsymbol {w}, \boldsymbol {\mu}, \boldsymbol {s})
431
+ $$
432
+
433
+ $$
434
+ z _ {2} = a z _ {1} + b
435
+ $$
436
+
437
+ $$
438
+ \tau = \exp (z _ {2})
439
+ $$
440
+
441
+ By using the affine transformation $z_{2} = az_{1} + b$ before the exp transformation, we obtain a better initialization, and thus faster convergence. This is similar to the batch normalization flow layer (Dinh et al., 2017), except that $b = \frac{1}{N}\sum_{i=1}^{N}\log\tau_{i}$ and $a = \sqrt{\frac{1}{N}\sum_{i=1}^{N}(\log\tau_{i} - b)}$ are estimated using the entire dataset, not using batches.
442
+
443
+ Forward direction samples a value from a Gaussian mixture, applies an affine transformation and applies exp. In the bacward direction we apply log-transformation to an observed data, center it with an affine layer and compute the density under the Gaussian mixture.
444
+
445
+ # D.3 BASELINES
446
+
447
+ We implement FullyNN model (Omi et al., 2019) as described in Appendix C, using the official implementation as a reference<sup>4</sup>. The model uses feed-forward neural network with non-negative weights (enforced by clipping values at 0 after every gradient step). Output of the network is a cumulative intensity function $\Lambda^{*}(\tau)$ from which we can easily get intensity function $\lambda^{*}(\tau)$ as a derivative w.r.t. $\tau$ using automatic differentiation in Pytorch. We get the PDF as $p^{*}(\tau) = \lambda^{*}(\tau)\exp (-\Lambda^{*}(\tau))$ .
448
+
449
+ We implement RMTPP / Gompertz distribution (Du et al., 2016) and the exponential distribution (Upadhyay et al., 2018) models as described in Appendix B.
450
+
451
+ All of the above methods define the distribution $p^*(\tau)$ . Since the inter-event times may come at very different scales, we apply a linear scaling $\tilde{\tau} = a\tau$ , where $a = \frac{1}{N}\sum_{i=1}^{N}\tau_i$ is estimated from the data. This ensures a good initialization for all models and speeds up training.
452
+
453
+ # D.4 DEEP SIGMOIDAL FLOW
454
+
455
+ A single layer of DSFlow model is defined as
456
+
457
+ $$
458
+ f _ {\boldsymbol {\theta}} ^ {D S F} (x) = \sigma^ {- 1} \left(\sum_ {k = 1} ^ {K} w _ {k} \sigma \left(\frac {x - \mu_ {k}}{s _ {k}}\right)\right)
459
+ $$
460
+
461
+ with parameters $\pmb{\theta} = \{\pmb{w} \in \mathbb{R}^K, \pmb{\mu} \in \mathbb{R}^K, \pmb{s} \in \mathbb{R}^K\}$ (subject to $\sum_{k} w_k = 1, w_k \geq 0$ and $s_k > 0$ ). We obtain the parameters of each layer using Equation 3.
462
+
463
+ We define $p(\tau)$ through the inverse transformation $(g_1^{-1} \circ \dots \circ g_M^{-1})$ , as described in Section 3.1.
464
+
465
+ $$
466
+ z _ {M} = g _ {M} ^ {- 1} (\tau) = \log \tau
467
+ $$
468
+
469
+ .
470
+
471
+ $$
472
+ z _ {m} = g _ {m} ^ {- 1} \big (z _ {m + 1} \big) = f _ {\pmb {\theta} _ {m}} ^ {D S F} \big (z _ {m + 1} \big)
473
+ $$
474
+
475
+ .
476
+
477
+ $$
478
+ z _ {1} = \sigma (z _ {2})
479
+ $$
480
+
481
+ $$
482
+ z _ {1} \sim q _ {1} (z _ {1}) = \operatorname {U n i f o r m} (0, 1)
483
+ $$
484
+
485
+ We use the batch normalization flow layer (Dinh et al., 2017) between every pair of consecutive layers, which significantly speeds up convergence.
486
+
487
+ # D.5 SUM-OF-SQUARES POLYNOMIAL FLOW
488
+
489
+ A single layer of SOSFlow model is defined as
490
+
491
+ $$
492
+ f ^ {S O S} (x) = a _ {0} + \sum_ {k = 1} ^ {K} \sum_ {p = 0} ^ {R} \sum_ {q = 0} ^ {R} \frac {a _ {p , k} a _ {q , k}}{p + q + 1} x ^ {p + q + 1}
493
+ $$
494
+
495
+ There are no constraints on the polynomial coefficients $\pmb{a} \in \mathbb{R}^{(R + 1) \times K}$ . We obtain $\pmb{a}$ similarly to Equation 3 as $\pmb{a} = \pmb{V}_{\pmb{a}}\pmb{c} + \pmb{b}_{\pmb{a}}$ , where $\pmb{c}$ is the context vector.
496
+
497
+ We define $p(\tau)$ by through the inverse transformation $(g_1^{-1}\circ \dots \circ g_M^{-1})$ , as described in Section 3.1.
498
+
499
+ .
500
+
501
+ ··
502
+
503
+ $$
504
+ \begin{array}{l} z _ {M} = g _ {M} ^ {- 1} (\tau) = \log \tau \\ z _ {m} = g _ {m} ^ {- 1} (z _ {m + 1}) = f _ {\pmb {\theta} _ {m}} ^ {S O S} (z _ {m + 1}) \\ z _ {1} = \sigma (z _ {2}) \\ z _ {1} \sim q _ {1} (z _ {1}) = \operatorname {U n i f o r m} (0, 1) \\ \end{array}
505
+ $$
506
+
507
+ Same as for DSFlow, we use the batch normalization flow layer between every pair of consecutive layers. When implementing SOSFlow, we used Pyro<sup>6</sup> for reference.
508
+
509
+ # D.6 REPARAMETRIZATION SAMPLING
510
+
511
+ Using a log-normal mixture model allows us to sample with reparametrization which proves to be useful, e.g. when imputing missing data (Section 5.4). In a score function estimator (Williams, 1992) given a random variable $x \sim p_{\theta}(x)$ , where $\theta$ are parameters, we can compute $\nabla_{\theta} \mathbb{E}_{x \sim p_{\theta}(x)}[f(x)]$ as $\mathbb{E}_{x \sim p_{\theta}(x)}[f(x) \nabla_{\theta} \log p_{\theta}(x)]$ . This is an unbiased estimator of the gradients but it often suffers from high variance. If the function $f$ is differentiable, we can obtain an alternative estimator using the reparametrization trick: $\epsilon \sim q(\epsilon), x = g_{\theta}(\epsilon)$ . Thanks to this reparametrization, we can compute $\nabla_{\theta} \mathbb{E}_{x \sim p_{\theta}(x)}[f(x)] = \mathbb{E}_{\epsilon \sim q(\epsilon)}[\nabla_{\theta} f(g_{\theta}(\epsilon))]$ . Such reparametrization estimator typically has lower variance than the score function estimator (Mohamed et al., 2019). In both cases, we estimate the expectation using Monte Carlo.
512
+
513
+ To sample with reparametrization from the mixture model we use the Straight-Through Gumbel Estimator (Jang et al., 2017). We first obtain a relaxed sample $\boldsymbol{z}^{*} = \mathrm{softmax}((\log \boldsymbol{w} + \boldsymbol{o}) / T)$ , where each $o_{i}$ is sampled i.i.d. from a Gumbel distribution with zero mean and unit scale, and $T$ is the temperature parameter. Finally, we get a one-hot sample $\boldsymbol{z} = \mathrm{onehot}(\arg \max_k z_k^*)$ . While a discrete $\boldsymbol{z}$ is used in the forward pass, during the backward pass the gradients will flow through the differentiable $\boldsymbol{z}^{*}$ .
514
+
515
+ The gradients obtained by the Straight-Through Gumbel Estimator are slightly biased, which in practice doesn't have a significant effect on the model's performance. There exist alternatives (Tucker et al., 2017; Grathwohl et al., 2018) that provide unbiased gradients, but are more expensive to compute.
516
+
517
+ # E DATASET STATISTICS
518
+
519
+ # E.1 SYNTHETIC DATA
520
+
521
+ Synthetic data is generated according to Omi et al. (2019) using well known point processes. We sample 64 sequences for each process, each sequence containing 1024 events.
522
+
523
+ **Poisson.** Conditional intensity function for a homogeneous (or stationary) Poisson point process is given as $\lambda^{*}(t) = 1$ . Constant intensity corresponds to exponential distribution.
524
+
525
+ Renewal. A stationary process defined by a log-normal probability density function $p(\tau)$ , where we set the parameters to be $\mu = 1.0$ and $\sigma = 6.0$ . Sequences appear clustered.
526
+
527
+ <table><tr><td>Dataset name</td><td>Number of sequences</td><td>Number of events</td></tr><tr><td>LastFM</td><td>929</td><td>1268385</td></tr><tr><td>Reddit</td><td>10000</td><td>672350</td></tr><tr><td>Stack Overflow</td><td>6633</td><td>480414</td></tr><tr><td>MOOC</td><td>7047</td><td>396633</td></tr><tr><td>Wikipedia</td><td>1000</td><td>157471</td></tr><tr><td>Yelp</td><td>300</td><td>215146</td></tr></table>
528
+
529
+ Table 2: Dataset statistics.
530
+
531
+ Self-correcting. Unlike the previous two, this point process depends on the history and is defined by a conditional intensity function $\lambda^{*}(t) = \exp (t - \sum_{t_i < t}1)$ . After every new event the intensity suddenly drops, inhibiting the future points. The resulting point patterns appear regular.
532
+
533
+ Hawkes. We use a self-exciting point process with a conditional intensity function given as $\lambda^{*}(t) = \mu +\sum_{t_i < t}\sum_{j = 1}^M\alpha_j\beta_j\exp (-\beta_j(t - t_i))$ . As per Omi et al. (2019), we create two different datasets: Hawkes1 with $M = 1$ , $\mu = 0.02$ , $\alpha_{1} = 0.8$ and $\beta_{1} = 1.0$ ; and Hawkes2 with $M = 2$ , $\mu = 0.2$ , $\alpha_{1} = 0.4$ , $\beta_{1} = 1.0$ , $\alpha_{2} = 0.4$ and $\beta_{2} = 20$ . For the imputation experiment we use Hawkes1 to generate the data and remove some of the events.
534
+
535
+ # E.2 REAL-WORLD DATA
536
+
537
+ In addition we use real-world datasets that are described bellow. Table 2 shows their summary. All datasets have a large amount of unique sequences and the number of events per sequence varies a lot. Using marked temporal point processes to predict the type of an event is feasible for some datasets (e.g. when the number of classes is low), and is meaningless for other.
538
+
539
+ LastFM. The dataset contains sequences of songs that selected users listen over time. Artists are used as an event type.
540
+
541
+ Reddit.8 On this social network website users submit posts to subreddits. In the dataset, most active subreddits are selected, and posts from the most active users on those subreddits are recoded. Each sequence corresponds to a list of submissions a user makes. The data contains 984 unique subreddits that we use as classes in mark prediction.
542
+
543
+ Stack Overflow. Users of a question-answering website get rewards (called badges) over time for participation. A sequence contains a list of rewards for each user. Only the most active users are selected and only those badges that users can get more than once.
544
+
545
+ MOOC.8 Contains the interaction of students with an online course system. An interaction is an event and can be of various types (97 unique types), e.g. watching a video, solving a quiz etc.
546
+
547
+ Wikipedia. $^{8}$ A sequence corresponds to edits of a Wikipedia page. The dataset contains most edited pages and users that have an activity (number of edits) above a certain threshold.
548
+
549
+ Yelp. $^{10}$ We use the data from the review forum and consider the reviews for the 300 most visited restaurants in Toronto. Each restaurant then has a corresponding sequence of reviews over time.
550
+
551
+ # F ADDITIONAL DISCUSSION OF THE EXPERIMENTS
552
+
553
+ # F.1 EVENT TIME PREDICTION USING HISTORY
554
+
555
+ Detailed setup. Each dataset consists of multiple sequences of inter-event times. We consider 10 train/validation/test splits of the sequences (of sizes $60\% /20\% /20\%$ ). We train all model parameters by minimizing the negative log-likelihood (NLL) of the training sequences, defined as $\mathcal{L}_{time}(\pmb {\theta}) =$
556
+
557
+ ![](images/b1ce88ecada651d525b271bcc586b1766fddaefb3aec2bf0c00b0125cba81555.jpg)
558
+ Figure 9: Models learn different conditional distribution $p(\tau|\mathcal{H})$ on Yelp dataset. Since check-ins occur during the opening hours, true distribution of the next check-in resembles the one on the right.
559
+
560
+ $-\frac{1}{N}\sum_{i = 1}^{N}\log p_{\pmb{\theta}}^{*}(\tau_{i})$ . After splitting the data into the 3 sets, we break down long training sequences into sequences of length at most 128. Optimization is performed using Adam (Kingma & Ba, 2015) with learning rate $10^{-3}$ . We perform training using mini-batches of 64 sequences. We train for up to 2000 epochs (1 epoch = 1 full pass through all the training sequences). For all models, we compute the validation loss at every epoch. If there is no improvement for 100 epochs, we stop optimization and revert to the model parameters with the lowest validation loss.
561
+
562
+ We select hyperparameter configuration for each model that achieves the lowest average loss on the validation set. For each model, we consider different values of $L_{2}$ regularization strength $C \in \{0,10^{-5},10^{-3}\}$ . Additionally, for SOSFlow we tune the number of transformation layers $M \in \{1,2,3\}$ and for DSFlow $M \in \{1,2,3,5,10\}$ . We have chosen the values of $K$ such that the mixture model has approximately the same number of parameters as a 1-layer DSFlow or a 1-layer FullyNN model. More specifically, we set $K = 64$ for LogNormMix, DSFlow and FullyNN. We found all these models to be rather robust to the choice of $K$ , as can be seen in Table 3 for LogNormMix. For SOSFlow we used $K = 4$ and $R = 3$ , resulting in a polynomial of degree 7 (per each layer). Higher values of $R$ led to unstable training, even when using batch normalization.
563
+
564
+ Additional discussion. In this experiment, we only condition the distribution $p^*(\tau_i)$ on the history embedding $h_i$ . We don't learn sequence embeddings $e_j$ since they can only be learned for the training sequences, and not fore the validation/test sets.
565
+
566
+ There are two important aspects related to the NLL loss values that we report. First, the absolute loss values can be arbitrarily shifted by rescaling the data. Assume, that we have a distribution $p(\tau)$ that models the distribution of $\tau$ . Now assume that we are interested in the distribution $q(x)$ of $x = a\tau$ (for $a > 0$ ). Using the change of variables formula, we obtain $\log q(x) = \log p(\tau) + \log a$ . This means that by simply scaling the data we can arbitrarily offset the log-likelihood score that we obtain. Therefore, the absolute values of the (negative) log-likelihood $\mathcal{L}$ for different models are of little interest — all that matters are the differences between them.
567
+
568
+ The loss values are dependent on the train/val/test split. Assume that model 1 achieves loss values $\mathcal{L}_1 = \{1.0,3.0\}$ on two train/val/test splits, and model 2 achieves $\mathcal{L}_2 = \{2.0,4.0\}$ on the same splits. If we first aggregate the scores and report the average $\hat{\mathcal{L}}_1 = 2.0\pm 1.0,\hat{\mathcal{L}}_2 = 3.0\pm 1.0$ , it may seem that the difference between the two models is not significant. However, if we first compute the differences and then aggregate $(\mathcal{L}_2 - \mathcal{L}_1) = 1.0\pm 0.0$ we see a different picture. Therefore, we use the latter strategy in Figure 3. For completeness, we also report the numbers obtained using the first strategy in Table 4.
569
+
570
+ As a baseline, we also considered the constant intensity / exponential distribution model (Upadhyay et al., 2018). However, we excluded the results for it from Figure 3, since it consistently achieved the worst loss values and had high variance. We still include the results for the constant intensity model in Table 4. We also performed all the experiments on the synthetic datasets (Appendix E.1). The results are shown in Table 5, together with NLL scores under the true model. We see that LogNormMix and DSFlow, besides achieving the best results, recover the true distribution.
571
+
572
+ Finally, in Figure 9 we plot the conditional distribution $p(\tau|\mathcal{H})$ with models trained on Yelp dataset. The events represent check-ins into a specific restaurant. Since check-ins mostly happen during the opening hours, the inter-event time is likely to be on the same day (0h), next day (24h), the day after (48h), etc. LogNormMix can fully recover this behavior from data while others either cannot learn multimodal distributions (e.g. RMTPP) or struggle to capture it (e.g. FullyNN).
573
+
574
+ <table><tr><td>K</td><td>2</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td></tr><tr><td>Reddit</td><td>10.239</td><td>10.208</td><td>10.189</td><td>10.185</td><td>10.191</td><td>10.192</td></tr><tr><td>LastFM</td><td>-2.828</td><td>-2.879</td><td>-2.881</td><td>-2.880</td><td>-2.877</td><td>-2.860</td></tr><tr><td>MOOC</td><td>6.246</td><td>6.053</td><td>6.055</td><td>6.055</td><td>6.050</td><td>5.660</td></tr><tr><td>Stack Overflow</td><td>14.461</td><td>14.438</td><td>14.435</td><td>14.435</td><td>14.436</td><td>14.428</td></tr><tr><td>Wikipedia</td><td>8.399</td><td>8.389</td><td>8.385</td><td>8.384</td><td>8.384</td><td>8.386</td></tr><tr><td>Yelp</td><td>13.169</td><td>13.103</td><td>13.058</td><td>13.045</td><td>13.032</td><td>13.024</td></tr><tr><td>Poisson</td><td>1.006</td><td>0.992</td><td>0.991</td><td>0.991</td><td>0.990</td><td>0.991</td></tr><tr><td>Renewal</td><td>0.256</td><td>0.254</td><td>0.254</td><td>0.254</td><td>0.256</td><td>0.259</td></tr><tr><td>Self-correcting</td><td>0.831</td><td>0.785</td><td>0.782</td><td>0.783</td><td>0.784</td><td>0.784</td></tr><tr><td>Hawkes1</td><td>0.530</td><td>0.523</td><td>0.532</td><td>0.532</td><td>0.523</td><td>0.523</td></tr><tr><td>Hawkes2</td><td>0.036</td><td>0.026</td><td>0.024</td><td>0.024</td><td>0.026</td><td>0.024</td></tr></table>
575
+
576
+ Table 3: Performance of LogNormMix model for different numbers $K$ of mixture components.
577
+
578
+ <table><tr><td></td><td>Reddit</td><td>LastFM</td><td>MOOC</td><td>Stack Overflow</td><td>Wikipedia</td><td>Yelp</td></tr><tr><td>LogNormMix</td><td>10.19 ± 0.078</td><td>-2.88 ± 0.147</td><td>6.03 ± 0.092</td><td>14.44 ± 0.013</td><td>8.39 ± 0.079</td><td>13.02 ± 0.070</td></tr><tr><td>DSFlow</td><td>10.20 ± 0.074</td><td>-2.88 ± 0.148</td><td>6.03 ± 0.090</td><td>14.44 ± 0.019</td><td>8.40 ± 0.090</td><td>13.09 ± 0.065</td></tr><tr><td>SOSFlow</td><td>10.27 ± 0.106</td><td>-2.56 ± 0.133</td><td>6.27 ± 0.058</td><td>14.47 ± 0.049</td><td>8.44 ± 0.120</td><td>13.21 ± 0.068</td></tr><tr><td>FullyNN</td><td>10.23 ± 0.072</td><td>-2.84 ± 0.179</td><td>6.83 ± 0.152</td><td>14.45 ± 0.014</td><td>8.40 ± 0.086</td><td>13.04 ± 0.073</td></tr><tr><td>LogNormal</td><td>10.38 ± 0.077</td><td>-2.60 ± 0.140</td><td>6.53 ± 0.016</td><td>14.62 ± 0.013</td><td>8.52 ± 0.078</td><td>13.44 ± 0.074</td></tr><tr><td>RMTPP</td><td>10.88 ± 0.293</td><td>-1.30 ± 0.164</td><td>10.65 ± 0.023</td><td>14.51 ± 0.014</td><td>10.02 ± 0.085</td><td>13.36 ± 0.056</td></tr><tr><td>Exponential</td><td>11.07 ± 0.070</td><td>-1.28 ± 0.152</td><td>10.64 ± 0.026</td><td>18.48 ± 3.257</td><td>10.03 ± 0.083</td><td>13.78 ± 1.250</td></tr></table>
579
+
580
+ Table 4: Time prediction test NLL on real-world data.
581
+
582
+ # F.2 LEARNING WITH MARKS
583
+
584
+ Detailed setup. We use the same setup as in Section F.1, except two differences. For learning in a marked temporal point process, we mimic the architecture from Du et al. (2016). The RNN takes a tuple $(\tau_i, m_i)$ as input at each time step, where $m_i$ is the mark. Moreover, the loss function now includes a term for predicting the next mark: $\mathcal{L}_{total}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}[\log p_{\pmb{\theta}}^*(\tau_i) + \log p_{\pmb{\theta}}^*(m_i)]$ .
585
+
586
+ The next mark $m_i$ at time $t_i$ is predicted using a categorical distribution $p^*(m_i)$ . The distribution is parametrized by the vector $\pi_i$ , where $\pi_{i,c}$ is the probability of event $m_i = c$ . We obtain $\pi_i$ using the history embedding $h_i$ passed through a feedforward neural network
587
+
588
+ $$
589
+ \boldsymbol {\pi} _ {i} = \operatorname {s o f t m a x} \left(\boldsymbol {V} _ {\boldsymbol {\pi}} ^ {(2)} \tanh \left(\boldsymbol {V} _ {\boldsymbol {\pi}} ^ {(1)} \boldsymbol {h} _ {i} + \boldsymbol {b} _ {\boldsymbol {\pi}} ^ {(1)}\right) + \boldsymbol {b} _ {\boldsymbol {\pi}} ^ {(2)}\right)
590
+ $$
591
+
592
+ where $V_{\pi}^{(1)}, V_{\pi}^{(2)}b_{\pi}^{(1)}, b_{\pi}^{(2)}$ are the parameters of the neural network.
593
+
594
+ Additional discussion. In Figure 3 (right) we reported the differences in time NLL between different models $\mathcal{L}_{time}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}\log p_{\pmb{\theta}}^{*}(\tau_{i})$ . In Table 6 we additionally provide the total NLL $\mathcal{L}_{total}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}\left[\log p_{\pmb{\theta}}^{*}(\tau_{i}) + \log p_{\pmb{\theta}}^{*}(m_{i})\right]$ averaged over multiple splits.
595
+
596
+ Using marks as input to the RNN improves time prediction quality for all the models. However, since we assume that the marks are conditionally independent of the time given the history (as was done in earlier works), all models have similar mark prediction accuracy.
597
+
598
+ # F.3 LEARNING WITH ADDITIONAL CONDITIONAL INFORMATION
599
+
600
+ Detailed setup. In the Yelp dataset, the task is to predict the time $\tau_{i}$ until the next customer check-in, given the history of check-ins up until the current time $t_{i-1}$ . We want to verify our intuition that the distribution $p^{*}(\tau_{i})$ depends on the current time $t_{i-1}$ . For example, $p^{*}(\tau_{i})$ might be different depending on whether it's a weekday and / or it's an evening hour. Unfortunately, a model that processes the history with an RNN cannot easily obtain this information. Therefore, we provide this information directly as a context vector $\mathbf{y}_{i}$ when modeling $p^{*}(\tau_{i})$ .
601
+
602
+ The first entry of context vector $\pmb{y}_i \in \{0,1\}^2$ indicates whether the previous event $t_{i-1}$ took place on a weekday or a weekend, and the second entry indicates whether $t_{i-1}$ was in the 5PM-11PM time
603
+
604
+ <table><tr><td></td><td>Poisson</td><td>Renewal</td><td>Self-correcting</td><td>Hawkes1</td><td>Hawkes2</td></tr><tr><td>True model</td><td>0.999</td><td>0.254</td><td>0.757</td><td>0.453</td><td>-0.043</td></tr><tr><td>LogNormMix</td><td>0.99 ± 0.006</td><td>0.25 ± 0.010</td><td>0.78 ± 0.003</td><td>0.52 ± 0.047</td><td>0.02 ± 0.049</td></tr><tr><td>DSFlow</td><td>0.99 ± 0.006</td><td>0.25 ± 0.010</td><td>0.78 ± 0.002</td><td>0.52 ± 0.047</td><td>0.02 ± 0.050</td></tr><tr><td>SOSFlow</td><td>1.00 ± 0.013</td><td>0.25 ± 0.010</td><td>0.88 ± 0.011</td><td>0.59 ± 0.056</td><td>0.06 ± 0.046</td></tr><tr><td>FullyNN</td><td>1.00 ± 0.006</td><td>0.28 ± 0.013</td><td>0.78 ± 0.004</td><td>0.55 ± 0.047</td><td>0.06 ± 0.047</td></tr><tr><td>LogNormal</td><td>1.08 ± 0.008</td><td>0.25 ± 0.010</td><td>1.03 ± 0.006</td><td>0.55 ± 0.047</td><td>0.06 ± 0.049</td></tr><tr><td>RMTPP</td><td>0.99 ± 0.006</td><td>1.01 ± 0.023</td><td>0.78 ± 0.003</td><td>0.74 ± 0.057</td><td>0.69 ± 0.058</td></tr><tr><td>Exponential</td><td>0.99 ± 0.006</td><td>1.00 ± 0.023</td><td>0.94 ± 0.002</td><td>0.74 ± 0.055</td><td>0.69 ± 0.054</td></tr></table>
605
+
606
+ Table 5: Time prediction test NLL on synthetic data.
607
+
608
+ <table><tr><td></td><td colspan="2">Time NLL</td><td colspan="2">Total NLL</td><td colspan="2">Mark accuracy</td></tr><tr><td></td><td>Reddit</td><td>MOOC</td><td>Reddit</td><td>MOOC</td><td>Reddit</td><td>MOOC</td></tr><tr><td>LogNormMix</td><td>10.28 ± 0.066</td><td>5.75 ± 0.040</td><td>12.40 ± 0.094</td><td>7.58 ± 0.047</td><td>0.62±0.014</td><td>0.45±0.003</td></tr><tr><td>DSFlow</td><td>10.28 ± 0.073</td><td>5.78 ± 0.067</td><td>12.39 ± 0.064</td><td>7.52 ± 0.074</td><td>0.62±0.013</td><td>0.45±0.004</td></tr><tr><td>SOSFlow</td><td>10.35 ± 0.106</td><td>6.06 ± 0.084</td><td>12.49 ± 0.158</td><td>7.78 ± 0.107</td><td>0.62±0.013</td><td>0.46±0.009</td></tr><tr><td>FullyNN</td><td>10.41 ± 0.079</td><td>6.22 ± 0.224</td><td>12.51 ± 0.094</td><td>7.93 ± 0.230</td><td>0.63±0.013</td><td>0.46±0.004</td></tr><tr><td>LogNormal</td><td>10.42 ± 0.076</td><td>6.38 ± 0.019</td><td>12.51 ± 0.080</td><td>8.11 ± 0.026</td><td>0.62±0.013</td><td>0.42±0.005</td></tr><tr><td>RMTPP</td><td>11.15 ± 0.061</td><td>10.29 ± 0.209</td><td>13.26 ± 0.085</td><td>12.14 ± 0.220</td><td>0.62±0.014</td><td>0.41±0.006</td></tr></table>
609
+
610
+ Table 6: Time and total NLL and mark accuracy when learning a marked TPP.
611
+
612
+ window. To each of the four possibilities we assign a learnable 64-dimensional embedding vector. The distribution of $p^*(\tau_i)$ until the next event depends on the embedding vector of the time stamp $t_{i-1}$ of the most recent event.
613
+
614
+ # F.4 MISSING DATA IMPUTATION
615
+
616
+ Detailed setup. The dataset for the experiment is generated as a two step process: 1) We generate a sequence of 100 events from the model used for Hawkes1 dataset (Appendix E.1) resulting in a sequence of arrival times $\{t_1,\dots t_N\}$ , 2) We choose random $t_i$ and remove all the events that fall inside the interval $[t_i,t_{i + k}]$ where $k$ is selected such that the interval length is approximately $t_N / 3$ .
617
+
618
+ We consider three strategies for learning with missing data (shown in Figure 4 (left)):
619
+
620
+ a) No imputation. The missing block spans the time interval $[t_i, t_{i+k}]$ . We simply ignore the missing data, i.e., training objective $\mathcal{L}_{\text{time}}$ will include an inter-event time $\tau = t_{i+k} - t_i$ .
621
+ b) Mean imputation. We estimate the average inter-event time $\hat{\tau}$ from the observed data, and impute events at times $\{t_i + n\hat{\tau}$ for $n \in \mathbb{N}$ , such that $t_i + n\hat{\tau} < t_{i+k}$ . These imputed events are fed into the history-encoding RNN, but are not part of the training objective.
622
+ c) Sampling. The RNN encodes the history up to and including $t_i$ and produces $\pmb{h}_i$ that we use to define the distribution $p^*(\tau | \pmb{h}_i)$ . We draw a sample $\tau_j^{(imp)}$ from this distribution and feed it into the RNN. We keep repeating this procedure until the samples get past the point $t_{i+k}$ . The imputed inter-event times $\tau_j^{(imp)}$ are affecting the hidden state of the RNN (thus influencing the likelihood of future observed inter-event times $\tau_i^{(obs)}$ ).
623
+
624
+ We sample multiple such sequences in order to approximate the expected log-likelihood of the observed inter-event times $\mathbb{E}_{\tau^{(imp)}}\sim p^*\left[\sum_i\log p^* (\tau_i^{obs})\right]$ . Since this objective includes an expectation that depends on $p^*$ , we make use of reparametrization sampling to obtain the gradients w.r.t. the distribution parameters (Mohamed et al., 2019).
625
+
626
+ # F.5 SEQUENCE EMBEDDING
627
+
628
+ Detailed setup. When learning sequence embeddings, we train the model as described in Appendix F.1, besides one difference. First, we pre-train the sequence embeddings $e_j$ by disabling the his-
629
+
630
+ tory embedding $\pmb{h}_i$ and optimizing $-\frac{1}{N}\sum_{i}\log p_{\pmb{\theta}}(\tau_i|\pmb{e}_j)$ . Afterwards, we enable the history and minimize $-\frac{1}{N}\sum_{i}\log p_{\pmb{\theta}}(\tau_i|\pmb{e}_j,\pmb{h}_i)$ .
631
+
632
+ In Figure 6 the top row shows samples generated using $e_{SC}$ , embedding of a self-correcting sequence, the bottom row was generated using $e_{SC}$ , embedding of a renewal sequence, and the middle row was generated using $1/2(e_{SC} + e_{RN})$ , an average of the two embeddings.
intensityfreelearningoftemporalpointprocesses/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01daec945879ac4e3766c586f5abedc67987264f35a918a725ae99b9d6e8e0fe
3
+ size 687185
intensityfreelearningoftemporalpointprocesses/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f38061f385f1a3f14aaa806ea689c2f1b3a3347d55040a588144f568449b07d
3
+ size 896577
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:651741f670f9776e2e6c77875107ce728666c70e600f5da48bcebbcd00a5e82a
3
+ size 126867
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17528c09cd8281ecd14bbd9921c952c53cb965150a45b9b6c0b2a37691e5c10a
3
+ size 152299
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbb8cdf5bebc53fc75a274a5edcd7f22af3ac7c516971085c2b994e83cd6754d
3
+ size 460093
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/full.md ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IS A GOOD REPRESENTATION SUFFICIENT FOR SAMPLE EFFICIENT REINFORCEMENT LEARNING?
2
+
3
+ Simon S. Du
4
+
5
+ Institute for Advanced Study
6
+ ssdu@ias.edu
7
+
8
+ Sham M. Kakade
9
+
10
+ University of Washington, Seattle sham@cs.washington.edu
11
+
12
+ Ruosong Wang
13
+
14
+ Carnegie Mellon University ruosongw@andrew.cmu.edu
15
+
16
+ Lin F. Yang
17
+
18
+ University of California, Los Angeles
19
+ linyang@ee.ucla.edu
20
+
21
+ # ABSTRACT
22
+
23
+ Modern deep learning methods provide effective means to learn good representations. However, is a good representation itself sufficient for sample efficient reinforcement learning? This question has largely been studied only with respect to (worst-case) approximation error, in the more classical approximate dynamic programming literature. With regards to the statistical viewpoint, this question is largely unexplored, and the extant body of literature mainly focuses on conditions which permit sample efficient reinforcement learning with little understanding of what are necessary conditions for efficient reinforcement learning.
24
+
25
+ This work shows that, from the statistical viewpoint, the situation is far subtler than suggested by the more traditional approximation viewpoint, where the requirements on the representation that suffice for sample efficient RL are even more stringent. Our main results provide sharp thresholds for reinforcement learning methods, showing that there are hard limitations on what constitutes good function approximation (in terms of the dimensionality of the representation), where we focus on natural representational conditions relevant to value-based, model-based, and policy-based learning. These lower bounds highlight that having a good (value-based, model-based, or policy-based) representation in and of itself is insufficient for efficient reinforcement learning, unless the quality of this approximation passes certain hard thresholds. Furthermore, our lower bounds also imply exponential separations on the sample complexity between 1) value-based learning with perfect representation and value-based learning with a good-but-not-perfect representation, 2) value-based learning and policy-based learning, 3) policy-based learning and supervised learning and 4) reinforcement learning and imitation learning.
26
+
27
+ # 1 INTRODUCTION
28
+
29
+ Modern reinforcement learning (RL) problems are often challenging due to the huge state space. To tackle this challenge, function approximation schemes are often employed to provide a compact representation, so that reinforcement learning can generalize across states. A common paradigm is to first use a feature extractor to transform the raw input to features (a succinct representation) and then apply a linear predictor on top of the features. Traditionally, the feature extractor is often handcrafted (Sutton & Barto, 2018), while more modern methods often train a deep neural network to extract features. The hope of this paradigm is that, if there exists a good low dimensional (linear) representation, then efficient reinforcement learning is possible.
30
+
31
+ Empirically, combining various RL function approximation algorithms with neural networks for feature extraction has lead to tremendous successes on various tasks (Mnih et al., 2015; Schulman et al., 2015; 2017). A major problem, however, is that these methods often require a large amount of samples to learn a good policy. For example, deep $Q$ -network requires millions of samples to solve certain Atari games (Mnih et al., 2015). Here, one may wonder if there are fundamental statistical
32
+
33
+ limitations on such methods, and, if so, under what conditions it would be possible to efficiently learn a good policy?
34
+
35
+ In the supervised learning context, it is well-known that empirical risk minimization is a statistically efficient method when using a low-complexity hypothesis space (Shalev-Shwartz & Ben-David, 2014), e.g. a hypothesis space with bounded VC dimension. For example, polynomial number of samples suffice for learning a near-optimal $d$ -dimensional linear classifier, even in the agnostic setting<sup>1</sup>. In contrast, in the more challenging RL setting, we seek to understand if efficient learning is possible (say from a sample complexity perspective) when we have access to an accurate (and compact) parametric representation — e.g. our policy class contains a near-optimal policy or our hypothesis class accurately approximates the optimal value function. In particular, this work focuses on the following question:
36
+
37
+ # Is a good representation sufficient for sample-efficient reinforcement learning?
38
+
39
+ This question has largely been studied only with respect to approximation error in the more classical approximate dynamic programming literature, where it is known that algorithms are stable to certain worst-case approximation errors. With regards to sample efficiency, this question is largely unexplored, where the extant body of literature mainly focuses on conditions which are sufficient for efficient reinforcement learning though there is little understanding of what are necessary conditions for efficient reinforcement learning. In reinforcement learning, there is no direct analogue of empirical risk minimization as in the supervised learning context, and it is not evident what are the statistical limits of learning based on properties of our underlying hypothesis class (which may be value-based, policy-based, or model-based).
40
+
41
+ Many recent works have provided polynomial upper bounds under various sufficient conditions, and in what follows we list a few examples. For value-based learning, the work of Wen & Van Roy (2013) showed that for deterministic systems $^{2}$ , if the optimal $Q$ -function can be perfectly predicted by linear functions of the given features, then the agent can learn the optimal policy exactly with polynomial number of samples. Recent work (Jiang et al., 2017) further showed that if certain complexity measure called Bellman rank is bounded, then the agent can learn a near-optimal policy efficiently. For policy-based learning, Agarwal et al. (2019) gave polynomial upper bounds which depend on a parameter that measures the difference between the initial distribution and the distribution induced by the optimal policy.
42
+
43
+ Our Contributions. This paper gives, perhaps surprisingly, strong negative results to this question. The main results are exponential lower bounds in terms of planning horizon $H$ for value-based, model-based, and policy-based algorithms with given good representations<sup>3</sup>. Notably, the requirements on the representation that suffice for sample efficient RL are even more stringent than the more traditional approximation viewpoint. A comprehensive summary of previous upper bounds and our lower bounds is given in Table 1, and here we briefly summarize our hardness results.
44
+
45
+ 1. For value-based learning, we show even if $Q$ -functions of all policies can be approximated by linear functions of the given representation with approximation error $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ where $d$ is the dimension of the representation and $H$ is the planning horizon, then the agent still needs to sample exponential number of trajectories to find a near-optimal policy.
46
+ 2. For model-based learning, we show even if the transition matrix and the reward function can be approximated by linear functions of the given representation with approximation error $\delta = \Omega\left(\sqrt{\frac{H}{d}}\right)$ (in $\ell_{\infty}$ sense), the agent still needs to sample exponential number of trajectories to find a near-optimal policy.
47
+ 3. We show even if optimal policy can be perfectly predicted by a linear function of the given representation with a strictly positive margin, the agent still requires exponential number of trajectories to find a near-optimal policy.
48
+
49
+ These lower bounds hold even in deterministic systems and even if the agent knows the transition model. Note these negative results apply to the case where the $Q$ -function, the model, or the optimal policy can be predicted well by a linear function of the given representation. Since the class of linear functions is a strict subset of many more complicated function classes, including neural networks in particular, our negative results imply lower bounds for these more complex function classes as well. Our results highlight the following conceptual insights:
50
+
51
+ - The requirements on the representation that suffice for sample efficient RL are significantly more stringent than the more traditional approximation viewpoint; our statistical lower bounds show that there are hard thresholds on the worst-case approximation quality of the representation which are not necessary from the approximation viewpoint.
52
+ - Since our lower bounds apply even when the agent knows the transition model, the hardness is not due to the difficulty of exploration in the standard sense. The unknown reward function is sufficient to make the problem exponentially difficult.
53
+ - Our lower bounds are not due to the agent's inability to perform efficient supervised learning, since our assumptions do admit polynomial sample complexity upper bounds if the data distribution is fixed.
54
+ - Our lower bounds are not pathological in nature and suggest that these concerns may arise in practice. In a precise sense, almost all feature extractors induce a hard MDP instance in our construction (see Section 4.4).
55
+
56
+ Instead, one interpretation is that the hardness is due to a distribution mismatch in the following sense: the agent does not know which distribution to use for minimizing a (supervised) learning error (see Kakade (2003) for discussion), and even a known transition model is not information-theoretically sufficient to reduce the sample complexity.
57
+
58
+ Furthermore, our work implies several interesting exponential separations on the sample complexity between: 1) value-based learning with perfect representation and value-based learning with a good-but-not-perfect representation, 2) value-based learning and policy-based learning, 3) policy-based learning and supervised learning and 4) reinforcement learning and imitation learning. We provide more details in Section 5.
59
+
60
+ # 2 RELATED WORK
61
+
62
+ A summary of previous upper bounds, together with lower bounds proved in this paper, is provided in Table 1. Some key assumptions are formally stated in Section 3 and Section 4. Our lower bounds highlight that classical complexity measures in supervised learning including small approximation error and margin, and standard assumptions in reinforcement learning including optimality gap and deterministic systems, are not enough for efficient RL with function approximation. We need additional assumptions, e.g., ones used in previous upper bounds, for efficient RL.
63
+
64
+ # 2.1 PREVIOUS LOWER BOUNDS
65
+
66
+ Existing exponential lower bounds, to our knowledge, construct unstructured MDPs with an exponentially large state space and reduce a bandit problem with exponentially many arms to an MDP (Krishnamurthy et al., 2016; Sun et al., 2017). However, these lower bounds cannot apply to MDPs whose transition models, value functions, or policies can be approximated with some natural function classes, e.g., linear functions, neural networks, etc. The current paper gives the first set of lower bounds for RL with linear function approximation (and thus also hold for super classes of linear functions such as neural networks).
67
+
68
+ # 2.2 PREVIOUS UPPER BOUNDS
69
+
70
+ We divide previous algorithms (with provable guarantees) into three classes: those that utilize uncertainty-based bonuses (e.g. UCB variants or Thompson sampling variants); approximate dynamic programming variants (which often make assumptions with respect to concentrability coefficients); and direct policy search-based methods (such as conserve policy iteration (CPI, see Kakade (2003)) or policy gradient methods, which make assumptions with respect to distribution mismatch coefficients).
71
+
72
+ <table><tr><td>Query Oracle</td><td>RL</td><td>Generative Model</td><td>Known Transition</td></tr><tr><td colspan="4">Previous Upper Bounds</td></tr><tr><td>Exact linear Q* + DetMDP (Wen &amp; Van Roy, 2013)</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Exact linear Q* + Bellman-Rank (Jiang et al., 2017)</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Exact Linear Q* + Low Var + Gap (Du et al., 2019a)</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Exact Linear Q* + Gap (Open Problem / Theorem C.1)</td><td>?</td><td>✓</td><td>✓</td></tr><tr><td>Exact Linear Qπ for all π (Open Problem / Theorem D.1)</td><td>?</td><td>✓</td><td>✓</td></tr><tr><td>Approx. Linear Qπ for all π + Concentratability (Munos, 2005; Antos et al., 2008)</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Approx. Linear Qπ for all π + Bounded Dist Mismatch Coeff (Kakade &amp; Langford, 2002)</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td colspan="4">Lower Bounds (this work)</td></tr><tr><td>Approx Linear Q* (Theorem 4.1)</td><td>×</td><td>×</td><td>×</td></tr><tr><td>Approx Linear Qπ for all π (Theorem 4.1)</td><td>×</td><td>×</td><td>×</td></tr><tr><td>l∞ Approx Linear MDP (Theorem 4.2)</td><td>×</td><td>×</td><td>×</td></tr><tr><td>Exact Linear π* + Margin + Gap + DetMDP (Theorem 4.3)</td><td>×</td><td>×</td><td>×</td></tr><tr><td>Exact Linear Q* (Open Problem)</td><td>?</td><td>?</td><td>?</td></tr></table>
73
+
74
+ Table 1: Summary of theoretical results on reinforcement learning with linear function approximation. See Section 2 for discussion on this table. RL, Generative Model, Known Transition are defined in Section 3.3. Exact linear $Q^{*}$ : Assumption 4.1 with $\delta = 0$ . Approx linear $Q^{*}$ : Assumption 4.1 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . Exact linear $\pi^{*}$ : Assumption 4.4. Margin: Assumption 4.5. Exact Linear $Q^{\pi}$ for all $\pi$ : Assumption 4.2 with $\delta = 0$ . Approximate Linear $Q^{\pi}$ for all $\pi$ : Assumption 4.2 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . DetMDP: deterministic system defined in Section 3.1. Bellman-rank: Definition 5 in Jiang et al. (2017). Low Var: Assumption 1 in Du et al. (2019b). Gap: Assumption 3.1. Bounded Distribution Mismatch Coefficient: Definition 3.3 in Agarwal et al. (2019). $\ell_{\infty}$ Approx Linear MDP: Assumption 4.3 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . $\checkmark$ : there exists an algorithm with polynomial sample complexity to find a near-optimal policy. $\checkmark$ : requires certain condition on the initial distribution. $\times$ : exponential number of samples is required. ?: open problem.
75
+
76
+ The first class of methods include those based on witness rank, Belman rank, and the Eluder dimension, while the latter two classes of algorithms make assumptions either on concentrability coefficients or on distribution mismatch coefficients (see Agarwal et al. (2019); Scherrer (2014) for discussions).
77
+
78
+ Uncertainty bonus-based algorithms. Now we discuss existing theoretical results on value-based learning with function approximation. The most relevant work is Wen & Van Roy (2013) which showed in deterministic systems, if the optimal $Q$ -function is within a pre-specified function class which has bounded Eluder dimension, for which the class of linear functions is a special case, then the agent can learn the optimal policy using polynomial number of samples. This result has recently been generalized by Du et al. (2019a) which can deal with stochastic reward and low variance transition but requires strictly positive optimality gap. As we listed in Table 1, it is an open problem whether the condition that the optimal $Q$ -function is linear itself is sufficient for efficient RL.
79
+
80
+ Li et al. (2011) proposed a $Q$ -learning algorithm which requires the Know-What-It-Knows oracle. However, it is in general unknown how to implement such oracle in practice. Jiang et al. (2017) proposed the concept of Bellman Rank to characterize the sample complexity of value-based learning methods and gave an algorithm that has polynomial sample complexity in terms of the Bellman Rank, though the proposed algorithm is not computationally efficient. Bellman rank is bounded for a wide range of problems, including MDP with small number of hidden states, linear MDP, LQR, etc. Later work gave computationally efficient algorithms for certain special cases (Dann et al., 2018; Du et al., 2019a; Yang & Wang, 2019b; Jin et al., 2019). Recently, Witness rank, a generalization of Bellman rank to model-based methods, is studied in Sun et al. (2019).
81
+
82
+ Approximate dynamic programming-based algorithms. We now discuss approximate dynamic programming-based results characterized in terms of the concentrability coefficient. While classical approximate dynamic programming results typically require $\ell_{\infty}$ -bounded errors, the notion of concentrability (originally due to (Munos, 2005)) permits sharper bounds in terms of average-case function approximation error, provided that the concentrability coefficient is bounded (e.g. see Munos (2005); Szepesvári & Munos (2005); Antos et al. (2008); Geist et al. (2019)). Under the assumption that this problem-dependent parameter is bounded, Munos (2005); Szepesvári & Munos (2005) and Antos et al. (2008) proved sample complexity and error bounds for approximate dynamic programming methods when there is a data collection policy (under which value-function fitting occurs) that induces a finite concentrability coefficient. The assumption that the concentrability coefficient is finite is in fact quite limiting. See Chen & Jiang (2019) which provides a more detailed discussion on this quantity.
83
+
84
+ Direct policy search-based algorithms. Stronger guarantees over approximate dynamic programming-based algorithm can be obtained with direct policy search-based methods, where instead of having a bounded concentrability coefficient, one only needs to have a bounded distribution mismatch coefficient. The latter assumption requires the agent to have access to a "good" initial state distribution (e.g. a measure which has coverage over where an optimal policy tends to visit); note that this assumption does not make restrictions over the class of MDPs. There are two classes of algorithms that fall into this category. First, there is Conservative Policy Iteration (Kakade & Langford, 2002), along with Policy Search by Dynamic Programming (PSDP) (Bagnell et al., 2004), and other boosting-style of policy search-based methods Scherrer & Geist (2014); Scherrer (2014), which have guarantees in terms of bounded distribution mismatch ratio. Second, more recently, Agarwal et al. (2019) showed that policy gradient styles of algorithms also have comparable guarantees.
85
+
86
+ Recent extensions. Subsequent to this work, the work by Van Roy & Dong (2019) and Lattimore & Szepesvari (2019) made notable contributions to the misspecified linear bandit problem. In particular, both papers found that Theorem 4.1 in our paper can be extended to the misspecified linear bandit problem and gave upper bounds for this problem showing that our lower bound has tight dependency on $\delta$ and $d$ . Lattimore & Szepesvari (2019) further gave an upper bound for the setting where the $Q$ -functions of all policies can be approximated by linear functions with small approximation errors and the agent can interact with the environment using a generative model. This upper bound also demonstrates that our lower bound has tight dependency on $\delta$ and $d$ .
87
+
88
+ # 3 PRELIMINARIES
89
+
90
+ Throughout this paper, for a given integer $H$ , we use $[H]$ to denote the set $\{0,1,\ldots ,H - 1\}$ .
91
+
92
+ # 3.1 EPISODIC REINFORCEMENT LEARNING
93
+
94
+ Let $\mathcal{M} = (\mathcal{S},\mathcal{A},H,P,R)$ be an Markov Decision Process (MDP) where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space whose size is bounded by a constant, $H\in \mathbb{Z}_{+}$ is the planning horizon, $P:S\times \mathcal{A}\to \triangle (\mathcal{S})$ is the transition function which takes a state-action pair and returns a distribution over states and $R:S\times \mathcal{A}\rightarrow \triangle (\mathbb{R})$ is the reward distribution. Without loss of generality, we assume a fixed initial state $s_0^4$ . A policy $\pi :S\to \triangle (\mathcal{A})$ prescribes a distribution over actions for each state. The policy $\pi$ induces a (random) trajectory $s_0,a_0,r_0,s_1,a_1,r_1,\ldots ,s_{H - 1},a_{H - 1},r_{H - 1}$ where $a_0\sim \pi (s_0),r_0\sim R(s_0,a_0),s_1\sim P(s_0,a_0),a_1\sim \pi (s_1)$ , etc. To streamline our analysis, for each $h\in [H]$ , we use $\mathcal{S}_h\subseteq \mathcal{S}$ to denote the set of states at level $h$ , and we assume $\mathcal{S}_h$ do not intersect with each other. We also assume $\sum_{h = 0}^{H - 1}r_h\in [0,1]$ almost surely. Our goal is to find a policy $\pi$ that maximizes the expected total reward $\mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi \right]$ . We use $\pi^{*}$ to denote the optimal policy. We say a policy $\pi$ is $\varepsilon$ -optimal if $\mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi \right]\geq \mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi^*\right] - \varepsilon$ .
95
+
96
+ In this paper we prove lower bounds for deterministic systems, i.e., MDPs with deterministic transition $P$ , deterministic reward $R$ . In this setting, $P$ and $R$ can be regarded as functions instead of distributions. Since deterministic systems are special cases of general stochastic MDPs, lower bounds proved in this paper still hold for more general MDPs.
97
+
98
+ # 3.2 $Q$ -FUNCTION AND OPTIMALITY GAP
99
+
100
+ An important concept in RL is the $Q$ -function. Given a policy $\pi$ , a level $h \in [H]$ and a state-action pair $(s, a) \in S_h \times \mathcal{A}$ , the $Q$ -function is defined as $Q_h^\pi(s, a) = \mathbb{E}\left[\sum_{h' = h}^{H-1} r_{h'} \mid s_h = s, a_h = a, \pi\right]$ . For simplicity, we denote $Q_h^*(s, a) = Q_h^{\pi^*}(s, a)$ . In addition to these definitions, we list below an important assumption, the optimality gap assumption, which is widely used in reinforcement learning and bandit literature. To state the assumption, we first define the function $\mathrm{gap}: S \times \mathcal{A} \to \mathbb{R}$ as $\mathrm{gap}(s, a) = \arg \max_{a' \in \mathcal{A}} Q^*(s, a') - Q^*(s, a)$ . Now we formally state the assumption.
101
+
102
+ Assumption 3.1 (Optimality Gap). There exists $\rho >0$ such that $\rho \leq \mathrm{gap}(s,a)$ for all $(s,a)\in S\times \mathcal{A}$ with $\mathrm{gap}(s,a) > 0$ .
103
+
104
+ Here, $\rho$ is the smallest reward-to-go difference between the best set of actions and the rest. Recently, Du et al. (2019b) gave a provably efficient $Q$ -learning algorithm based on this assumption and Simchowitz & Jamieson (2019) showed that with this condition, the agent only incurs logarithmic regret in the tabular setting.
105
+
106
+ # 3.3 QUERY MODELS
107
+
108
+ Here we discuss three possible query oracles interacting with the MDP.
109
+
110
+ - RL: The most basic and weakest query oracle for MDP is the standard reinforcement learning query oracle where the agent can only interact with the MDP by choosing actions and observe the next state and the reward.
111
+ - Generative Model: A stronger query model assumes the agent can transit to any state (Kearns & Singh, 2002; Kakade, 2003; Sidford et al., 2018). This query model is available in certain robotic applications where one can control the robot to reach the target state.
112
+ - Known Transition: The strongest query model considered is that the agent can not only transit to any state, but also knows the whole transition function. In this model, only the reward is unknown.
113
+
114
+ In this paper, we will prove lower bounds for the strongest Known Transition query oracle. Therefore, our lower bounds also apply to RL and Generative Model query oracles.
115
+
116
+ # 4 MAIN RESULTS
117
+
118
+ In this section we formally present our lower bounds. We also discuss proof ideas in Section 4.4.
119
+
120
+ # 4.1 LOWER BOUND FOR VALUE-BASED LEARNING
121
+
122
+ We first present our lower bound for value-based learning. A common assumption is that the $Q$ -function can be predicted well by a linear function of the given features (representation) (Bertsekas & Tsitsiklis, 1996). Formally, the agent is given a feature extractor $\phi : S \times \mathcal{A} \to \mathbb{R}^d$ which can be hand-crafted or a pre-trained neural network that transforms a state-action pair to a $d$ -dimensional embedding. The following assumption states that the given feature extractor can be used to predict the $Q$ -function with approximation error at most $\delta$ using a linear function.
123
+
124
+ Assumption 4.1. There exists $\delta >0$ and $\theta_0,\theta_1,\ldots ,\theta_{H - 1}\in \mathbb{R}^d$ such that for any $h\in [H]$ and any $(s,a)\in \mathcal{S}_h\times \mathcal{A},|Q_h^* (s,a) - \langle \theta_h,\phi (s,a)\rangle |\leq \delta .$
125
+
126
+ Here $\delta$ is the approximation error, which indicates the quality of the representation. If $\delta = 0$ , then $Q$ -function can be perfectly predicted by a linear function of $\phi(\cdot, \cdot)$ . In general, $\delta$ becomes smaller as we increase the dimension of $\phi$ , since larger dimension usually has more expressive power. When the feature extractor is strong enough, previous papers (Chen & Jiang, 2019; Farahmand, 2011) assume that linear functions of $\phi$ can approximate the $Q$ -function of any policy.
127
+
128
+ Assumption 4.2 (Policy Completeness). There exists $\delta >0$ , such that for any $h\in [H]$ and any policy $\pi$ , there exists $\theta_h^\pi \in \mathbb{R}^d$ such that for any $(s,a)\in S_h\times \mathcal{A}$ , $|Q_h^\pi (s,a) - \langle \theta_h,\phi (s,a)\rangle |\leq \delta$ .
129
+
130
+ In the theoretical reinforcement learning literature, Assumption 4.2 is often called the (approximate) policy completeness assumption. This assumption is crucial in proving polynomial sample complexity guarantee for value iteration type of algorithms (Chen & Jiang, 2019; Farahmand, 2011).
131
+
132
+ The following theorem shows when $\delta = \Omega\left(\sqrt{\frac{H}{d}}\right)$ , the agent needs to sample exponential number of trajectories to find a near-optimal policy.
133
+
134
+ Theorem 4.1 (Exponential Lower Bound for Value-based Learning). There exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 4.2, such that any algorithm that returns a 1/2-optimal policy with probability 0.9 needs to sample $\Omega \left( \min \{|S|, 2^H, \exp(d\delta^2 / 16)\} \right)$ trajectories.
135
+
136
+ Note this lower bound also applies to MDPs that satisfy Assumption 4.1, since Assumption 4.2 is strictly stronger. We would like to emphasize that since linear functions is a subclass of more complicated function classes, e.g., neural networks, our lower bound also holds for these function classes. Moreover, in many scenarios, the feature extractor $\phi$ is the last layer of a neural network. Modern neural networks are often over-parameterized, which makes $d$ large. In this case, $d$ is much larger than $H$ . Thus, our lower bound holds even if the representation has small approximation error. Furthermore, the assumption that $|\mathcal{A}| = 2$ is only for simplicity. Our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ , in which case the sample complexity lower bound is $\Omega \left( \min \{|S|, |\mathcal{A}|^H, \exp(d\delta^2 / 16)\} \right)$ .
137
+
138
+ # 4.2 LOWER BOUND FOR MODEL-BASED LEARNING
139
+
140
+ Here we present our lower bound for model-based learning. Recently, Yang & Wang (2019b) proposed the linear transition assumption which was later studied in Yang & Wang (2019a); Jin et al. (2019). Again, we assume the agent is given a feature extractor $\phi : S \times \mathcal{A} \to \mathbb{R}^d$ , and now we state the assumption formally as follow.
141
+
142
+ Assumption 4.3 (Approximate Linear MDP). There exists $\delta > 0$ , $\beta_0, \beta_1, \ldots, \beta_{H-1} \in \mathbb{R}^d$ and $\psi : S \to \mathbb{R}^d$ such that for any $h \in [H-1]$ , $(s,a) \in S_h \times A$ and $s' \in S_{h+1}$ , $|P(s'| s,a) - \langle \psi(s'), \phi(s,a) \rangle| \leq \delta$ and $|\mathbb{E}[R(s,a)] - \langle \beta_h, \phi(s,a) \rangle| \leq \delta$ .
143
+
144
+ It has been shown in Yang & Wang (2019b;a); Jin et al. (2019) if $\| P(\cdot \mid s,a) - \langle \psi (\cdot),\phi (s,a)\rangle \| _1$ is bounded, then the problem admits an algorithm with polynomial sample complexity. Now we show that when $\delta = \Omega \left(\sqrt{\frac{H}{d}}\right)$ in Assumption 4.3, the agent needs exponential number of samples to find a near-optimal policy.
145
+
146
+ Theorem 4.2 (Exponential Lower Bound for Linear Transition Model). There exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 4.3, such that any algorithm that returns a $1/2$ -optimal policy with probability 0.9 needs to sample $\Omega \left( \min \{ |S|, 2^H, \exp(d\delta^2 / 16) \} \right)$ trajectories.
147
+
148
+ Again, our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ .
149
+
150
+ We do note that an $\ell_{\infty}$ approximation for a transition matrix may be a weak condition. Under the stronger condition that the transition matrix can be approximated well under the total variational distance, there exists polynomial sample complexity upper bounds that can tolerate approximation errors (Yang & Wang, 2019b;a; Jin et al., 2019).
151
+
152
+ # 4.3 LOWER BOUND FOR POLICY-BASED LEARNING
153
+
154
+ Next we present our lower bound for policy-based learning. This class of methods use function approximation on the policy and use optimization techniques, e.g., policy gradient, to find the optimal policy. In this paper, we focus on linear policies on top of a given representation. A linear policy $\pi$ is a policy of the form $\pi(s_h) = \arg \max_{a \in \mathcal{A}} \langle \theta_h, \phi(s_h, a) \rangle$ where $s_h \in S_h$ , $\phi(\cdot, \cdot)$ is a given feature extractor and $\theta_h \in \mathbb{R}^d$ is the linear coefficient. Note that applying policy gradient on softmax parameterization of the policy is indeed trying to find the optimal policy among linear policies.
155
+
156
+ Similar to value-based learning, a natural assumption for policy-based learning is that the optimal policy is realizable<sup>5</sup>, i.e., the optimal policy is linear.
157
+
158
+ Assumption 4.4. For any $h \in [H]$ , there exists $\theta_h \in \mathbb{R}^d$ that satisfies for any $s \in S_h$ , we have $\pi^*(s) \in \arg \max_a \langle \theta_h, \phi(s, a) \rangle$ .
159
+
160
+ Here we discuss another assumption. For learning a linear classifier in the supervised learning setting, one can reduce the sample complexity significantly if the optimal linear classifier has a margin.
161
+
162
+ Assumption 4.5. We assume $\phi(s, a) \in \mathbb{R}^d$ satisfies $\|\phi(s, a)\|_2 = 1$ for any $(s, a) \in S \times \mathcal{A}$ . For any $h \in [H]$ , there exists $\theta_h \in \mathbb{R}^d$ with $\|\theta_h\|_2 = 1$ and $\triangle > 0$ such that for any $s \in S_h$ , there is a unique optimal action $\pi^*(s)$ , and for any $a \neq \pi^*(s)$ , $\langle \theta_h, \phi(s, \pi^*(s)) \rangle - \langle \theta_h, \phi(s, a) \rangle \geq \triangle$ .
163
+
164
+ Here we restrict the linear coefficients and features to have unit norm for normalization. Note that Assumption 4.5 is strictly stronger than Assumption 4.4. Now we present our result for linear policy.
165
+
166
+ Theorem 4.3 (Exponential Lower Bound for Policy-based Learning). There exists an absolute constant $\triangle_0$ , such that for any $\triangle \leq \triangle_0$ , there exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 3.1 with $\rho = \frac{1}{2\min\{H,d\}}$ and Assumption 4.5, such that any algorithm that returns a $1/4$ -optimal policy with probability at least 0.9 needs to sample $\Omega\left(\min\{2^H, 2^d\}\right)$ trajectories.
167
+
168
+ Again, our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ .
169
+
170
+ Compared with Theorem 4.1, Theorem 4.3 is even more pessimistic, in the sense that even with perfect representation with benign properties (gap and margin), the agent still needs to sample exponential number of samples. It also suggests that policy-based learning could be very different from supervised learning.
171
+
172
+ # 4.4 PROOF IDEAS
173
+
174
+ The binary tree hard instance. All our lower bound are proved based on reductions from the following hard instance. In this instance, both the transition $P$ and the reward $R$ are deterministic. There are $H$ levels of states, which form a full binary tree of depth $H$ . There are $2^h$ states in level $h$ , and thus $2^H - 1$ states in total. Among all the $2^{H-1}$ states in level $H - 1$ , there is only one state with reward $R = 1$ , and for all other states in the MDP, the corresponding reward value $R = 0$ . Intuitively, to find a 1/2-optimal policy for such MDPs, the agent must enumerate all possible states in level $H - 1$ to find the state with reward $R = 1$ . Doing so intrinsically induces a sample complexity of $\Omega(2^H)$ . This intuition is formalized in Theorem A.1 using Yao's minimax principle (Yao, 1977).
175
+
176
+ Lower bound for value-based and model-based learning We now show how to construct a set of features so that Assumption 4.1-4.3 hold. Our main idea is to utilize the following fact regarding the identity matrix: $\varepsilon\text{-rank}(I_{2^H}) \leq O(H / \varepsilon^2)$ . Here for a matrix $A \in \mathbb{R}^{n \times n}$ , its $\varepsilon$ -rank (a.k.a approximate rank) is defined to be $\min \{\mathrm{rank}(B) : B \in \mathbb{R}^{n \times n}, \|A - B\|_{\infty} \leq \varepsilon\}$ , where we use $\|\cdot\|_{\infty}$ to denote the entry-wise $\ell_{\infty}$ norm of a matrix. The upper bound $\varepsilon\text{-rank}(I_n) \leq O(\log n / \varepsilon^2)$ was first proved in Alon (2009) using the Johnson-Lindenstrauss Lemma (Johnson & Lindenstrauss, 1984), and we also provide a proof in Lemma A.1. The concept of $\varepsilon$ -rank has wide applications in theoretical computer science (Alon, 2009; Barak et al., 2011; Alon et al., 2013; 2014; Chen & Wang, 2019), but to our knowledge, this is the first time that it appears in reinforcement learning.
177
+
178
+ This fact can be alternatively stated as follow: there exists $\Phi \in \mathbb{R}^{2^H\times O(H / \varepsilon^2)}$ such that $\| I_{2^H} - \Phi \Phi^\top \|_\infty \leq \varepsilon$ . We interpret each row of $\Phi$ as the feature of a state in the binary tree. By construction of $\Phi$ , now features of states in the binary tree have a nice property that (i) each feature vector has approximately unit norm and (ii) different feature vector are nearly orthogonal. Using this set of features, we can now show that Assumption 4.1-4.3 hold. Here we prove Assumption 4.1 holds as an example and prove other assumptions also hold in the appendix. To prove Assumption 4.1, we note that in the binary tree hard instance, for each level $h$ , only a single state satisfies $Q^{*} = 1$ , and all other states satisfy $Q^{*} = 0$ . We simply take $\theta_h$ to be the feature of the state with $Q^{*} = 1$ . Since all feature vectors are nearly orthogonal, Assumption 4.1 holds.
179
+
180
+ Since the above fact regarding the $\varepsilon$ -rank of the identity matrix can be proved by simply taking each row of $\Phi$ to be a random unit vector, our lower bound reveals another intriguing (yet pessimistic) aspect of Assumption 4.1-4.3: for the binary tree instance, almost all feature extractors induce a hard MDP instance. This again suggests that a good representation itself may not necessarily lead to efficient RL and additional assumptions (e.g. on the reward distribution) could be crucial.
181
+
182
+ Lower bound for policy-based learning. It is straightforward to construct a set of feature vectors for the binary tree instance so that Assumption 4.4 holds, even if $d = 1$ . We set $\phi(s, a)$ to be $+1$ if $a = a_1$ and $-1$ if $a = a_2$ . For each level $h$ , for the unique state $s$ in level $h$ with $Q^* = 1$ , we set $\theta_h$ to be 1 if $\pi^*(s) = a_1$ and $-1$ if $\pi^*(s) = a_2$ . With this construction, Assumption 4.4 holds.
183
+
184
+ To prove that the lower bound under Assumption 4.5, we use a new reward function for states in level $H - 1$ in the binary tree instance above so that there exists a unique optimal action for each state in the MDP. See Figure 2 for an example with $H = 3$ levels of states. Another nice property of the new reward function is that for all states $s$ we always have $\pi^{*}(s) = a_{1}$ . Now, we define $2^{H - 1}$ different new MDPs as follows: for each state in level $H - 1$ , we change its original reward (defined in Figure 2) to 1. An exponential sample complexity lower bound for these MDPs can be proved using the same argument as the original binary tree hard instance, and now we show this set of MDPs satisfy Assumption 4.5. We first show in Lemma A.2 that there exists a set $\mathcal{N} \subseteq \mathbb{S}^{d - 1}$ with $|\mathcal{N}| = (1 / \triangle)^{\Omega(d)}$ , so that for each $p \in \mathcal{N}$ , there exists a hyperplane $L$ that separates $p$ and $\mathcal{N} \setminus \{p\}$ , and all vectors in $\mathcal{N}$ have distance at least $\triangle$ to $L$ . Equivalently, for each $p \in \mathcal{N}$ , we can always define a linear function $f_{p}$ so that $f_{p}(p) \geq \triangle$ and $f_{p}(q) \leq -\triangle$ for all $q \in \mathcal{N} \setminus \{p\}$ . This can be proved using standard lower bounds on the size of $\varepsilon$ -nets. Now we simply use vectors in $\mathcal{N}$ as features of states. By construction of the reward function, for each level $h$ , there could only be two possible cases for the optimal policy $\pi^{*}$ . I.e., either $\pi^{*}(s) = a_{1}$ for all states in level $h$ , or $\pi^{*}(s) = a_{2}$ for a unique state $s$ and $\pi^{*}(s') = a_{1}$ for all $s \neq s'$ . In both cases, we can easily define a linear function with margin $\triangle$ to implement the optimal policy $\pi^{*}$ , and thus Assumption 4.5 holds. Notice that in this proof, we critically relies on $d = \Theta(H)$ , so that we can utilize the curse of dimensionality to construct a large set of vectors as features.
185
+
186
+ # 5 SEPARATIONS
187
+
188
+ Perfect representation vs. good-but-not-perfect representation. For value-based learning in deterministic systems, Wen & Van Roy (2013) showed polynomial sample complexity upper bound when the representation can perfectly predict the $Q$ -function. In contrast, if the representation is only able to approximate the $Q$ -function, then the agent requires exponential number of trajectories. This exponential separation demonstrates a provable exponential benefit of better representation.
189
+
190
+ Value-based learning vs. policy-based learning. Note that if the optimal $Q$ -function can be perfectly predicted by the provided representation, then the optimal policy can also be perfectly
191
+
192
+ predicted using the same representation. Since Wen & Van Roy (2013) showed polynomial sample complexity upper bound when the representation can perfectly predict the $Q$ -function, our lower bound on policy-based learning, which applies to perfect representations, thus demonstrates that the ability of predicting the $Q$ -function is much stronger than that of predicting the optimal policy.
193
+
194
+ Supervised learning vs. reinforcement learning. For policy-based learning, if the planning horizon $H = 1$ , the problem becomes learning a linear classifier, for which there are polynomial sample complexity upper bounds. For policy-based learning, the agent needs to learn $H$ linear classifiers sequentially. Our lower bound on policy-based learning shows the sample complexity dependency on $H$ is exponential.
195
+
196
+ Imitation learning vs. reinforcement learning. In imitation learning (IL), the agent can observe trajectories induced by the optimal policy (expert). If the optimal policy is linear in the given representation, it can be shown that the simple behavior cloning algorithm only requires polynomial number of samples to find a near-optimal policy (Ross et al., 2011). Our Theorem 4.3 shows if the agent cannot observe expert's behavior, then it requires exponential number of samples. Therefore, our lower bound shows there is an exponential separation between policy-based RL and IL when function approximation is used.
197
+
198
+ # 6 ACKNOWLEDGMENTS
199
+
200
+ The authors would like to thank Yuping Luo, Wenlong Mou, Martin Wainwright, Mengdi Wang and Yifan Wu for insightful discussions. Also, the authors would also like to gratefully acknowledge Benjamin Van Roy, Shi Dong, Tor Lattimore and Csaba Szepesvári for sharing a draft of their work and their comments. Simon S. Du is supported by NSF grant DMS-1638352 and theInfosys Membership. Sham M. Kakade acknowledges funding from the Washington Research Foundation Fund for Innovation in Data-Intensive Discovery; the NSF award CCF 1740551; and the ONR award N00014-18-1-2247. Ruosong Wang is supported in part by NSF IIS1763562, AFRL CogDeCON FA875018C0014, and DARPA SAGAMORE HR00111990016. Part of this work was done while Simon S. Du was visiting Google Brain Princeton and Ruosong Wang was visiting Princeton University.
201
+
202
+ # REFERENCES
203
+
204
+ Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. Optimality and approximation with policy gradient methods in markov decision processes. arXiv preprint arXiv:1908.00261, 2019.
205
+ Noga Alon. Perturbed identity matrices have high rank: Proof and applications. Combinatorics, Probability and Computing, 18(1-2):3-15, 2009.
206
+ Noga Alon, Troy Lee, Adi Shraibman, and Santosh Vempala. The approximate rank of a matrix and its algorithmic applications: approximate rank. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pp. 675-684. ACM, 2013.
207
+ Noga Alon, Troy Lee, and Adi Shraibman. The cover number of a matrix and its algorithmic applications. Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pp. 34, 2014.
208
+ Andras Antos, Csaba Szepesvari, and Rémi Munos. Learning near-optimal policies with bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71 (1):89-129, 2008.
209
+ Baruch Awerbuch and Robert Kleinberg. Online linear optimization and adaptive routing. Journal of Computer and System Sciences, 74(1):97-114, 2008.
210
+ J. A. Bagnell, Sham M Kakade, Jeff G. Schneider, and Andrew Y. Ng. Policy search by dynamic programming. In S. Thrun, L. K. Saul, and B. Schölkopf (eds.), Advances in Neural Information Processing Systems 16, pp. 831-838. MIT Press, 2004.
211
+
212
+ Boaz Barak, Zeev Dvir, Amir Yehudayoff, and Avi Wigderson. Rank bounds for design matrices with applications to combinatorial geometry and locally correctable codes. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pp. 519-528. ACM, 2011.
213
+ Dimitri P Bertsekas and John N Tsitsiklis. Neuro-dynamic programming, volume 5. Athena Scientific Belmont, MA, 1996.
214
+ Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. arXiv preprint arXiv:1905.00360, 2019.
215
+ Lijie Chen and Ruosong Wang. Classical algorithms from quantum and arthur-merlin communication protocols. 10th Innovations in Theoretical Computer Science, 2019.
216
+ Christoph Dann, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. On polynomial time PAC reinforcement learning with rich observations. arXiv preprint arXiv:1803.00606, 2018.
217
+ Sanjoy Dasgupta and Anupam Gupta. An elementary proof of a theorem of johnson and lindenstrauss. _Random Structures & Algorithms_, 22(1):60-65, 2003.
218
+ Simon S Du, Akshay Krishnamurthy, Nan Jiang, Alekh Agarwal, Miroslav Dudík, and John Langford. Provably efficient RL with rich observations via latent state decoding. arXiv preprint arXiv:1901.09018, 2019a.
219
+ Simon S Du, Yuping Luo, Ruosong Wang, and Hanrui Zhang. Provably efficient $Q$ -learning with function approximation via distribution shift error checking oracle. arXiv preprint arXiv:1906.06321, 2019b.
220
+ Amir-massoud Farahmand. Regularization in reinforcement learning. 2011.
221
+ Matthieu Geist, Bruno Scherrer, and Olivier Pietquin. A theory of regularized markov decision processes. arXiv preprint arXiv:1901.11275, 2019.
222
+ Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are PAC-learnable. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1704-1713. JMLR.org, 2017.
223
+ Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. arXiv preprint arXiv:1907.05388, 2019.
224
+ William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
225
+ Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pp. 267-274, 2002.
226
+ Sham Machandranath Kakade. On the sample complexity of reinforcement learning. PhD thesis, University of College London, 2003.
227
+ Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Mach. Learn., 49(2-3):209-232, November 2002. ISSN 0885-6125. doi: 10.1023/A:1017984413808. URL https://doi.org/10.1023/A:1017984413808.
228
+ Akshay Krishnamurthy, Alekh Agarwal, and John Langford. PAC reinforcement learning with rich observations. In Advances in Neural Information Processing Systems, pp. 1840-1848, 2016.
229
+ Tor Lattimore and Csaba Szepesvari. Learning with good feature representations in bandits and in rl with a generative model. arXiv preprint arXiv:1911.07676, 2019.
230
+ Lihong Li, Michael L Littman, Thomas J Walsh, and Alexander L Strehl. Knows what it knows: a framework for self-aware learning. Machine learning, 82(3):399-443, 2011.
231
+ GG Lorentz. Metric entropy and approximation. Bulletin of the American Mathematical Society, 72 (6):903-937, 1966.
232
+
233
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
234
+ Rémi Munos. Error bounds for approximate value iteration. In Proceedings of the National Conference on Artificial Intelligence, volume 20, pp. 1006. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005.
235
+ Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627-635, 2011.
236
+ Bruno Scherrer. Approximate policy iteration schemes: A comparison. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML'14. JMLR.org, 2014.
237
+ Bruno Scherrer and Matthieu Geist. Local policy search in a convex space and conservative policy iteration as boosted policy search. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 35-50. Springer, 2014.
238
+ John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889-1897, 2015.
239
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
240
+ S. Shalev-Shwartz and S. Ben-David. Understanding Machine Learning: From Theory to Algorithms. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. ISBN 9781107057135. URL https://books.google.com/books?id=ttJkAwAAQBAJ.
241
+ Aaron Sidford, Mengdi Wang, Xian Wu, Lin F Yang, and Yinyu Ye. Near-optimal time and sample complexities for solving discounted markov decision process with a generative model. arXiv preprint arXiv:1806.01492, 2018.
242
+ Max Simchowitz and Kevin Jamieson. Non-asymptotic gap-dependent regret bounds for tabular MDPs. 05 2019.
243
+ Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggravated: Differentiable imitation learning for sequential prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3309-3318. JMLR.org, 2017.
244
+ Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on Learning Theory, pp. 2898-2933, 2019.
245
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
246
+ Csaba Szepesvári and Rémi Munos. Finite time bounds for sampling based fitted value iteration. In Proceedings of the 22nd international conference on Machine learning, pp. 880-887. ACM, 2005.
247
+ Benjamin Van Roy and Shi Dong. Comments on the du-kakade-wang-yang lower bounds. arXiv preprint arXiv:1911.07910, 2019.
248
+ Zheng Wen and Benjamin Van Roy. Efficient exploration and value function generalization in deterministic systems. In Advances in Neural Information Processing Systems, pp. 3021-3029, 2013.
249
+ Lin F. Yang and Mengdi Wang. Reinforcement leaning in feature space: Matrix bandit, kernels, and regret bound. arXiv preprint arXiv:1905.10389, 2019a.
250
+ Lin F. Yang and Mengdi Wang. Sample-optimal parametric q-learning using linearly additive features. In International Conference on Machine Learning, pp. 6995-7004, 2019b.
251
+ Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In 18th Annual Symposium on Foundations of Computer Science (sfcs 1977), pp. 222-227. IEEE, 1977.
252
+
253
+ # A PROOFS OF LOWER BOUNDS
254
+
255
+ In this section we present our lower bounds. It will also be useful to define the value function of a given state $s \in S_h$ as $V_h^\pi(s) = \mathbb{E}\left[\sum_{h' = h}^{H - 1} r_{h'} \mid s_h = s, \pi\right]$ . For simplicity, we denote $V_h^* = V_h^{\pi^*}(s)$ . Throughout the appendix, for the $Q$ -function $Q_h^\pi$ and $Q_h^*$ and the value function $V_h^\pi$ and $V_h^*$ , we may omit $h$ from the subscript when it is clear from the context.
256
+
257
+ We first introduce the INDEX-QUERY problem, which will be useful in our lower bound arguments.
258
+
259
+ Definition A.1 (INDEX-QUERY). In the $\mathsf{INDQ}_n$ problem, there is an underlying integer $i^* \in [n]$ . The algorithm sequentially (and adaptively) outputs guesses $i \in [n]$ and queries whether $i = i^*$ . The goal is to output $i^*$ , using as few queries as possible.
260
+
261
+ Definition A.2 ( $\delta$ -correct algorithms). For a real number $\delta \in (0,1)$ , we say a randomized algorithm $\mathcal{A}$ is $\delta$ -correct for $\mathrm{INDQ}_n$ , if for any underlying integer $i^* \in [n]$ , with probability at least $1 - \delta$ , $\mathcal{A}$ outputs $i^*$ .
262
+
263
+ The following theorem states the query complexity of $\mathsf{INDQ}_n$ for 0.1-correct algorithms, whose proof is provided in Section B.1.
264
+
265
+ Theorem A.1. Any 0.1-correct algorithm $\mathcal{A}$ for $\mathrm{INDQ}_n$ requires at least $0.9n$ queries in the worst case.
266
+
267
+ # A.1 PROOF OF LOWER BOUND FOR VALUE-BASED LEARNING
268
+
269
+ In this section we prove Theorem 4.1. We need the following existential result, whose proof is provided in Section B.2.
270
+
271
+ Lemma A.1. For any $n > 2$ , there exists a set of vectors $\mathcal{P} = \{p_0, p_1, \ldots, p_{n-1}\} \subset \mathbb{R}^d$ with $d = \lceil 8 \ln n / \varepsilon^2 \rceil$ such that
272
+
273
+ 1. $\| p_i\| _2 = 1$ for all $0\leq i\leq n - 1$
274
+ 2. $|\langle p_i, p_j \rangle| \leq \varepsilon$ for any $0 \leq i, j \leq n - 1$ with $i \neq j$ .
275
+
276
+ Now we give the construction of the hard MDP instances. We first define the transitions and the reward functions. In the hard instances, both the rewards and the transitions are deterministic. There are $H$ levels of states, and level $h \in [H]$ contains $2^h$ distinct states. Thus we have $|\mathcal{S}| = 2^H - 1$ . If $|S| > 2^H - 1$ we simply add dummy states to the state space $S$ . We use $s_0, s_1, \ldots, s_{2^H - 2}$ to name these states. Here, $s_0$ is the unique state in level $h = 0$ , $s_1$ and $s_2$ are the two states in level $h = 1$ , $s_3, s_4, s_5$ and $s_6$ are the four states in level $h = 2$ , etc. There are two different actions, $a_1$ and $a_2$ , in the MDPs. For a state $s_i$ in level $h$ with $h < H - 1$ , playing action $a_1$ transits state $s_i$ to state $s_{2i + 1}$ and playing action $a_2$ transits state $s_i$ to state $s_{2i + 2}$ , where $s_{2i + 1}$ and $s_{2i + 2}$ are both states in level $h + 1$ . See Figure 1 for an example with $H = 3$ .
277
+
278
+ In our hard instances, $r(s, a) = 0$ for all $(s, a)$ pairs except for a unique state $s$ in level $H - 2$ and a unique action $a \in \{a_1, a_2\}$ . It is convenient to define $\overline{r}(s') = r(s, a)$ , if playing action $a$ transits $s$ to $s'$ . For our hard instances, we have $\overline{r}(s) = 1$ for a unique node $s$ in level $H - 1$ and $\overline{r}(s) = 0$ for all other nodes.
279
+
280
+ Now we define the features map $\phi(\cdot, \cdot)$ . Here we assume $d \geq 2 \cdot \lceil 8\ln 2 \cdot H / \delta^2 \rceil$ , and otherwise we can simply decrease the planning horizon so that $d \geq 2 \cdot \lceil 8\ln 2 \cdot H / \delta^2 \rceil$ . We invoke Lemma A.1 to get a set $\mathcal{P} = \{p_0, p_1, \ldots, p_{2^H - 1}\} \subset \mathbb{R}^{d/2}$ . For each state $s_i$ , $\phi(s_i, a_1) \in \mathbb{R}^d$ is defined to be $[p_i; 0]$ , and $\phi(s_i, a_2) \in \mathbb{R}^d$ is defined to be $[0; p_i]$ . This finishes the definition of the MDPs. We now show that no matter which state $s$ in level $H - 1$ satisfies $\overline{r}(s) = 1$ , the resulting MDP always satisfies Assumption 4.2.
281
+
282
+ Verifying Assumption 4.2. By construction, for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . For a given level $h$ and policy $\pi$ , we take $\theta_h^\pi$ to be $Q^\pi(s_h, a_h) \cdot \phi(s_h, a_h)$ . Now we show that $|Q^\pi(s, a) - \langle \theta_h^\pi, \phi(s, a) \rangle| \leq \delta$ for all states $s$ in level $h$ and $a \in \{a_1, a_2\}$ .
283
+
284
+ ![](images/8a79a54c85a4cae9654ece5402c948441f8732e1a50a3fa03dad3d842a0bdd3c.jpg)
285
+ Figure 1: An example with $H = 3$ . For this example, we have $\overline{r}(s_5) = 1$ and $\overline{r}(s) = 0$ for all other states $s$ . The unique state $s_5$ which satisfies $\overline{r}(s) = 1$ is marked as dash in the figure. The induced $Q^*$ function is marked on the edges.
286
+
287
+ Case I: $a \neq a_h$ . In this case, we have $Q^{\pi}(s,a) = 0$ and $\langle \theta_h^\pi, \phi(s,a) \rangle = 0$ , since $\theta_h^\pi$ and $\phi(s,a)$ do not have a common non-zero coordinate.
288
+
289
+ Case II: $a = a_h$ and $s \neq s_h$ . In this case, by the second property of $\mathcal{P}$ in Lemma A.1 and the fact that $Q^{\pi}(s_h, a_h) \leq 1$ , we have $|\langle \theta_h^\pi, \phi(s, a) \rangle| \leq \delta$ . Meanwhile, we have $Q^{\pi}(s, a) = 0$ .
290
+
291
+ Case III: $a = a_h$ and $s = s_h$ . In this case, we have $\langle \theta_h^\pi, \phi(s, a) \rangle = Q^\pi(s_h, a_h)$ .
292
+
293
+ Finally, we prove any algorithm that solves these MDP instances and succeeds with probability at least 0.9 needs to sample at least $\frac{9}{20} \cdot 2^H$ trajectories. We do so by providing a reduction from $\mathrm{INDQ}_{2^{H-1}}$ to solving MDPs. Suppose we have an algorithm for solving these MDPs, we show that such an algorithm can be transformed to solve $\mathrm{INDQ}_{2^{H-1}}$ . For a specific choice of $i^*$ in $\mathrm{INDQ}_{2^{H-1}}$ , there is a corresponding MDP instance with
294
+
295
+ $$
296
+ \overline {{r}} (s) = \left\{ \begin{array}{l l} 1 & \text {i f} s = s _ {i ^ {*} + 2 ^ {H - 1} - 1} \\ 0 & \text {o t h e r w i s e} \end{array} \right..
297
+ $$
298
+
299
+ Notice that for all MDPs that we are considering, the transition and features are always the same. Thus, the only thing that the learner needs to learn by interacting with the environment is the reward value. Since the reward value is non-zero only for states in level $H - 1$ , each time the algorithm for solving MDP samples a trajectory that ends at state $s_i$ where $s_i$ is a state in level $H - 1$ , we query whether $i^* = i - 2^{H - 1} + 1$ or not in INDQ $_{2^{H - 1}}$ , and return reward value 1 if $i^* = i - 2^{H - 1} + 1$ and 0 otherwise. If the algorithm is guaranteed to return a 1/2-optimal policy, then it must be able to find $i^*$ .
300
+
301
+ # A.2 PROOF OF LOWER BOUND FOR MODEL-BASED LEARNING
302
+
303
+ Proof of Theorem 4.2. We use the same construction as in the proof of Theorem 4.1. Note we just need to verify that the construction satisfies Assumption 4.3. By construction, for all $h \in \{1, 2, \ldots, H - 1\}$ , for each state $s'$ in level $h$ , there exists a unique $(s, a)$ pair such that playing action $a$ transits $s$ to $s'$ , and we take $\psi(s') = \phi(s, a)$ . We also take $\beta_h = 0$ for $h \in \{0, 1, \ldots, H - 4, H - 3\}$ and $\beta_{H - 2} = \phi(s, a)$ where $(s, a)$ is the unique pair with $R(s, a) = 1$ . Now, according to the design of $\phi(\cdot, \cdot)$ and Lemma A.1, Assumption 4.3 is satisfied.
304
+
305
+ # A.3 PROOF OF LOWER BOUND FOR POLICY-BASED LEARNING
306
+
307
+ In this section, we present our hardness results for linear policy learning. We first prove a weaker lower bound which only satisfies Assumption 4.4, and then prove Theorem 4.3.
308
+
309
+ Warmup: Lower Bound for Linear Policy Without Margin. To present the hardness results, we first give the construction of the hard instances. The transitions and rewards functions of these MDP instances are exactly the same as those in Section A.1. The main difference is in the definition of the feature map $\phi(\cdot, \cdot)$ . For this lower bound, we define $\phi(s, a) = 1 \in \mathbb{R}$ if $a = a_1$ and $\phi(s, a) = -1$ if $a = a_2$ . By construction, these MDPs satisfy Assumption 3.1 with $\rho = 1$ . We now show that no matter which state $s$ in level $H - 1$ satisfies $\overline{r}(s) = 1^6$ , the resulting MDP always satisfies Assumption 4.4.
310
+
311
+ **Verifying Assumption 4.4.** Recall that for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . We simply take $\theta_h$ to be 1 if $a_h = a_1$ , and take $\theta_h$ to be -1 if $a_h = a_2$ .
312
+
313
+ Using the same lower bound argument (by reducing INDEX-QUERY to MDPs), we have the following theorem.
314
+
315
+ Theorem A.2. There exists a family of MDPs and a feature map $\phi (\cdot ,\cdot)$ that satisfy Assumption 4.4 with $d = 1$ and Assumption 3.1 with $\rho = 1$ , such that any algorithm that returns a $1 / 2$ -optimal policy with probability at least 0.9 needs to sample $\Omega (2^H)$ trajectories.
316
+
317
+ Proof of Theorem 4.3 Now we prove Theorem 4.3. In order to prove Theorem 4.3, we need the following geometric lemma whose proof is provided in Section B.3.
318
+
319
+ Lemma A.2. Let $d \in \mathbb{N}_+$ be a positive integer and $\epsilon \in (0,1)$ be a real number. Then there exists a set of points $\mathcal{N} \subset \mathbb{S}^{d-1}$ with size $|\mathcal{N}| = \Omega(1/\epsilon^{d/2})$ such that for every point $x \in \mathcal{N}$ ,
320
+
321
+ $$
322
+ \inf _ {y \in \operatorname {c o n v} (\mathcal {N} \backslash \{x \})} \| x - y \| _ {2} \geq \epsilon / 2. \tag {1}
323
+ $$
324
+
325
+ Now we are ready to prove Theorem 4.3. In the proof we assume $H = d$ , since otherwise we can take $H$ and $d$ to be $\min \{H, d\}$ by decreasing the planning horizon $H$ or adding dummy dimensions to the feature extractor $\phi$ .
326
+
327
+ Proof of Theorem 4.3. We define a set of $2^{H - 1}$ deterministic MDPs. The transitions of these hard instances are exactly the same as those in Section A.1. The main difference is in the definition of the feature map $\phi (\cdot ,\cdot)$ and the reward function. Again in the hard instances, $r(s,a) = 0$ for all $s$ in the first $H - 2$ levels. Using the terminology in Section A.1, we have $\overline{r} (s) = 0$ for all states in the first $H - 1$ levels. Now we define $\overline{r} (s)$ for states $s$ in level $H - 1$ . We do so by recursively defining the optimal value function $V^{*}(\cdot)$ . The initial state $s_0$ in level 0 satisfies $V^{*}(s_{0}) = 1 / 2$ . For each state $s_i$ in the first $H - 2$ levels, we have $V^{*}(s_{2i + 1}) = V^{*}(s_{i})$ and $V^{*}(s_{2i + 2}) = V^{*}(s_{i}) - 1 / 2H$ . For each state $s_i$ in the level $h = H - 2$ , we have $\overline{r} (s_{2i + 1}) = V^{*}(s_{i})$ and $\overline{r} (s_{2i + 2}) = V^{*}(s_{i}) - 1 / 2H$ . This implies that $\rho = 1 / 2H$ . In fact, this implies a stronger property that each state has a unique optimal action. See Figure 2 for an example with $H = 3$ .
328
+
329
+ To define $2^{H - 1}$ different MDPs, for each state $s$ in level $H - 1$ of the MDP defined above, we define a new MDP by changing $\overline{r} (s)$ from its original value to 1. This also affects the definition of the optimal $V$ function for states in the first $H - 1$ levels. In particular, for each level $i\in \{0,1,2,\dots ,H - 2\}$ , we have changed the $V$ value of a unique state in level $i$ from its original value (at most $1 / 2$ ) to 1. By doing so we have defined $2^{H - 1}$ different MDPs. See Figure 3 for an example with $H = 3$ .
330
+
331
+ Now we define the feature function $\phi (\cdot ,\cdot)$ . We invoke Lemma A.2 with $\epsilon = 8\triangle$ and $d = H / 2 - 1$ . Since $\triangle$ is sufficiently small, we have $|\mathcal{N}|\geq 2^{H}$ . We use $\mathcal{P} = \{p_0,p_2,\dots ,p_{2^H -1}\} \subset \mathbb{R}^{H / 2 - 1}$ to denote an arbitrary subset of $\mathcal{N}$ with cardinality $2^{H}$ . By Lemma A.2, for any $p\in \mathcal{P}$ , the distance between $p$ and the convex hull of $\mathcal{P}\setminus \{p\}$ is at least $4\triangle$ . Thus, there exists a hyperplane $L$ which separates $p$ and $\mathcal{P}\setminus \{p\}$ , and for all points $q\in \mathcal{P}$ , the distance between $q$ and $L$ is at least $2\triangle$ . Equivalently, for each point $p\in \mathcal{P}$ , there exists $n_p\in \mathbb{R}^{H / 2 - 1}$ and $o_p\in \mathbb{R}$ such that $\| n_p\| _2 = 1$ , $|o_p|\leq 1$ and the linear function $f_{p}(q) = \langle q,n_{p}\rangle +o_{p}$ satisfies $f_{p}(p)\geq 2\triangle$ and $f_{p}(q)\leq -2\triangle$ for all $q\in \mathcal{P}\setminus \{p\}$ . Given the set $\mathcal{P} = \{p_0,p_2,\ldots ,p_{2^H -1}\} \subset \mathbb{R}^{H / 2 - 1}$ , we construct a new set
332
+
333
+ ![](images/83a127321cfb976637be2891582cc0875d266a233d9d50faf27f11cac10c8e28.jpg)
334
+ Figure 2: An example with $H = 3$ .
335
+
336
+ ![](images/0ebe02fa1fbebc79420a484860b26d422baaea12599b0b8b7f9c0f3f228171ff.jpg)
337
+ Figure 3: An example with $H = 3$ . Here we define a new MDP by changing $\overline{r}(s_5)$ from its original value $1/3$ to 1. This also affects the value of $V(s_2)$ and $V(s_0)$ .
338
+
339
+ $\overline{\mathcal{P}} = \{\overline{p}_0,\overline{p}_2,\dots ,\overline{p}_{2^H -1}\} \subset \mathbb{R}^{H / 2}$ , where $\overline{p}_i = [p_i;1]\in \mathbb{R}^{H / 2}$ . Thus $\| \overline{p}_i\| _2 = \sqrt{2}$ for all $\overline{p}_i\in \overline{\mathcal{P}}$ . Clearly, for each $\overline{p}\in \overline{\mathcal{P}}$ , there exists a vector $\omega_{\overline{p}}\in \mathbb{R}^{H / 2}$ such that $\langle \omega_{\overline{p}},\overline{p}\rangle \geq 2\triangle$ and $\langle \omega_{\overline{p}},\overline{q}\rangle \leq -2\triangle$ for all $\overline{q}\in \overline{\mathcal{P}}\setminus \{\overline{p}\}$ . It is also clear that $\| \omega_{\overline{p}}\| _2\leq \sqrt{2}$ . We take $\phi (s_i,a_1) = [0;\overline{p}_i]\in \mathbb{R}^H$ and $\phi (s_i,a_2) = [\overline{p}_i;0]\in \mathbb{R}^H$ .
340
+
341
+ We now show that all the $2^{H - 1}$ MDPs constructed above satisfy the linear policy assumption. Namely, we show that for any state $s$ in level $H - 1$ , after changing $\overline{r}(s)$ to be 1, the resulting MDP satisfies the linear policy assumption. As in Section A.1, for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . For each level $h$ , if $a_h = a_1$ , then we take $(\theta_h)_{H/2} = 1$ and $(\theta_h)_H = -1$ , and all other entries in $\theta_h$ are zeros. If $a_h = a_2$ , we use $\overline{p}$ to denote the vector formed by the first $H/2$ coordinates of $\phi(s_h, a_2)$ . By construction, we have $\overline{p} \in \overline{\mathcal{P}}$ . We take $\theta_h = [\omega_{\overline{p}}; 0]$ in this case. In any case, we have $\| \theta_h \|_2 \leq \sqrt{2}$ . Now for each level $h$ , if $a_h = a_1$ , then for all states $s$ in level $h$ , we have $\pi^*(s) = a_1$ . In this case, $\langle \phi(s, a_1), \theta_h \rangle = 1$ and $\langle \phi(s, a_2), \theta_h \rangle = -1$ for all states in level $h$ , and thus Assumption 4.5 is satisfied. If $a_h = a_2$ , then $\pi^*(s_h) = a_2$ and $\pi^*(s) = a_1$ for all states $s \neq s_h$ in level $h$ . By construction, we have $\langle \theta_h, \phi(s, a_1) \rangle = 0$ for all states $s$ in level $h$ , since $\theta_h$ and $\phi(s, a_1)$ do not have a common non-zero entry. We also have $\langle \theta_h, \phi(s_h, a_2) \rangle \geq 2\triangle$ and $\langle \theta_h, \phi(s, a_2) \rangle \leq -2\triangle$ for all states $s \neq s_h$ in level $h$ . Finally, we normalize all $\theta_h$ and $\phi(s, a)$ so that they all have unit norm. Since $\| \phi(s, a) \|_2 = \sqrt{2}$ for all $(s, a)$ pairs before normalization, Assumption 4.5 is still satisfied after normalization.
342
+
343
+ Finally, we prove any algorithm that solves these MDP instances and succeeds with probability at least 0.9 needs to sample at least $\Omega(2^H)$ trajectories. We do so by providing a reduction from $\mathrm{INDQ}_{2^{H-1}}$ to solving MDPs. Suppose we have an algorithm for solving these MDPs, we show that such an algorithm can be transformed to solve $\mathrm{INDQ}_{2^{H-1}}$ . For a specific choice of $i^*$ in $\mathrm{INDQ}_{2^{H-1}}$ , there is a corresponding MDP instance with
344
+
345
+ $$
346
+ \overline {{r}} (s) = \left\{ \begin{array}{l l} 1 & \text {i f} s = s _ {i ^ {*} + 2 ^ {H - 1} - 1} \\ \text {t h e o r i g i n a l (r e c u r s i v e l y d e f i n e d) v a l u e} & \text {o t h e r w i s e} \end{array} \right..
347
+ $$
348
+
349
+ Notice that for all MDPs that we are considering, the transition and features are always the same. Thus, the only thing that the learner needs to learn by interacting with the environment is the reward value. Since the reward value is non-zero only for states in level $H - 1$ , each time the algorithm for solving MDP samples a trajectory that ends at state $s_i$ where $s_i$ is a state in level $H - 1$ , we query whether $i^* = i - 2^{H - 1} + 1$ or not in $\mathsf{INDQ}_{2^{H - 1}}$ , and return reward value 1 if $i^* = i - 2^{H - 1} + 1$ and it original reward value otherwise. If the algorithm is guaranteed to return a 1/4-optimal policy, then it must be able to find $i^*$ .
350
+
351
+ ![](images/fdfb967fbbe38e243ba8d7adea04379a11faf7f12ee7e38661046df994697247.jpg)
352
+
353
+ # B TECHNICAL PROOFS
354
+
355
+ # B.1 PROOF OF THEOREM A.1
356
+
357
+ Proof. The proof is a straightforward application of Yao's minimax principle Yao (1977). We provide the full proof for completeness.
358
+
359
+ Consider an input distribution where $i^{*}$ is drawn uniformly at random from $[n]$ . Suppose there is a 0.1-correct algorithm for $\mathrm{INDQ}_n$ with worst-case query complexity $T$ such that $T < 0.9n$ . By averaging, there is a deterministic algorithm $\mathcal{A}'$ with worst-case query complexity $T$ , such that
360
+
361
+ $$
362
+ \operatorname * {P r} _ {i \sim [ n ]} \left[ \mathcal {A} ^ {\prime} \text {c o r r e c t l y o u t p u t s} i \text {w h e n} i ^ {*} = i \right] \geq 0. 9.
363
+ $$
364
+
365
+ We may assume that the sequence of queries made by $\mathcal{A}'$ is fixed. This is because (i) $\mathcal{A}'$ is deterministic and (ii) before $\mathcal{A}'$ correctly guesses $i^*$ , all responses that $\mathcal{A}'$ receives are the same (i.e., all guesses are incorrect). We use $S = \{s_1, s_2, \ldots, s_m\}$ to denote the sequence of queries made by $\mathcal{A}'$ . Notice that $m$ is the worst-case query complexity of $\mathcal{A}'$ . Suppose $m < 0.9n$ , there exist $0.1n$ distinct $i \in [n]$ such that $\mathcal{A}'$ will never guess $i$ , and will be incorrect if $i^*$ equals $i$ , which implies
366
+
367
+ $$
368
+ \operatorname * {P r} _ {i \sim [ n ]} \left[ \mathcal {A} ^ {\prime} \text {c o r r e c t l y o u t p u t s} i \text {w h e n} i ^ {*} = i \right] < 0. 9.
369
+ $$
370
+
371
+ ![](images/d79b0511702aefa6910e375e41b5ca68b7804eb0054a1d74a13eebf53e1b43c0.jpg)
372
+
373
+ # B.2 PROOF OF LEMMA A.1
374
+
375
+ We need the following tail inequality for random unit vectors, which will be useful for the proof of Lemma A.1.
376
+
377
+ Lemma B.1 (Lemma 2.2 in Dasgupta & Gupta (2003)). For a random unit vector $u$ in $\mathbb{R}^d$ and $\beta > 1$ , we have
378
+
379
+ $$
380
+ \operatorname * {P r} \left[ u _ {1} ^ {2} \geq \beta / d \right] \leq \exp ((1 + \ln \beta - \beta) / 2).
381
+ $$
382
+
383
+ In particular, when $\beta \geq 6$ , we have
384
+
385
+ $$
386
+ \operatorname * {P r} \left[ u _ {1} ^ {2} > \beta / d \right] \leq \exp (- \beta / 4).
387
+ $$
388
+
389
+ Proof of Lemma A.1. Let $\mathcal{Q} = \{q_1, q_2, \ldots, q_n\}$ be a set of $n$ independent random unit vectors in $\mathbb{R}^d$ with $d = \lceil 8 \ln n / \varepsilon^2 \rceil$ . We will prove that with probability at least $1/2$ , $\mathcal{Q}$ satisfies the two desired properties as stated in Lemma A.1. This implies the existence of such set $\mathcal{P}$ .
390
+
391
+ It is clear that $\| q_i\| _2 = 1$ for all $i\in [n]$ , since each $q_{i}$ is drawn from the unit sphere. We now prove that for any $i,j\in [n]$ with $i\neq j$ , with probability at least $1 - \frac{1}{n^2}$ , we have $|\langle q_i,q_j\rangle |\leq \varepsilon$ . Notice that this is sufficient to prove the lemma, since by a union bound over all the $\binom{n}{2} = n(n-1)/2$ possible pairs of $(i,j)$ , this implies that $\mathcal{Q}$ satisfies the two desired properties with probability at least $1/2$ .
392
+
393
+ Now, we prove that for two independent random unit vectors $u$ and $v$ in $\mathbb{R}^d$ with $d = \lceil 8\ln n / \varepsilon^2 \rceil$ , with probability at least $1 - \frac{1}{n^2}$ , $|\langle u,v\rangle |\leq \varepsilon$ . By rotational invariance, we assume that $v$ is a standard basis vector. I.e., we assume $v_{1} = 1$ and $v_{i} = 0$ for all $1 < i\leq d$ . Notice that now $\langle u,v\rangle$ is the magnitude of the first coordinate of $u$ . We finish the proof by invoking Lemma B.1 and taking $\beta = 8\ln n > 6$ .
394
+
395
+ # B.3 PROOF OF LEMMA A.2
396
+
397
+ Proof of Lemma A.2. Consider a $\sqrt{\epsilon}$ -packing $\mathcal{N}$ with size $\Omega(1/\epsilon^{d/2})$ on the $d$ -dimensional unit sphere $\mathbb{S}^{d-1}$ (for the existence of such a packing, see, e.g., Lorentz (1966)). Let $o$ be the origin. For two points $x, x' \in \mathbb{R}^d$ , we denote $|xx'| := \|x - x'\|_2$ the length of the line segment between $x, x'$ . Note that every two points $x, x' \in \mathcal{N}$ satisfy $|xx'| \geq \sqrt{\epsilon}$ .
398
+
399
+ To prove the lemma, it suffices to show that $\mathcal{N}$ satisfies the property equation 1. Consider a point $x\in \mathcal{N}$ , let $A$ be a hyperplane that is perpendicular to $x$ (notice that $x$ is a also a vector) and separates $x$ and every other points in $\mathcal{N}$ . We let the distance between $x$ and $A$ be the largest possible, i.e., $A$ contains a point in $\mathcal{N}\backslash \{x\}$ . Since $x$ is on the unit sphere and $\mathcal{N}$ is a $\sqrt{\epsilon}$ -packing, we have that $x$ is at least $\sqrt{\epsilon}$ away from every point on the spherical cap not containing $x$ , defined by the cutting plane $A$ . More formally, let $b$ be the intersection point of the line segment $ox$ and $A$ . Then
400
+
401
+ $$
402
+ \forall y \in \left\{y ^ {\prime} \in \mathbb {S} ^ {d - s}: \langle b, y ^ {\prime} \rangle \leq \| b \| _ {2} ^ {2} \right\}: \quad \| x - y \| _ {2} \geq \sqrt {\epsilon}.
403
+ $$
404
+
405
+ Indeed, by symmetry, $\forall y\in \{y^{\prime}\in \mathbb{S}^{d - 1}:\langle b,y^{\prime}\rangle \leq \| b\|_{2}^{2}\}$
406
+
407
+ $$
408
+ \left\| x - y \right\| _ {2} \geq \left\| x - z \right\| _ {2} \geq \sqrt {\epsilon}.
409
+ $$
410
+
411
+ where $z \in \mathcal{N} \cap A$ . Notice that the distance between $x$ and the convex hull of $\mathcal{N} \backslash \{x\}$ is lower bounded by the distance between $x$ and $A$ , which is given by $|bx|$ . Consider the triangles defined by $x, z, o, b$ . We have $bz \perp ox$ (note that $bz$ lies inside $A$ ). By Pythagorean theorem, we have
412
+
413
+ $$
414
+ \begin{array}{l} \left| b z \right| ^ {2} + \left| b x \right| ^ {2} = \left| x z \right| ^ {2}; \\ \vert b x \vert + \vert b o \vert = \vert x o \vert = 1; \\ \left| b z \right| ^ {2} + \left| b o \right| ^ {2} = \left| o z \right| ^ {2} = 1. \\ \end{array}
415
+ $$
416
+
417
+ Solve the above three equations for $|bx|$ , we have
418
+
419
+ $$
420
+ | b x | = | x z | ^ {2} / 2 \geq \epsilon / 2
421
+ $$
422
+
423
+ as desired.
424
+
425
+ ![](images/0e7fe1af73fc2108fff2c54e7eb2615af676e5c4dc2e392d98c4c7f8bd306c15.jpg)
426
+
427
+ # C EXACT LINEAR $Q^{*} + \mathrm{GAP}$ IN GENERATIVE MODEL
428
+
429
+ In this section we present and prove the following theorem.
430
+
431
+ Theorem C.1. Under Assumption 3.1, Assumption 4.2 and Generative Model query model, the agent can find the optimal $\pi^{*}$ with poly $\left(d,H,\frac{1}{\rho},\log \left(\frac{1}{\delta}\right)\right)$ queries with probability $1 - \delta$ for a given failure probability $\delta >0$ ,
432
+
433
+ Proof of Theorem C.1. We first describe the algorithm. For each level, the agent first constructs a barycentric spanner $\Lambda_h \triangleq \{\phi(s_h^1, a_h^1), \ldots, \phi(s_h^d, a_h^d)\} \subset \Phi_h \triangleq \{\phi(s, a)\}_{s \in S_h, a \in \mathcal{A}}$ (Awerbuch & Kleinberg, 2008). We have the property that any $\phi(s, a)$ with $s_h \in S_h, a \in \mathcal{A}$ , we have $c_{s,a}^1, \ldots, c_{s,a}^d \in [-1,1]$ such that $\phi(s, a) = \sum_{i=1}^{d} c_{s,a}^i \phi(s_h^i, a_h^i)$ .
434
+
435
+ The algorithm learns the optimal policy from $h = H - 1, \ldots, 0$ . At any level $h$ , we assume the agent has learned the optimal policy $\pi_{h'}^*$ at level $h' = h + 1, \ldots, H - 1$ .
436
+
437
+ Now we present a procedure to show how to learn the optimal policy at level $h$ . At level $h$ , the agent queries every vector $\phi(s_h^i, a_h^i)$ in $\Lambda_h$ for $\mathrm{poly}(d, \frac{1}{\rho}, \log(\frac{H}{\delta}))$ times and uses $\pi_{h+1}^*, \ldots, \pi_H^*$ as the roll-out to get the on-the-go reward. Note by the definition of $\pi^*$ and $Q^*$ , the on-the-go reward is an unbiased sample of $Q^*(s_h^i, a_h^i)$ . We denote $\widehat{Q}(s_h^i, a_h^i)$ the average of these on-the-go rewards. By Hoeffding inequality, it is easy to show with probability $1 - \frac{\delta}{H}$ , for all $i = 1, \ldots, d$ , $\left| \widehat{Q}(s_h^i, a_h^i) - Q^*(s_h^i, a_h^i) \right| \leq \mathrm{poly}\left(\frac{1}{d}, \rho\right)$ . Now we define our estimated $Q^*$ at level $h$ as follows: for any $(s, a) \in S_h \times \mathcal{A}$ , $\widehat{Q}(s, a) = \sum_{i=1}^{d} c_{s,a}^i \widehat{Q}(s_h^i, a_h^i)$ . By the boundedness property of $c_{s,a}$ , we know for any $(s, a) \in S_h \times \mathcal{A}$ , $\widehat{Q}(s, a) - Q^*(s, a) < \frac{\rho}{2}$ . Note this implies the policy induced by $\widehat{Q}$ is the same as $\pi^*$ . Therefore by induction we finish the proof.
438
+
439
+ ![](images/c73994f2b9912a7d23e6e5af9d995111db8b1aa1910c0363c047a07ef6d0e51c.jpg)
440
+
441
+ # D LINEAR $Q^{\pi}$ FOR ALL $\pi$ IN GENERATIVE MODEL
442
+
443
+ In this section we present and prove the following theorem.
444
+
445
+ Theorem D.1. Under Assumption 4.2 with $\delta = 0$ , in the Generative Model query model, there is an algorithm that finds an $\epsilon$ -optimal policy $\hat{\pi}$ using poly $(d,H,\frac{1}{\epsilon})$ trajectories with probability 0.99.
446
+
447
+ Proof of Theorem D.1. The algorithm is the same as the one in Theorem C.1 We only need to change the analysis. Suppose we are learning at level $h$ and we have learned policies $\pi_{h+1}, \ldots, \pi_{H-1}$ for level $h+1, h+2, \ldots, H-1$ , respectively. Because we use the roll-out policy $\pi_{h+1} \circ \dots \circ \pi_{H-1}$ , by Assumption 4.2 and the property of barycentric spanner, using the same argument in the proof of Theorem C.1, we know with probability $1 - 0.01 / H$ , we can learn a policy $\pi_h$ with poly $(d, H, \frac{1}{\epsilon})$ samples such that for any $s \in S_h$ , we know $\pi_h$ is only sub-optimal by $\frac{\epsilon}{H}$ from the $\tilde{\pi}_h$ where $\tilde{\pi}_h$ is the optimal policy at level $h$ such that $\pi_{h+1} \circ \dots \circ \pi_{H-1}$ is the fixed roll-out policy.
448
+
449
+ Now we can bound the sub-optimality of $\hat{\pi} \triangleq \pi_0 \circ \dots \circ \pi_{H - 1}$ :
450
+
451
+ $$
452
+ \begin{array}{l} V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) \\ = V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\tilde {\pi} _ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) \\ + V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) \\ + V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}). \\ \end{array}
453
+ $$
454
+
455
+ The first term is at least $-\frac{\epsilon}{H}$ by our estimation bound, The second term is positive by definition of $\tilde{\pi}_0$ . We can just recursively apply this argument to obtain
456
+
457
+ $$
458
+ \begin{array}{l} V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} \left(s _ {1}\right) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} \left(s _ {1}\right) \\ \geq V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) - \frac {\epsilon}{H}. \\ \geq V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) - \frac {2 \epsilon}{H}. \\ \end{array}
459
+ $$
460
+
461
+ $$
462
+ \begin{array}{l} > \dots \\ \geq - \epsilon . \\ \end{array}
463
+ $$
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44a492d8a533a9038681b78b6638de9d72a36886b90c2c8cd305952b39cb2dca
3
+ size 244977
isagoodrepresentationsufficientforsampleefficientreinforcementlearning/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50ef3d7bb80a0cbf64614720e8c7562b194913c4c8c1feb33421c8056219e888
3
+ size 1117464
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62ef81a093ad7173b154e4bbefb65b970b257a1219dce0becfd52c1bbb488927
3
+ size 319520
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a638cd17017ed680bd17b7cf4ef097a40865129c87d885bef540bb37c3eb140
3
+ size 376098
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d38e919cbd36d288d31036ead19a9c55c50ce24edbf946b4a9f80e703db9466
3
+ size 1615609
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/full.md ADDED
The diff for this file is too large to render. See raw diff
 
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f36b1bdf34577e6ee78cd9dec28a7b3bd9337bb7f59aa8d483581e82a4f159cf
3
+ size 1223476
kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1d0929b4911dd2ea156a86ffc4a0756ef124b296b4e58e2081a8458318e0ef9
3
+ size 2340152
kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0775043d7b6343d2f0d49cf7645aff23d5957ea120023d4948b54c740d680e2e
3
+ size 244601
kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2afdfcc01c6a2e812e168b2ac5e3e6146f7a9774db7eb5b1753661836c1b644
3
+ size 279622
kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5068179c9d4b0dbcb9021ce180fba6152d7d090bd5630df2811fba7a0b433a82
3
+ size 1236615
kernelizedwassersteinnaturalgradient/full.md ADDED
The diff for this file is too large to render. See raw diff
 
kernelizedwassersteinnaturalgradient/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5cee6fdad65735af2e0fa497f3b5bc80c5c7ae15e231d692cfde0e4088ed2e7b
3
+ size 1573269
kernelizedwassersteinnaturalgradient/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80476c7fc9d23aa06d1f69f0ff4afde747a5e044419d0b5d24a6d33256143168
3
+ size 1795865
learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee9ab6ee9d5dcea51b6fc3729cf8486608a53a93c024745154f61625eb1011dd
3
+ size 85531
learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f4476956b917538894dd634a4c77df3d0f8d00112d2b934ec87d5ac0b4495cc
3
+ size 104676
learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:166c94ed165852839f2a4e1cc16dccf03ee7fb7895ee6b0f2c6693a0dba9767e
3
+ size 1526457
learningcompositionalkoopmanoperatorsformodelbasedcontrol/full.md ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING COMPOSITIONAL KOOPMAN OPERATORS FOR MODEL-BASED CONTROL
2
+
3
+ Yunzhu Li*
4
+
5
+ MIT CSAIL
6
+
7
+ Hao He*
8
+
9
+ MIT CSAIL
10
+
11
+ Jiajun Wu
12
+
13
+ MIT CSAIL
14
+
15
+ Dina Katabi
16
+
17
+ MIT CSAIL
18
+
19
+ Antonio Torralba
20
+
21
+ MIT CSAIL
22
+
23
+ # ABSTRACT
24
+
25
+ Finding an embedding space for a linear approximation of a nonlinear dynamical system enables efficient system identification and control synthesis. The Koopman operator theory lays the foundation for identifying the nonlinear-to-linear coordinate transformations with data-driven methods. Recently, researchers have proposed to use deep neural networks as a more expressive class of basis functions for calculating the Koopman operators. These approaches, however, assume a fixed dimensional state space; they are therefore not applicable to scenarios with a variable number of objects. In this paper, we propose to learn compositional Koopman operators, using graph neural networks to encode the state into object-centric embeddings and using a block-wise linear transition matrix to regularize the shared structure across objects. The learned dynamics can quickly adapt to new environments of unknown physical parameters and produce control signals to achieve a specified goal. Our experiments on manipulating ropes and controlling soft robots show that the proposed method has better efficiency and generalization ability than existing baselines.
26
+
27
+ # 1 INTRODUCTION
28
+
29
+ Simulating and controlling complex dynamical systems, such as ropes or soft robots, relies on two key features of the dynamics model: first, it needs to be efficient for system identification and motor control; second, it needs to be generalizable to a complex, constantly evolving environments.
30
+
31
+ In practice, computational models for complex, nonlinear dynamical systems are often not efficient enough for real-time control (Mayne, 2000). The Koopman operator theory suggests that identifying nonlinear-to-linear coordinate transformations allows efficient linear approximation of nonlinear systems (Williams et al., 2015; Mauroy & Goncalves, 2016). Fast as they are, however, existing papers on Koopman operators focus on a single dynamical system, making it hard to generalize to cases where there are a variable number of components.
32
+
33
+ In contrast, recent advances in approximating dynamics models with deep nets have demonstrated its power in characterizing complex, generic environments. In particular, a few recent papers have explored the use of graph nets in dynamics modeling, taking into account the state of each object as well as their interactions. This allows their models to generalize to scenarios with a variable number of objects (Battaglia et al., 2016; Chang et al., 2017). Despite their strong generalization power, they are not as efficient in system identification and control, because deep nets are heavily over-parameterized, making optimization time-consuming and sample-inefficient.
34
+
35
+ In this paper, we propose compositional Koopman operators, integrating Koopman operators with graph networks for generalizable and efficient dynamics modeling. We build on the idea of encoding states into object-centric embeddings with graph neural networks, which ensures generalization power. But instead of using over-parameterized neural nets to model state transition, we identify the Koopman matrix and control matrix from data as a linear approximation of the nonlinear dynamical system. The linear approximation allows efficient system identification and control synthesis.
36
+
37
+ The main challenge of extending Koopman theory to multi-object systems is scalability. The number of parameters in the Koopman matrix scales quadratically with the number of objects, which harms the learning efficiency and leads to overfitting. To tackle this issue, we exploit the structure of the
38
+
39
+ ![](images/b3545f89479a813218deeff30868199df5b0fd4d65a7b6ae5f3ded7d32b04dd3.jpg)
40
+ Figure 1: Overview of our model. A graph neural network $\phi$ takes in the current state of the physical system $\boldsymbol{x}^t$ , and generates object-centric representations in the Koopman space $\boldsymbol{g}^t$ . We then use the block-wise Koopman matrix $K$ and control matrix $L$ identified from equation 6 or equation 8 to predict the Koopman embeddings in the next time step $\boldsymbol{g}^{t + 1}$ . Note that in $K$ and $L$ , object pairs of the same relation share the same sub-matrix. Another graph neural network $\psi$ maps $\boldsymbol{g}^{t + 1}$ back to the original state space, i.e., $\boldsymbol{x}^{t + 1}$ . The mapping between $\boldsymbol{g}^t$ and $\boldsymbol{g}^{t + 1}$ is linear and is shared across all time steps, where we can iteratively apply $K$ and $L$ to the Koopman embeddings and roll multiple steps into the future. The formulation enables efficient system identification and control synthesis.
41
+
42
+ underlying system and use the same block-wise Koopman sub-matrix for object pairs of the same relation. This significantly reduces the number of parameters that need to be identified by making it independent of the size of the system.
43
+
44
+ Our experiments include simulating and controlling ropes of variable lengths and soft robots of different shapes. The compositional Koopman operators are significantly more accurate than the state-of-the-art learned physics engines (Battaglia et al., 2016; Li et al., 2019b), and faster when adapting to new environments of unknown physical parameters. Our method also outperforms vanilla deep Koopman methods (Lusch et al., 2018; Morton et al., 2018) and Koopman models with manually-designed basis functions, which shows the advantages of using a structured Koopman matrix and graph neural networks. Please see our project page for demonstrating videos.
45
+
46
+ # 2 RELATED WORK
47
+
48
+ Koopman operators. The Koopman operator formalism of dynamical systems is rooted in the seminal works of Koopman and Von Neumann in the early 1930s (Koopman, 1931; Koopman & Neumann, 1932). The core idea is to map the state of a nonlinear dynamical system to an embedding space, over which we can linearly propagate into the future. Researchers have proposed various algorithms to explore the Koopman spectral properties from data. A large portion of them are in the class of dynamic mode decomposition (DMD) (Rowley et al., 2009; Schmid, 2010; Tu et al., 2014; Williams et al., 2015; Arbabi & Mezic, 2017). The linear representation will enable efficient prediction, estimation, and control using tools from linear dynamical systems (Williams et al., 2016; Proctor et al., 2018; Mauroy & Goncalves, 2019; Korda & Mezic, 2018). People have been using hand-designed Koopman observables for various modeling and control tasks (Brunton et al., 2016; Kaiser et al., 2017; Abraham et al., 2017; Bruder et al., 2019b; Arbabi et al., 2018). Some recent works have applied the method to the real world and successfully control soft robots with great precision (Bruder et al., 2019a; Mamakoukas et al., 2019).
49
+
50
+ However, hand-crafted basis functions sometimes fail to generalize to more complex environments. Learning these functions from data using neural nets turns out to generate a more expressive invariant subspace (Lusch et al., 2018; Takeishi et al., 2017) and has achieved successes in fluid control (Morton et al., 2018). Morton et al. (2019) has also extended the framework to account for uncertainty in the system by inferring a distribution over observations. Our model differs by explicitly modeling the compositionality of the underlying system with graph networks. It generalizes better to environments of a variable number of objects or soft robots of different shapes.
51
+
52
+ Learning-based physical simulators. Battaglia et al. (2016) and Chang et al. (2017) first explored learning a simulator from data by approximating object interactions with neural networks. These models are no longer bounded to hard-coded physical rules, and can adapt to scenarios where the underlying physics is unknown. Please refer to Battaglia et al. (2018) for a full review. Recently, Mrowca et al. (2018) and Li et al. (2019a) extended these models to approximate particle dynamics of deformable shapes and fluids. Flexible as they are, these models become less efficient during model adaptation in complex scenarios, because the optimization of neural networks usually needs a lot of
53
+
54
+ samples and compute, which limits its use in an online setting. Nagabandi et al. (2019a;b) proposed to use meta-learning for online adaptation, and have shown to be effective in simulated robots and a real legged millirobot. However, it is not clear whether their methods can generalize to systems with variable numbers of instances. The use of graph nets and Koopman operators in our model allows better generalization ability and enables efficient system identification as we only need to identify the transition matrices, which is essentially a least-square problem and can be solved very efficiently.
55
+
56
+ People have also used the learned physics engines for planning and control. Many previous papers in this direction learn a latent dynamics model together with a policy in a model-based reinforcement learning setup (Racanière et al., 2017; Hamrick et al., 2017; Pascanu et al., 2017; Hafner et al., 2019); a few alternatives use the learned model in model-predictive control (MPC) (Sanchez-Gonzalez et al., 2018; Li et al., 2019b; Janner et al., 2019). In this paper, we leverage the fact that the embeddings in the Koopman space are propagating linearly through time, which allows us to formulate the control problem as quadratic programming and optimize the control signals much more efficiently.
57
+
58
+ # 3 APPROACH
59
+
60
+ We first present the basics of Koopman operators: for a nonlinear dynamical system, the Koopman observation functions can map the state space to an embedding space where the dynamics become linear. We then discuss the compositional nature of physical systems and show how graph networks can be used to capture the compositionality.
61
+
62
+ # 3.1 THE KOOPMAN OPERATORS
63
+
64
+ Let $\boldsymbol{x}^t \in \mathcal{X} \subset \mathbb{R}^n$ be the state vector for the system at time step $t$ . We consider a non-linear discrete-time dynamical system described by $\boldsymbol{x}^{t + 1} = F(\boldsymbol{x}^t)$ . The Koopman operator (Koopman, 1931), denoted as $\mathcal{K}: \mathcal{F} \to \mathcal{F}$ , is a linear transformation defined by $\mathcal{K}g \triangleq g \circ F$ , where $\mathcal{F}$ is the collection of all functions (also referred to as observables) that form an infinite-dimensional Hilbert space. For every function $g: \mathcal{X} \to \mathbb{R}$ belonging to $\mathcal{F}$ , we have
65
+
66
+ $$
67
+ \left(\mathcal {K} g\right) \left(\boldsymbol {x} ^ {t}\right) = g \left(F \left(\boldsymbol {x} ^ {t}\right)\right) = g \left(\boldsymbol {x} ^ {t + 1}\right), \tag {1}
68
+ $$
69
+
70
+ making the function space $\mathcal{F}$ invariant under the action of the Koopman operator.
71
+
72
+ Although the theory guarantees the existence of the Koopman operator, its use in practice is limited by its infinite dimensionality. Most often, we assume there is an invariant subspace $\mathcal{G}$ of the Koopman operator. It spans by a set of base observation functions $\{g_1,\dots ,g_m\}$ and satisfies that $\mathcal{K}g\in \mathcal{G}$ for any $g\in \mathcal{G}$ . With a slightly abuse of the notation, we now use $g(\pmb {x}^t):\mathbb{R}^n\to \mathbb{R}^m$ to represent $[g_{1}(\pmb{x}^{t}),\dots ,g_{m}(\pmb{x}^{t})]^{T}$ . By constraining the Koopman operator on this invariant subspace, we get a finite-dimensional linear operator $K\in \mathbb{R}^{m\times m}$ that we refer as the Koopman matrix.
73
+
74
+ Traditionally, people hand-craft base observation functions from the knowledge of underlying physics. The system identification problem is then reduced to finding the Koopman matrix $K$ , which can be solved by linear regression given historical data of the system. Recently, researchers have also explored data-driven methods that automatically find the Koopman invariant subspace via representing the base observation functions $g(\pmb{x})$ via deep neural networks.
75
+
76
+ Although the original Koopman theory does not consider the system with external control inputs, researchers have found that linearly injecting control signals to the Koopman observation space can give us good numerical performance (Brunton et al., 2016; Bruder et al., 2019a). Mathematically, considering a dynamical system, $\boldsymbol{x}^{t + 1} = F(\boldsymbol{x}^t,\boldsymbol{u}^t)$ , with an external control input $\boldsymbol{u}^t$ , we aim to find the Koopman observation functions and the linear dynamics model in the form of
77
+
78
+ $$
79
+ g \left(\boldsymbol {x} ^ {t + 1}\right) = K g \left(\boldsymbol {x} ^ {t}\right) + L \boldsymbol {u} ^ {t}, \tag {2}
80
+ $$
81
+
82
+ where the coefficient matrix $L$ is referred to as the control matrix.
83
+
84
+ # 3.2 COMPOSITIONAL KOOPMAN OPERATORS
85
+
86
+ The dynamics of a physical system are governed by physical rules, which are usually shared across different subcomponents in the system. Explicitly modeling such compositionality enables more efficient system identification and control synthesis and provides better generalization ability.
87
+
88
+ Motivating example. Consider a system with $N$ balls moving in a 2D plane, each pair connected by a linear spring. Assume all balls have mass 1 and all springs share the same stiffness coefficient $k$ . We denote the $i$ 's ball's position as $(x_i, y_i)$ and its velocity as $(\dot{x}_i, \dot{y}_i)$ . For ball $i$ , equation 3 describes its dynamics, where $\boldsymbol{x}_i \triangleq [x_i, y_i, \dot{x}_i, \dot{y}_i]^T$ denotes ball $i$ 's state:
89
+
90
+ $$
91
+ \dot {\boldsymbol {x}} _ {i} = \left[ \begin{array}{c} \dot {x} _ {i} \\ \dot {y} _ {i} \\ \ddot {x} _ {i} \\ \ddot {y} _ {i} \end{array} \right] = \left[ \begin{array}{c} \dot {x} _ {i} \\ \dot {y} _ {i} \\ \sum_ {j = 1} ^ {N} k (x _ {j} - x _ {i}) \\ \sum_ {j = 1} ^ {N} k (y _ {j} - y _ {i}) \end{array} \right] = \underbrace {\left[ \begin{array}{c c c c} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ k - N k & 0 & 0 & 0 \\ 0 & k - N k & 0 & 0 \end{array} \right]} _ {\triangleq A} \underbrace {\left[ \begin{array}{c} x _ {i} \\ y _ {i} \\ \dot {x} _ {i} \\ \dot {y} _ {i} \end{array} \right]} _ {\triangleq B} + \sum_ {j \neq i} \underbrace {\left[ \begin{array}{c c c c} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ k & 0 & 0 & 0 \\ 0 & k & 0 & 0 \end{array} \right]} _ {\triangleq B} \left[ \begin{array}{c} x _ {j} \\ y _ {j} \\ \dot {x} _ {j} \\ \dot {y} _ {j} \end{array} \right]. \tag {3}
92
+ $$
93
+
94
+ We can represent the state of the whole system using the union of every ball's state, where $\pmb{x} = [x_1,\dots ,x_N]^T$ . Then the transition matrix is essentially a block matrix, where the matrix parameters are shared among the diagonal or off-diagonal blocks as shown in equation 4:
95
+
96
+ $$
97
+ \dot {\boldsymbol {x}} = \left[ \begin{array}{c} \dot {\boldsymbol {x}} _ {1} \\ \dot {\boldsymbol {x}} _ {2} \\ \vdots \\ \dot {\boldsymbol {x}} _ {N} \end{array} \right] = \left[ \begin{array}{c c c c} A & B & \dots & B \\ B & A & \dots & B \\ \vdots & \vdots & \ddots & \vdots \\ B & B & \dots & A \end{array} \right] \left[ \begin{array}{c} \boldsymbol {x} _ {1} \\ \boldsymbol {x} _ {2} \\ \vdots \\ \boldsymbol {x} _ {N} \end{array} \right]. \tag {4}
98
+ $$
99
+
100
+ Based on the linear spring system, we make three observations for multi-object systems.
101
+
102
+ - The system state is composed of the state of each individual object. The dimension of the whole system scales linearly with the number of objects. We formulate the system state by concatenating the state of every object, corresponding to an object-centric state representation.
103
+ - The transition matrix has a block-wise substructure. After assuming an object-centric state representation, the transition matrix naturally has a block-wise structure as shown in equation 4.
104
+ - The same physical interactions share the same transition block. The blocks in the transition matrix encode actual interactions and generalize across systems. $A$ and $B$ govern the dynamics of the linear spring system, and are shared by systems with a different number of objects.
105
+
106
+ These observations inspire us to exploit the structure of multi-object systems, instead of learning separate models for systems that contains different numbers of balls.
107
+
108
+ Compositional Koopman operators. Motivated by the linear spring system, we want to inject a good inductive bias to incorporate compositionality when applying the Koopman theory. This allows better generalization ability and more efficient system identification and better controller design. Figure 1 shows an overview of our model.
109
+
110
+ Considering a system with $N$ objects, we denote $\pmb{x}^t$ as the system state at time $t$ and $\pmb{x}_i^t$ is the state of the $i$ 'th object. We further denote $\pmb{g}^t \triangleq g(\pmb{x}^t)$ as the embedding of the state in the Koopman invariant space. In the rest of the paper, we call $\pmb{g}^t$ the Koopman embedding. Based on the observation we made in the case of linear spring system, we propose the following assumptions on the compositional structure of the Koopman embedding and the Koopman matrix.
111
+
112
+ - The Koopman embedding of the system is composed of the Koopman embedding of every objects. Similar to the decomposition in the state space, we assume the Koopman embedding can be divided into object-centric sub-embeddings, i.e. $\pmb{g}^t \in \mathbb{R}^{Nm}$ denoting the concatenation of $g_1^t, \dots, g_N^t$ , where we use $g_i^t = g_i(\pmb{x}^t) \in \mathbb{R}^m$ as the Koopman embedding for the $i$ 'th object.
113
+ - The Koopman matrix has a block-wise structure. It is natural to think the Koopman matrix is composed of block matrices after assuming an object-centric Koopman embeddings. In equation 5, $K_{ij} \in \mathbb{R}^{m \times m}$ and $L_{ij} \in \mathbb{R}^{m \times l}$ are blocks of the Koopman matrix and the control matrix, where $l$ is the dimension of the action for each object and $\boldsymbol{u}^t \in \mathbb{R}^{Nl}$ is the concatenation of $\boldsymbol{u}_1^t, \dots, \boldsymbol{u}_N^t$ denoting the total control signal at time $t$ :
114
+
115
+ $$
116
+ \left[ \begin{array}{c} \boldsymbol {g} _ {1} ^ {t + 1} \\ \vdots \\ \boldsymbol {g} _ {N} ^ {t + 1} \end{array} \right] = \left[ \begin{array}{c c c} K _ {1 1} & \dots & K _ {1 N} \\ \vdots & \ddots & \vdots \\ K _ {N 1} & \dots & K _ {N N} \end{array} \right] \left[ \begin{array}{c} \boldsymbol {g} _ {1} ^ {t} \\ \vdots \\ \boldsymbol {g} _ {N} ^ {t} \end{array} \right] + \left[ \begin{array}{c c c} L _ {1 1} & \dots & L _ {1 N} \\ \vdots & \ddots & \vdots \\ L _ {N 1} & \dots & L _ {N N} \end{array} \right] \left[ \begin{array}{c} \boldsymbol {u} _ {1} ^ {t} \\ \vdots \\ \boldsymbol {u} _ {N} ^ {t} \end{array} \right]. \tag {5}
117
+ $$
118
+
119
+ As we have seen in the case of linear spring system, those matrix blocks are not independent, but some of them share the same set of values.
120
+
121
+ - The same physical interactions shall share the same transition block. The equivalence between the blocks should reflect the equivalence of the interactions, where we use the same transition sub-matrix for object pairs of the same relation. For example, if the system is composed of $N$ identical objects interacting with the same relation, then, by symmetry, all the diagonal blocks should be the same, while all the off-diagonal blocks should also be the same. The repetitive structure allows us to efficiently identify the values using least squares regression.
122
+
123
+ # 3.3 LEARNING THE KOOPMAN EMBEDDINGS USING GRAPH NEURAL NETWORKS
124
+
125
+ For a physical system that contains $N$ objects, we represent the system at time $t$ using a directed graph $G^{t} = (O^{t},R)$ , where vertices $O^{t} = \{\pmb{o}_{i}^{t}\}_{i = 1}^{N}$ represent objects and edges $R = \{\pmb{r}_k\}_{k = 1}^{N^2}$ represent pair-wise relations. Specifically, $\pmb{o}_i^t = (\pmb{x}_i^t,\pmb{a}_i^o)$ , where $\pmb{x}_i^t$ is the state of object $i$ and $\pmb{a}_i^o$ is a one-hot vector indicating the object type, e.g., fixed or movable. For relation, we have $\pmb{r}_k = (u_k,v_k,\pmb{a}_k^r)$ , $1\leq u_{k},v_{k}\leq N$ , where $u_{k}$ and $v_{k}$ are integers denoting the end points of this directed edge, and $\pmb{a}_k^r$ is a one-hot vector denoting the type of the relation $k$ .
126
+
127
+ We use a graph neural network similar to Interaction Networks (IN) (Battaglia et al., 2016) to generate object-centric Koopman embeddings. IN defines an object function $f_{O}$ and a relation function $f_{R}$ to model objects and their relations in a compositional way. Similar to a message passing procedure, we calculate the edge effect $e_k^t = f_R(\pmb{o}_{u_k}^t,\pmb{o}_{v_k}^t,\pmb{a}_k^r)_{k = 1\dots N^2}$ , and node effect $g_i^t = f_O(\pmb{o}_i^t,\sum_{k\in \mathcal{N}_i}\pmb {e}_k^t)_{i = 1\dots N}$ , where $\mathcal{N}_i$ denotes the relations that point to the object $i$ and $\{\pmb {g}_i^t\}$ are the derived Koopman embeddings. We use this graph neural network, denoted as $\phi$ , to represent our Koopman observation function.
128
+
129
+ System identification. For a sequence of observations $\widetilde{\pmb{x}} = [\pmb{x}^1,\dots ,\pmb{x}^T]$ from time 1 to time $T$ we first map them to the Koopman space as $\widetilde{\pmb{g}} = [g^{1},\dots ,g^{T}]$ using the graph encoder $\phi$ where $\pmb{g}^{t} = \phi (\pmb{x}^{t})$ . We use $\pmb{g}^{i:j}$ to denote the sub-sequence $[g^i,\dots ,g^j ]$ . To identify the Koopman matrix, we solve the linear regression $\min_K\| Kg^{1:T - 1} - g^{2:T}\| _2$ . As a result, $K = g^{2:T}(g^{1:T - 1})^{\dagger}$ will asymptotically approach the Koopman operator $\mathcal{K}$ with an increasing $T$ . For cases where there are control inputs $\widetilde{\pmb{u}} = [\pmb{u}^1,\dots ,\pmb{u}^{T - 1}]$ , the calculation of the Koopman matrix and the control matrix is essentially solving a least squares problem w.r.t. the objective
130
+
131
+ $$
132
+ \min _ {K, L} \| K g ^ {1: T - 1} + L \widetilde {\boldsymbol {u}} - g ^ {2: T} \| _ {2}. \tag {6}
133
+ $$
134
+
135
+ As we mentioned in the Section 3.2, the dimension of the Koopman space is linear to the number of objects in the system, i.e., $\widetilde{\pmb{g}}\in \mathbb{R}^{Nm\times T}$ and $K\in \mathbb{R}^{Nm\times Nm}$ . If we do not enforce any structure on the Koopman matrix $K$ , we will have to identify $N^2 m^2$ parameters. Instead, we can significantly reduce the number by leveraging the assumption on the structure of $K$ . Assume we know some blocks ( $\{K_{ij}\}$ ) of the matrix $K$ are shared and in total there are $h$ different kinds of blocks, which we denote as $\hat{K}\in \mathbb{R}^{h\times m\times m}$ . Then, the number of parameters to be identified reduces to $hm^2$ . Usually, $h$ does not depend on $N$ , and is much smaller than $N^2$ . Now, for each block $K_{ij}$ , we have a one-hot vector $\sigma_{ij}\in \{0,1\}^h$ indicating its type, i.e., $K_{ij} = \sigma_{ij}\hat{K}\in \mathbb{R}^{m\times m}$ . Finally, as shown in equation 7, we represent the Koopman matrix as the product of the index tensor $\sigma$ and the parameter tensor $\hat{K}$ :
136
+
137
+ $$
138
+ K = \sigma \otimes \hat {K} = \left[ \begin{array}{c c c} \sigma_ {1 1} \hat {K} & \dots & \sigma_ {1 N} \hat {K} \\ \vdots & \ddots & \vdots \\ \sigma_ {N 1} \hat {K} & \dots & \sigma_ {N N} \hat {K} \end{array} \right], \text {w h e r e} \quad \sigma = \left[ \begin{array}{c c c} \sigma_ {1 1} & \dots & \sigma_ {1 N} \\ \vdots & \ddots & \vdots \\ \sigma_ {N 1} & \dots & \sigma_ {N N} \end{array} \right] \in \mathbb {R} ^ {N \times N \times h}. \tag {7}
139
+ $$
140
+
141
+ Similar to the Koopman matrix, we assume the same block structure in the control matrix $L$ and denote its parameter as $\hat{L} \in \mathbb{R}^{h \times m \times l}$ . The least squares problem of identifying $\hat{K}$ and $\hat{L}$ becomes
142
+
143
+ $$
144
+ \min _ {\hat {K}, \hat {L}} \| (\sigma \otimes \hat {K}) \boldsymbol {g} ^ {1: T - 1} + (\sigma \otimes \hat {L}) \widetilde {\boldsymbol {u}} - \boldsymbol {g} ^ {2: T} \| _ {2}, \tag {8}
145
+ $$
146
+
147
+ where $\sigma \otimes \hat{K} \in \mathbb{R}^{Nm \times Nm}$ , $\sigma \otimes \hat{L} \in \mathbb{R}^{Nm \times Nl}$ , $g^{1:T-1} \in \mathbb{R}^{Nm \times (T-1)}$ and $\widetilde{\boldsymbol{u}} \in \mathbb{R}^{Nl \times (T-1)}$ . Since the linear least squares problems described in equation 6 and equation 8 have analytical solutions, performing system identification using our method is very efficient.
148
+
149
+ Training GNN models. To make predictions on the states, we use a graph decoder $\psi$ to map the Koopman embeddings back to the original state space. In total, we have three losses to train the graph encoder and decoder. The first term is the auto-encoding loss
150
+
151
+ $$
152
+ \mathcal {L} _ {\mathrm {a e}} = \frac {1}{T} \sum_ {i} ^ {T} \| \psi \left(\phi \left(\boldsymbol {x} ^ {i}\right)\right) - \boldsymbol {x} ^ {i} \|. \tag {9}
153
+ $$
154
+
155
+ The second term is the prediction loss. To calculate it, we rollout in the Koopman space and denote the embeddings as $\hat{\pmb{g}}^1 = \pmb{g}^1$ , and $\hat{\pmb{g}}^{t + 1} = K\hat{\pmb{g}}^t +Lu^t$ , for $t = 1,\dots ,T - 1$ . The prediction loss is defined as the difference between the decoded states and the actual states, i.e.,
156
+
157
+ $$
158
+ \mathcal {L} _ {\text {p r e d}} = \frac {1}{T} \sum_ {i = 1} ^ {T} \| \psi (\hat {\boldsymbol {g}} ^ {i}) - \boldsymbol {x} ^ {i} \|. \tag {10}
159
+ $$
160
+
161
+ Third, we employ a metric loss to encourage the Koopman embeddings preserving the distance in the original state space. The loss is defined as the absolute error between the distances measured in the Koopman space and that in the original space, i.e.,
162
+
163
+ $$
164
+ \mathcal {L} _ {\text {m e t r i c}} = \sum_ {i j} \left| \| \boldsymbol {g} ^ {i} - \boldsymbol {g} ^ {j} \| - \| \boldsymbol {x} ^ {i} - \boldsymbol {x} ^ {j} \| \right|. \tag {11}
165
+ $$
166
+
167
+ Having Koopman embeddings that perserves the distance in the state space is important as we are using the distance in the Koopman space to define the cost function for downstream control tasks.
168
+
169
+ The final training loss is simply the combination of all the terms above: $\mathcal{L} = \mathcal{L}_{\mathrm{ae}} + \lambda_1\mathcal{L}_{\mathrm{pred}} + \lambda_2\mathcal{L}_{\mathrm{metric}}$ . We then minimize the loss $\mathcal{L}$ by optimizing the parameters in the graph encoder $\phi$ and graph decoder $\psi$ using stochastic gradient descent. Once the model is trained, it can be used for system identification, future prediction, and control synthesis.
170
+
171
+ # 3.4 CONTROL
172
+
173
+ For a control task, the goal is to synthesize a sequence of control inputs $\pmb{u}^{1:T}$ that minimize $C = \sum_{t=1}^{T} c_t(\pmb{x}^t, \pmb{u}^t)$ , the total incurred cost, where $c_t(\pmb{x}^t, \pmb{u}^t)$ is the instantaneous cost. For example, considering the control task of reaching a desired state $\pmb{x}^*$ at time $T$ , we can design the following instantaneous cost, $c_t(\pmb{x}^t, \pmb{u}^t) = \mathbb{1}_{[t=T]} \| \pmb{x}^t - \pmb{x}^* \|_2^2 + \lambda \| \pmb{u}^t \|_2^2$ . The first term promotes the control sequence that matches the state to the goal, while the second term regularizes the control signals.
174
+
175
+ Open-loop control via quadratic programming (QP). Our model maps the original nonlinear dynamics to a linear dynamical system. We can then solve the control task by solving a linear control problem. With the assumption that the Koopman embeddings preserve the distance measure, we define the control cost as $c_{t}(\pmb{g}^{t}, \pmb{u}^{t}) = \mathbb{1}_{[t=T]} \| \pmb{g}^{t} - \pmb{g}^{*} \|_{2}^{2} + \lambda \| \pmb{u}^{t} \|_{2}^{2}$ . As a result, we reduce the problem to minimizing a quadratic cost function $C = \sum_{t=1}^{T} c_{t}(\pmb{g}^{t}, \pmb{u}^{t})$ over variables $\{\pmb{g}^{t}, \pmb{u}^{t}\}_{t=1}^{T}$ under linear constrains $\pmb{g}^{t+1} = K \pmb{g}^{t} + L \pmb{u}^{t}$ , where $\pmb{g}^{1} = \phi(\pmb{x}^{1})$ and $\pmb{g}^{*} = \phi(\pmb{x}^{*})$ .
176
+
177
+ Model predictive control (MPC). Solving the QP gives us control signals, which might not be good enough for long-term control as the prediction error accumulates. We can combine it with Model Predictive Control, assuming feedback from the environment every $\tau$ steps.
178
+
179
+ # 4 EXPERIMENTS
180
+
181
+ **Environments.** We evaluate our method by assessing how well it can simulate and control ropes and soft robots. Specifically, we consider three environments. (1) **Rope** (Figure 2a): the top mass of a rope is fixed to a specific height. We apply force to the top mass to move it in a horizontal line. The rest of the masses are free to move according to internal force and gravity. (2) **Soft** (Figure 2b): we aim to control a soft robot that is consist of soft blocks. Blocks in dark grey are rigid and those in light blue are soft blocks. Each one of the dark blue blocks is soft but have an actuator inside that can contract or expand the block. One of the blocks is pinned to the ground, as shown using the red dots. (3) **Swim** (Figure 2c): instead of pinning the soft robot to the ground, we let the robot swim in fluids. The colors shown in this environment have the same meaning as in **Soft**.
182
+
183
+ ![](images/abb7d453e6da3d8c85b296f89f47ae36c49a36c3398ed4d4631adb4c5c4f0dd5.jpg)
184
+ Figure 2: Qualitative results. Top: our model prediction matches the ground truth over a long period. Bottom: for control, we use red dots or frames to indicate the goal. We apply the control signals generated from our identified model to the original simulator, which allows the agent to achieve the goal accurately. Please refer to our supplementary video for more results.
185
+
186
+ Observation space. In the Rope environment, each mass on the rope is considered as an object. The observation of each mass is its position and velocity in the 2D plane, which has a dimension of 4. In total, a rope with $N$ masses has an observation space of dimension $4N$ . In both the Soft and the Swim environments, each quadrilateral is considered as an object. For each quadrilateral, we have access to the positions and velocities of the four corners. Thus for a soft robot containing $N$ quadrilaterals, we have a $4 \times 4 \times N = 16N$ dimensional observation.
187
+
188
+ Baselines. We compare our model to the following baselines: Interaction Networks (Battaglia et al., 2016) (IN), Propagation Networks (Li et al., 2019b) (PN) and Koopman method with handcrafted Koopman base functions (KPM). IN and PN are the state-of-the-art learning-based physical simulators, and we evaluate their adaptation ability by finetuning their parameters on a small sequence of observations from the testing environment. Similar to our method, KPM fits a linear dynamics in the Koopman space. Instead of learning Koopman observations from data, KPM uses polynomials of the original states as the basis functions. In our setting, we set the maximum order of the polynomials to be three to make the dimension of the hand-crafted Koopman embeddings match our model's.
189
+
190
+ Data generation. We generate 10,000 episodes for Rope and 50,000 episodes for Soft and Swim. Among them, $90\%$ are used for training, and the rest for testing. Each episode has 100 time steps. In the dataset, the physical systems have a various number of objects from 5 to 9, i.e. the ropes have 5 to 9 masses while the soft robots in Soft and Swim environments have 5 to 9 quadrilaterals. To evaluate the model's extrapolating generalization ability, for each environment, we generate an extra dataset with the same size as the test set while containing systems consist of 10 to 14 objects.
191
+
192
+ ![](images/9f20d92af29dd73579a05d7c568b5b7b5499e7deeb59a02d7d5095132bec6868.jpg)
193
+ (a) Rope
194
+
195
+ ![](images/2ac1fb717e43401a1fa50a4898ece6e91a2bafb8cc32dd0361ee51d838052f09.jpg)
196
+ (b) Soft
197
+
198
+ ![](images/0e8206d99e0ee46709f2bdf0c25eb55a549d617d6ee3dbc477e8bca79ecbb7ce.jpg)
199
+ (c) Swim
200
+
201
+ ![](images/34f3c237b8f6b370e9e08ec8b184d1106d2eefafe756448a797ec06542646b30.jpg)
202
+ Figure 3: Quantitative results on simulation. The $x$ axis shows time steps. The solid lines indicate medians and the transparent regions are the interquartile ranges of simulation errors. Our method significantly outperforms the baselines in all testing environments.
203
+ (a) Rope
204
+ Figure 4: Quantitative results on control and ablation studies on model hyperparameters. Left: box-plots show the distributions of control errors. The yellow line in the box indicates the median. Our model consistently achieves smaller errors in all environments against KPM. Right: our model's simulation errors with different amount of data for system identification (d) and different dimensions of the Koopman space (e).
205
+
206
+ ![](images/f4d6838c03ec44c1ab45030d835802399e7dd19b5aa4309a30967868056341eb.jpg)
207
+ (b) Soft
208
+
209
+ ![](images/13f392adeced456758a23fa8a4db13fcbe19c7eb870f2ad7c79f7684ed6602b4.jpg)
210
+ (c) Swim
211
+
212
+ ![](images/c9c917cd595111d86d55316424cdaaebb77a6c0ec0a6ff2178cd76871dc8682f.jpg)
213
+ (d) Number of samples for identifying $K$ and $L$
214
+
215
+ ![](images/52ad0926a2dedb1b764858cce6acf3af529f250ceb23e7430a04d30ff4968ff0.jpg)
216
+ (e) The size of object-centric embeddings
217
+
218
+ Training and evaluation protocols. All models are trained using Adam optimizer (Kingma & Ba, 2015) with a learning rate of $10^{-4}$ and a batch size of 8. $\lambda_{1}$ and $\lambda_{2}$ are 1.0 and 0.3, respectively, for our model. For both our model and the baselines, we apply 400K iterations of gradient steps in the Rope environment and 580K iterations in the Soft and Swim environment. Our model is trained on the sub-sequence of length 64 from the training set, and IN/PN aims at minimizing the L1 distance between their prediction and the ground truth. During test time, the models have to adapt to a new environment of unknown physical parameters, where they have access to a short sequence of observations and the opportunity to adjust their models' parameters. Our model uses 8 episodes to identify the transition matrix via least-square regression. IN/PN update the model's parameters by minimizing the distance between the model's prediction and the actual observation using a gradient step of length $10^{-4}$ for 5 iterations. For evaluation, we use two metrics: simulation error and control error. For a given episode, the simulation error at time step $t$ is defined as the mean squared error between the model prediction $\hat{\pmb{x}}^t$ and the ground truth $\pmb{x}^t$ . For control, we pick the initial frame $\pmb{x}^0$ and the $t$ 'th frame $\pmb{x}^t$ from a episode. Then we ask the model to generate a control sequence of length $t$ to transfer the system from the initial state $\pmb{x}^0$ to the target state $\pmb{x}^t$ . The control error is defined as the mean squared distance between the target state and the state of the system at time $t$ .
219
+
220
+ # 4.1 SIMULATION
221
+
222
+ Figure 2 shows qualitative results on simulation. Our model accurately predicts system dynamics for more than 100 steps. For Rope, the small prediction error comes from the slight delay of the force propagation inside the rope; hence, the tail of the rope usually has a larger error. For Soft, our model captures the interaction between the body parts and generates accurate prediction over the global movements of the robot. The error mainly comes from the misalignment of some local components.
223
+
224
+ We evaluate the models by predicting 100 steps into the future on 500 trajectories and Figure 3 shows quantitative results. IN and PN do not work well in the Rope and Swim environments due to insufficient system identification ability. The KPM baseline performs poorly in the Rope and
225
+
226
+ Soft environments indicating the limited power of polynomial Koopman base functions. Our model significantly outperforms all the baselines.
227
+
228
+ # 4.2 CONTROL
229
+
230
+ We compare our model with KPM, the Koopman baseline using polynomial basis. In Rope, we ask the models to perform open-loop control where it only solves the QP once at the beginning. The length of the control sequence is 40. When it comes to Soft/Swim, each model is asked to generate control signals of 64 steps, and we allow the model to receive feedback after 32 steps. Thus every model has a second chance to correct its control sequence by solving the QP again at the time step 32.
231
+
232
+ As shown in Figure 2, our model leverages the inertia of the rope and matches the target state accurately. As for controlling a soft body swinging on the ground or swimming in the water, our model can move each part (the boxes) of the body to the exact target position. The small control error comes from the slight misalignment of the orientation and the size of the body parts. Figure 4 shows that quantitatively our model outperforms KPM, too.
233
+
234
+ # 4.3 ABLATION STUDY
235
+
236
+ Structure of the Koopman matrix. We explore three different structures of the Koopman matrix, Block, Diag and None, to understand its effect on the learned dynamics. None assumes no structure in the Koopman matrix. Diag assumes a diagonal block structure of $K$ : all off-diagonal blocks ( $K_{ij}$ where $i \neq j$ ) are zeros and all diagonal blocks share the same values. Block predefines a block-wise structure, decided by the relation between the objects as introduced in Section 3.3.
237
+
238
+ Table 1 includes our model's simulation error and control error with different Koopman matrix structures in Rope. All models are trained in the Rope environment with 5 to 9 masses. Besides the result on the test set, we also report models' extrapolation performance in parentheses, where the model is evaluated on systems with more masses than training, i.e., 10 to 14 masses.
239
+
240
+ Our model with Block structure consistently achieves a smaller error in all settings. Diag assumes an overly simplified structure, leading to larger errors and failing to make reasonable controls. None has comparable simulation errors but larger control errors. Without the structure in the Koopman matrix, it overfits the data and makes the resulting linear dynamics less amiable to the control.
241
+
242
+ Table 1: Ablation study results on the Koopman matrix structure (Rope environment). For simulation, we show the Mean Squared Error between the prediction and the ground truth at $T = 100$ , whereas for control, we show the performance with a horizon of length 40. The numbers in parentheses show the performance on extrapolation.
243
+
244
+ <table><tr><td></td><td>Simulation</td><td>Control</td></tr><tr><td>Diag</td><td>0.133 (0.174)</td><td>2.337 (2.809)</td></tr><tr><td>None</td><td>0.117 (0.083)</td><td>1.522 (1.288)</td></tr><tr><td>Block</td><td>0.105 (0.075)</td><td>0.854 (1.101)</td></tr></table>
245
+
246
+ Hyperparameters. In our main experiments, we set the dimension of the Koopman embedding to $m = 32$ per object. Online system identification requires 800 data samples for each training/test case. To understand our model's performance under different hyperparameters, we vary the dimension of the Koopman embedding from 8 to 64 and the number of data samples used for system identification from 200 to 1,600. Figure 4d shows that more data for system identification leads to better simulation results. Figure 4e shows that dimension 16 gives the best results on simulation. It may suggest that the intrinsic dimension of the Koopman invariant space of the Rope system is around 16 per object.
247
+
248
+ # 5 CONCLUSION
249
+
250
+ Compositionality is common in our daily life. Many ordinary objects contain repetitive subcomponents: ropes and soft robots, as shown in this paper, granular materials such as coffee beans and lego blocks, and deformable objects such as cloth and modeling clay. These objects are known to be very challenging for manipulation using traditional methods, while our formulation opens up a new direction by combining deep Koopman operators with graph neural networks. By leveraging the compositional structure in the Koopman operator via graph neural nets, our model can efficiently manipulate deformable objects such as ropes and soft robots, and generalize to systems with variable numbers of components. We hope this work could encourage more endeavors in modeling larger and more complex systems by integrating the power of the Koopman theory and the expressiveness of neural networks.
251
+
252
+ # REFERENCES
253
+
254
+ Ian Abraham, Gerardo De La Torre, and Todd D Murphey. Model-based control using koopman operators. In RSS, 2017.
255
+ Hassan Arbabi and Igor Mezic. Ergodic theory, dynamic mode decomposition, and computation of spectral properties of the koopman operator. SIAM Journal on Applied Dynamical Systems, 16(4): 2096-2126, 2017.
256
+ Hassan Arbabi, Milan Korda, and Igor Mezic. A data-driven koopman model predictive control framework for nonlinear flows. In CDC, 2018.
257
+ Peter W. Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. In NeurIPS, 2016.
258
+ Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv:1806.01261, 2018.
259
+ Daniel Bruder, Brent Gillespie, C David Remy, and Ram Vasudevan. Modeling and control of soft robots using the koopman operator and model predictive control. In RSS, 2019a.
260
+ Daniel Bruder, C David Remy, and Ram Vasudevan. Nonlinear system identification of soft robot dynamics using koopman operator theory. In ICRA, 2019b.
261
+ Steven L Brunton, Bingni W Brunton, Joshua L Proctor, and J Nathan Kutz. Koopman invariant subspaces and finite linear representations of nonlinear dynamical systems for control. PloS one, 11(2):e0150171, 2016.
262
+ Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. In ICLR, 2017.
263
+ Herve Delingette. Toward realistic soft-tissue modeling in medical simulation. Proceedings of the IEEE, 86(3):512-523, 1998.
264
+ Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In ICML, 2019.
265
+ Jessica B Hamrick, Andrew J Ballard, Razvan Pascanu, Oriol Vinyals, Nicolas Heess, and Peter W Battaglia. Metacontrol for adaptive imagination-based optimization. In ICLR, 2017.
266
+ Michael Janner, Sergey Levine, William T Freeman, Joshua B Tenenbaum, Chelsea Finn, and Jiajun Wu. Reasoning about physical interactions with object-oriented prediction and planning. In *ICLR*, 2019.
267
+ Eurika Kaiser, J Nathan Kutz, and Steven L Brunton. Data-driven discovery of koopman eigenfunctions for control. arXiv:1707.01146, 2017.
268
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
269
+ Bernard O Koopman. Hamiltonian systems and transformation in hilbert space. PNAS, 17(5):315, 1931.
270
+ BO Koopman and J v Neumann. Dynamical systems of continuous spectra. PNAS, 18(3):255, 1932.
271
+ Milan Korda and Igor Mezić. Linear predictors for nonlinear dynamical systems: Koopman operator meets model predictive control. Automatica, 93:149-160, 2018.
272
+ Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In ICLR, 2019a.
273
+ Yunzhu Li, Jiajun Wu, Jun-Yan Zhu, Joshua B Tenenbaum, Antonio Torralba, and Russ Tedrake. Propagation networks for model-based control under partial observation. In ICRA, 2019b.
274
+
275
+ Bethany Lusch, J Nathan Kutz, and Steven L Brunton. Deep learning for universal linear embeddings of nonlinear dynamics. Nature Communications, 9(1):4950, 2018.
276
+ Giorgos Mamakoukas, Maria Castano, Xiaobo Tan, and Todd Murphey. Local koopman operators for data-driven control of robotic systems. In RSS, 2019.
277
+ Alexandre Mauroy and Jorge Goncalves. Linear identification of nonlinear systems: A lifting technique based on the koopman operator. In CDC, 2016.
278
+ Alexandre Mauroy and Jorge Goncalves. Koopman-based lifting techniques for nonlinear systems identification. IEEE Transactions on Automatic Control, 2019.
279
+ David Mayne. Nonlinear model predictive control: Challenges and opportunities. In *Nonlinear Model Predictive Control*, pp. 23-44. Springer, 2000.
280
+ Jeremy Morton, Freddie D Witherden, Antony Jameson, and Mykel J Kochenderfer. Deep dynamical modeling and control of unsteady fluid flows. In NeurIPS, 2018.
281
+ Jeremy Morton, Freddie D Witherden, and Mykel J Kochenderfer. Deep variational koopman models: Inferring koopman observations for uncertainty-aware dynamics modeling and control. In *IJCAI*, 2019.
282
+ Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li Fei-Fei, Joshua B Tenenbaum, and Daniel LK Yamins. Flexible neural representation for physics prediction. In NeurIPS, 2018.
283
+ Anusha Nagabandi, Ignasi Clavera, Simin Liu, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt in dynamic, real-world environments through meta-reinforcement learning. In ICLR, 2019a.
284
+ Anusha Nagabandi, Chelsea Finn, and Sergey Levine. Deep online learning via meta-learning: Continual adaptation for model-based rl. In ICLR, 2019b.
285
+ Razvan Pascanu, Yujia Li, Oriol Vinyals, Nicolas Heess, Lars Buesing, Sebastien Racanière, David Reichert, Théophane Weber, Daan Wierstra, and Peter Battaglia. Learning model-based planning from scratch. arXiv:1707.06170, 2017.
286
+ Joshua L Proctor, Steven L Brunton, and J Nathan Kutz. Generalizing koopman theory to allow for inputs and control. SIAM Journal on Applied Dynamical Systems, 17(1):909-930, 2018.
287
+ Sebastien Racanière, Théophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo Jimenez Rezende, Adrià Puigdomènech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, Razvan Pascanu, Peter Battaglia, David Silver, and Daan Wierstra. Imagination-augmented agents for deep reinforcement learning. In NeurIPS, 2017.
288
+ Clarence W Rowley, Igor Mezić, Shervin Bagheri, Philipp Schlatter, and Dan S Henningson. Spectral analysis of nonlinear flows. Journal of Fluid Mechanics, 641:115-127, 2009.
289
+ Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In ICML, 2018.
290
+ Peter J Schmid. Dynamic mode decomposition of numerical and experimental data. Journal of Fluid Mechanics, 656:5-28, 2010.
291
+ Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In NeurIPS, 2012.
292
+ Naoya Takeishi, Yoshinobu Kawahara, and Takehisa Yairi. Learning koopman invariant subspaces for dynamic mode decomposition. In NeurIPS, 2017.
293
+ Jonathan H Tu, Clarence W Rowley, Dirk M Luchtenburg, Steven L Brunton, and J Nathan Kutz. On dynamic mode decomposition: Theory and applications. Journal of Computational Dynamics, 1 (2):391-421, 2014.
294
+
295
+ Matthew O Williams, Ioannis G Kevrekidis, and Clarence W Rowley. A data-driven approximation of the koopman operator: Extending dynamic mode decomposition. Journal of Nonlinear Science, 25(6):1307-1346, 2015.
296
+ Matthew O Williams, Maziar S Hemati, Scott TM Dawson, Ioannis G Kevrekidis, and Clarence W Rowley. Extending data-driven koopman analysis to actuated systems. IFAC-PapersOnLine, 49 (18):704-709, 2016.
297
+
298
+ # A ENVIRONMENT AND MODEL DETAILS
299
+
300
+ Interaction types. In our experiments, interactions are considered different if the types are different or the objects involved have different physical properties.
301
+
302
+ In the Rope environment, the top mass has a fixed height and is considered differently from the other masses. Thus, we have 2 types of self-interactions for the top mass and the non-top masses. In addition, we have 8 types of interactions between different objects. The objects on a relation could be either top mass or non-top mass. It is a combination of 4. And the interaction may happen between two nearby masses or masses that are two-hop away. In total, the number of interactions between different objects is $4 \times 2 = 8$ .
303
+
304
+ In the Soft environments, there are four types of quadrilaterals: rigid, soft, actuated, and fixed. We have four types of self-interactions correspondingly. For the interactions between objects, we add edges between two quadrilaterals only if they are connected by a point or edge. Connection from different directions are considered as different relations. There are 8 different directions, up, down, left, right, up-left, down-left, up-right, down-right. The relation types also encode the type of receiver object. Thus, in total, there are $(8 + 1) \times 4 = 36$ types of relations between different objects.
305
+
306
+ In the Swim environment, there are three types of quadrilaterals: rigid, soft, and actuated. Similar to the Soft environment, we use different edge types for different connecting directions; hence, the number of edge type is $(8 + 1)\times 3 = 27$
307
+
308
+ # B ADDITIONAL EXPERIMENTS
309
+
310
+ Comparison with a classical physical simulator optimized using back-box optimization. We have performed comparisons with a classical physical simulator optimized using black-box optimization (Delingette, 1998) by assuming different levels of knowledge over the ground truth model.
311
+
312
+ If we assume that we know the ground truth model, where we only need to identify relevant physical parameters during the system identification stage, Bayesian Optimization (Snoek et al., 2012) (BO) can give us a reasonable estimate of the physical parameters. However, BO requires much more time to achieve a comparable performance with our method in the Rope environment: 0.43 vs. 180 seconds averaged over 100 trails (Ours vs. BO).
313
+
314
+ If we are unsure about the ground truth model and we approximate the system using a set of points linked by springs and dampers, BO does not work as well. In our additional experiments, we approximate the Rope environment using a chained spring-mass system, say $n$ masses and $n - 1$ springs. While taking much more time, BO still cannot give us a satisfying result: simulation error 0.046 vs. 0.084 and control error 0.854 vs. 2.547 (Ours vs. BO).
315
+
316
+ Ablation study on the effectiveness of the metric loss. The internal linear structure allows us to solve the control problem using quadratic programming, where the objective function for control is defined in the embedding space (Section 3.4); hence, it is desirable to have Koopman embeddings that preserve the distance in the original state space. In Section 3.3, we introduce a metric loss to promote learning a Koopman embedding that keeps the distance measurement.
317
+
318
+ To demonstrate the effect of the metric loss, we compare the models trained with and without the metric loss. We establish the comparison using two measurements, the distance preservation and the prediction accuracy. To evaluate how well the Koopman embeddings preserve the distance, we compute the distribution of the log-ratio of the distance in the Koopman space and in the original state space, i.e., $\log \left(\frac{\|g^i - g^j\|_2}{\|x^i - x^j\|_2}\right)$ . For the model prediction accuracy, we show the simulation errors.
319
+
320
+ We perform the experiments in the Rope environment and show the result in Figure 5. On the left, we show the ratio of distance in the learned Koopman space and the distance in the original state space. The model trained with metric loss has a log distance ratio that significantly more concentrates on 0. It means the metric loss effectively regularizes the model to preserve the distance. On the right, we show the simulation errors of the two models, which indicate that two models have comparable prediction performance. Metric loss effectively enhances the property of distance-preserving while not making a big sacrifice on the accuracy of the dynamics modeling.
321
+
322
+ ![](images/767a032d134d7a5f5a4d8dcde14e341f379471bc1bf45ea31715d86f233cea45.jpg)
323
+ (a) Distance Preservation
324
+
325
+ ![](images/a37319641ef2191790b5611bc66eefa123d69d23b857f8e65ae2d4a5ae774ae2.jpg)
326
+ (b) Simulation
327
+
328
+ ![](images/27bd8a190805ef009e8a62ae9e49d94119763dfc23fba6fcff7c6bbdba624a90.jpg)
329
+ (c) Control
330
+
331
+ ![](images/3ed1f65f583ee86db5ac597f29e194b4dda0d82fea177f75bd833042d8fac84c.jpg)
332
+ Figure 5: Ablation study on the metric loss in the Rope environment. (a) shows the distributions of the logarithm distance ratio, i.e., $\log \left(\frac{\|g^i - g^j\|_2}{\|x^i - x^j\|_2}\right)$ . The model trained with metric loss has a distance ratio much more concentrated to 1, which indicates it preserves the distance much better than the counterpart. (b) illustrates the simulation error of two models, where their performance is on par. (c) shows that the model trained using the metric loss performs better control.
333
+ Figure 6: Modeling rope with known physical parameters. We show the comparison between our model and IN/PN in scenarios where we have access to the ground truth physical parameters. In this case, IN and PN slightly outperform our method due to the internal linear structure in our model. However, in the real world, we do not always know the physical parameters and their values, which makes our method preferable when adapting to new environments.
334
+
335
+ Experiments in a known physical parameter setting. Our setting is different from the settings in the original IN and PN papers that we do not assume we know the physical parameters and their values, such as stiffness, mass, and gravity. Instead, the parameters are embedded in the transition matrices during the system identification stage (Section 3.3). If the model has access to the underlying physical parameters, as expected, IN and PN slightly outperform our method as the internal linear structure limits our model's expressiveness, as shown in Figure 6. In the real world, however, the underlying physical parameters are not always known, which makes our model a better choice when adapting to unseen environments.
learningcompositionalkoopmanoperatorsformodelbasedcontrol/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:676a746f108eb813fc47710ff4dee482f675b59b8f18ab22127ceff6e46ae20b
3
+ size 343196
learningcompositionalkoopmanoperatorsformodelbasedcontrol/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:373be8bba6bb61e15cf5317d347d6b83f6cc53f4470e32289376d4646e4fa506
3
+ size 492943
learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8e48696ac3665ef2b0c097bc0c7468e2dfee1a2423421b4960e6bfa938c779a
3
+ size 103041
learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48dce43aad970ae9d2adf10cf4c6c2766f4fa4ca04d0def618a5fa17f9214402
3
+ size 121034
learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:266ccc3f74fb81e9a5805df503256917b7af38caae6c5f1eec1353d1d3bd000e
3
+ size 578295
learningfromrulesgeneralizinglabeledexemplars/full.md ADDED
@@ -0,0 +1,418 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING FROM RULES GENERALIZING LABELED EXEMPLARS
2
+
3
+ Abhijeet Awasthi Sabyasachi Ghosh Rasna Goyal Sunita Sarawagi
4
+
5
+ Department of Computer Science and Engineering
6
+
7
+ Indian Institute of Technology Bombay
8
+
9
+ Mumbai, Maharashtra 400076, India
10
+
11
+ {awasthi, sghosh, goyalrasna, sunita}@cse.iitb.ac.in
12
+
13
+ # ABSTRACT
14
+
15
+ In many applications labeled data is not readily available, and needs to be collected via pain-staking human supervision. We propose a rule-exemplar method for collecting human supervision to combine the efficiency of rules with the quality of instance labels. The supervision is coupled such that it is both natural for humans and synergistic for learning. We propose a training algorithm that jointly denoises rules via latent coverage variables, and trains the model through a soft implication loss over the coverage and label variables. The denoised rules and trained model are used jointly for inference. Empirical evaluation on five different tasks shows that (1) our algorithm is more accurate than several existing methods of learning from a mix of clean and noisy supervision, and (2) the coupled rule-exemplar supervision is effective in denoising rules.
16
+
17
+ # 1 INTRODUCTION
18
+
19
+ With the ever-increasing reach of machine learning, a common hurdle to new adoptions is the lack of labeled data and the pain-staking process involved in collecting human supervision. Over the years, several strategies have evolved. On the one hand are methods like active learning and crowd-consensus learning that seek to reduce the cost of supervision in the form of per-instance labels. On the other hand is the rich history of rule-based methods (Appelt et al., 1993; Cunningham, 2002) where humans code-up their supervision as labeling rules. There is growing interest in learning from such efficient, albiet noisy, supervision (Ratner et al., 2016; Pal & Balasubramanian, 2018; Bach et al., 2019; Sun et al., 2018; Kang et al., 2018). However, clean task-specific instance labels continue to be critical for reliable results (Goh et al., 2018; Bach et al., 2019) in spite of easy availability of pre-trained models (Sun et al., 2017; Devlin et al., 2018).
20
+
21
+ In this paper we propose a unique blend of cheap coarse-grained supervision in the form of rules and expensive fine-grained supervision in the form of labeled instances. Instead of supervising rules and instance labels independently, we propose that each labeling rule be attached with exemplars of where the rule correctly 'fires'. Thus, the rule can be treated as a noisy generalization of those exemplars. Often rules are coded up only after inspecting data. As a human inspects instances, he labels them, and then generalizes them to rules. Thus, humans provide paired supervision of rules and exemplars demonstrating correct deployment of that rule. We explain further with two illustrative applications. Our examples below are from the text domain because rules have been traditionally used in many NLP tasks, but our learning algorithm is agnostic to how rules are expressed.
22
+
23
+ Sentiment Classification Consider an instance I highly recommend this modest priced cellular phone that a human inspects for a sentiment labeling task. After labeling it as positive, he can easily generalize it to a rule Contains 'highly recommend' $\rightarrow$ positive label. This rule generalizes to several more instances, thereby eliminating the need of per-instance labeling on those. However, the label assigned by this rule on unseen instances may not be as reliable as the explicit label on this specific exemplar it generalized. For example, it misfires on I would highly recommend this phone if it weren't for their poor service.
24
+
25
+ Slot-filling Consider a slot-filling task on restaurant reviews over labels like cuisine, location, and time. When an annotator sees an instance like: what chinese restaurants in this city have good reviews?, after labeling token chinese as cuisine, he generalizes it to a rule: (.esel. iian|mexican) restaurants $\rightarrow$ (cuisine) restaurants. This rule matches hundreds of instances in the unlabeled set, but could wrongly label a phrase like these restaurants. Our focus in this paper is developing algorithms for training models under such coupled rule-exemplar supervision. Our main challenge is that the labels induced by the rules are more noisy than instance-level supervised labels because humans tend to over generalize (Tessler & Goodman, 2019) as we saw in the illustrations above. Learning with noisy labels with or without additional clean data has been a problem of long-standing interest in ML (Khetan et al., 2018; Zhang & Sabuncu, 2018; Ren et al., 2018b; Veit et al., 2017; Shen & Sanghavi, 2019). However, we seek to design algorithms that better capture rule-specific noise with the help of exemplars around which we have supervision that the rule fired correctly. We associate a latent random variable on whether a rule correctly 'covers' an instance, and jointly learn the distribution among the label and all cover variables. This way we simultaneously train the classifier with corrected rule-label examples, and restrict over-generalized rules. The denoised rules are used during inference to further boost accuracy of the trained model. In summary our contributions in this paper are as follows:
26
+
27
+ Our contributions (1) We propose the paradigm of supervision in the form of rules generalizing labeled exemplars that is natural in several applications. (2) We design a training method that simultaneously denoises over-generalized rules via latent coverage variables, and trains a classification model with a soft implication loss that we introduce. (3) Through experiments on five tasks spanning question classification, spam detection, sequence labeling, and record classification we show that our proposed paradigm of supervision enables an effective synergy between rule-level and instance-level supervision. (4) We compare our algorithm to several recent frameworks for learning with noisy supervision and constraints, and show much better results with our method.
28
+
29
+ # 2 TRAINING WITH RULES AND EXEMPLARS
30
+
31
+ We first formally describe the problem of learning from rules generalizing exemplars on a classification task. Let $\mathcal{X}$ denote the space of instances and $\mathcal{Y} = \{1, \dots, K\}$ denote the space of class labels. Let the set of labeled examples be $L = \{(\mathbf{x}_1, \ell_1, e_1), \dots, (\mathbf{x}_n, \ell_n, e_n)\}$ where $\mathbf{x}_i \in \mathcal{X}$ is an instance, $\ell_i \in \mathcal{Y}$ is its user-provided label, and $e_i \in \{R_1, \dots, R_m, \emptyset\}$ denotes that $\mathbf{x}_i$ is an exemplar for rule $e_i$ . Some labeled instances may not be generalized to rules and for them $e_i = \emptyset$ . Also, a rule can have more than one exemplar associated with it. Each rule $R_j$ could be a blackbox function $R_j: \mathbf{x} \mapsto \{\ell_j, \emptyset\}$ that takes as input an instance $\mathbf{x} \in \mathcal{X}$ and assigns it either label $\ell_j$ or no-label. When the $i$ th labeled instance is an exemplar for rule $R_j$ (that is, $e_i = R_j$ ), the label of the instance $\ell_i$ should be $\ell_j$ . Additionally, we have a different set of unlabeled instances $U = \{\mathbf{x}_{n+1}, \dots, \mathbf{x}_N\}$ . The cover set $H_j$ of rule $R_j$ is the set of all instances in $U \cup L$ for which $R_j$ assigns a noisy label $\ell_j$ . An instance may be covered by more than one rule or no rule at all, and the labels provided by these rules may be conflicting. Our goal is to train a classification model $P_\theta(y|\mathbf{x})$ using $L$ and $U$ to maximize accuracy on unseen test instances. A baseline solution is to use $R_j$ to noisily label the covered $U$ instances using majority or other consensus method of resolving conflicts. We then train $P_\theta(y|\mathbf{x})$ on the noisy labels using existing algorithms for learning from noisy and clean labels (Veit et al., 2017; Ren et al., 2018b). However, we expect to be able to do better by learning the systematic pattern of noise in rules along with the classifier $P_\theta(y|\mathbf{x})$ .
32
+
33
+ Our noise model on $R_{j}$ A basic premise of our learning paradigm is that the noise induced by a rule $R_{j}$ is due to over-generalizing the exemplar(s) seen when creating the rule. And, there exists a smaller neighborhood closer to the exemplar(s) where the noise is zero. We model this phenomenon by associating a latent Bernoulli random variable $r_{ji}$ for each instance $\mathbf{x}_i$ in the stated cover set $H_{j}$ of each rule $R_{j}$ . When $r_{ji} = 1$ , rule $R_{j}$ has not over-generalized on $\mathbf{x}_i$ , and there is no noise in the label $\ell_{j}$ that $R_{j}$ assigns to $\mathbf{x}_i$ . When $r_{ji} = 0$ we flag an over-generalization, and abstain from labeling $\mathbf{x}_i$ as $\ell_{j}$ suspecting it to be too noisy. We call $r_{ji}$ s as the latent coverage variables. We propose to learn the distribution of $r_{j}$ using another network with parameters $\phi$ that outputs the probability $P_{j\phi}(r_j|\mathbf{x})$ that $r_{j} = 1$ . We then seek to jointly learn $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ to model the distribution over the true label $y$ and true coverage $r_{j}$ for each rule $j$ and each $\mathbf{x}$ in $H_{j}$ . Thus
34
+
35
+ $P_{j\phi}$ plays the role of restricting a rule $R_{j}$ so that $r_j$ is not necessarily 1 for all instances in its cover set $H_{j}$
36
+
37
+ An example We make our discussion concrete with an example. Figure 1 shows a two-dimensional $\mathcal{X}$ space with labeled points $L$ denoted as red crosses and blue circles, unlabeled points as dots, and the true labels as background color of the region. We show two rule-exemplar pairs: $(\mathbf{x}_1,y_1 = \text{red}, R_1)$ , $(\mathbf{x}_2,y_2 = \text{blue}, R_2)$ with bold boundaries. Clearly, both rules $R_1,R_2$ have over-generalized to the wrong region. If we train a classifier with many examples in $H_{1} \cup H_{2}$ wrongly labeled by rules, then even with a noise tolerant loss function like Zhang &
38
+
39
+ ![](images/8ec484a4c24675aa4c22b6b51e596ce82a59407a7a815a22a8c69b92f2e11acb.jpg)
40
+ Figure 1: Restricting over-generalized rules
41
+
42
+ Sabuncu (2018), the classifier $P_{\theta}(y|\mathbf{x})$ might be misled. In contrast, what we hope to achieve is to learn the $P_{j\phi}(r_j|\mathbf{x})$ distribution using the limited labeled data and the overlap among the rules such that $\operatorname{Pr}(r_j|\mathbf{x})$ predicts a value of 0 for examples wrongly covered. Such examples are then excluded from training $P_{\theta}$ . The dashed boundaries indicate the revised boundaries of $R_{j}$ s that we can hope to learn based on consensus on the labeled data and the set of rules. Even after such restriction, $R_{j}$ s are useful for training the classifier because of the unlabeled points inside the dashed regions that get added to the labeled set.
43
+
44
+ # 2.1 HOW WE JOINTLY LEARN $P_{\theta}$ AND $P_{j\phi}$
45
+
46
+ In general we will be provided with several rules with arbitrary overlap in the set of labeled $L$ and unlabeled examples $U$ that they cover. Intuitively, we want the label distribution $P_{\theta}(y|\mathbf{x})$ to correctly restrict the coverage distribution $P_{j\phi}(r_j|\mathbf{x})$ , which in turn can provide clean labels to instances in $U$ that can be used to train $P_{\theta}(y|\mathbf{x})$ . We have two types of supervision in our setting. First, individually for each of $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ we have ground truth values of $y$ and $r_j$ for some instances. For the $P_{\theta}(y|\mathbf{x})$ distribution, supervision on $y$ is provided by the human labeled data $L$ , and we use these to define the usual log-likelihood as one term in our training objective:
47
+
48
+ $$
49
+ \max _ {\theta} L L (\theta) = \max _ {\theta} \sum_ {(\mathbf {x} _ {i}, \ell_ {i}) \in L} \log P _ {\theta} \left(\ell_ {i} | \mathbf {x} _ {i}\right) \tag {1}
50
+ $$
51
+
52
+ For learning the distribution $P_{j\phi}(r_j|\mathbf{x})$ over the coverage variables, the only sure-shot labeled data is that $r_{ji} = 1$ for any $\mathbf{x}_i$ that is an exemplar of rule $R_j$ and $r_{ji} = 0$ for any $\mathbf{x}_i \in H_j$ whose label $\ell_i$ is different from $\ell_j$ . For other labeled instances $\mathbf{x}_i$ covered with rules $R_j$ with agreeing labels, that is $\ell_i = \ell_j$ we do not strictly require that $r_{ji} = 1$ . In the example above the corrected dashed red boundary excludes a red labeled point to reduce its noise on other points. However, if the number of labeled exemplars are too few, we regularize the networks towards more rule firings, by adding a noise tolerant $r_{ji} = 1$ loss on the instances with agreeing labels. We use the generalized cross entropy loss of Zhang & Sabuncu (2018).
53
+
54
+ $$
55
+ \begin{array}{l} L L (\phi) = \sum_ {(\mathbf {x} _ {i}, \ell_ {i}, e _ {i}) \in L} \big (\log P _ {e _ {i} \phi} (r _ {e _ {i} i} = 1 | \mathbf {x} _ {i}) + \sum_ {j: \mathbf {x} _ {i} \in H _ {j} \land \ell_ {i} \neq \ell_ {j}} \log P _ {j \phi} (r _ {j i} = 0 | \mathbf {x} _ {i}) \\ - \sum_ {j: \mathbf {x} _ {i} \in H _ {j} \wedge \ell_ {i} = \ell_ {j}} \text {G e n e r a l i z e d - X E N T} \left(P _ {j \phi} \left(r _ {j} | \mathbf {x} _ {i}\right), r _ {j i} = 1\right)) \\ \end{array}
56
+ $$
57
+
58
+ Note for other instances $\mathbf{x}_i$ in $R_{j}$ 's cover $H_{j}$ , value of $r_{ji}$ is unknown and latent. The second type of supervision is on the relationship between $r_{ji}$ and $y_{i}$ for each $\mathbf{x}_i\in H_j$ . A rule $R_{j}$ imposes a causal constraint that when $r_{ji} = 1$ , the label $y_{i}$ has to be $\ell_{j}$ .
59
+
60
+ $$
61
+ r _ {j i} = 1 \Longrightarrow y _ {i} = \ell_ {j} \quad \forall \mathbf {x} _ {i} \in H _ {j} \tag {3}
62
+ $$
63
+
64
+ We convert this hard constraint into a (log) probability of the constraint being satisfied under the $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ distributions as:
65
+
66
+ $$
67
+ \log \left(1 - P _ {j \phi} \left(r _ {j} = 1 | \mathbf {x}\right) \left(1 - P _ {\theta} \left(\ell_ {j} | \mathbf {x}\right)\right)\right) \tag {4}
68
+ $$
69
+
70
+ Figure 2 shows a surface plot of the above log probability as a function of $P_{\theta}(\ell_j|\mathbf{x})$ (shown as axis $\mathrm{P(y)}$ in figure) and $P_{j\phi}(r_j = 1|\mathbf{x})$ (shown as axis $\mathrm{P(r)}$ in figure) for a single rule.
71
+
72
+ Observe that likelihood drops sharply as $P(r_{j}|\mathbf{x})$ is close to 1 but $P(y = \ell_{j}|\mathbf{x})$ is close to zero. For all other values of these probabilities the log-likelihood is flat and close to zero. Specifically, when $P_{j\phi}$ predicts low values of $r_{j}$ for a $\mathbf{x}$ , the log-likelihood surface is flat, effectively withdrawing the $(\mathbf{x},\ell_{j})$ supervision from training the classifier $P_{\theta}$ . Thus maximizing this likelihood provides a soft enforcement of the constraint without unwanted biases. We call this the negative implication loss.
73
+
74
+ We do not need to explicitly model the conflict among rules, that is when an $\mathbf{x}_i$ is covered by two rules $R_{j}$ and $R_{k}$ of differing labels $(\ell_j\neq$ $\ell_k)$ , then both $r_{ji}$ and $r_{ki}$ cannot be 1. This is
75
+
76
+ ![](images/5b3210f57e976c5f03caf7bb280cff5b448139f23d4f8a7fe0109b56c6200406.jpg)
77
+ Figure 2: Negative implication loss
78
+
79
+ because the constraint among pairs $(y_{i},r_{ji})$ and $(y_{i},r_{ki})$ as stated in Equation 3 subsumes this one.
80
+
81
+ During training we then seek to maximize the log of the above probability along with normal data likelihood terms. Putting the terms in Equations 1, 2 and 4 together our final training objective is:
82
+
83
+ $$
84
+ \min _ {\theta , \phi} - L L (\theta) - L L (\phi) - \gamma \sum_ {j; \mathbf {x} \in H _ {j} \cap U} \log \left(1 - P _ {j \phi} \left(r _ {j} = 1 \mid \mathbf {x}\right) \left(1 - P _ {\theta} \left(\ell_ {j} \mid \mathbf {x}\right)\right)\right) \tag {5}
85
+ $$
86
+
87
+ We refer to our training loss as a denoised rule-label implication loss or ImplyLoss for short. The $LL(\phi)$ term seeks to denoise rule coverage which then influence the $y$ distribution via the implication loss. We explored several other methods of enforcing the constraint among $y$ and $r_j$ in the training of the $P_{\theta}$ and $P_{j\phi}$ networks. Our method ImplyLoss consistently performed the best among several methods we tried including the recent posterior regularization (Ganchev et al., 2010; Hu et al., 2016) method of enforcing soft constraints and co-training (Blum & Mitchell, 1998).
88
+
89
+ Network Architecture Our network has three modules. (1) A shared embedding layer that provides the feature representation of the input. When labeled data is scarce, this will typically be a pre-trained layer from a related task. The embedding module is task-specific and is described in the experiment section. (2) A classification network that models $P_{\theta}(y|\mathbf{x})$ with parameters $\theta$ . The embedding of an input $\mathbf{x}$ is passed through multiple non-linear layers with ReLU activation, a last linear layer followed by Softmax to output a distribution over the class labels. (3) A rule network that models $P_{j\phi}(r_j = 1|\mathbf{x})$ whose parameters $\phi$ are shared across all rules. The input to the network is rule-specific and concatenates the embedding of the input instance $\mathbf{x}$ , and a one-hot encoding of the rule id 'j'. The input is passed through multiple non-linear layers with ReLU activation before passing through a Sigmoid activation which outputs the probability $P_{j\phi}(r_j = 1|\mathbf{x})$ .
90
+
91
+ Inference During prediction, joint inference over the label $y$ and coverage variables $r_j$ provides slight gains over depending solely on $P_{\theta}(y|\mathbf{x})$ . For any test example $\mathbf{x}$ , consider the set of rules $G$ covering $\mathbf{x}$ such that $P_{j\phi}(1|\mathbf{x}) > 0.5$ . Probabilities from the label and coverage variables are combined to obtain a score $s(y)$ for each label $y$ as:
92
+
93
+ $$
94
+ s (y | \mathbf {x}) = P _ {\theta} (y | \mathbf {x}) + \frac {\sum_ {R _ {j} \in G} \delta (\ell_ {j} = y) P _ {j \phi} (1 | \mathbf {x}) + \delta (\ell_ {j} \neq y) P _ {j \phi} (0 | \mathbf {x})}{| G |} \tag {6}
95
+ $$
96
+
97
+ The above can be viewed as a soft voting over the trained classifier $P_{\theta}$ and labels provided by rules with uncertain coverage. Because we also learned to denoise rules along with training the classifier, the labels assigned by the rules have higher precision than original rules.
98
+
99
+ # 3 EXPERIMENTS
100
+
101
+ We compare our training algorithms against simple baselines, existing error-tolerant learning algorithms, and existing constraint-based learning in deep networks.
102
+
103
+ We evaluate across five datasets spanning three task types: text classification, sequence labeling, and record classification. We augment the datasets with rules, that we obtained manually in three
104
+
105
+ <table><tr><td>Dataset</td><td>|L|</td><td>|U|</td><td>#Rules</td><td>%Cover</td><td>Precision</td><td>%Conflict</td><td>Avg |Hj|</td><td>#Rules Per In-stance</td><td>Valid|</td><td>|Test|</td></tr><tr><td>Question</td><td>68</td><td>4884</td><td>68</td><td>95</td><td>63.8</td><td>22.5</td><td>124</td><td>1.8</td><td>500</td><td>500</td></tr><tr><td>MIT-R</td><td>1842</td><td>64888</td><td>15</td><td>14</td><td>80.7</td><td>2.5</td><td>634</td><td>1.1</td><td>4091</td><td>14256</td></tr><tr><td>SMS</td><td>69</td><td>4502</td><td>73</td><td>40</td><td>97.3</td><td>0.6</td><td>31</td><td>1.3</td><td>500</td><td>500</td></tr><tr><td>YouTube</td><td>100</td><td>1586</td><td>10</td><td>87</td><td>78.6</td><td>30.2</td><td>258</td><td>1.9</td><td>120</td><td>250</td></tr><tr><td>Census</td><td>83</td><td>10000</td><td>83</td><td>100</td><td>84.1</td><td>27.5</td><td>540</td><td>4.5</td><td>5561</td><td>16281</td></tr></table>
106
+
107
+ Table 1: Statistics of datasets and their rules. %Cover is fraction of instances in $U$ covered by at least one rule. Precision refers to micro precision of rules. Conflict denotes the fraction of instances covered by conflicting rules among all the covered instances. Avg $|H_{j}|$ is average cover size of a rule in $U$ . Rules Per Instance is average number of rules covering an instance in $U$ .
108
+
109
+ cases, from pre-existing public sources in one case, and automatically in another. Table 1 presents statistics summarizing the datasets and rules. A brief description of each appears below.
110
+
111
+ Question Classification (Li & Roth, 2002): This is a TREC-6 dataset to classify a question to one of six categories: {Abbreviation, Entity, Description, Human, Location, Numeric-value}. The training set has 5452 instances which are split as 68 for $L$ , 500 for validation, and the remaining as $U$ . Each example in $L$ is generalized as a rule represented by a regular expression. E.g. After labeling How do you throw a housewarming party? as Description we define a rule
112
+
113
+ (how|How|what|What)(does|do|to|can).* $\longrightarrow$ Description.
114
+
115
+ More rules in Table 4 of supplementary. Although, creating such 68 generalised rules required 90 minutes, the generalizations cover 4637 instances in $U$ , almost two orders of magnitude more instances than in $L$ ! On an average each of our rule covered 124 instances ( $|H_{j}|$ column in Table 1). But the precision of labels assigned by rules was only $63.8\%$ . $22.5\%$ of covered instances had an inter-rule conflict, demonstrating noise in the rule labelings. Accuracy is used as the performance metric.
116
+
117
+ MIT-R $^1$ (Liu et al., 2013): This is a slot-filling task on sentences about restaurant search and the task is to label each token as one of {Location, Hours, Amenity, Price, Cuisine, Dish, Restaurant_Name, Rating, Other}. The training data is randomly split into 200 sentences (1842 tokens) as $L$ , 500 sentences (4k tokens) as validation and remaining 6.9k sentences (64.9k tokens) as $U$ . We manually generalize 15 examples in $L$ . E.g. After inspecting the sentence where can i get the highest rated burger within ten miles and labeling highest rated as Rating, we provide the rule:
118
+
119
+ $\ast$ (highly|high|good|top|highest)(rate|rating|rated).* $\rightarrow$ Rating
120
+
121
+ to the matched positions. More examples in Table 7 of supplementary. Although, creating 15 generalizing rules took 45 minutes of annotator effort, the rules covered roughly 9k tokens in $U$ . F1 metric is used for evaluation on the default test set of 14.2k tokens over 1.5k sentences.
122
+
123
+ SMS Spam Classification (Almeida et al., 2011): This dataset contains $5.5\mathrm{k}$ text messages labeled as spam/not-spam, out of which 500 were held out for validation and 500 for testing. We manually generalized 69 exemplars to rules. Remaining examples go in the $U$ set. The rules here check for presence of keywords or phrases in the SMS $\star$ guaranteed gift $\star \rightarrow$ spam. A rule covers 31 examples on an average and has a precision of $97.3\%$ . However, in this case only $40\%$ of the unlabeled set is covered by a rule. We report F1 here since class is skewed. More examples in Table 5 of supplementary.
124
+
125
+ Youtube Spam Classification (Alberto et al., 2015): Here the task is to classify comments on YouTube videos as Spam or Not-Spam. We obtain this from Snorkel's Github page<sup>2</sup>, which provides 10 labeling functions which we use as rules, an unlabeled train set which we use as $U$ , a labeled dev set to guide the creation of their labeling functions which we use as $L$ , and labeled test and validation sets which we use in the same roles. Their labeling functions have a large coverage (258 on average), and a precision of $78.6\%$ .
126
+
127
+ Census Income (Dua & Graff, 2019): This UCI dataset is extracted from the 1994 U.S. census. It lists a total of 13 features of an individual such as age, education level, marital status, country of
128
+
129
+ <table><tr><td rowspan="2">Methods</td><td colspan="5">Datasets</td></tr><tr><td>Question (Accuracy)</td><td>MIT-R (F1)</td><td>YouTube (Accuracy)</td><td>SMS (F1)</td><td>Census (Accuracy)</td></tr><tr><td>Majority (No parameters trained)</td><td>60.9 (0.7)</td><td>40.9 (0.1)</td><td>82.2 (0.9)</td><td>48.4 (1.2)</td><td>80.1 (0.1)</td></tr><tr><td>Only-L</td><td>72.9 (0.6)</td><td>73.5 (0.3)</td><td>90.9 (1.8)</td><td>89.0 (1.6)</td><td>79.4 (0.5)</td></tr><tr><td>L+Umaj</td><td>-1.4 (1.5)</td><td>+0.0 (0.3)</td><td>+0.8 (1.9)</td><td>+3.5 (1.2)</td><td>+0.9 (0.1)</td></tr><tr><td>Noise-tolerant (Zhang et al., 2018)</td><td>-0.5 (1.1)</td><td>+0.0 (0.2)</td><td>+1.7 (1.1)</td><td>+2.9 (1.2)</td><td>+1.0 (0.2)</td></tr><tr><td>L2R (Ren et al., 2018b)</td><td>+0.3 (2.1)</td><td>-15.4 (1.0)</td><td>+2.5 (0.5)</td><td>+2.3 (0.8)</td><td>+2.9 (0.3)</td></tr><tr><td>L+Usnorkel (Ratner et al., 2016)</td><td>-0.7 (3.0)</td><td>+0.0 (0.2)</td><td>+2.7 (0.7)</td><td>+3.5 (1.3)</td><td>+1.0 (0.4)</td></tr><tr><td>Snorkel-Noise-Tolerant</td><td>-1.4 (1.6)</td><td>+0.0 (0.3)</td><td>+2.0 (0.7)</td><td>+2.7 (1.5)</td><td>+0.2 (0.5)</td></tr><tr><td>Posterior Reg. (Hu et al., 2016)</td><td>-0.8 (1.0)</td><td>-0.1 (0.4)</td><td>-2.9 (1.9)</td><td>+1.8 (1.5)</td><td>-0.8 (0.5)</td></tr><tr><td>ImplyLoss (Ours)</td><td>+11.7 (1.5)</td><td>+0.8 (0.3)</td><td>+3.2 (1.1)</td><td>+4.2 (1.0)</td><td>+1.7 (0.2)</td></tr></table>
130
+
131
+ Table 2: Comparison of ImplyLoss (our method) with various methods (described in Section 3.1) on five different datasets. The numbers reported for all methods after the double-line are gains over the baseline (Only-L) that does not use rules at all. Higher is better. NOTE: Numbers in brackets represent standard deviation of the original accuracy and not of gains.
132
+
133
+ origin etc. The primary task on it is binary classification - whether a person earns more than $50\mathrm{K}$ or not. The train data consists of 32563 records. We choose 83 random data points as $L$ , 10k points as $U$ and 5561 points as validation data. For this case we created the rules synthetically as follows: We hold out disjoint 16k random points from the training dataset as a proxy for human knowledge and extract a PART decision list (Frank & Witten, 1998) from it as our set of rules. We retain only those rules which fire on $L$ .
134
+
135
+ Network Architecture Since our labeled data is small we depend on pre-trained resources. As the embedding layer we use a pretrained ELMO (Peters et al., 2018) network where 1024 dimensional contextual token embeddings serve as representations of tokens in the MIT-R sentences, and their average serve as representation for sentences in Question and SMS dataset. Parameters of the embedding network are held fixed during training. For sentences in the YouTube dataset, we use Snorkel's² architecture of a simple bag-of-words feature representation marking the frequent unigrams and bi-grams present in a sentence using a few-hot vector. For the Census dataset categorical features are represented as one hot vectors, while real valued features are simply normalized. For MIT-R, Question and SMS both classification and rule-weight network contain two 512 dimensional hidden layers with ReLU activation. For Census, both the networks contain two 256 dimensional hidden layers with ReLU activation. For YouTube, the classifier network is a simple logistic regression like in Snorkel's code. The rule network has one 32-dimensional hidden layer with ReLU activation.
136
+
137
+ Each reported number is obtained by averaging over ten random initializations. Whenever a method involved hyper-parameters to weigh the relative contribution of various terms in the objective, we used a validation dataset to tune the value of the hyper-parameter. Hyperparameters used are provided in Section C of supplementary.
138
+
139
+ # 3.1 COMPARISON WITH DIFFERENT METHODS
140
+
141
+ In Table 2 we compare our method with the following alternatives on each of the five datasets:
142
+
143
+ Majority: that predicts via majority vote among the rules that cover an instance. This baseline indicates the stand-alone quality of rules, no network is learned here. Ties are broken arbitrarily for class-balanced datasets or by using a default class. Table 2, shows that the accuracy of majority is quite poor indicating either poor precision or poor coverage of the rule sets. $^3$ .
144
+
145
+ Only-L: Here we train the classifier $P_{\theta}(y|\mathbf{x})$ only on the labeled data $L$ using the standard cross-entropy loss (Equation 1). Rule generalisations are not utilized at all in this case. We observe in Table 2 that even with the really small labeled set we used for each dataset, the accuracy of a classifier learned with clean labeled data is much higher than noisy majority labels of rules. We consider this method as our baseline and report the gains on remaining methods.
146
+
147
+ $\mathbf{L} + \mathbf{U}\mathbf{m}\mathbf{a}\mathbf{j}$ : Next we train the classifier on $L$ along with $U_{\mathrm{maj}}$ obtained by labeling instances in $U$ with the majority label among the rules applicable to the instance. Loss corresponding to the examples labeled by rules is weighted as follows:
148
+
149
+ $$
150
+ \min _ {\theta} \sum_ {(\mathbf {x} _ {j}, \ell_ {j}) \in L} - \log P _ {\theta} (\ell_ {j} | \mathbf {x} _ {j}) + \gamma \sum_ {(\mathbf {x} _ {j}, y _ {j}) \in U _ {\mathrm {m a j}}} - \log P _ {\theta} (y _ {j} | \mathbf {x} _ {j}) \tag {7}
151
+ $$
152
+
153
+ The row corresponding to $\mathrm{L} + \mathrm{Umaj}$ in Table 2 provides the gains of this method over Only-L. We observe gains with the noisily labeled $U$ in three out of the five cases.
154
+
155
+ Noise-tolerant: Since labels in $U_{\mathrm{maj}}$ are noisy, we next use Zhang & Sabuncu (2018)'s noise tolerant generalized cross entropy loss on them with regular cross-entropy loss on the clean $L$ as follows:
156
+
157
+ $$
158
+ \min _ {\theta} \sum_ {(\mathbf {x} _ {j}, \ell_ {j}) \in L} - \log P _ {\theta} \left(\ell_ {j} | \mathbf {x} _ {j}\right) + \gamma \sum_ {(\mathbf {x} _ {j}, y _ {j}) \in U _ {\mathrm {m a j}}} \frac {\left(1 - P _ {\theta} \left(y _ {j} | \mathbf {x}\right)\right) ^ {q}}{q} \tag {8}
159
+ $$
160
+
161
+ Parameter $q \in [0,1]$ controls the noise tolerance which we tune as a hyper-parameter. We observe that in three cases minimizing the above objective improves beyond $\mathrm{L} + \mathrm{Umaj}$ validating that noise-tolerant loss functions can be useful for learning from noisy labels on $U_{\mathrm{maj}}$ .
162
+
163
+ Learning to Reweight (L2R) (Ren et al., 2018b): is a recent method for training with a mix of clean and noisy labeled data. They train the classifier by meta-learning to re-weight the loss on the noisily labelled instances $(U_{\mathrm{maj}})$ with the help of the clean examples $(L)$ . This method provides significant accuracy gains over Only-L in three out the five datasets. However, it fails in the multiclass classification task of slot-filling which has a very high class imbalance and rules of smaller coverage.
164
+
165
+ All the above methods employ no extra parameters to denoise or weight individual rules. We next compare with a number of methods that do.
166
+
167
+ $\mathbf{L} + \mathbf{U}$ snorkel: This method replaces Majority-based consensus with Snorkel's generative model (Ratner et al., 2016) that assigns weights to rules and labels examples in $U$ . Thereafter we use the same approach as in $\mathbf{L} + \mathbf{U}$ maj with just Snorkel's soft-labels instead of Majority on $U$ . We also compare with using noise-tolerant loss on $U$ labeled by Snorkel (Eqn:8) which we call Snorkel-Noise-Tolerant. Like previous methods, both of these methods provide improvements over Only-L on three of the five datasets where the rules are less noisy. $\mathbf{L} + \mathbf{U}$ snorkel performs slightly better than Noise-Tolerant on $U_{\mathrm{maj}}$ .
168
+
169
+ We next compare with a method that simultaneously learns two sets of networks $P_{\theta}$ and $P_{j\phi}$ like ours but with different loss function and training schedule.
170
+
171
+ Posterior Regularization (PR): This method proposed in Hu et al. (2016) also treats rules as soft-constraints and has been used for training neural networks for structured outputs. They use Ganchev et al. (2010)'s posterior regularization framework to train the two networks in a teacher-student setup. We adapt the same framework and get a procedure as follows: The student proposes a distribution over $y$ and $r_j$ s using current $P_{\theta}$ and $P_{j\phi}$ , the teacher uses the constraint in Eq 3 to revise the distributions so as to minimize the probability of violations, the student updates parameters $\theta$ and $\phi$ to minimize KL distance with the revised distribution. The detailed formulation appears in the Section A of supplementary. We find that this method is no better than Only-L in most of the cases and worse than the noise-tolerant method that does not train extra $\phi$ parameters.
172
+
173
+ **ImplyLoss(Ours):** Overall our approach of training with denoised rule-label implication loss provides much better accuracy than all the above eight methods and we get consistent gains over Only-L on all datasets. On the Question dataset we get 11.7 points gain over Only-L whereas the best gain by existing method was 0.3. A useful property of our method compared to the PR method above is that the training process is simple and fits into the batch stochastic gradient training template. In contrast, PR requires special alternating computations. We next perform a number of diagnostics experiments to explain the reasons for the superior performance of our method.
174
+
175
+ Diagnostics: Effectiveness of learning true coverage via $P_{j\phi}$ An important part of our method is the rule-specific denoising learned via the $P_{j\phi}$ network. In the chart alongside we plot the original precision of rules on the test data, and the precision after suppressing those rule labelings where $P_{j\phi}(r_j|\mathbf{x})$ predicts 0 instead of 1. Observe now that the precision is more than $91\%$ on all datasets. For the Question dataset, the precision jumped from $64\%$ to $98\%$ . The percentage of labelings suppressed (shown by the dashed line) is higher on datasets with noisier rules (e.g. compare Question and
176
+
177
+ SMS). This shows that $P_{j\phi}$ is able to denoise rules by capturing the distribution of the latent true coverage variables with the limited $LL(\phi)$ loss and indirectly via the implication loss.
178
+
179
+ ![](images/051fd58bb68ab0ed4b498530a2c9812ab0633347e12839d40f5c7990880d964e.jpg)
180
+ Figure 3: Rule-specific denoising by our method.
181
+
182
+ Effect of rule precision Rules in the Census dataset are of higher quality in terms of precision as well as coverage. Superior performance of the L2R method on this dataset motivated us to inspect how well our method performs on the same dataset in the absence of high precision rules. We created four new versions of the rule sets by successively removing high precision rules from the original rule set. We observe that our method performs better than L2R when rules have low precision. Because ImplyLoss denoises rules, it is better able to handle low-precision rules.
183
+
184
+ ![](images/da86539d7d22e9c1ae71c4bb83abe1bf460e83e9200d68d7573608e2f8ee3629.jpg)
185
+ Figure 4: Effect of rule precision
186
+
187
+ Role of Exemplars in Rules We next evaluate the importance of the exemplar-rule pairs in learning the $P_{j\phi}$ and $P_{\theta}$ networks. The exemplars of a rule give an interesting new form of supervision about an instance where a labeling rule must fire. To evaluate the importance of this supervision, we exclude the $r_j = 1$ likelihood on rule-exemplar pairs from $LL(\phi)$ , that is, the first term in Equation 2 is dropped. In the table below we see that performance of ImplyLoss usually drops when the exemplar-rule supervision is removed. Interestingly, even after this drop, the performance of ImplyLoss surpasses most of the methods in Table 2 indicating that even without exemplar-rule pairs our training objective is effective in learning from rules and labeled instances.
188
+
189
+ <table><tr><td></td><td>Question</td><td>MIT-R</td><td>SMS</td><td>Census</td></tr><tr><td>rj=1 for rule-exemplar pairs</td><td>84.5 (1.5)</td><td>73.7 (0.3)</td><td>93.2 (1.0)</td><td>81.0 (0.2)</td></tr><tr><td>No rj=1 for rule-exemplar pairs</td><td>83.8 (0.7)</td><td>73.5 (0.5)</td><td>93.5 (1.2)</td><td>80.8 (0.3)</td></tr></table>
190
+
191
+ Table 3: Effect of removing rule-exemplar supervision from ${LL}\left( \phi \right)$
192
+
193
+ Effect of increasing labeled data $L$ We increase $L$ while keeping the number of rules fixed on the Question dataset. In the attached plot we see the accuracy of our method (ImplyLoss) against Only-L, L+Usnorkel and Posterior Reg. We observe the expected trend that the gap between the method narrows as labeled data increases.
194
+
195
+ # 4 RELATED WORK
196
+
197
+ Learning from noisily labeled data has been extensively studied in settings like crowdsourcing. One category of these algorithms
198
+
199
+ ![](images/473fea67b9597172d295806820003931ad3d24b475919045ed0f5e912602e5ba.jpg)
200
+ Figure 5: Effect of increasing labeled data
201
+
202
+ upper-bound the loss function to make it robust to noise. These include methods like MAE (Ghosh
203
+
204
+ et al., 2017), Generalized Cross Entropy (CE)(Zhang & Sabuncu, 2018), and Ramp loss (Collobert et al., 2006). Most of these assume that noise is independent of the input given the true label. In our model noise is systematic and instance-dependent.
205
+
206
+ A second category assume that a small clean dataset is available along with noisily labeled data. This is also true in our case, and we compared with a state of the art method in that category Ren et al. (2018b) that chooses a descent direction that aligns with a clean validation set using meta-learning. Others in this category include: Shen & Sanghavi (2019)'s method of iteratively selecting examples with smallest loss, and Veit et al. (2017)'s method of learning a separate network to transform noisy labels to cleaned ones which are used to impose a cross-entropy loss on $P_{\theta}(y|\mathbf{x})$ . In contrast, we perform rule-specific cleaning via latent coverage variables and a flexible implication loss which withdraws $y$ supervision when $P_{j\phi}(r_{ji}|\mathbf{x})$ assumes low values. Another way of relating clean and noisy labels is via an instance-independent confusion matrix learned jointly with the classifier (Khetan et al., 2018; Goldberger & Ben-Reuven, 2016; Han et al., 2018b;a). These works assume that the confusion matrix is instance independent, which does not hold for our case. Tanaka et al. (2018) uses confidence from the classifier to eliminate noise but they need to ensure that the network does not memorize noise. Our learning setup also has the advantage of extracting confidence from a different network. There is growing interest in integrating logical rules with labeled examples for training networks, specifically for structured outputs (Manhaeve et al., 2018; Xu et al., 2018; Fischer et al., 2019; Sun et al., 2018; Ren et al., 2018a). Xu et al. (2018); Fischer et al. (2019) convert rules on output nodes of network, to (almost differentiable) loss functions during training. The primary difference of these methods from ours is that they assume that rules are correct whereas we assume them to be noisy. Accordingly, we simultaneously correct the rules and use them to improve the classifier, whereas they use the rules as-is to train the network outputs.
207
+
208
+ A well-known framework for working with soft rules is posterior regularization (Ganchev et al., 2010) which is used in Hu et al. (2016) to train deep structured output networks while harnessing logic rules. Ratner et al. (2016) works only with noisy rules treating them as black-box labeling functions and assigns a linear weight to each rule based on an agreement objective. Our learning model is more powerful that attempts to learn a non-linear network to restrict rule boundaries rather than just weight their outputs. We presented a comparison with both these approaches in the experimental section, and showed superior performance.
209
+
210
+ To the best of our knowledge, our proposed paradigm of coupled rule-exemplar supervision is novel, and our proposed training algorithm is able to harness them in ways not possible by existing frameworks for learning from rules or noisy supervision.
211
+
212
+ # 5 CONCLUSION
213
+
214
+ We proposed a new rule-exemplar model for collecting human supervision to combine the scalability of top-level rules with the quality of instance-level labels. We show that such supervision is natural since humans typically inspect examples to code rules. Furthermore, such coupled examples provide supervision on correct firing of rules which help to denoise rules. We propose to train the classifier while jointly denoising rules via latent coverage variables imposing a soft-implication constraint on the true label. Empirically on five datasets we show that our training algorithm that performs rule-specific denoising is better than generic noise-tolerant learning. In future we plan to deploy this framework on other applications where human supervision is a scarce resource.
215
+
216
+ Reproducibility Code and Data for the experiments available at https://github.com/awasthiabhijeet/Learning-From-Rules
217
+
218
+ Acknowledgements We thank the anonymous reviewers for their constructive feedback on this work. This research was partly sponsored by a Google India AI/ML Research Award and partly by the IBM AI Horizon Networks - IIT Bombay initiative. Abhijeet is supported by Google PhD Fellowship in Machine Learning.
219
+
220
+ # REFERENCES
221
+
222
+ Túlio C Alberto, Johannes V Lochter, and Tiago A Almeida. Tubespam: Comment spam filtering on youtube. In 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), pp. 138-143. IEEE, 2015.
223
+ Tiago A Almeida, José María G Hidalgo, and Akebo Yamakami. Contributions to the study of sms spam filtering: new collection and results. In Proceedings of the 11th ACM symposium on Document engineering, pp. 259-262. ACM, 2011.
224
+ Douglas E. Appelt, Jerry R. Hobbs, John Bear, David J. Israel, and Mabry Tyson. Fastus: A finite-state processor for information extraction from real-world text. In *IJCAI*, pp. 1172-1178, 1993.
225
+ Stephen H. Bach, Daniel Rodriguez, Yintao Liu, Chong Luo, Haidong Shao, Cassandra Xia, Souvik Sen, Alexander Ratner, Braden Hancock, Houman Alborzi, Rahul Kuchhal, Christopher Ré, and Rob Malkin. Snorkel drybell: A case study in deploying weak supervision at industrial scale. In Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019., pp. 362-375, 2019.
226
+ Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In $COLT$ , 1998.
227
+ R. Collobert, F. Sinz, J. Weston, and L. Bottou. Trading convexity for scalability. In ICML 2006, 2006.
228
+ Hamish Cunningham. Gate: A framework and graphical development environment for robust nlp tools and applications. In Proc. 40th Annual Meeting of the Association for Computational Linguistics (ACL 2002), pp. 168-175, 2002.
229
+ Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1): 1-22, 1977.
230
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
231
+ Dheeru Dua and Casey Graff. UCI machine learning repository, 2019. URL http://archive.ics.uci.edu/ml.
232
+ Marc Fischer, Mislav Balunovic, Dana Drachsler-Cohen, Timon Gehr, Ce Zhang, and Martin Vechev. DL2: Training and querying neural networks with logic. In Proceedings of the 36th International Conference on Machine Learning, pp. 1931-1941, 2019.
233
+ Eibe Frank and Ian H. Witten. Generating accurate rule sets without global optimization. In J. Shavlik (ed.), Fifteenth International Conference on Machine Learning, pp. 144-151. Morgan Kaufmann, 1998.
234
+ Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11(Jul):2001-2049, 2010.
235
+ Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
236
+ Garrett B. Goh, Charles Siegel, Abhinav Vishnu, and Nathan Hodas. Using rule-based labels for weak supervised learning: A chemnet for transferable chemical property prediction. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery &#38; Data Mining, KDD '18, 2018.
237
+ Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. 2016.
238
+ Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5841-5851, 2018a.
239
+
240
+ Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems 31, pp. 8536-8546. 2018b.
241
+ Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), August 2016.
242
+ Dongyeop Kang, Tushar Khot, Ashish Sabharwal, and Eduard Hovy. Adventure: Adversarial training for textual entailment with knowledge-guided examples. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, 2018.
243
+ Ashish Khetan, Zachary C. Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=H1sUHgb0Z.
244
+ Xin Li and Dan Roth. Learning question classifiers. In Proceedings of the 19th international conference on Computational linguistics-Volume 1, pp. 1-7. Association for Computational Linguistics, 2002.
245
+ Jingjing Liu, Panupong Pasupat, Yining Wang, Scott Cyphers, and Jim Glass. Query understanding enhanced by hierarchical parsing structures. In 2013 IEEE Workshop on Automatic Speech Recognition and Understanding, pp. 72-77. IEEE, 2013.
246
+ Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. Deepproblog: Neural probabilistic logic programming. In Advances in Neural Information Processing Systems 31, pp. 3749-3759. 2018.
247
+ Arghya Pal and Vineeth N. Balasubramanian. Adversarial data programming: Using gans to relax the bottleneck of curated labeled data. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 1556-1565, 2018.
248
+ Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
249
+ Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. Data programming: Creating large training sets, quickly. In Advances in Neural Information Processing Systems 29. 2016.
250
+ Hongyu Ren, Russell Stewart, Jiaming Song, Volodymyr Kuleshov, and Stefano Ermon. Learning with weak supervision from physics and data-driven constraints. AI Magazine, 39(1):27-38, 2018a.
251
+ Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018b.
252
+ Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In Proceedings of the 36th International Conference on Machine Learning, pp. 5739-5748, 2019.
253
+ Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 843-852, 2017.
254
+ Haitian Sun, William W Cohen, and Lidong Bing. Semi-supervised learning with declaratively specified entropy constraints. In Advances in Neural Information Processing Systems 31, pp. 4425-4435. 2018.
255
+ Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552-5560, 2018.
256
+
257
+ Michael Henry Tessler and Noah D. Goodman. The language of generalization. Psychological Review, 126(3):395-436, 2019.
258
+ Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 839-847, 2017.
259
+ Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. In Proceedings of the 35th International Conference on Machine Learning, pp. 5502-5511, 2018.
260
+ Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in Neural Information Processing Systems 31. 2018.
261
+
262
+ # Supplementary Material: Learning from Rules Generalizing Labeled Exemplars
263
+
264
+ # A POSTERIOR REGULARIZATION METHOD
265
+
266
+ We model a joint distribution $Q(y, r_1, \ldots, r_n | \mathbf{x})$ to capture the interaction among the label random variable $y$ and coverage random variables $r_1, \ldots, r_n$ of any instance $\mathbf{x}$ . We use $\mathbf{r}$ to compactly represent $r_1, \ldots, r_n$ . Strictly speaking, when a rule $R_j$ does not cover $\mathbf{x}$ , the $r_j$ is not a random variable and its value is pinned to 0 but we use this fixed-tuple notation for clarity. The random variables $r_j$ and $y$ impose a constraint on the joint distribution $Q$ : for a $\mathbf{x} \in H_j$ when $r_j = 1$ , the label $y$ cannot be anything other than $\ell_j$ .
267
+
268
+ $$
269
+ r _ {j} = 1 \Longrightarrow y = \ell_ {j} \quad \forall \mathbf {x} \in H _ {j} \tag {9}
270
+ $$
271
+
272
+ We can convert this into a soft constraint on the marginals of the distribution $Q$ by stating the probability of $\sum_{y\neq \ell_j}Q(y,r_j = 1|\mathbf{x})$ should be small.
273
+
274
+ $$
275
+ \min _ {Q} \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) \tag {10}
276
+ $$
277
+
278
+ The singleton marginals of $Q$ along the $y$ and $r_j$ variables are tied to the $P_{\theta}$ and $P_{j\phi}(r_j|\mathbf{x})$ we seek to learn. A network with parameters $\theta$ models the classifier $P_{\theta}(y|\mathbf{x})$ , and a separate network with $\phi$ variables (shared across all rules) learns the $P_{j\phi}(r_j|\mathbf{x})$ distribution. The marginals of joint $Q$ should match these trained marginals and we use a KL term for that:
279
+
280
+ $$
281
+ \min _ {Q, \theta , \phi} \sum_ {\mathbf {x} \in U \cup L} \left(K L (Q (y | \mathbf {x}); P _ {\theta} (y | \mathbf {x})) + \sum_ {j: \mathbf {x} \in H _ {j}} K L (Q \left(r _ {j} | \mathbf {x}\right); P _ {j \phi} \left(r _ {j} | \mathbf {x}\right))\right) \tag {11}
282
+ $$
283
+
284
+ We call the combined KL term succinctly as $KL(Q, P_{\theta}) + KL(Q, P_{\phi})$ .
285
+
286
+ Further the $P_{\theta}$ and $P_{j\phi}$ distributions should maximize the log-likelihood on their respective labeled data as provided in Equation 1 and Equation 2 respectively.
287
+
288
+ Putting all the above objectives together with hyper-parameters $\alpha > 0$ , $\lambda > 0$ we get our final objective as:
289
+
290
+ $$
291
+ \min _ {Q, \theta , \phi} - \alpha (L L (\theta) + L L (\phi)) + K L (Q, P _ {\theta}) + K L (Q, P _ {\phi}) + \lambda \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) \tag {12}
292
+ $$
293
+
294
+ We show in Section A.1 that this gives rise to the solution for $Q$ in terms of $P_{\theta}$ , $P_{j\phi}$ and alternately for $P_{\theta}$ , $P_{j\phi}$ in terms of $Q$ as follows.
295
+
296
+ $$
297
+ Q (y, \mathbf {r} | \mathbf {x}) \propto P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} P _ {j \phi} \left(r _ {j} | \mathbf {x}\right) e ^ {- \lambda \delta \left(y \neq \ell_ {j} \wedge r _ {j} = 1\right)} \tag {13}
298
+ $$
299
+
300
+ where $\delta(y \neq \ell_j \wedge r_j = 1)$ is an indicator function that is 1 when the constraint inside holds, else it is 0. Computing marginals of the above using straight-forward message passing techniques we get:
301
+
302
+ $$
303
+ Q (y | \mathbf {x}) \propto P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} \left(P _ {j \phi} (1 | \mathbf {x}) e ^ {- \lambda \delta (y \neq \ell_ {j})} + P _ {j \phi} (0 | \mathbf {x})\right) \tag {14}
304
+ $$
305
+
306
+ $$
307
+ Q \left(r _ {k} = 1 | \mathbf {x}\right) \propto P _ {k \phi} \left(1 | \mathbf {x}\right) \sum_ {y} e ^ {- \lambda \delta \left(y \neq \ell_ {k}\right)} P _ {\theta} (y | \mathbf {x}) \prod_ {j \neq k, \mathbf {x} \in H _ {j}} \left(P _ {j \phi} (1 | \mathbf {x}) e ^ {- \lambda \delta \left(y \neq \ell_ {j}\right)} + P _ {j \phi} (0 | \mathbf {x})\right) \tag {15}
308
+ $$
309
+
310
+ Thereafter, we solve for $\theta$ and $\phi$ in terms of a given $Q$ as
311
+
312
+ $$
313
+ \min _ {\theta , \phi} - L L (\theta) - L L (\phi) - \gamma \sum_ {\mathbf {x} _ {i} \in U} \sum_ {y \in \mathcal {Y}} Q (y | \mathbf {x} _ {i}) \log P _ {\theta} (y | \mathbf {x} _ {i}) + \sum_ {j: \mathbf {x} _ {i} \in H _ {j}} \sum_ {r _ {j} \in \{0, 1 \}} Q (r _ {j} | \mathbf {x} _ {i}) \log P _ {j \phi} (r _ {j} | \mathbf {x} _ {i}) \tag {16}
314
+ $$
315
+
316
+ Here, $\gamma = \frac{1}{\alpha}$ . This gives rise to an alternating optimization algorithm as in the posterior regularization framework of Ganchev et al. (2010). We initialize $\theta$ and $\phi$ randomly. Then in a loop, we perform the following two steps alternatively much like the EM algorithm (Dempster et al., 1977).
317
+
318
+ Q Computation step: Here we compute marginals $Q(y|\mathbf{x})$ and $Q(r_j|\mathbf{x})$ from current $P_{\theta}$ and $P_{j\phi}$ using Equations 14 and 15 respectively for each $\mathbf{x}$ in a batch. This computation is straightforward and does not require any neural optimization. We can interpret the $Q(y|\mathbf{x})$ as a small correction of the $P_{\theta}(y|\mathbf{x})$ so as to align better with the constraints imposed by the rules in Equation 3. Likewise $Q(r_j|\mathbf{x})$ is an improvement of current $P_{j\phi}s$ in the constraint preserving direction. For example, the expected $r_j$ values might be reduced for an instance if its probability of $y$ being $\ell_j$ is small.
319
+
320
+ Parameter update step: We next reoptimize the $\theta$ and $\phi$ parameters to match the corrected $Q$ distribution as shown in Equation 16. This is solved using standard stochastic gradient techniques. The $Q$ terms can just be viewed as weights at this stage which multiply the loss or label likelihood. A pseudocode of our overall training algorithm is described in Algorithm 1.
321
+
322
+ Algorithm 1 Our Joint Training Algorithm using Posterior Regularization
323
+ Input: $L,U$
324
+ Initialize parameters $\theta ,\phi$ randomly
325
+ for a random training batch from $U\cup L$ do Obtain $P_{\theta}(y|\mathbf{x})$ from the classification network. Obtain $P_{j\phi}(r_j|\mathbf{x})_{j\in [n]}$ from the rule-weight network. Calculate $Q(y|\mathbf{x})$ using Eqn 14 and $Q(r_j|\mathbf{x})_{j\in [n]}$ using Eqn 15. Update $\theta$ and $\phi$ by taking a step in the direction to minimize the loss in Eqn 16.
326
+ end for
327
+ Output: $\theta ,\phi$
328
+
329
+ # A.1 PROOF: ALTERNATING SOLUTION FOR OPTIMIZATION OBJECTIVE IN EQN 12
330
+
331
+ Treat each $Q(y, \mathbf{r})$ as an optimization variable with the constraint that $\sum_{y, \mathbf{r}} Q(y, \mathbf{r}) = 1$ . We express this constraint with a Langrangian multiplier $\eta$ in the objective. Also, define a distribution
332
+
333
+ $$
334
+ P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x}) = P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} P _ {j \phi} (r _ {j} | \mathbf {x})
335
+ $$
336
+
337
+ It is easy to verify that the KL terms in our objective 12 can be collapsed as $KL(Q;P_{\theta ,\phi})$ . The rewritten objective (call it $F(Q,\theta ,\phi)$ ) is now:
338
+
339
+ $$
340
+ \begin{array}{l} - \alpha (L L (\theta) + L L (\phi)) + \sum_ {\mathbf {x}} K L (Q (y, \mathbf {r} | \mathbf {x}), P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x})) \\ + \lambda \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) + \eta (1 - \sum_ {y, \mathbf {r}} Q (v, r)) \tag {17} \\ \end{array}
341
+ $$
342
+
343
+ Next we solve for $\frac{\partial F}{\partial Q(y,\mathbf{r})} = 0$ after expressing the marginals in their expanded forms: e.g. $Q(y,r_{j}|\mathbf{x}) = \sum_{r_{1},\ldots ,r_{j - 1},r_{j + 1},\ldots ,r_{n}}Q(y,r_{1},\ldots ,r_{n}|\mathbf{x})$ . This gives us
344
+
345
+ $$
346
+ \begin{array}{l} \frac {\partial F}{\partial Q (y , \mathbf {r})} = \quad \log Q (y, \mathbf {r}) - \log P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x}) \\ + \sum_ {j: \mathbf {x} \in H _ {j}} \lambda \delta (y \neq \ell_ {j}, r _ {j} = 1) + \eta + 1 \\ \end{array}
347
+ $$
348
+
349
+ Equating it to zero and substituting for $P_{\theta, \phi}$ we get the solution for $Q(y, \mathbf{r})$ in Equation 13.
350
+
351
+ The proof for the optimal $P_{\theta}$ and $P_{j\phi}$ while keeping $Q$ fixed in Equation 17 is easy and we skip here.
352
+
353
+ # B LIST OF RULES
354
+
355
+ We provide a list of rules for each task type.
356
+
357
+ <table><tr><td>Rule</td><td>Example</td><td>Class</td></tr><tr><td>( |^ ) (where) [^ \w] * ( \w+ ) {0,1}
358
+ (was|is) [^ \w] * ( | \$)</td><td>Where is Trinidad ?</td><td>Location</td></tr><tr><td>( |^ ) (which|what) [^ \w] * ( \w+ ) {0,1}
359
+ /play|game|movie|book) [^ \w] * ( | $)</td><td>What book is the follow-up
360
+ to Future Shock ?</td><td>Entity</td></tr><tr><td>( |^ ) (what) [^ \w] * ( \w+ ) {0,1}
361
+ (part|division|ratio|percentage)
362
+ [^ \w] * ( | $)</td><td>Of children between the
363
+ ages of two and eleven ,
364
+ what percentage watch “
365
+ The Simpsons ” ?</td><td>Numeric</td></tr><tr><td>( |^ ) (who|who) [^ \w] * ( \w+ ) {0,1}
366
+ (found|discovered|made|built
367
+ |build|invented) [^ \w] * ( | $)</td><td>Who invented volleyball ?</td><td>Human</td></tr></table>
368
+
369
+ Table 4: Sample rules for TREC Question Classification. Rule fires if the regex matches
370
+
371
+ <table><tr><td>Rule</td><td>Example</td><td>Class</td></tr><tr><td>( |^ ) (free) [^ \w] *
372
+ ([^ \s]+ ) * (price) [^ \w] *
373
+ ([^ \s]+ ) * (call) [^ \w] * ( |$)</td><td>Free video camera phones with
374
+ Half Price line rental for 12 mths
375
+ and 500 cross ntwk mins 100 txts.
376
+ Call MobileUpd8 08001950382 or
377
+ Call2OptOut/674</td><td>Spam</td></tr><tr><td>( |^ ) (guaranteed) [^ \w] * ([^ \s]+ ) *
378
+ (gift\.|gift) [^ \w] * ( |$)</td><td>Great News! Call FREEFONE
379
+ 08006344447 to claim your guaran-
380
+ teed £1000 CASH or £2000 gift.</td><td>Spam</td></tr><tr><td>( |^ ) (can&#x27;t) [^ \w] *
381
+ (\w+ ) {0,1} (talk) [^ \w] * ( |$)</td><td>sry can&#x27;t talk on phone, with parents</td><td>NotSpam</td></tr><tr><td>( |^ ) (that&#x27;s) [^ \w] *
382
+ (\w+ ) {0,1} (fine! | fine) [^ \w] * ( |$)</td><td>Yeah, that&#x27;s fine! It&#x27;s £6 to get in,
383
+ is that ok?</td><td>NotSpam</td></tr></table>
384
+
385
+ Table 5: Sample rules for Spam Classification. Rule fires if the regex matches
386
+
387
+ <table><tr><td>Rules</td><td>Class</td></tr><tr><td>capital-gain &gt; 6849</td><td>&gt; 50K</td></tr><tr><td>education-num &gt; 12 AND
388
+ marital-status = Never-married AND
389
+ native-country = United-States AND
390
+ occupation = Exec-managerial</td><td>&gt; 50K</td></tr><tr><td>marital-status = Separated AND
391
+ hours-per-week ≤ 41</td><td>≤ 50K</td></tr><tr><td>education-num ≤ 12 AND
392
+ native-country = United-States AND
393
+ age ≤ 30</td><td>≤ 50K</td></tr></table>
394
+
395
+ Table 6: Sample rules for census dataset. Rule fires if all clauses are True
396
+
397
+ <table><tr><td>Rule</td><td>Example</td><td>Class</td></tr><tr><td>( |^) [^{\w}] * (within|near|next|close|nearby| around|around) [^{\w}] * ([^{\s}]+ ){0,2} (here|city|miles|mile) *[^{\w}]* ( |$)</td><td>any kid friendly restaurants around here</td><td>Location</td></tr><tr><td>WordLists:
398
+ cuisine1a=[&#x27;italian&#x27;,&#x27;american&#x27;, &#x27;japanese&#x27;,&#x27;spanish&#x27;,&#x27;mexican&#x27;, &#x27;chinese&#x27;,&#x27;vietnamese&#x27;,&#x27;vegan&#x27;]
399
+ cuisine1b=[&#x27;bistro&#x27;,&#x27;delis&#x27;]
400
+ cuisine2=[&#x27;barbecue&#x27;,&#x27;halal&#x27;, &#x27;vegetarian&#x27;, &#x27;bakery&#x27;]</td><td>can you find me some chi- nese food</td><td>Cuisine</td></tr><tr><td>([0-9]+|few|under [0-9]+) dollar</td><td>i need a family restaurant with meals under 10 dollars and kids eat</td><td>Price</td></tr><tr><td>((high|highly|good|best|top| well|highest|zagat)
401
+ (rate|rating|rated)) |
402
+ ((rated|rate|rating) [0-9]* star) | ([0-9]+ star)</td><td>where can i get the highest rated burger within ten miles</td><td>Rating</td></tr><tr><td>((open|opened)(now|late)) |
403
+ (still (open|opened|closed|close)) | (((open|close|opened|closed) \w+([\\s] | \w* | \w* \w*) *[0-9]+ (am|pm|((a|p)m)|hours|hour))</td><td>where is the nearest italian restaurant that is still open</td><td>Hours</td></tr><tr><td>(outdoor|indoor|group|romantic| family|outside|inside|fine| waterfront|outside|private| business|formal|casual|rooftop| (special occasion))
404
+ ([\\s] | \w+ | \w+ \w+) dining</td><td>i want to go to a restaurant within 20 miles that got a high rating and is considered fine dining</td><td>Amenity</td></tr><tr><td>[\w+ ]{0,2} (palace|cafe|bar| kitchen|outback|dominoes)</td><td>is passims kitchen open at 2 am</td><td>Restaurant Name</td></tr><tr><td>wine|sandwich|pasta|burger| peroggis|burrito| (chicken tikka masala)| appetizer|pizza|wine| cupcake| (onion ring)|tapas</td><td>please find me a pub that serves burgers</td><td>Dish</td></tr></table>
405
+
406
+ Table 7: Sample rules for MIT-R dataset. Rule fires if the regex matches or sentence contains a word found in the provided word lists.
407
+
408
+ # C HYPERPARAMETERS
409
+
410
+ Across all experiments we use Adam optimizer with default values of $\beta_{1},\beta_{2}$ , and $\epsilon$ . Dropout of 0.8 (keep probability) was used in the feed forward layers. All the models were trained for a maximum of 100 epochs and early stopping was used based on a validation set. Best model on the validation set was evaluated on the test set. Each experiment was run with 10 random initializations. A list of hyperparameters used in our experiments is provided below.
411
+
412
+ <table><tr><td></td><td>Noise-tolerant</td><td>Snorkel-Noise-Tolerant</td><td>Post. Reg.</td><td>implication</td><td>L+Usnorkel</td><td>L+Umaj</td></tr><tr><td colspan="7">Question Classification</td></tr><tr><td>γ</td><td>0.001</td><td>0.1</td><td>0.001</td><td>0.1</td><td>0.01</td><td>0.001</td></tr><tr><td>q</td><td>0.9</td><td>0.6</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>lr</td><td colspan="6">0.0003</td></tr><tr><td>bs</td><td colspan="6">32 (16 for Only-L)</td></tr><tr><td colspan="7">MIT-R</td></tr><tr><td>γ</td><td>0.01</td><td>0.001</td><td>0.01</td><td>0.1</td><td>0.05</td><td>0.01</td></tr><tr><td>q</td><td>0.6</td><td>0.6</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>lr</td><td colspan="6">0.0003</td></tr><tr><td>bs</td><td colspan="6">64 (32 for Only-L)</td></tr><tr><td colspan="7">YouTube</td></tr><tr><td>γ</td><td>0.003</td><td>0.5</td><td>0.1</td><td>0.2</td><td>0.5</td><td>0.003</td></tr><tr><td>q</td><td>0.6</td><td>0.6</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>lr</td><td colspan="6">0.0003</td></tr><tr><td>bs</td><td colspan="6">32 (16 for Only-L)</td></tr><tr><td colspan="7">SMS</td></tr><tr><td>γ</td><td>0.1</td><td>0.1</td><td>0.001</td><td>0.3</td><td>0.5</td><td>0.1</td></tr><tr><td>q</td><td>0.6</td><td>0.6</td><td>-</td><td>-</td><td>-</td><td>0.1</td></tr><tr><td>lr</td><td colspan="6">0.0001</td></tr><tr><td>bs</td><td colspan="6">32 (16 for Only-L)</td></tr><tr><td colspan="7">Census</td></tr><tr><td>γ</td><td>0.5</td><td>0.1</td><td>0.001</td><td>0.1</td><td>0.01</td><td>0.5</td></tr><tr><td>q</td><td>0.1</td><td>0.6</td><td>-</td><td>-</td><td>-</td><td>0.5</td></tr><tr><td>lr</td><td colspan="2">0.0001</td><td colspan="4">0.0003</td></tr><tr><td>bs</td><td colspan="6">64 (16 for Only-L)</td></tr></table>
413
+
414
+ Table 8: Hyperparameters for various methods and datasets. $bs$ refers to the batch size and $lr$ refers to the learning rate. For Only-L baseline smaller batch size was used considering the smaller size of $L$ set.
415
+
416
+ <table><tr><td></td><td>Question</td><td>MIT-R</td><td>YouTube</td><td>SMS</td><td>Census</td></tr><tr><td>meta_lr</td><td>0.01</td><td>0.0001</td><td>0.001</td><td>0.0001</td><td>0.0001</td></tr><tr><td>lr</td><td colspan="3">0.0003</td><td>0.0001</td><td>0.0003</td></tr><tr><td>bs</td><td>32</td><td>64</td><td>32</td><td>32</td><td>64</td></tr></table>
417
+
418
+ Table 9: Meta-learning rate, learning rate and batch size used for L2R (Ren et al., 2018b) for various datasets
learningfromrulesgeneralizinglabeledexemplars/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23d07256d81062217538157d194a4ee7bfa5dc6542b7fe7ff50c9fa8bcf728f3
3
+ size 853308
learningfromrulesgeneralizinglabeledexemplars/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ae7dd687eeab4004a8256e7c552cee7777fd8638869dac9d31f2496fdc5fcdf
3
+ size 647815
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed0021a1e9957ca4d5ab206eddd43885919144f91e541183ea2b18992f5c8b4e
3
+ size 83439
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a41f5ad577b6138023e7111e2b2483da469e902aef1e1d045b1d0f502baa2f6
3
+ size 100905
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a31fd2ebbed18f1ce12c61f51343371923b35800752c08e64b8d50748d225c99
3
+ size 678122
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/full.md ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING THE DIFFERENCE THAT MAKES A DIFFERENCE WITH COUNTERFACTUALLY-AUGMENTED DATA
2
+
3
+ Divyansh Kaushik, Eduard Hovy, Zachary C. Lipton
4
+
5
+ Carnegie Mellon University
6
+
7
+ Pittsburgh PA, USA
8
+
9
+ {dkaushik, hovy, zlipton}@cmu.edu
10
+
11
+ # ABSTRACT
12
+
13
+ Despite alarm over the reliance of machine learning systems on so-called spurious patterns, the term lacks coherent meaning in standard statistical frameworks. However, the language of causality offers clarity: spurious associations are due to confounding (e.g., a common cause), but not direct or indirect causal effects. In this paper, we focus on natural language processing, introducing methods and resources for training models less sensitive to spurious patterns. Given documents and their initial labels, we task humans with revising each document so that it (i) accords with a counterfactual target label; (ii) retains internal coherence; and (iii) avoids unnecessary changes. Interestingly, on sentiment analysis and natural language inference tasks, classifiers trained on original data fail on their counterfactually-revised counterparts and vice versa. Classifiers trained on combined datasets perform remarkably well, just shy of those specialized to either domain. While classifiers trained on either original or manipulated data alone are sensitive to spurious features (e.g., mentions of genre), models trained on the combined data are less sensitive to this signal. Both datasets are publicly available<sup>1</sup>.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ What makes a document's sentiment positive? What makes a loan applicant creditworthy? What makes a job candidate qualified? When does a photograph truly depict a dolphin? Moreover, what does it mean for a feature to be relevant to such a determination?
18
+
19
+ Statistical learning offers one framework for approaching these questions. First, we swap out the semantic question for a more readily answerable associative question. For example, instead of asking what conveys a document's sentiment, we recast the question as which documents are likely to be labeled as positive (or negative)? Then, in this associative framing, we interpret as relevant, those features that are most predictive of the label. However, despite the rapid adoption and undeniable commercial success of associative learning, this framing seems unsatisfying.
20
+
21
+ Alongside deep learning's predictive wins, critical questions have piled up concerning spurious patterns, artifacts, robustness, and discrimination, that the purely associative perspective appears ill-equipped to answer. For example, in computer vision, researchers have found that deep neural networks rely on surface-level texture (Jo & Bengio, 2017; Geirhos et al., 2018) or clues in the image's background to recognize foreground objects even when that seems both unnecessary and somehow wrong: the beach is not what makes a seagull a seagull. And yet, researchers struggle to articulate precisely why models should not rely on such patterns.
22
+
23
+ In natural language processing (NLP), these issues have emerged as central concerns in the literature on annotation artifacts and societal biases. Across myriad tasks, researchers have demonstrated that models tend to rely on spurious associations (Poliak et al., 2018; Gururangan et al., 2018; Kaushik & Lipton, 2018; Kiritchenko & Mohammad, 2018). Notably, some models for question-answering tasks may not actually be sensitive to the choice of the question (Kaushik & Lipton, 2018), while in Natural Language Inference (NLI), classifiers trained on hypotheses only (vs hypotheses and premises) perform surprisingly well (Poliak et al., 2018; Gururangan et al., 2018). However, papers
24
+
25
+ ![](images/33719eea2688bbadb1edd73128b580ec982e814e4dbc27b911c9d319d562ffe2.jpg)
26
+ Figure 1: Pipeline for collecting and leveraging counterfactually-altered data
27
+
28
+ seldom make clear what, if anything, spuriousness means within the standard supervised learning framework. ML systems are trained to exploit the mutual information between features and a label to make accurate predictions. The standard statistical learning toolkit does not offer a conceptual distinction between spurious and non-spurious associations.
29
+
30
+ Causality, however, offers a coherent notion of spuriousness. Spurious associations owe to confounding rather than to a (direct or indirect) causal path. We might consider a factor of variation to be spuriously correlated with a label of interest if intervening upon it would not impact the applicability of the label or vice versa. While our paper does not call upon the mathematical machinery of causality, we draw inspiration from the underlying philosophy to design a new dataset creation procedure in which humans counterfactually revise documents.
31
+
32
+ Returning to NLP, although we lack automated tools for mapping between raw text and disentangled factors, we nevertheless describe documents in terms of these abstract representations. Moreover, it seems natural to speak of manipulating these factors directly (Hovy, 1987). Consider, for example, the following interventions: (i) Revise the letter to make it more positive; (ii) Edit the second sentence so that it appears to contradict the first. These edits might be thought of as intervening on only those aspects of the text that are necessary to make the counterfactual label applicable.
33
+
34
+ In this exploratory paper, we design a human-in-the-loop system for counterfactually manipulating documents. Our hope is that by intervening only upon the factor of interest, we might disentangle the spurious and non-spurious associations, yielding classifiers that hold up better when spurious associations do not transport out of domain. We employ crowd workers not to label documents, but rather to edit them, manipulating the text to make a targeted (counterfactual) class applicable. For sentiment analysis, we direct the worker to revise this negative movie review to make it positive, without making any gratuitous changes. We might regard the second part of this directive as a least action principle, ensuring that we perturb only those spans necessary to alter the applicability of the label. For NLI, a 3-class classification task (entailment, contradiction, neutral), we ask the workers to modify the premise while keeping the hypothesis intact, and vice versa, collecting edits corresponding to each of the (two) counterfactual classes. Using this platform, we collect thousands of counterfactually-manipulated examples for both sentiment analysis and NLI, extending the IMDb (Maas et al., 2011) and SNLI (Bowman et al., 2015) datasets, respectively. The result is two new datasets (each an extension of a standard resource) that enable us to both probe fundamental properties of language and train classifiers less reliant on spurious signal.
35
+
36
+ We show that classifiers trained on original IMDb reviews fail on counterfactually-revised data and vice versa. We further show that spurious correlations in these datasets are even picked up by linear models. However, augmenting the revised examples breaks up these correlations (e.g., genre ceases to be predictive of sentiment). For a Bidirectional LSTM (Graves & Schmidhuber, 2005) trained on IMDb reviews, classification accuracy goes down from $79.3\%$ to $55.7\%$ when evaluated on original vs revised reviews. The same classifier trained on revised reviews achieves an accuracy of $89.1\%$ on revised reviews compared to $62.5\%$ on their original counterparts. These numbers go to $81.7\%$ and $92.0\%$ on original and revised data, respectively, when the classifier is retrained on the combined dataset. Similar patterns are observed for linear classifiers. We discovered that BERT (Devlin et al., 2019) is more resilient to such drops in performance on sentiment analysis.
37
+
38
+ Additionally, SNLI models appear to rely on spurious associations as identified by Gururangan et al. (2018). Our experiments show that when fine-tuned on original SNLI sentence pairs, BERT fails on pairs with revised premise and vice versa, suffering more than a 30 point drop in accuracy. Fine-tuned on the combined set, BERT's performance improves significantly across all datasets. Similarly, a Bi-LSTM trained on (original) hypotheses alone can accurately classify $69\%$ of pairs correctly but performs worse than the blind classifier when evaluated on the revised dataset. When trained on hypotheses only from the combined dataset, its performance is not appreciably better than random guessing.
39
+
40
+ # 2 RELATED WORK
41
+
42
+ Several papers demonstrate cases where NLP systems appear not to learn what humans consider to be the difference that makes the difference. For example, otherwise state-of-the-art models have been shown to be vulnerable to synthetic transformations such as distractor phrases (Jia & Liang, 2017; Wallace et al., 2019), to misclassify paraphrased task (Iyyer et al., 2018; Pfeiffer et al., 2019) and to fail on template-based modifications (Ribeiro et al., 2018). Glockner et al. (2018) demonstrate that simply replacing words by synonyms or hypernyms, which should not alter the applicable label, nevertheless breaks ML-based NLI systems. Gururangan et al. (2018) and Poliak et al. (2018) show that classifiers correctly classified the hypotheses alone in about $69\%$ of SNLI corpus. They further discover that crowd workers adopted specific annotation strategies and heuristics for data generation. Chen et al. (2016) identify similar issues exist with automatically-constructed benchmarks for question-answering (Hermann et al., 2015). Kaushik & Lipton (2018) discover that reported numbers in question-answering benchmarks could often be achieved by the same models when restricted to be blind either to the question or to the passages. Dixon et al. (2018); Zhao et al. (2018) and Kiritchenko & Mohammad (2018) showed how imbalances in training data lead to unintended bias in the resulting models, and, consequently, potentially unfair applications. Shen et al. (2018) substitute words to test the behavior of sentiment analysis algorithms in the presence of stylistic variation, finding that similar word pairs produce significant differences in sentiment score.
43
+
44
+ Several papers explore richer feedback mechanisms for classification. Some ask annotators to highlight rationales, spans of text indicative of the label (Zaidan et al., 2007; Zaidan & Eisner, 2008; Poulis & Dasgupta, 2017). For each document, Zaidan et al. remove the rationales to generate contrast documents, learning classifiers to distinguish original documents from their contrasting counterparts. While this feedback is easier to collect than ours, how to leverage it for training deep NLP models, where features are not neatly separated, remains less clear.
45
+
46
+ Lu et al. (2018) programmatically alter text to invert gender bias and combined the original and manipulated data yielding gender-balanced dataset for learning word embeddings. In the simplest experiments, they swap each gendered word for its other-gendered counterpart. For example, the doctor ran because he is late becomes the doctor ran because she is late. However, they do not substitute names even if they co-refer to a gendered pronoun. Building on their work, Zmigrod et al. (2019) describe a data augmentation approach for mitigating gender stereotypes associated with animate nouns for morphologically-rich languages like Spanish and Hebrew. They use a Markov random field to infer how the sentence must be modified while altering the grammatical gender of particular nouns to preserve morpho-syntactic agreement. In contrast, Maudslay et al. (2019) describe a method for probabilistic automatic in-place substitution of gendered words in a corpus. Unlike Lu et al., they propose an explicit treatment of first names by pre-defining name-pairs for swapping, thus expanding Lu et al.'s list of gendered word pairs significantly.
47
+
48
+ # 3 DATA COLLECTION
49
+
50
+ We use Amazon's Mechanical Turk crowdsourcing platform to recruit editors to revise each document. To ensure high quality of the collected data, we restricted the pool to U.S. residents that had already completed at least 500 HITs and had an over $97\%$ HIT approval rate. For each HIT, we conducted pilot tests to identify appropriate compensation per assignment, receive feedback from workers and revise our instructions accordingly. A total of 713 workers contributed throughout the whole process, of which 518 contributed edits reflected in the final datasets.
51
+
52
+ Sentence batch 4
53
+
54
+ # Instructions
55
+
56
+ 1. The blue box contains a text passage and a label. Please edit this text in the text box below, and a small number of changes such that:
57
+
58
+ (a) the document remains coherent and
59
+
60
+ (b) the new label (colored).
61
+ (c) the new description of the revised passage.
62
+
63
+ Do not charge any portions of the passage unnecessarily.
64
+
65
+ 2. After modifying the passage and checking it over to make sure that the text matches the label, scroll down and click the Submit HIT button.
66
+
67
+ You will receive a Survey Code upon successful submission. Paste that in the input field on Mechanical Turk.
68
+
69
+ Next Step
70
+
71
+ # Dipolar Sentiment Annotation
72
+
73
+ ![](images/95eaa2e3ae38d8a951eaacd9d1f1d84cac85d6efe69c5c7e17c9f0c34d9a9644.jpg)
74
+ Figure 2: Annotation platform for collecting counterfactually annotated data for sentiment analysis
75
+
76
+ Table 1: Percentage of inter-editor agreement for counterfactually-revised movie reviews
77
+
78
+ <table><tr><td colspan="9">Number of tokens</td></tr><tr><td>Type</td><td>0-50</td><td>51-100</td><td>101-150</td><td>151-200</td><td>201-250</td><td>251-300</td><td>301-329</td><td>Full</td></tr><tr><td>Replacement</td><td>35.6</td><td>25.7</td><td>20.0</td><td>17.2</td><td>15.0</td><td>14.8</td><td>11.6</td><td>19.3</td></tr><tr><td>Insertion</td><td>27.7</td><td>20.8</td><td>14.4</td><td>12.2</td><td>11.0</td><td>11.5</td><td>07.6</td><td>14.3</td></tr><tr><td>Combined</td><td>41.6</td><td>32.7</td><td>26.3</td><td>23.4</td><td>21.6</td><td>20.3</td><td>16.2</td><td>25.5</td></tr></table>
79
+
80
+ Sentiment Analysis The original IMDb dataset consists of $50k$ reviews divided equally across train and test splits. To keep the task of editing from growing unwieldy, we filter out the longest $20\%$ of reviews, leaving $20k$ reviews in the train split from which we randomly sample $2.5k$ reviews, enforcing a 50:50 class balance. Following revision by the crowd workers, we partition this dataset into train/validation/test splits containing 1707, 245 and 488 examples, respectively. We present each review to two workers, instructing them to revise the review such that (a) the counterfactual label applies; (b) the document remains coherent; and (c) no unnecessary modifications are made.
81
+
82
+ Over a four week period, we manually inspected each generated review and rejected the ones that were outright wrong (sentiment was still the same or the review was a spam). After review, we rejected roughly $2\%$ of revised reviews. For 60 original reviews, we did not approve any among the counterfactually-revised counterparts supplied by the workers. To construct the new dataset, we chose one revised review (at random) corresponding to each original review. In qualitative analysis, we identified eight common patterns among the edits (Table 2).
83
+
84
+ By comparing original reviews to their counterfactually-revised counterparts we gain insight into which aspects are causally relevant. To analyze inter-editor agreement, we mark indices corresponding to replacements and insertions, representing the edits in each original review by a binary vector. Using these representations, we compute the Jaccard similarity between the two reviews (Table 1), finding it to be negatively correlated with the length of the review.
85
+
86
+ Natural Language Inference Unlike sentiment analysis, SNLI is 3-way classification task, with inputs consisting of two sentences, a premise and a hypothesis and the three possible labels being entailment, contradiction, and neutral. The label is meant to describe the relationship between the facts stated in each sentence. We randomly sampled 1750, 250, and 500 pairs from the train, validation, and test sets of SNLI respectively, constraining the new data to have balanced classes. In one HIT, we asked workers to revise the hypothesis while keeping the premise intact, seeking edits corresponding to each of the two counterfactual classes. We refer to this data as Revised Hypothesis
87
+
88
+ Table 2: Most prominent categories of edits performed by humans for sentiment analysis (Original/Revised, in order). Red spans were replaced by Blue spans.
89
+
90
+ <table><tr><td>Types of Revisions</td><td>Examples</td></tr><tr><td>Recasting fact as hoped for</td><td>The world of Atlantis, hidden beneath the earth&#x27;s core, is fantastic
91
+ The world of Atlantis, hidden beneath the earth&#x27;s core is supposed to be fantastic</td></tr><tr><td>Suggesting sarcasm</td><td>thoroughly captivating thriller-drama, taking a deep and realistic view
92
+ thoroughly mind numbing “thriller-drama”, taking a “deep” and “realistic” (who are they kidding?) view</td></tr><tr><td>Inserting modifiers</td><td>The presentation of simply Atlantis&#x27; landscape and setting
93
+ The presentation of Atlantis&#x27; predictable landscape and setting</td></tr><tr><td>Replacing modifiers</td><td>“Election” is a highly fascinating and thoroughly captivating thriller-drama
94
+ “Election” is a highly expected and thoroughly mind numbing “thriller-drama”</td></tr><tr><td>Inserting phrases</td><td>Although there&#x27;s hardly any action, the ending is still shocking.
95
+ Although there&#x27;s hardly any action (or reason to continue watching past 10 minutes), the ending is still shocking.</td></tr><tr><td>Diminishing via qualifiers</td><td>which, while usually containing some reminder of harshness, become more and more intriguing.
96
+ which, usually containing some reminder of harshness, became only slightly more intriguing.</td></tr><tr><td>Differing perspectives</td><td>Granted, not all of the story makes full sense, but the film doesn&#x27;t feature any amazing new computer-generated visual effects.
97
+ Granted, some of the story makes sense, but the film doesn&#x27;t feature any amazing new computer-generated visual effects.</td></tr><tr><td>Changing ratings</td><td>one of the worst ever scenes in a sports movie. 3 stars out of 10.
98
+ one of the wildest ever scenes in a sports movie. 8 stars out of 10.</td></tr></table>
99
+
100
+ (RH). In another HIT, we asked workers to revise the original premise, while leaving the original hypothesis intact, seeking similar edits, calling it Revised Premise (RP).
101
+
102
+ Following data collection, we employed a different set of workers to verify whether the given label accurately described the relationship between each premise-hypothesis pair. We presented each pair to three workers and performed a majority vote. When all three reviewers were in agreement, we approved or rejected the pair based on their decision, else, we verified the data ourselves. Finally, we only kept premise-hypothesis pairs for which we had valid revised data in both RP and RH, corresponding to both counterfactual labels. As a result, we discarded $\approx 9\%$ data. RP and RH, each comprised of 3332 pairs in train, 400 in validation, and 800 in test, leading to a total of 6664 pairs in train, 800 in validation, and 1600 in test in the revised dataset. In qualitative analysis, we identified some common patterns among hypothesis and premise edits (Table 3, 4).
103
+
104
+ We collected all data after IRB approval and measured the time taken to complete each HIT to ensure that all workers were paid more than the federal minimum wage. During our pilot studies, workers spent roughly 5 minutes per revised review, and 4 minutes per revised sentence (for NLI). We paid workers $0.65 per revision, and$ 0.15 per verification, totalling $10778.14 for the study.
105
+
106
+ # 4 MODELS
107
+
108
+ Our experiments rely on the following five models: Support Vector Machines (SVMs), Naïve Bayes (NB) classifiers, Bidirectional Long Short-Term Memory Networks (Bi-LSTMs; Graves & Schmidhuber, 2005), ELMo models with LSTM, and fine-tuned BERT models (Devlin et al., 2019). For brevity, we discuss only implementation details necessary for reproducibility.
109
+
110
+ Table 3: Analysis of edits performed by humans for NLI hypotheses. P denotes Premise, OH denotes Original Hypothesis, and NH denotes New Hypothesis.
111
+
112
+ <table><tr><td>Types of Revisions</td><td>Examples</td></tr><tr><td>Modifying/removing actions</td><td>P: A young dark-haired woman crouches on the banks of a river while washing dishes.
113
+ OH: A woman washes dishes in the river while camping. (Neutral)
114
+ NH: A woman washes dishes in the river. (Entailment)</td></tr><tr><td>Substituting entities</td><td>P: Students are inside of a lecture hall.
115
+ OH: Students are indoors. (Entailment)
116
+ NH: Students are on the soccer field. (Contradiction)</td></tr><tr><td>Adding details to entities</td><td>P: An older man with glasses raises his eyebrows in surprise.
117
+ OH: The man has no glasses. (Contradiction)
118
+ NH: The man wears bifocals. (Neutral)</td></tr><tr><td>Inserting relationships</td><td>P: A blond woman speaking to a brunette woman with her arms crossed.
119
+ OH: A woman is talking to another woman. (Entailment)
120
+ NH: A woman is talking to a family member. (Neutral)</td></tr><tr><td>Numerical modifications</td><td>P: Several farmers bent over working on the fields while lady with a baby and four other children accompany them.
121
+ OH: The lady has three children. (Contradiction)
122
+ NH: The lady has many children. (Entailment)</td></tr><tr><td>Using/Removing negation</td><td>P: An older man with glasses raises his eyebrows in surprise.
123
+ OH: The man has no glasses. (Contradiction)
124
+ NH: The man wears glasses. (Entailment)</td></tr><tr><td>Unrelated hypothesis</td><td>P: A female athlete in crimson top and dark blue shorts is running on the street.
125
+ OH: A woman is sitting on a white couch. (Contradiction)
126
+ NH: A woman owns a white couch. (Neutral)</td></tr></table>
127
+
128
+ Standard Methods We use scikit-learn (Pedregosa et al., 2011) implementations of SVMs and Naive Bayes for sentiment analysis. We train these models on TF-IDF bag of words feature representations of the reviews. We identify parameters for both classifiers using grid search conducted over the validation set.
129
+
130
+ Bi-LSTM When training Bi-LSTMs for sentiment analysis, we restrict the vocabulary to the most frequent $20k$ tokens, replacing out-of-vocabulary tokens by UNK. We fix the maximum input length at 300 tokens and pad smaller reviews. Each token is represented by a randomly-initialized 50-dimensional embedding. Our model consists of a bidirectional LSTM (hidden dimension 50) with recurrent dropout (probability 0.5) and global max-pooling following the embedding layer. To generate output, we feed this (fixed-length) representation through a fully-connected hidden layer with ReLU (Nair & Hinton, 2010) activation (hidden dimension 50), and then a fully-connected output layer with softmax activation. We train all models for a maximum of 20 epochs using Adam (Kingma & Ba, 2015), with a learning rate of 1e-3 and a batch size of 32. We apply early stopping when validation loss does not decrease for 5 epochs. We also experimented with a larger Bi-LSTM which led to overfitting. We use the architecture due to Poliak et al. (2018) to evaluate hypothesis-only baselines.
131
+
132
+ ELMo-LSTM We compute contextualized word representations (ELMo) using character-based word representations and bidirectional LSTMs (Peters et al., 2018). The module outputs a 1024-dimensional weighted sum of representations from the 3 Bi-LSTM layers used in ELMo. We represent each word by a 128-dimensional embedding concatenated to the resulting 1024-dimensional ELMo representation, leading to a 1152-dimensional hidden representation. Following Batch Normalization, this is passed through an LSTM (hidden size 128) with recurrent dropout (probability
133
+
134
+ Table 4: Analysis of edits performed by humans for NLI premises. OP denotes Original Premise, NP denotes New Premise, and H denotes Hypothesis.
135
+
136
+ <table><tr><td>Types of Revisions</td><td>Examples</td></tr><tr><td>Introducing direct evidence</td><td>OP: Man walking with tall buildings with reflections behind him. (Neutral)NP: Man walking away from his friend, with tall buildings with reflections behind him. (Contradiction)H: The man was walking to meet a friend.</td></tr><tr><td>Introducing indirect evidence</td><td>OP: An Indian man standing on the bank of a river. (Neutral)NP: An Indian man standing with only a camera on the bank of a river. (Contradiction)H: He is fishing.</td></tr><tr><td>Substituting entities</td><td>OP: A young man in front of a grill laughs while pointing at something to his left. (Entailment)NP: A young man in front of a chair laughs while pointing at something to his left. (Neutral)H: A man is outside</td></tr><tr><td>Numerical modifications</td><td>OP: The exhaustion in the woman&#x27;s face while she continues to ride her bicycle in the competition. (Neutral)NP: The exhaustion in the woman&#x27;s face while she continues to ride her bicycle in the competition for people above 7 ft. (Entailment)H: A tall person on a bike</td></tr><tr><td>Reducing evidence</td><td>OP: The girl in yellow shorts and white jacket has a tennis ball in her left pocket. (Entailment)NP: The girl in yellow shorts and white jacket has a tennis ball. (Neutral)H: A girl with a tennis ball in her pocket.</td></tr><tr><td>Using abstractions</td><td>OP: An elderly woman in a crowd pushing a wheelchair. (Entailment)NP: An elderly person in a crowd pushing a wheelchair. (Neutral)H: There is an elderly woman in a crowd.</td></tr><tr><td>Substituting evidence</td><td>OP: A woman is cutting something with scissors. (Entailment)NP: A woman is reading something about scissors. (Contra-diction)H: A woman uses a tool</td></tr></table>
137
+
138
+ 0.2). The output from this LSTM is then passed to a fully-connected output layer with softmax activation. We train this model for up to 20 epochs with same early stopping criteria as for Bi-LSTM, using the Adam optimizer with a learning rate of $1\mathrm{e} - 3$ and a batch size of 32.
139
+
140
+ BERT We use an off-the-shelf uncased BERT Base model, fine-tuning for each task. To account for BERT's sub-word tokenization, we set the maximum token length is set at 350 for sentiment analysis and 50 for NLI. We fine-tune BERT up to 20 epochs with same early stopping criteria as for Bi-LSTM, using the BERT Adam optimizer with a batch size of 16 (to fit on a Tesla V-100 GPU). We found learning rates of $5\mathrm{e} - 5$ and $1\mathrm{e} - 5$ to work best for sentiment analysis and NLI respectively.
141
+
142
+ ![](images/6106ddbb9b79534293ee187e2f79fbf4c540a762df26a50bb9adc57991d35270.jpg)
143
+ (a) Trained on the original dataset
144
+
145
+ ![](images/d01b4e9c0a3b2ec2188e9e921538373f528ab109570b38524637985131e0b4ed.jpg)
146
+ Figure 3: Most important features learned by an SVM classifier trained on TF-IDF bag of words.
147
+
148
+ ![](images/dec080e77e33707578219f255cfd5e3f879f7f03e091e52dfdc229b6d9df5ddf.jpg)
149
+ (b) Trained on the revised dataset
150
+ (c) Trained on combined dataset
151
+
152
+ # 5 EXPERIMENTAL RESULTS
153
+
154
+ Sentiment Analysis We find that for sentiment analysis, linear models trained on the original $1.7k$ reviews achieve $80\%$ accuracy when evaluated on original reviews but only $51\%$ (level of random guessing) on revised reviews (Table 5). Linear models trained on revised reviews achieve $91\%$ accuracy on revised reviews but only $58.3\%$ on the original test set. We see similar pattern for Bi-LSTMs where accuracy drops substantially in both directions. Interestingly, while BERT models suffer drops too, they are less pronounced, perhaps a benefit of the exposure to a larger dataset where the spurious patterns may not have held. Classifiers trained on combined datasets perform well on both, often within $\approx 3$ pts of models trained on the same amount of data taken only from the original distribution. Thus, there may be a price to pay for breaking the reliance on spurious associations, but it may not be substantial.
155
+
156
+ We also conduct experiments to evaluate our sentiment models vis-a-vis their generalization out-of-domain to new domains. We evaluate models on Amazon reviews (Ni et al., 2019) on data aggregated over six genres: beauty, fashion, appliances, giftcards, magazines, and software, the Twitter sentiment dataset (Rosenthal et al., 2017),<sup>4</sup> and Yelp reviews released as part of the Yelp dataset challenge. We show that in almost all cases, models trained on the counterfactually-augmented IMDb dataset perform better than models trained on comparable quantities of original data.
157
+
158
+ To gain intuition about what is learnable absent the edited spans, we tried training several models on passages where the edited spans have been removed from training set sentences (but not test set). SVM, Naïve Bayes, and Bi-LSTM achieve $57.8\%$ , $59.1\%$ , $60.2\%$ accuracy, respectively, on this task. Notably, these passages are predictive of the (true) label despite being semantically compatible with the counterfactual label. However, BERT performs worse than random guessing.
159
+
160
+ In one simple demonstration of the benefits of our approach, we note that seemingly irrelevant words such as: romantic, will, my, has, especially, life, works, both, it, its, lives and gives (correlated with positive sentiment), and horror, own, jesus, cannot, even, instead, minutes, your, effort, script, seems and something (correlated with negative sentiment) are picked up as high-weight features by linear models trained on either original or revised reviews as top predictors. However, because humans never edit these during revision owing to their lack of semantic relevance, combining the original and revised datasets breaks these associations and these terms cease to be predictive of sentiment (Fig 4). Models trained on original data but at the same scale as combined data are able to perform slightly better on the original test set but still fail on the revised reviews. All models trained on $19k$ original reviews receive a slight boost in accuracy on revised data (except Naive Bayes), yet their performance significantly worse compared to specialized models. Retraining models on a combination of the original $19k$ reviews with revised $1.7k$ reviews leads to significant increases in accuracy for all models on classifying revised reviews, while slightly improving the accuracy on classifying the original reviews. This underscores the importance of including counterfactually-revised examples in training data.
161
+
162
+ Natural Language Inference Fine-tuned on $1.67k$ original sentence pairs, BERT achieves $72.2\%$ accuracy on SNLI dataset but it is only able to accurately classify $39.7\%$ sentence pairs from the RP set (Table 7). Fine-tuning BERT on the full SNLI training set ( $500k$ sentence pairs) results in similar behavior. Fine-tuning it on RP sentence pairs improves its accuracy to $66.3\%$ on RP but causes a drop of roughly 20 pts on SNLI. On RH sentence pairs, this results in an accuracy of $67\%$ on RH and $71.9\%$ on SNLI test set but $47.4\%$ on the RP set. To put these numbers in context, each
163
+
164
+ Table 5: Accuracy of various models for sentiment analysis trained with various datasets. Orig. denotes original, Rev. denotes revised, and Orig. - Edited denotes the original dataset where the edited spans have been removed.
165
+
166
+ <table><tr><td>Training data</td><td colspan="2">SVM</td><td colspan="2">NB</td><td colspan="2">ELMo</td><td colspan="2">Bi-LSTM</td><td colspan="2">BERT</td></tr><tr><td></td><td>O</td><td>R</td><td>O</td><td>R</td><td>O</td><td>R</td><td>O</td><td>R</td><td>O</td><td>R</td></tr><tr><td>Orig. (1.7k)</td><td>80.0</td><td>51.0</td><td>74.9</td><td>47.3</td><td>81.9</td><td>66.7</td><td>79.3</td><td>55.7</td><td>87.4</td><td>82.2</td></tr><tr><td>Rev. (1.7k)</td><td>58.3</td><td>91.2</td><td>50.9</td><td>88.7</td><td>63.8</td><td>82.0</td><td>62.5</td><td>89.1</td><td>80.4</td><td>90.8</td></tr><tr><td>Orig. - Edited</td><td>57.8</td><td>-</td><td>59.1</td><td>-</td><td>50.3</td><td>-</td><td>60.2</td><td>-</td><td>49.2</td><td>-</td></tr><tr><td>Orig. &amp; Rev. (3.4k)</td><td>83.7</td><td>87.3</td><td>86.1</td><td>91.2</td><td>85.0</td><td>92.0</td><td>81.5</td><td>92.0</td><td>88.5</td><td>95.1</td></tr><tr><td>Orig. (3.4k)</td><td>85.1</td><td>54.3</td><td>82.4</td><td>48.2</td><td>82.4</td><td>61.1</td><td>80.4</td><td>59.6</td><td>90.2</td><td>86.1</td></tr><tr><td>Orig. (19k)</td><td>87.8</td><td>60.9</td><td>84.3</td><td>42.8</td><td>86.5</td><td>64.3</td><td>86.3</td><td>68.0</td><td>93.2</td><td>88.3</td></tr><tr><td>Orig. (19k) &amp; Rev.</td><td>87.8</td><td>76.2</td><td>85.2</td><td>48.4</td><td>88.3</td><td>84.6</td><td>88.7</td><td>79.5</td><td>93.2</td><td>93.9</td></tr></table>
167
+
168
+ Table 6: Accuracy of various sentiment analysis models on out-of-domain data
169
+
170
+ <table><tr><td>Training data</td><td>SVM</td><td>NB</td><td>ELMo</td><td>Bi-LSTM</td><td>BERT</td></tr><tr><td colspan="6">Accuracy on Amazon Reviews</td></tr><tr><td>Orig. &amp; Rev. (3.4k)</td><td>77.1</td><td>82.6</td><td>78.4</td><td>82.7</td><td>85.1</td></tr><tr><td>Orig. (3.4k)</td><td>74.7</td><td>66.9</td><td>79.1</td><td>65.9</td><td>80.0</td></tr><tr><td colspan="6">Accuracy on Semeval 2017 (Twitter)</td></tr><tr><td>Orig. &amp; Rev. (3.4k)</td><td>66.5</td><td>73.9</td><td>70.0</td><td>68.7</td><td>82.9</td></tr><tr><td>Orig. (3.4k)</td><td>61.2</td><td>64.6</td><td>69.5</td><td>55.3</td><td>79.3</td></tr><tr><td colspan="6">Accuracy on Yelp Reviews</td></tr><tr><td>Orig. &amp; Rev. (3.4k)</td><td>87.6</td><td>89.6</td><td>87.2</td><td>86.2</td><td>89.4</td></tr><tr><td>Orig. (3.4k)</td><td>81.8</td><td>77.5</td><td>82.0</td><td>78.0</td><td>85.3</td></tr></table>
171
+
172
+ Table 7: Accuracy of BERT on NLI with various train and eval sets.
173
+
174
+ <table><tr><td>Train/Eval</td><td>Original</td><td>RP</td><td>RH</td><td>RP &amp; RH</td></tr><tr><td>Original (1.67k)</td><td>72.2</td><td>39.7</td><td>59.5</td><td>49.6</td></tr><tr><td>Revised Premise (RP; 3.3k)</td><td>50.6</td><td>66.3</td><td>50.1</td><td>58.2</td></tr><tr><td>Revised Hypothesis (RH; 3.3k)</td><td>71.9</td><td>47.4</td><td>67.0</td><td>57.2</td></tr><tr><td>RP &amp; RH (6.6k)</td><td>64.7</td><td>64.6</td><td>67.8</td><td>66.2</td></tr><tr><td>Original w/ RP &amp; RH (8.3k)</td><td>73.5</td><td>64.6</td><td>69.6</td><td>67.1</td></tr><tr><td>Original (8.3k)</td><td>77.8</td><td>44.6</td><td>66.1</td><td>55.4</td></tr><tr><td>Original (500k)</td><td>90.4</td><td>54.3</td><td>74.3</td><td>64.3</td></tr></table>
175
+
176
+ individual hypothesis sentence in RP is associated with two labels, each in the presence of a different premise. A model that relies on hypotheses only would at best perform slightly better than choosing the majority class when evaluated on this dataset. However, fine-tuning BERT on a combination of RP and RH leads to consistent performance on all datasets as the dataset design forces models to look at both premise and hypothesis. Combining original sentences with RP and RH improves these
177
+
178
+ Table 8: Accuracy of Bi-LSTM classifier trained on hypotheses only
179
+
180
+ <table><tr><td>Train/Test</td><td>Original</td><td>RP</td><td>RH</td><td>RP &amp; RH</td></tr><tr><td>Majority class</td><td>34.7</td><td>34.6</td><td>34.6</td><td>34.6</td></tr><tr><td>RP &amp; RH (6.6k)</td><td>32.4</td><td>35.1</td><td>33.4</td><td>34.2</td></tr><tr><td>Original w/ RP &amp; RH (8.3k)</td><td>44.0</td><td>25.8</td><td>43.2</td><td>34.5</td></tr><tr><td>Original (8.3k)</td><td>60.2</td><td>20.5</td><td>46.6</td><td>33.6</td></tr><tr><td>Original (500k)</td><td>69.0</td><td>15.4</td><td>53.2</td><td>34.3</td></tr></table>
181
+
182
+ Table 9: Accuracy of models trained to differentiate between original and revised data
183
+
184
+ <table><tr><td>Model</td><td>IMDb</td><td>SNLI/RP</td><td>SNLI/RH</td></tr><tr><td>Majority class</td><td>50.0</td><td>66.7</td><td>66.7</td></tr><tr><td>SVM</td><td>67.4</td><td>46.6</td><td>51.0</td></tr><tr><td>NB</td><td>69.2</td><td>66.7</td><td>66.6</td></tr><tr><td>BERT</td><td>77.3</td><td>64.8</td><td>69.7</td></tr></table>
185
+
186
+ numbers even further. We compare this with the performance obtained by fine-tuning it on $8.3k$ sentence pairs sampled from SNLI training set, and show that while the two perform roughly within 4 pts of each other when evaluated on SNLI, the former outperforms latter on both RP and RH.
187
+
188
+ To further isolate this effect, Bi-LSTM trained on SNLI hypotheses only achieves $69\%$ accuracy on SNLI test set, which drops to $44\%$ if it is retrained on combination of original, RP and RH data (Table 8). Note that this combined dataset consists of five variants of each original premise-hypothesis pair. Of these five pairs, three consist of the same hypothesis sentence, each associated with different truth value given the respective premise. Using these hypotheses only would provide conflicting feedback to a classifier during training, thus causing the drop in performance. Further, we notice that the gain of the latter over majority class baseline comes primarily from the original data, as the same model retrained only on RP and RH data experiences a further drop of $11.6\%$ in accuracy, performing worse than just choosing the majority class at all times.
189
+
190
+ One reasonable concern might be that our models would simply distinguish whether an example were from the original or revised dataset and thereafter treat them differently. The fear might be that our models would exhibit a hypersensitivity (rather than insensitivity) to domain. To test the potential for this behavior, we train several models to distinguish between original and revised data (Table 9). BERT identifies original reviews from revised reviews with $77.3\%$ accuracy. In case of NLI, BERT and Naïve Bayes perform roughly within 3 pts of the majority class baseline $(66.7\%)$ whereas SVM performs substantially worse.
191
+
192
+ # 6 CONCLUSION
193
+
194
+ By leveraging humans not only to provide labels but also to intervene upon the data, revising documents to accord with various labels, we can elucidate the difference that makes a difference. Moreover, we can leverage the augmented data to train classifiers less dependent on spurious associations. Our study demonstrates the promise of leveraging human-in-the-loop feedback to disentangle the spurious and non-spurious associations, yielding classifiers that hold up better when spurious associations do not transport out of domain. Our methods appear useful on both sentiment analysis and NLI, two contrasting tasks. In sentiment analysis, expressions of opinion matter more than stated facts, while in NLI this is reversed. SNLI poses another challenge in that it is a 3-class classification task using two input sentences. In future work, we will extend these techniques, leveraging humans in the loop to build more robust systems for question answering and summarization.
195
+
196
+ # ACKNOWLEDGEMENTS
197
+
198
+ The authors are grateful to Amazon AWS and NVIDIA for providing GPUs to conduct the experiments, Salesforce Research and Facebook AI for their generous grants that made the data collection possible, Sina Fazelpour, Sivaraman Balakrishnan, Shruti Rijhwani, Shruti Palaskar, Aishwarya Kamath, Michael Collins, Rajesh Ranganath and Sanjoy Dasgupta for their valuable feedback, and Tzu-Hsiang Lin for his generous help in creating the data collection platform. We also thank Abridge AI, UPMC, the Center for Machine Learning in Health, and the AI Ethics and Governance Fund for their support of our broader research on robust machine learning.
199
+
200
+ # REFERENCES
201
+
202
+ Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Empirical Methods in Natural Language Processing (EMNLP), 2015.
203
+ Danqi Chen, Jason Bolton, and Christopher D Manning. A thorough examination of the cnn/daily mail reading comprehension task. In Association for Computational Linguistics (ACL), 2016.
204
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2019.
205
+ Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Measuring and mitigating unintended bias in text classification. In AAAI/ACM Conference on AI, Ethics, and Society. ACM, 2018.
206
+ 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. arXiv preprint arXiv:1811.12231, 2018.
207
+ Max Glockner, Vered Shwartz, and Yoav Goldberg. Breaking nli systems with sentences that require simple lexical inferences. In Association for Computational Linguistics (ACL), 2018.
208
+ Alex Graves and Jürgen Schmidhuber. Framewise phoneme classification with bidirectional LSTM and other neural network architectures. Neural networks, 18(5-6), 2005.
209
+ Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A Smith. Annotation artifacts in natural language inference data. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
210
+ Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems (NeurIPS), 2015.
211
+ Eduard Hovy. Generating natural language under pragmatic constraints. Journal of Pragmatics, 1987.
212
+ Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. Adversarial example generation with syntactically controlled paraphrase networks. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
213
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017.
214
+ Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
215
+ Divyansh Kaushik and Zachary C Lipton. How much reading does reading comprehension require? a critical investigation of popular benchmarks. In Empirical Methods in Natural Language Processing (EMNLP), 2018.
216
+
217
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
218
+ Svetlana Kiritchenko and Saif Mohammad. Examining gender and race bias in two hundred sentiment analysis systems. In Joint Conference on Lexical and Computational Semantics (*SEM), 2018.
219
+ Kaiji Lu, Piotr Mardziel, Fangjing Wu, Preetam Amancharla, and Anupam Datta. Gender bias in neural natural language processing. arXiv preprint arXiv:1807.11714, 2018.
220
+ Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Association for Computational Linguistics: Human Language Technologies (ACL-HLT), 2011.
221
+ Rowan Hall Maudslay, Hila Gonen, Ryan Cotterell, and Simone Teufel. It's all in the name: Mitigating gender bias with name-based counterfactual data substitution. arXiv preprint arXiv:1909.00871, 2019.
222
+ Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In International Conference on Machine Learning (ICML), 2010.
223
+ Jianmo Ni, Jiacheng Li, and Julian McAuley. Justifying recommendations using distantly-labeled reviews and fine-grained aspects. In Empirical Methods in Natural Language Processing and International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019. URL https://www.aclweb.org/anthology/D19-1018.
224
+ F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research (JMLR), 12, 2011.
225
+ Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
226
+ Jonas Pfeiffer, Aishwarya Kamath, Iryna Gurevych, and Sebastian Ruder. What do deep networks like to read? arXiv preprint arXiv:1909.04547, 2019.
227
+ Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. Hypothesis Only Baselines in Natural Language Inference. In *Joint Conference on Lexical and Computational Semantics (*Sem), 2018.
228
+ Stefanos Poulis and Sanjoy Dasgupta. Learning with feature feedback: from theory to practice. In Artificial Intelligence and Statistics (AISTATS), 2017.
229
+ Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Semantically equivalent adversarial rules for debugging nlp models. In Association for Computational Linguistics (ACL), 2018.
230
+ Sara Rosenthal, Noura Farra, and Preslav Nakov. SemEval-2017 task 4: Sentiment analysis in twitter. In International Workshop on Semantic Evaluation (SemEval), 2017. URL https://www.aclweb.org/anthology/S17-2088.
231
+ Judy Hanwen Shen, Lauren Fratamico, Iyad Rahwan, and Alexander M Rush. Darling or babygirl? investigating stylistic bias in sentiment analysis. 5th Workshop on Fairness, Accountability, and Transparency in Machine Learning (FATML), 2018.
232
+ Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for nlp. arXiv preprint arXiv:1908.07125, 2019.
233
+ Omar Zaidan, Jason Eisner, and Christine Piatko. Using annotator rationales to improve machine learning for text categorization. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2007.
234
+
235
+ Omar F Zaidan and Jason Eisner. Modeling annotators: A generative approach to learning from annotator rationales. In Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2008.
236
+ Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Gender bias in coreference resolution: Evaluation and debiasing methods. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
237
+ Ran Zmigrod, Sebastian J. Mielke, Hanna Wallach, and Ryan Cotterell. Counterfactual data augmentation for mitigating gender stereotypes in languages with rich morphology. In Association for Computational Linguistics (ACL), 2019.
238
+
239
+ # APPENDIX
240
+
241
+ Table 10: Most frequent insertions/deletions by human annotators for sentiment analysis.
242
+
243
+ <table><tr><td>Revision</td><td>Removed words</td><td>Inserted words</td></tr><tr><td>Positive to Negative</td><td>movie, film, great, like, good, re-ally, would, see, story, love</td><td>movie, film, one, like, bad, would, really, even, story, see</td></tr><tr><td>Negative to Positive</td><td>bad, even, worst, waste, nothing, never, much, would, like, little</td><td>great, good, best, even, well, amazing, much, many, watch, better</td></tr></table>
244
+
245
+ Table 11: Most frequent insertions/deletions by human annotators for SNLI.
246
+
247
+ <table><tr><td>Revision</td><td>Removed words</td><td>Inserted words</td></tr><tr><td colspan="3">Revising Premise</td></tr><tr><td>Entailment to Neutral</td><td>woman, walking, man, blue, sitting, men, girl, standing, looking, running</td><td>person, near, child, something, together, people, tall, vehicle, wall, holding</td></tr><tr><td>Neutral to Entailment</td><td>man, street, black, water, little, front, young, playing, woman, two</td><td>waiting, couple, playing, running, getting, making, tall, game, black, happily</td></tr><tr><td>Entailment to Contradiction</td><td>blue, people, standing, girl, front, street, red, young, sitting, band</td><td>sitting, standing, inside, young, women, child, red, men, sits, one</td></tr><tr><td>Contradiction to Entailment</td><td>sitting, man, walking, black, blue, people, red, standing, white, street</td><td>man, sitting, sleeping, woman, sits, eating, playing, park, two, standing</td></tr><tr><td>Neutral to Contradiction</td><td>man, woman, people, boy, black, red, standing, young, two, water</td><td>man, woman, boy, men, alone, sitting, girl, dog, three, one</td></tr><tr><td>Contradiction to Neutral</td><td>man, sitting, black, blue, walking, red, standing, street, white, street</td><td>man, sitting, woman, people, person, near, something, something, sits, black</td></tr><tr><td colspan="3">Revising Hypothesis</td></tr><tr><td>Entailment to Neutral</td><td>man, wearing, white, blue, black, shirt, one, young, people, woman</td><td>people, there, playing, man, person, wearing, outside, two, old, near</td></tr><tr><td>Neutral to Entailment</td><td>white, wearing, shirt, black, blue, man, two, standing, young, red</td><td>playing, wearing, man, two, there, woman, people, men, near, person</td></tr><tr><td>Entailment to Contradiction</td><td>man, wearing, white, blue, black, two, shirt, one, young, people</td><td>people, man, woman, playing, no, inside, person, two, wearing, women</td></tr><tr><td>Contradiction to Entailment</td><td>wearing, blue, black, man, white, two, red, shirt, young, one</td><td>people, there, man, two, wearing, playing, people, men, woman, outside</td></tr><tr><td>Neutral to Contradiction</td><td>white, man, wearing, shirt, black, blue, two, standing, woman, red</td><td>woman, man, there, playing, two, wearing, one, men, girl, no</td></tr><tr><td>Contradiction to Neutral</td><td>wearing, blue, black, man, white, two, red, sitting, young, standing</td><td>people, playing, man, woman, two, wearing, near, tall, men, old</td></tr></table>
248
+
249
+ ![](images/afcc65ed26a6d9fea0ea4014b96fee64271845bbeed8fcb511836278e27532f4.jpg)
250
+
251
+ ![](images/13bba1eee338caa1d9750347d67392dedf208c2efa82b74bdd1970fdaaaca7d8.jpg)
252
+ (a) Trained on the original dataset
253
+ (b) Trained on the revised dataset
254
+
255
+ ![](images/495e630dbc8250cadad36c800e86c5cb772b30fb736d7e9fc43635d17d5bacf4.jpg)
256
+ (c) Trained on combined dataset
257
+ Figure 4: Thirty most important features learned by an SVM classifier trained on TF-IDF bag of words.
258
+
259
+ The blue box contains a text passage and a label. Please edit this text in the textbox below, making a small number of changes such that:
260
+
261
+ (a) the document remains coherent and
262
+ (b) the new label (colored) accurately describes the revised passage.
263
+
264
+ Do not change any portions of the passage unnecessarily.
265
+
266
+ After modifying the passage and checking it over to make sure that is coherent and matches the label.
267
+
268
+ (a) Revising IMDb movie reviews
269
+
270
+ The upper blue box contains Sentence 1. The lower blue box contains Sentence 2.
271
+
272
+ Given that Sentence 1 is True, Sentence 2 (by implication), must either be
273
+
274
+ (a) definitely True, (b) definitely False, or (c) May be True.
275
+
276
+ You are presented with an initial Sentence 1 and Sentence 2 and the correct initial relationship label (True, False, or May be True).
277
+
278
+ Please edit Sentence 2 in the textboxes, making a small number of changes such that:
279
+
280
+ (a) The new sentences are coherent and
281
+ (b) The target labels (in red) accurately describe the truthfulness of the modified Sentence 2 given the original Sentence 1.
282
+
283
+ Do not change any portions of the sentence unnecessarily.
284
+
285
+ After modifying the text and checking it over to make sure that it is coherent and matches the target label.
286
+
287
+ (b) Revising hypothesis in SNLI
288
+
289
+ The upper blue box contains Sentence 1. The lower blue box contains Sentence 2.
290
+
291
+ Given that Sentence 1 is True, Sentence 2 (by implication), must either be
292
+
293
+ (a) definitely True, (b) definitely False, or (c) May be True.
294
+
295
+ You are presented with an initial Sentence 1 and Sentence 2 and the correct initial relationship label (True, False, or May be True).
296
+
297
+ Please edit Sentence 1 in the textboxes, making a small number of changes such that:
298
+
299
+ (a) The new sentences are coherent and
300
+ (b) The target labels (in red) accurately describe the truthfulness of the original Sentence 2 given the modified Sentence 1.
301
+
302
+ Do not change any portions of the sentence unnecessarily.
303
+
304
+ After modifying the text and checking it over to make sure that it is coherent and matches the target label.
305
+
306
+ (c) Revising premise in SNLI
307
+
308
+ Figure 5: Instructions used on Amazon Mechanical Turk for data collection
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02d3f9d941b95e72a521694b808d964e0cff9e4a1b622db203ca2c0bbbbaf590
3
+ size 1209679
learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddd6b6d674484dd1ec1112ce024ce40d327cce034fb139388ff414d3e856015c
3
+ size 358766
learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0dda32fbe823af8fcfae081bc1c0443634786e6d4c3df7d17e6538021d2215a
3
+ size 159045
learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9946bff897ae0c93c9f5d3d3b0c43ff1981bdb93e1edaa55574d8e8ff3d3327b
3
+ size 191271